-
Notifications
You must be signed in to change notification settings - Fork 304
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
Wierdness in ordering of pre_spawn_hook and load_user_options #339
Comments
@rkdarst could you provide an update on this issue? Is this relevant still etc, and do you have a concrete action plan for this issue at this point? |
I think documentation for all the hooks should be consolidated into a section that better explains the sequencing, and that the API should also consider providing a hook that runs immediately before the pod is created. For anyone wanting both user-specific customisations and profile choices (for example, if they want to inject the username into an environment variable, but also want the profile to set another environment variable) then they probably want the user-customisation to occur after the profile choice has been applied but before the pod manifest is produced. Any earlier and the profile clobbers the customisation; any later and manipulating spawner attributes has no effect. The problem is that there is actually no such hook. Probably the best approach (currently) is to use (This seems simpler than the alternative approach of using Otherwise, for anyone wanting to use the hooks to make customisations, they will probably need to know:
|
I was just upgrading JH/kubespawner, and noticed that PR #301 caused a problem and possibly there's a bug in how it interacts with JupyterHub. #301 handles loading the user options the correct way (in a
load_user_options
function instead ofoptions_from_form
). Thanks for #301, by the way, that allows us to do better CI.JH runs
pre_spawn_hook
first, then.start()
, but.start()
applies the profile options. So with the latest kubespawner the hook can't use thekubespawner_override
settings (and would have to handle the raw user_options first). Andkubespawner_override
will also override anything that is also set inpre_spawn_hook
.I have worked around it by adding this to the top of my
pre_spawn_hook
, which applies the profile options, then eliminates the profile list. An false-like but notNone
value for profile list makes kubespawner skip applying the profile list again.I'm not sure what the "right" answer is, since this seems almost intrinsic to how JH is set up with options being applied in
start
and hook being done first. My first idea is in the default pre_spawn_hook which needs to besuper()
ed, but I don't know.The text was updated successfully, but these errors were encountered: