Open consideRatio opened 3 years ago
The user environment is configured by setting Spawner.environment
. Perhaps this shoudl be in tljh-config set user_environment.env.ENVVAR
? It's unclear to me when an option should have a high-level tljh-config alias vs use the underlying traitlets config.
We should perhaps even have a tljh config area for setting the hub env, because manually editing the systemd unit is pretty advanced, and I suspect a problem for upgrades. In most cases, setting environment variables for the hub with Python code in jupyterhub_config.py with os.environ
will work, which would be the easiest to implement, because nothing but jupyterhub itself has been imported or instantiated at this point. However, it does preclude setting things like $PATH or $PYTHONPATH or $PYTHONUNBUFFERED that should have an effect on the invocation of python or jupyterhub itself. To work everywhere, we would need to write config somewhere and have a custom entrypoint that loads the environment prior to invoking python -m jupyterhub ...
.
TLJH makes use of SystemdSpawner, which in turn has the extra_paths
configuration.
A user can do append to that in a custom config file.
It could be needed for a environment variable to be set for the hub environment or the user environment. This may be done in various ways perhaps, but we should probably document this as this is quite distribution specific.
Related
415 (closed in favor of this, about setting GITHUB_HOST for the gitlab oauthenticator)