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

Update the jupyterhub/repo2docker image #217

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Nov 14, 2023

Update the jupyterhub/repo2docker Docker image to point to a pinned version by default.

The tag is made configurable in case so it's easier to override if needed, without having to update this repo.

Having a default pinned version makes it easier to reason about which version is being installed when the playbook is run multiple times.

Fixes #211

@jtpio
Copy link
Member Author

jtpio commented Nov 15, 2023

Environments seems to be building fine locally:

image

Although servers time out on startup. Wondering if it could be related to the custom entrypoint used in Plasma, and the fact that it has since changed in repo2docker to be implemented in Python instead of being a Bash script: jupyterhub/repo2docker#1014

tornado.web.HTTPError: HTTP 500: Internal Server Error (Spawner failed to start [status=0]. The logs for jtp may contain details.)

c.PlasmaSpawner.default_url = "/lab"
# TODO: change back to jupyterhub-singleuser
c.PlasmaSpawner.cmd = ["/srv/conda/envs/notebook/bin/jupyterhub-singleuser"]
# set the default cpu and memory limits
c.PlasmaSpawner.args = ["--ResourceUseDisplay.track_cpu_percent=True"]
# explicitely opt-in to enable the custom entrypoint logic
c.PlasmaSpawner.run_as_root = True
Copy link
Member Author

@jtpio jtpio Nov 20, 2023

Choose a reason for hiding this comment

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

This is now opt-in in dockerspawner>=12.0: https://jupyterhub-dockerspawner.readthedocs.io/en/latest/changelog.html#id3

Not sure why we didn't have to set it explicitly before, as it was updated in #193.

@@ -43,4 +43,4 @@ export JUPYTER_PATH=${IMAGE_DIR}/.local/share/jupyter
cd ${IMAGE_DIR}

# execute the notebook process as the given user
exec su - $NB_USER -m -c '"$0" "$@"' -- "$@"
exec su $NB_USER -m -c '"$0" "$@"' -- "$@"
Copy link
Member Author

Choose a reason for hiding this comment

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

OK this seems to be doing the trick for being able able to launch the server.

If I understand correctly, specifying - would be equivalent to starting the process with --login, which conflicts with -m / --preserve-environment.

As hinted by the the error logs:

su: ignoring --preserve-environment, it's mutually exclusive with --login
--root-prefix: 1 required TEXT missing
Run with --help for more information.
/srv/conda/envs/notebook/bin/jupyterhub-singleuser: 7: /etc/profile.d/activate-conda.sh: [[: not found
/srv/conda/envs/notebook/bin/jupyterhub-singleuser: 20: /etc/profile.d/activate-conda.sh: mamba: not found
JUPYTERHUB_API_TOKEN env is required to run jupyterhub-singleuser. Did you launch it manually?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess this is related to recent update of the mamba activation scripts in repo2docker. Removing the - seems to be working fine locally so we should be able to do without now:

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Need to do a bit more testing on a test VM, but this change might break compatibility with existing environments built with an older version of repo2docker.

This was referenced Nov 23, 2023
@atrawog
Copy link

atrawog commented Jan 4, 2024

This issue is quite likely caused by jupyterhub/repo2docker#1287 and the latest version of repo2docker using Ubuntu 22.04 instead of 18.04 and should be fixed by using repo2docker --build-arg BASE_IMAGE=ubuntu:18.04 or adding BASE_IMAGE=ubuntu:18.04 to the build args in the tljh-repo2docker web gui when craeting the environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force update of repo2docker Docker image
2 participants