-
Notifications
You must be signed in to change notification settings - Fork 223
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
Issue setting environment variables in remote kernels using KERNEL_ prefix #1192
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
Hi @debashis1982 - as I expected, I cannot reproduce this issue, so I think we'll need to go through the exercise of what you're exactly running and doing. Here's what I did:
$ helm upgrade --install enterprise-gateway https://github.com/jupyter-server/enterprise_gateway/releases/download/v3.0.0/jupyter_enterprise_gateway_helm-3.0.0.tar.gz --namespace enterprise-gateway
Release "enterprise-gateway" does not exist. Installing it now.
NAME: enterprise-gateway
LAST DEPLOYED: Wed Nov 9 11:53:55 2022
NAMESPACE: enterprise-gateway
STATUS: deployed
REVISION: 1
TEST SUITE: None
$ kubectl logs -f deployment.apps/enterprise-gateway -n enterprise-gateway
[I 2022-11-09 19:53:59.167 EnterpriseGatewayApp] Jupyter Enterprise Gateway 3.0.0 is available at http://0.0.0.0:8888
$ export KERNEL_FLOW_TEST=42
$ jupyter lab --debug --gateway-url=http://localhost:53433 As you can see Could you please try these steps or provide the necessary information to better understand where the differences are? |
We are building enterprise gateway from source
As you can see we are launching EG using supervisor. There are also some other critical processes that we run besides enterprise gateway
That launches EG pod and in the logs for EG I can see the version
To test it, in a terminal
It returns other KERNEL_ prefixed env vars except
Also as I pointed out in the original issue even if try to create a kernel using a API call and in the process try to set environment variable, it does not work. In both cases it works only if I add that variable in the kernel pod yaml's env variable list |
Ok - two immediate observations that should be updated.
Here's the applicable section in the docs. The build you're doing appears to follow our repo so that looks okay, but I suspect the envs are not getting to the EG server from the notebook server. All of the |
Another thing to confirm is that your code contains the changes from 4f4e6de. Could you run the command equivalent to the following and confirm the existence of the
I just went and looked at |
I don't see that method there. We deploy the kernelspecs and launch scripts through a different process. Looks like we need to then update the launch script and retry. I will do that and get back to you. Thank you! |
That was it! That did it! Updating the kernel launch script was all that was needed. Thank you for all your help @kevin-bates .Really appreciate it. |
Awesome. Glad to have you moving forward! Since you're developing with EG, it would be great to hear how we could help in that area, etc. |
Description
We are using enterprise gateway to spin up kernels in kubernetes. Enterprise Gateway version is
3.1.0
and is running on Kubernetes.We want to set custom environment variables in kernels while they are being created so that they are available when the kernel is ready to use.
I have followed Kernel Environment Variables — Jupyter Enterprise Gateway 3.1.0.dev0 documentation
While I am able to override existing
KERNEL_
prefixed env vars likeKERNEL_USERNAME
andKERNEL_SPARK_CONTEXT_INIT_MODE
, I am unable to create new environment var likeKERNEL_USERID
.This is how my create kernel API call looks like
But when I check the environment variables in the newly created kernel, it is not there.
To make it work I had to add
in the kernel's
kernel-pod.yaml.j2
file. Is this config necessary or is there a way I can get it to work by just havingKERNEL_
prefixed environment variables set at the client side?The text was updated successfully, but these errors were encountered: