-
Notifications
You must be signed in to change notification settings - Fork 817
Allow extraFiles to be injected to hub / singleuser pods and automatically load config in /usr/local/etc/jupyterhub_config.d #2006
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
Conversation
05e1c75
to
dfda9b8
Compare
Feature planningThe general idea is to add a volume and a volumeMount to the pod in question, but there are some deliberations along the way.
Passing files?Its straightforward on how to pass dictionary like configuration, but, how to go about passing a large A standalone text file A standalone binary file There is a PR open for It would be possible for users to base64 encode their files and then use --set-file on the base64 encoded version and then passing Decision References
|
Implementation work items
|
61c8c01
to
1233ff3
Compare
95c5ce4
to
59eb6a2
Compare
50c4fae
to
51e4583
Compare
I think that the documentation of this field looks good to me, though I am not 100% sure why this would be useful I'm assuming it'd be obvious to someone trying to deploy their JupyterHub. Is the main reason for this to add extra configuration within the hub that one might want for other purposes? If there is a quick one-liner to explain when it is useful, perhaps that could be added to the top of the section. |
This should be next to wherever Alternatively, we could move An example on overriding templates would be wonderful! |
@yuvipanda thank you for your input!! We currently mount it in /etc/jupyterhub following #1407.
If done from scratch, you would mount files something like...
Is that correct? I think this is won't be breaking actually. Only those that use a custom command to start jupyterhub and have hardcoded the config location would need to make a change afaik. I suggest we update to the sensible structure. What do you think? |
I agree! Let's do it :) |
The key point is mentioned in this bit in the docs:
It eliminates the need to do things like inline python/js/html/etc. in yaml config files like we do in binderhub, which loses syntax highlighting, editor support, linters, etc. Instead, you can write regular files and get all your familiar tooling, and then use this config to mount those files into the container. A big help when you have nontrivial things in there! |
mountPath in k8s Secrets imply the need to declare the file name as well when a subPath is used. So it feels a bit more clear to name this option mountDir, leaving less doubt about the interpretation.
aba3aa4
to
f1ca325
Compare
Woops I got a bit confused between PRs and pushed things regarding #1993. This PR is ready for review / merge again. |
e9baa27
to
f1ca325
Compare
This is great! I'm not sure the FHS doc supports switching from /etc/jupyterhub to /usr/local/etc/jupyterhub in a container/k8s/helm context (are we the "system administrators" in question, or the host system providers? I'd argue we are closer to the host system providers, based on the discussion of which files change during software updates). This is the relevant FHS statement on /usr/local:
Translating that to our context, I think that means we should be guaranteeing to our users that we never modify files in Since the work is already done, I don't object to it, but based on my reading of FHS, I think it was probably more appropriate and less surprising to use Great work @consideRatio! |
jupyterhub/zero-to-jupyterhub-k8s#2006 Merge pull request #2006 from consideRatio/pr/file-injection
Summary
hub.extraFiles
andsingleuser.extraFiles
allowing the chart users to inject files to the pods in specific locations with specific permissions (644, 400, etc)./etc/jupyterhub.d
.Motivation
Injecting files to the hub / singleuser pods have a wide range of applications:
hub.extraConfig
that. Related: allow extending jupyterhub_config.py from files #1987, Dedicated .py file instead of snippets in extraConfig #1580.jupyter_notebook_config.json
,gitconfig
, etc. Related: Add support for setting hub-wide notebook config #1691Usage documentation
See the documentation preview, or if its already merged the latest documentation.