-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Jupyter Notebook deprecation -> default to JupyterLab #1575
Conversation
Introduce a new `JUPYTER_CMD` option
It's there any sort of standard variable across the Jupyter ecosystem for defining the Jupyter app/command? This has kind of come up in JupyterHub before, so it'd be nice if everyone in Jupyter could use a common variable! |
What about
Should this be changed to |
@benz0li good point! I will have a look 👀. |
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 do like this solution - it's quite clear what's gonna be launched.
One thing to add about this solution - we should probably parametrize more tests based on what we launch, it will make our test suite work in more situations.
Does not seem to be necessary: JupyterHub < v2.0 (JupyterLab ≥ v3.0)Opens Jupyter Notebook by default. --
— Configuring user environments — JupyterHub 1.4.2 documentation > Switching to Jupyter Server ℹ️ Setting JupyterHub ≥ v2.0 (JupyterLab ≥ v3.0)
— Configuring user environments — JupyterHub 2.0.0 documentation > Switching back to classic notebook ℹ️ Setting -- The ℹ️ Setting |
@benz0li thank you and I confirm about As per the doc the app launched can be controlled through
See also this thread. # default
docker run -it --rm -p 8888:8888 \
jupyter/base-notebook start-singleuser.sh \
| grep SingleUserLabApp
# [I 2022-01-19 16:43:54.025 SingleUserLabApp mixins:615] Starting jupyterhub single-user server version 2.0.2
# NotebookApp
docker run -it --rm -p 8888:8888 \
-e JUPYTERHUB_SINGLEUSER_APP=notebook.notebookapp.NotebookApp \
jupyter/base-notebook start-singleuser.sh \
| grep SingleUserNotebookApp
# [I 2022-01-19 16:44:25.061 SingleUserNotebookApp mixins:615] Starting jupyterhub single-user server version 2.0.2 |
My two cents:
Also, please, add |
@mathbunnyru totally agree with you. I will continue this way.
👌 got it maybe you want to add a test case when Thanks ! |
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.
Please, grep JUPYTER_ENABLE_LAB
- if there is something left, let's get rid of it.
I will also update the tag 33add21fab64
when this gets merged and built.
And I do actually like the table which you added in your first message: #1575 (comment) I think it's worth to add it to the docs as well. |
@mathbunnyru I made the changes requested. Please check if it's Ok for you. |
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.
This looks awesome.
Let's wait for @consideRatio and then give it a go.
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.
Beautiful! Thank you so much for your thorough work to make this change @romainx!
Naming of environment variables
One thing that I think is a bit problematic is the naming of our environment variables in general. They aren't named to indicate they influence this project's scripts.
I'm considering if we could try to do something about that to help people find their way to this projects documentation to learn more about the environment variable that they otherwise may not be sure what it does.
Overall I'd love to see that this project would prefix its environment variables, but, we would need to deprecate many old variables if we wanted to do that anyhow.
Example situation
Someone configures their installation of a JupyterHub Helm chart in a k8s cluster to start the servers differently, which works, because they use a jupyter/docker-stacks based image.
singleuser:
extraEnv:
JUPYTER_CMD: notebook
After this, someone copies configuration to a situation when they are not using an image derived from a docker-stacks based image, and voila - they are confused what's going on etc.
Naming of environment variables - conclusion
I'm okay with merging this as it is. I wanted though to raise the question on what you think about prefixing the new environment variable with DOCKER_STACKS_
as an initial step towards making our environment variables be prefixed like that in general.
@consideRatio thanks a lot 😄! and this is a very good remark.
|
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'm ok with whatever env variable you choose :)
@mathbunnyru and @consideRatio I think I'm done with this PR 😌. I will just update the issue to reflect what has been done and it will be 👌. |
Done. Welcome back, @romainx :) |
The new jupyter/minimal-notebook image uses lab CMD to run the jupyter server, which was introduced by jupyter/docker-stacks#1575. It provides DOCKER_STACKS_JUPYTER_CMD to set how to run it. The lab (full-stack) is for AiiDAlab only and should start with notebook mode. I pin it as an environment variable to start the jupyter backend. Since we have the new jupyterhub, the `NOTEBOOK_ARGS` can be used to set the notebook arguments.
The new jupyter/minimal-notebook image uses lab CMD to run the jupyter server, which was introduced by jupyter/docker-stacks#1575. It provides DOCKER_STACKS_JUPYTER_CMD to set how to run it. The lab (full-stack) is for AiiDAlab only and should start with notebook mode. I pin it as an environment variable to start the jupyter backend. Since we have the new jupyterhub, the `NOTEBOOK_ARGS` can be used to set the notebook arguments.
Hello,
This PR intends to close #1217.
The idea is to
jupyter lab
commandInstead of defining a closed option, I think it's more flexible to define a new option
JUPYTER_CMD
that can be used to launch differentjupyter
commands.lab
(def)notebook
nbclassic
server
retro
**Not installed at this time, but it could be the case in the future or it could be customized by end users.
Thanks 🙏 @krassowski, your answer on SO helped me a lot to better understand the Jupyter landscape.
For example to switching back to classic notebook backend and frontend.
docker run -it --rm -p 8888:8888 -e JUPYTER_CMD=notebook jupyter/base-notebook # Executing the command: jupyter notebook
At this time I've not checked if the value is in a list, if not it will be managed by the
jupyter
command.docker run -it --rm -p 8888:8888 -e JUPYTER_CMD=foo jupyter/base-notebook # Jupyter command `jupyter-foo` not found.
Warning and deprecation
I've left a warning that is intended to tell that
JUPYTER_ENABLE_LAB
is no more used and has no effect.I'm not sure we have to manage here Jupyter Notebook deprecation since we do not launch it anymore by default.
If the user decides to run it intentionally, it's not necessary to raise a warning it should be done by Jupyter Notebook.
Todo
JUPYTER_CMD
holds a proper value -> 👎JUPYTER_ENABLE_LAB
flag -> 👍 but it has to be changed@mathbunnyru and @consideRatio I would like to have your opinion. Once decided I will take care of the remaining tasks.
Many thanks 😄