Utilizing the API endpoint via POST
(ref here):
/users/{name}/servers/{server_name}
I am trying to send send a payload that includes environmental variables to be initialized in the notebook on start. Currently, my request looks like the following:
# Creates notebook for the user to use.
req = requests.post(
f"{uri}/users/{username}/servers/{project}",
json={
"environment": {
"PROJECT_UUID": project,
"USER_ID": user_id,
"STORAGE_URI": storage_uri,
"DATABASE_URI": database_uri,
}
},
headers=headers,
)
However, the above does not seem to initialize any env variables within the Spawner. The user of the environment
key is after seeing online that the payload must follow the Spawner’s variables – however, I also did try with it, and it did not work. My JupyterHub setup is currently running with Kubernetes, and configuring extraEnv
does seem to work, but it is not as dynamic as I need it to be.
# Spawned Jupyter Notebook configuration.
singleuser:
defaultUrl: "/lab"
image:
name: ...
tag: 1.0.2
extraEnv:
EASTERN: "You've found me! :)"
Any help would be appreciated.