Conversation
The reason they existed was because we were earlier sanitizing the usernames to be pod / PVC names in a lossy fashion, and thus needed an extra unique identifier (user.id). However, this can cause some fun problems - such as https://github.com/data-8/infrastructure/blob/master/incidents/2017-02-09-datahub-db-outage.md. The user id is really the only piece of info that's inherently generated by the db, and having the db be blown away causes a lot of problems because we were using {userid}. This is a breaking Change! If you are using this spawner right now and using the default naming scheme, you have a couple of options: If you are not using the PVC autogeneration feature: 1. Delete all user's pods, and have them log back in. This should be enough, and everything should just work. 2. (Not recommended) In your jupyterhub_config.py, add: c.KubeSpawner.pod_name_template = 'jupyter-{legacy_escaped_username}-{userid}' The {legacy-escaped-username} will use the older lossy username escaping. It's deprecated, and it'll be removed at a future time. If you are using the PVC autogeneration feature: 1. Mass rename all the PVCs to match the new names. Usually just getting rid of the -{userid} at the end will be enough. If your users have special characters in their usernames, you might have to generate the new names with the following code: safe_username = escapism.escape(self.user.name, safe=safe_chars, escape_char='-').lower() and use the new code. 2. (Not recommended) In your jupyterhub_config.py, replace `{username}` in c.KubeSpawner.pvc_name_template with `{legacy_escaped_username}`. Note that support for this will also be removed at a future version.
Collaborator
Author
|
/cc @danielfrg @ryanlovett @minrk @ktongsc (since I think you all might be affected by this) I'll merge this one tomorrow. I feel ok about breaking since we haven't actually made a release in a long time, so there aren't actually any published pip releases with this behavior (need to verify that!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reason they existed was because we were earlier sanitizing
the usernames to be pod / PVC names in a lossy fashion, and thus
needed an extra unique identifier (user.id). However, this can
cause some fun problems - such as https://github.com/data-8/infrastructure/blob/master/incidents/2017-02-09-datahub-db-outage.md.
The user id is really the only piece of info that's inherently
generated by the db, and having the db be blown away causes a lot
of problems because we were using {userid}.
This is a breaking Change! If you are using this spawner right
now and using the default naming scheme, you have a couple of options:
If you are not using the PVC autogeneration feature:
Delete all user's pods, and have them log back in. This should
be enough, and everything should just work.
(Not recommended) In your jupyterhub_config.py, add:
c.KubeSpawner.pod_name_template = 'jupyter-{legacy_escaped_username}-{userid}'
The {legacy-escaped-username} will use the older lossy username
escaping. It's deprecated, and it'll be removed at a future time.
If you are using the PVC autogeneration feature:
Mass rename all the PVCs to match the new names. Usually just getting rid of
the -{userid} at the end will be enough. If your users have special characters
in their usernames, you might have to generate the new names with the following
code:
safe_username = escapism.escape(self.user.name, safe=safe_chars, escape_char='-').lower()
and use the new code.
(Not recommended) In your jupyterhub_config.py, replace
{username}inc.KubeSpawner.pvc_name_template with
{legacy_escaped_username}. Note thatsupport for this will also be removed at a future version.