-
Notifications
You must be signed in to change notification settings - Fork 108
support updated kubespawner #2938
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
Conversation
| envvars_fixed = {**(profile["kubespawner_override"].get("environment", {}))} | ||
|
|
||
| def preserve_envvars(spawner): | ||
| # This adds in JUPYTERHUB_ANYONE/GROUP rather than overwrite all env vars, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior of Kubespawner changed in v5 so kubespawner_override's default behavior is merge instead of replace now so I'm now simplifing this part.
reference: https://jupyterhub-kubespawner.readthedocs.io/en/latest/changelog.html#id24
| return profile | ||
|
|
||
|
|
||
| @gen.coroutine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flyby: tornado coroutine to native coroutine
|
Failing tests should be able to be rerun. I'm seeing |
|
"Local Integration Tests" will fail until nebari-dev/nebari-docker-images#194 is merged |
|
I tested this locally and Local Integration tests passed fine. I changed the jupyterhub image to the one created by the CI in nebari-dev/nebari-docker-images#194 in 5829038. We should revert 5829038 prior to merging, but it'll show reviewers that the tests pass first. |
| # Change jupyterhub image for PR testing purposes | ||
| cat >> '${{ steps.metadata.outputs.config }}' <<- EOM | ||
| default_images: | ||
| jupyterhub: quay.io/nebari/nebari-jupyterhub:jhub-fancy-profiles | ||
| EOM | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Adam-D-Lewis , I think this was not suposed to be committed as part of this PR, is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVM, just saw your comment above.
marcelovilla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Adam-D-Lewis I'm testing this PR using the image you mentioned:
default_images:
jupyterhub: quay.io/nebari/nebari-jupyterhub:jhub-fancy-profiles-df68a39-20250204I'm seeing the following error:

Here are the logs from the hub pod:
[E 2025-03-04 13:45:22.366 JupyterHub web:1875] Uncaught exception GET /hub/spawn/mvilla (10.244.0.1)
HTTPServerRequest(protocol='http', host='172.20.1.100', method='GET',
uri='/hub/spawn/mvilla', version='HTTP/1.1', remote_ip='10.244.0.1')
Traceback (most recent call last):
File "/opt/conda/lib/python3.9/site-packages/tornado/web.py", line 1790, in _execute
result = await result
File "/opt/conda/lib/python3.9/site-packages/jupyterhub/handlers/pages.py", line 206, in _get
spawner_options_form = await spawner.get_options_form()
File "/opt/conda/lib/python3.9/site-packages/jupyterhub/spawner.py", line 614, in get_options_form
options_form = await maybe_future(self.options_form(self))
File "/opt/conda/lib/python3.9/site-packages/kubespawner/spawner.py", line 2999, in _render_options_form_dynamically
return self._render_options_form(profile_list)
File "/opt/conda/lib/python3.9/site-packages/kubespawner/spawner.py", line 2964, in _render_options_form
profile_list = self._get_initialized_profile_list(profile_list)
File "/opt/conda/lib/python3.9/site-packages/kubespawner/spawner.py", line 3287, in _get_initialized_profile_list
for option_config in profile.get('profile_options', {}).values():
AttributeError: 'NoneType' object has no attribute 'values'
Any ideas? Is there anything else I need to add to the config?
|
I reproduced what you're seeing. I'll look into it further. |
This reverts commit 1051be1.
|
I'm also hoping to sneak an unrelated bugfix in with ffc77d6. In that commit, we want to write "\;", but python interprets that as an invalid escape sequence so I need to escape the backslash with "\\;". |
marcelovilla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Adam-D-Lewis 🚀 ! This is working now.
I'd wait until we figure out what's going on with CI on the docker images repo to merge this PR.
|
Looks like the CI issue got figured out based on nebari-dev/nebari-docker-images@8328b3a, merging |
Reference Issues or PRs
Necessary changes to support Kubespawner >= 5.0.0
Should be merged simultaneously with nebari-dev/nebari-docker-images#194
What does this implement/fix?
Put a
xin the boxes that applyTesting
How to test this PR?
When using the
quay.io/nebari/nebari-jupyterhub:jhub-fancy-profiles-df68a39-20250204for my jupyterhub image I got errors when loading the profile_list of servers to start up, but this PR resolves them, and I can now start a server successfully with Kubespawner version 6.2.Any other comments?