-
Notifications
You must be signed in to change notification settings - Fork 65
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
Upgrade to JupyterLab 3.0 #204
Conversation
@GeorgianaElena this is also needed I think. singleuser:
extraEnv:
# ref: https://github.com/jupyterhub/jupyterhub/blob/master/docs/source/reference/config-user-env.md#switching-to-jupyter-server
JUPYTERHUB_SINGLEUSER_APP: jupyter_server.serverapp.ServerApp |
Hmm, I'd like us to not switch to serverapp yet, and continue using the notebook package for now. The situation around jupter_server, nbclassic, notebook packages is very confusing to me :D And since the primary interface used in teaching is still the classic notebook package, I want us to stick to that as closely as possible for now. I'm also already running JupterLab 3.0 with the notebook package at berkeley, and it seems to be doing ok. |
Oh so using ServerApp wasn't required? Ah! I think the issues I mentioned for jupyter-server-proxy related to ServerApp specifically, and then there is no need for the 1.6.0 release. |
Nope! Check it out - https://github.com/berkeley-dsep-infra/datahub/blob/staging/deployments/datahub/images/default/infra-requirements.txt. Jupyterlab continues to function fine as a notebook extension |
This LGTM, @GeorgianaElena :) |
Thanks @yuvipanda! I'm building the image right now and want to test it on staging before merging. |
For some reason, when trying to build the image, it gets stuck in:
:( @consideRatio or @yuvipanda, did you encounter this before and know what the issue may be? |
hmm, how long is it stuck there? Maybe the docker image is full? I unfortunately do not have enough conda experience to debug this :( This is why I always just use pip, though. So if we can't figure this out in a bit, let's just move the packages to pip. |
I think yesterday I left it more than an hour and nothing happened. The thing is that it used to work before bumping the version of some packages (I got some version conflicts) and now nothing :( |
@yuvipanda, when pining pip to 20.2 (as per this comment conda/conda#6986 (comment)), it got pass the Few questions:
I don't see it pinned to 10.x anywhere, but I guess this is the newest version available from apt, right? |
mmmm, fun.. Here's what I suggest:
How does this sound? |
Sounds like a plan 🦸♀️
So the labextentions we had before are:
I believe that only |
In a image having quite a bit of conda packages, I got a speedup from 60 minute builds to 40 minute builds using For reference, this is how I've most recently installed the base python environment using # Install a minimal conda based python disitribution and ensure we use a
# specific python version. Instead of using conda, we use mamba which increase
# performance. Instead of the default channel, we use conda-forge by default as
# well.
#
# Ref for latest versions and SHA: https://github.com/conda-forge/miniforge/releases
ENV MAMBAFORGE_VERSION=4.9.2-5 \
MAMBAFORGE_SHA256SUM=7f0ad0c2f367751f7878d25a7bc1b4aa48b8dcea864daf9bc09acb595102368b \
PYTHON_VERSION=3.7
ENV MAMBAFORGE_FILENAME=Mambaforge-${MAMBAFORGE_VERSION}-Linux-x86_64.sh
ENV MAMBAFORGE_URL=https://github.com/conda-forge/miniforge/releases/download/${MAMBAFORGE_VERSION}/${MAMBAFORGE_FILENAME}
RUN cd /tmp \
# Download, verify checksum, install, cleanup
&& wget --quiet $MAMBAFORGE_URL \
&& echo "${MAMBAFORGE_SHA256SUM} ${MAMBAFORGE_FILENAME}" | sha256sum --quiet -c - \
&& /bin/bash "${MAMBAFORGE_FILENAME}" -f -b -p $CONDA_DIR \
&& rm "${MAMBAFORGE_FILENAME}" \
# Install desired Python version, cleanup
&& mamba install python=${PYTHON_VERSION} --quiet --yes \
&& mamba clean --all --yes -f \
# Preserve behavior of miniconda - packages come from conda-forge + defaults
&& conda config --system --append channels defaults \
&& fix-permissions $CONDA_DIR $HOME Note that fix-permissions and $CONDA_DIR relate to jupyter/docker-stacks images |
I was aware of mamba, but didn't get to use it yet. The speedup seems really impressive 🎉 Thanks for sharing @consideRatio! I won't mind giving mamba a try for this. @yuvipanda, what do you think, go mama 💃 or stick with pip? :D |
Also, running
It really doesn't make any sense for me, and I don't see any connection between pip and de-registering signal handlers 🤷 |
The approach I've evolved to is to rely on pip as much as possible, but when needed, let individual packages be installed with mamba using the conda-forge channel. To first transition to using pip for everything is a good first step towards such approach btw, because then that is the default and only what is needed can be migrated to be conda/mamba installed. Motivation
|
@GeorgianaElena I definitely want us to explore mamba! But I want us to finish this up as soon as we possibly can and move on to other tasks, here and in UToronto, so let's open an issue for that instead? |
Thanks for sharing all this knowledge @consideRatio <3 |
My approach to packaging is also exactly @consideRatio's :D I used conda here as an experiment to see what kinda complexity I can deal with, and unfortunately it looks like the amount of knowledge I have isn't good enough to deal with conda packaging complexities... |
@yuvipanda, do you want to wait for a new release of jupyter-server-proxy that doesn't require nodejs anymore or just go without it until then? |
@GeorgianaElena if we can test that everything else in this PR works, we can just wait until that release is made. Not urgent :D |
I built the image (as it is, without jupyter-server-proxy extension enabled for jupyterlab, but pkg installed), pushed it, then deployed it to staging. What happened:
[W 2021-02-10 16:07:43.160 SingleUserNotebookApp notebookapp:1950] Error loading server extension jupyter_server_proxy
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/notebook/notebookapp.py", line 1945, in init_server_extensions
func(self)
File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/__init__.py", line 27, in load_jupyter_server_extension
server_processes += get_entrypoint_server_processes()
File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/config.py", line 75, in get_entrypoint_server_processes
make_server_process(entry_point.name, entry_point.load()())
File "/opt/conda/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2460, in load
self.require(*args, **kwargs)
File "/opt/conda/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2483, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/opt/conda/lib/python3.7/site-packages/pkg_resources/__init__.py", line 790, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (nbformat 4.4.0 (/opt/conda/lib/python3.7/site-packages), Requirement.parse('nbformat>=5.0'), {'nbclient'})
[W 2021-02-10 16:07:44.255 LabApp] 'terminado_settings' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-10 16:07:44.255 LabApp] 'terminado_settings' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
|
ah, fun! I think the 'InteractExporter' is from nbinteract, which we can remove - I don't think anyone is actively using that, and Jupyyterbook's thebe does similar things I think. The other one is concerning :| |
Removing nbinteract from my single user server seemed to have solved the 500 error issue.
|
Hey all - what is the state of this one? Are we blocked on the error messages reported above? |
All the labextensions that were giving us trouble have now been upgraded to work with JupyterLab 3.0, so this can be picked up again. |
Are you running notebook servers or jupyter_server servers? |
That's the key... see my comment here: pangeo-data/pangeo-docker-images#206 (comment) Particularly this piece (pasted here for a quick look):
The fix for this sort of scenarios is to make your extension also compatible with the new server: https://jupyter-server.readthedocs.io/en/latest/developers/extensions.html#migrating-an-extension-to-use-jupyter-server And support both, the legacy and the new server, for at least some time, until the transition completes... |
@damianavila do you think what I observed (jupyterhub/nbgitpuller#176) as a web-frontend issue is a sympton of this, or do you think there are two separate issues to report in nbgitpuller? |
I think it is a symptom... if you control that environment, try launching the legacy notebook app vs the jupyterlab app and check if things behave in a different way. |
@damianavila thanks, I opened jupyterhub/nbgitpuller#177! @GeorgianaElena then I think with regards to nbgitpuller, as long as we don't start using jupyter_server as part of this PR, then we are fine. @damianavila is that your understanding as well? |
IIRC JupyterLab 3 actually has the new jupyter_server as a requirement but, I think, we are defaulting to So we should be fine, maybe? We should definitely test nbgitpuller on top of the current PR and see how it behaves... |
Hey all - what are the blockers to getting this one merged? |
⬇️
I guess it is just a matter of testing if the nbgitpuller works as expected. And solve the conflicts. |
23eaf5a
to
8291481
Compare
I've just fixed the conflicts and re-built the user image. I also tried to test out What I did:
A strage thing I noticed was that running I would highly appreciate if this nbgitpuller situation got another pair of 👀 If anyone wants to give this a try, the staging hub (https://staging.pilot.2i2c.cloud) is using lab v3 and it's defaulting to this interface. |
Super!
Interesting... is the cloning capability actually calling the server-side extension to perform the action?
Yep, that is expected because AFAIK, nbgitpuller is not yet compatible with the new server...
Yep, expected as well... Wondering if other actions that nbgitpuller performs that involve server-side code is actually working on the system defaulted to |
I haven't used I'm thinking of two approaches, in order to unblock this PR:
What do you think? |
I am not sure to what extent our users are actually using nbgitpuller, but I think this ⬆️ is an OK approach since we have some previous reports that things are going OK with this in other places and we have already identified the possible issue, so if anything arises, we should be able to quickly fix it/workaround it/revert it. |
Thanks a lot @damianavila! |
wahooo!!! congrats @GeorgianaElena and thanks everybody else for helping out :-) |
Closes #197
jupyter-server-proxy
version has been bumped. This only needs building the new user image and some manual testing.