-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot create Scheduler if JupyterHub username isn't a valid label #879
Comments
In kubespawner, we use https://github.com/jupyterhub/kubespawner/blob/master/kubespawner/spawner.py#L1395 to help deal with it. Maybe something like that can be added to dask-gateway? |
Thanks, that looks better than the hacky regex I was cooking up :)
dask-gateway *may* not be the appropriate place for this. In this case, it’s just us (pangeo’s daskhub deployment) adding the label. If that method in kubespawner happened to be public, it’d be perfect for us, since kubespawner would be present on the machine where this code is executed :)
That said, there are dask-gateway deployments that aren’t jupyterhub deployments, who might benefit from a method like this, and wouldn’t have access to kubespawner.
… On Nov 23, 2020, at 1:30 AM, Yuvi Panda ***@***.***> wrote:
In kubespawner, we use https://github.com/jupyterhub/kubespawner/blob/master/kubespawner/spawner.py#L1395 <https://github.com/jupyterhub/kubespawner/blob/master/kubespawner/spawner.py#L1395> to help deal with it. Maybe something like that can be added to dask-gateway?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#879 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAKAOIQF3LI67UTI4TUTPKTSRIFQZANCNFSM4T45OSJQ>.
|
The criteria required is that it's a valid DNS label - https://github.com/jupyterhub/kubespawner/blob/master/kubespawner/spawner.py#L1395. import string
from escapism import escape
safe_chars = set(string.ascii_lowercase + string.digits)
safe_username = escapism.escape(self.user.name, safe=safe_chars, escape_char='-').lower() This should work! |
yuvipanda
added a commit
to yuvipanda/pangeo-cloud-federation
that referenced
this issue
Dec 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We add the JupyterHub username as a kubernetes label to the scheduler and worker pods at
pangeo-cloud-federation/pangeo-deploy/values.yaml
Lines 104 to 106 in 41b9814
In another deployment, I noticed failures to start a scheduler when the JupyterHub username isn't a valid kubernetes label. Perhaps GitHub usernames are always valid so this hasn't come up, but we should set a model here for others copying our configuration options.
The text was updated successfully, but these errors were encountered: