Skip to content
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

Some fixes for Jupyter Notebook 7 #1944

Merged

Conversation

mathbunnyru
Copy link
Member

Describe your changes

Issue ticket if applicable

Checklist (especially for first-time contributors)

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests
  • I will try not to use force-push to make the review process easier for reviewers
  • I have updated the documentation for significant changes

@@ -38,7 +38,8 @@ WORKDIR /tmp
RUN mamba install --yes \
'notebook' \
'jupyterhub' \
'jupyterlab' && \
'jupyterlab' \
'nbclassic' && \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that we need to install this explicitly, and nbclassic is kept to make migration easier. So, our images should also support nbclassic.
https://jupyter-notebook.readthedocs.io/en/stable/migrating/multiple-interfaces.html#nbclassic-and-notebook-7

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. The classic notebook UI is then available under the /nbclassic endpoint.

@@ -19,4 +19,4 @@ if [[ "${RESTARTABLE}" == "yes" ]]; then
fi

# shellcheck disable=SC1091,SC2086
exec /usr/local/bin/start.sh ${wrapper} jupyter ${DOCKER_STACKS_JUPYTER_CMD} ${NOTEBOOK_ARGS} "$@"
exec /usr/local/bin/start.sh ${wrapper} jupyter ${DOCKER_STACKS_JUPYTER_CMD} --port ${JUPYTER_PORT} ${NOTEBOOK_ARGS} "$@"
Copy link
Member Author

@mathbunnyru mathbunnyru Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JUPYTER_PORT env variable is no longer considered as a port for jupyter applications, so we pass this explicitly - I think the easiest way to do this is to add this line to both start-notebook.sh and start.sh.

We, on the other hand, can and should keep the variable name JUPYTER_PORT for users of our docker image.
This way we won't break them (unless they call start.sh manually, but I suppose it's a rare case).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally this should still be supported I think?

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I will try to revert this part.

@mathbunnyru
Copy link
Member Author

@jtpio may I ask you to take a look here - I think you know quite well if this is a reasonable change after Jupyter Notebook 7 release.

@@ -64,7 +64,7 @@ RUN mamba install --yes \
# Install facets which does not have a pip or conda package at the moment
WORKDIR /tmp
RUN git clone https://github.com/PAIR-code/facets.git && \
jupyter nbextension install facets/facets-dist/ --sys-prefix && \
jupyter nbclassic-extension install facets/facets-dist/ --sys-prefix && \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtpio
Copy link
Member

jtpio commented Jul 25, 2023

Thanks @mathbunnyru for looking into this!

I left a couple of comments, looking good otherwise 👍

@mathbunnyru mathbunnyru merged commit b8d617d into jupyter:main Jul 25, 2023
53 checks passed
@kondi
Copy link

kondi commented Jul 26, 2023

@mathbunnyru @jtpio Since this pull request got merged (b8d617d), zero-to-jupyterhub-k8s always launches the singleuser jupyter environment in the classic notebook tree view, instead of the JupyterLab mode. I tried many different configuration options to force it otherwise, but I did not manage to change it. If I go back to the previous docker-stacks image (141d72d, there are only documentation related changes between the merged pull request and that version), it works as expected and I got the /lab view loaded by default correctly.

@jtpio
Copy link
Member

jtpio commented Jul 26, 2023

Thanks @kondi for reporting.

I wonder if this might be related to jupyter/notebook#6954.

@mathbunnyru
Copy link
Member Author

mathbunnyru commented Jul 26, 2023

@kondi @jtpio I also think there is a bug in the JupyterHub which won't allow to choose Jupyter Notebook properly by setting JUPYTERHUB_SINGLEUSER_APP variable to notebook.
jupyterhub/jupyterhub#4518

c3HenryHsieh pushed a commit to c3HenryHsieh/docker-stacks that referenced this pull request Jul 26, 2023
* Some fixes for Jupyter Notebook 7

* Fix jupyter nbextension

* Remove explicit port setting
kentwait pushed a commit to kentwait/docker-stacks that referenced this pull request Aug 3, 2023
* Some fixes for Jupyter Notebook 7

* Fix jupyter nbextension

* Remove explicit port setting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants