-
Notifications
You must be signed in to change notification settings - Fork 801
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
Setting environment variables that depend on other environment variables using extraEnv #1255
Comments
If you need to evaluate other env vars while setting these, they must be set after container startup from within the container, but before the jupyter server starts etc, i think. It doesnt work now because kubernetes is configured to start a container with these variables, and kubernetes doesnt know of various env vars in the container on startup. If look into modifying singleuser.cmd, add an extra volume and volumemount, with a script referenced by singleuser.cmd, to first load additional vars, and then start the previous command. Prepare for some tough debugging sessions ahead, but that is the way i see this done atm. |
Thanks for the help. I can't find singleuser.cmd in the z2jh configuration reference. Are you able to provide additional details about what I would do here? Is changing singleuser.cmd different from providing a different Entrypoint script for the single user image? |
It will configure kubespawner within images/hub/jupyterhub_config.py, and kubespawner will then use that to configure the kubernetes pod spec, that will in turn configure the Docker container with certain things to do when it starts up. I'm unable to provide much further help to solve this as I'm out of time to do so overall =/ It is a spare time thing for me to contribute to this repo. Good luck! |
Currently, I am setting these environment variables in an entrypoint script (what is run on container start up before calling the command |
Hi. I am trying to set an environment variable like so:
The issue is that this will get parsed to the literal string "my.url.com${JUPYTERHUB_SERVICE_PREFIX}proxy/4040/jobs/" instead of evaluating the environment variable.
A further issue is that since both SPARK_PUBLIC_DNS and JUPYTERHUB_SERVICE_PREFIX are set only on container creation, there doesn't seem to be a way to set an environment variable that requires e.g. JUPYTERHUB_SERVICE_PREFIX before the container is started. I have worked around this by altering my single-user container's Entrypoint script to set SPARK_PUBLIC_DNS, but this feels like an inelegant solution given the option to set extra environment variables directly in the
config.yaml
. Is there any other way I could go about doing this?I could also imagine that a situation where I pass a list of environment variables that all depend on one another to
extraEnv
, none that depend on environment variables that are only set on container creation. For example,or something like that. Here, environment variables B and C won't be set correctly, but it would be reasonable to imagine that they would be since A precedes both B and C and B precedes C in definition. Is this functionality possible?
The text was updated successfully, but these errors were encountered: