the-littlest-jupyterhub icon indicating copy to clipboard operation
the-littlest-jupyterhub copied to clipboard

plugin for creating environmental variables

Open raybellwaves opened this issue 2 years ago • 2 comments

I would like a plugin function to create environmental variables.

Motivation is for https://github.com/dask/dask-labextension/issues/183 i.e. set export DASK_DISTRIBUTED__DASHBOARD__LINK=/user/${JUPYTERHUB_USER}/proxy/8787/status

Proposed change

A function in https://github.com/jupyterhub/the-littlest-jupyterhub/blob/main/tljh/hooks.py called tljh_environmnetal_variables'

Alternative options

Maybe this can be done currently with https://github.com/jupyterhub/the-littlest-jupyterhub/blob/main/tljh/hooks.py#L69 but not sure how

os.environ["DASK_DISTRIBUTED__DASHBOARD__LINK"] = f"user/{os.getenv('JUPYTERHUB_USER')}/proxy/8787/status"

Not sure if it will persist though

Who would use this feature?

People who want to use the dask lab extension

(Optional): Suggest a solution

raybellwaves avatar Dec 24 '21 03:12 raybellwaves

Some work here

https://github.com/jupyterhub/the-littlest-jupyterhub/pull/414/files

If that goes could make that conf file plugable?

raybellwaves avatar Dec 24 '21 04:12 raybellwaves

Done via yaml in z2jh https://zero-to-jupyterhub.readthedocs.io/en/latest/jupyterhub/customizing/user-environment.html#set-environment-variables

raybellwaves avatar Dec 24 '21 04:12 raybellwaves