-
Notifications
You must be signed in to change notification settings - Fork 799
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
BREAKING: singleuser.cmd
defaults to Docker image default
#2138
Conversation
This is breaking change. Instead of setting the start command to `jupyterhub-singleuser` it now defaults to whatever was set in the Docker image.
So this will be breaking for anyone that relies on a docker image that doesn't have a startup command that automatically ensures we make use of a startup script that couples us with the JupyterHub. In practice, this would be images not based on jupyter/docker-stacks for example that are made without consideration for JupyterHub. A missing piece of knowledge is that I'm leaning for supporting this and writing about it in the changelog, which can be done separately if we agree that this is an acceptable change. It certainly is a easy to patch back to previous behavior if it is breaking. |
It sounds like we'll have to make a breaking change for the switch to JupyterLab 3, and if we switch to jupyter-server at a later date that's potentially another breaking change. My thinking was that by unsetting the property here Z2JH is no longer responsible for choosing the singleuser application. Instead we'll require that the singleuser Docker image provides a JupyterHub compatible server. I'm happy to work on some docs if we go ahead with this. |
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: |
Even if you remove the default in the helm chart here the default in jupyterhub is still /me answers his own question: Nope, because that's overridden by kubespawner: I've just been trying to figure out how to get rid of these warnings on notebook app startup when using jupyterhub:
We have this set in the hub image (though I'm not sure from where):
Using docker-stacks scipy-notebook pinned to 837c0c870545 so we have jupyterlab 3.0.5 and nbclassic 0.2.6 installed. docker-stacks puts config under /etc/jupyter/jupyter_notebook_config.py and /etc/jupyter/jupyter_server_config.py (though I'm not sure which is used). It seems like maybe I just need to wait for some of these upstream projects to align on making jupyterlab the default (z2jh, docker-stacks, jupyterhub) before worrying too much about those deprecation warnings. |
Related, but possible tangent: I think it is a better approach for images with 'pre-launch' stages like the Jupyter docker stacks to implement the bulk of the startup in ENTRYPOINT instead of CMD (ref). This way it's ~always run, and the consequences of setting the command to launch are more what you expect them to be. This is what we do in repo2docker-built images, for exactly this reason. |
@minrk @yuvipanda what do you think about this suggested change? I'm in favor of it. With this PR, I think we reduce the complexity in a good way. I have struggled a lot with mapping out what @manics mapps out very clearly in the topic. When z2jh, kubespawner, and the Dockerfile, as well as scripts within the image are all doing things it becomes complicated. With this change, z2jh will no longer do something unless explicitly configured. I'll go for a merge unless someone objects by friday evening! |
👍. It's not clear to me what's best, but solving known problems is worth a shot. Matching kubespawner, at the very least, is a good thing. This also matches DockerSpawner's longstanding behavior. @consideRatio pointed out the main case negatively affected by this - specifying images where jupyterhub is available will no longer work by default without also specifying the command, but for those the answer is always the same: |
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.
I think I put this in when z2jh started (?) and it was a mistake. Unsetting is the right thing to do.
However, this is a heavy breaking change now - can we add more docs and a heavy bit of notice to the changelog? Happy to merge after that.
I'll definitely add some docs to this PR now that there's agreement for this change. |
I can write a Discourse announcement too when this is merged. |
@manics having thought a lot about KubeSpawner's The big difference is that we leave
|
Good point. Though if we're switching to JupyterLab 3 I think we'll end up making breaking changes anyway. |
@manics because switching to JupyterLab by default implies setting I'm currently very hesitant to merge this, feeling inactionable by the complexity of all the related issues. Do you have an action point to suggest? My concern is that we make a change here only to have a lot of users running into issues with Related
Me when considering this complexity |
The original motivation for me suggesting this change was to make it easier to configure the default singleuser application in Z2JH by delegating the choice to the Docker image instead of Z2JH, which in turn was motivated by the desire to switch to JupyterLab 3. It just so happens that I discovered the problem of I think we need to consider this and JupyterLab 3 together. If we're prepared to make breaking changes to switch to JupyterLab 3 I think we should consider merging this PR since it helps to avoid future problems if we need to switch again (e.g. for jupyter server, or if something else replaces JupyterLab, or just to make it easier for people to cusomise their images). If we find a non-breaking way to switch to JupyterLab 3, or we decide it's too much trouble, that removes one of the drivers behind this change, and we should consider the pros and cons again. |
I still don't have a clear mind about what switching to JupyterLab 3 as default would imply, but merging this PR standalone is something that makes me very uneasy at this point. If I would write the CHANGELOG message or respond to questions about that later i would communicate something like...
My current opinion
|
I'll close this then, we can always reopen in future. |
@manics thank you for exploring this, let us reopen as soon as we improve the CLI args situation |
This is breaking change. Instead of setting the start command to
jupyterhub-singleuser
it now defaults to whatever was set in the Docker image.start-notebook.sh
JUPYTERHUB_API_TOKEN
environment variable and runsstart-singleuser.sh
if detectedjupyterhub-singleuser
viastart.sh
See https://discourse.jupyter.org/t/pyspark-library-is-missing-from-jupyter-pyspark-notebook-when-running-with-jupyterhub-zero-to-jupyterhub-k8s/8450/3 for an example where this is important
In addition this may (or may not) make the switch to JupyterLab 3 easier:
JUPYTER_ENABLE_LAB
environment variable from juststart-notebook.sh
to also work instart-singleuser.sh
. The big advantage here is we could then switch to JupyterLab 3 by settingJUPYTER_ENABLE_LAB
without breaking images using JupyterLab 2 or those without JupyterLab. Since it's just an env var if your Docker image command doesn't care about it nothing breaks.