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

Using notebook CMD to run the jupyter stack #331

Merged
merged 3 commits into from
Nov 28, 2022
Merged

Conversation

unkcpz
Copy link
Member

@unkcpz unkcpz commented Nov 25, 2022

The new jupyter/minimal-notebook image uses lab CMD to run the jupyter server, which was introduced by jupyter/docker-stacks#1575. It provide 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.

@danielhollas
Copy link
Contributor

I tried to give it a test, but I am getting a 500 Jupyter server error, due to this jinja exception

      File "/opt/conda/lib/python3.9/site-packages/nbconvert/__init__.py", line 4, in <module>
        from .exporters import *
      File "/opt/conda/lib/python3.9/site-packages/nbconvert/exporters/__init__.py", line 3, in <module>
        from .html import HTMLExporter
      File "/opt/conda/lib/python3.9/site-packages/nbconvert/exporters/html.py", line 12, in <module>
        from jinja2 import contextfilter
    ImportError: cannot import name 'contextfilter' from 'jinja2' (/opt/conda/lib/python3.9/site-packages/jinja2/__init__.py)

This is probably another side-effect of updating the base image to Python 9.13? Perhaps we need to adjust the nbconvert / jinja dependencies, not sure where they are defined.

d2l-ai/d2l-book#46

@danielhollas
Copy link
Contributor

Ah, I see the error comes from AWB which reinstalls some dependencies and breaks the environment, which you're already trying to address in aiidalab/aiidalab-widgets-base#395

If I don't install AWB, things seems to work.

danielhollas
danielhollas previously approved these changes Nov 27, 2022
Copy link
Contributor

@danielhollas danielhollas left a comment

Choose a reason for hiding this comment

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

I have verified that the issue exist on the current aiidalab/full-stack:edge and verified that this PR fixes it.

stack/lab/Dockerfile Outdated Show resolved Hide resolved
@@ -3,6 +3,13 @@ FROM base

LABEL maintainer="AiiDAlab Team <aiidalab@materialscloud.org>"

# The lab mode is default to run jupyter server.
# Here the CMD pinned to `notebook` for running in legacy notebook backend
# In the future, we have appmode compatible with nbclassic
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I understand correctly that Appmode is currently not compatible with the nbclassic option?

@unkcpz
Copy link
Member Author

unkcpz commented Nov 28, 2022

Ah, I see the error comes from AWB which reinstalls some dependencies and breaks the environment, which you're already trying to address in aiidalab/aiidalab-widgets-base#395

Yes, exactly! @danielhollas thanks a lot for the review. I addressed the things you mentioned.

@unkcpz unkcpz requested a review from danielhollas November 28, 2022 10:16
Copy link
Contributor

@danielhollas danielhollas left a comment

Choose a reason for hiding this comment

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

Thanks @unkcpz. LGTM
I think this needs to be merged before the other open PRs.

@unkcpz unkcpz enabled auto-merge (squash) November 28, 2022 10:22
@unkcpz unkcpz merged commit f97dd68 into main Nov 28, 2022
@unkcpz unkcpz deleted the fix/329/default-nb-mode branch November 28, 2022 10:25
danielhollas pushed a commit that referenced this pull request Nov 28, 2022
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.
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.

2 participants