-
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
Add user in script #16
Conversation
Provides ability to specify NB_USER and NB_UID at docker run time rather than build time.
Thanks for the UID configuration change. @rgbkrk had a question about supervisord as well back on PR #1. I responded there about why I thought it was important to have it #1 (comment). If there's a way to handle those two concerns with a pure script plus Docker commands, I'm all for it. |
Oooooh, thank you for the UID specifying. We've ran into that trouble before with JupyterHub deployments which had lots of users (and we were mounting from NFS). /cc @jhamrick |
Yes, +1 on the uid specifying! |
Used to relaunch notebook and collect logging data.
I think your first concern about preserving a modified jupyter config between container restarts might be handled by assigning it to a persistent docker volume. The absence of init within Docker is a complicated problem, thanks for the reference! It seems that supervisord is often used to launch multiple programs within containers. It addresses some of the init problems but opinions are mixed on its reaping capability and this isn't a recommended use in the supervisord manual. However, I don't know anything better and that's not the main thrust of this PR so I've restored supervisord to PID1 and parameterized its config file a little more. I couldn't get it to expand |
Perfect! You beat me to the punch about separating the UID work out from the init process work. I'll run a few tests here on the sub-images and then merge it in. I'm happy to open a separate issue about supervisord. Maybe we can find a solution over time. For what it's worth, it's specified as a CMD in the Dockerfile so it's entirely possible to override it and just launch the notebook server as part of the
|
Some problems:
I pushed a copy of your PR with one additional commit to parente@9562116. It has all the above updates except but retains /home/jovyan/work as the notebook path. However, it's currently busted when volume mounted. I'm looking for a way around that. |
Also, the start-notebook.sh script re-runs on container stop/start. Takes a bit to recursively set all the perms on the conda dir each time. Wonder if there's a way around that too. |
Ah, whoops I should have read feedback here before #21! |
stage CILogon cert to spawners
I wanted to be able to specify the UID of the jovyan user so I could mount host volumes and have the ownership make sense. I found this was most flexible if the useradd happened inside a CMD script instead of being built into the docker image.
The start-notebook.sh script changes the write permission of the conda root environment so there is no need to swap USERs back-and-forth in the Dockerfiles.
It was also convenient to launch the jupyter notebook at the end of the script, rather than using supervisord. The server may still be restarted automatically using Docker restart policies.