-
Notifications
You must be signed in to change notification settings - Fork 131
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
After enable kernelgateway, pwd env does not change #342
Comments
What do you mean by "enable kg"? And what is your "pwd" test attempting to show - please explain? Kernel Gateway must be running before a notebook configured to use it is started. To configure the notebook server to use Kernel Gateway, it must be launched with the |
Hi, @kevin. Even though i passed [KernelGatewayApp] Starting kernel: ['/home/ma-user/anaconda3/envs/TensorFlow-1.8/bin/python', '-m', 'ipykernel_launcher', '-f', '/home/ma-user/.local/share/jupyter/runtime/kernel-accf88d7-d665-4cc5-8529-d9332fa0e7bf.json'] jupyter_kernel_gateway v2.4.1, Notebook v6.0.3 |
After enable kernelgateway, no matter where i create the file, the 'pwd' result is the same as where i start the kernelgateway.
|
After analyzing related code, i think the reason for above problem is missing 'path' parameter while calling 'start_kernel' method, a bug? To fix which, we need changes of Notebook and KernelGateway code。 https://github.com/jupyter/notebook/blob/master/notebook/services/kernels/handlers.py
https://github.com/jupyter/notebook/blob/master/notebook/gateway/managers.py https://github.com/jupyter/kernel_gateway/blob/master/kernel_gateway/services/kernels/handlers.py
|
The gateway projects (Kernel and Enterprise) are intended to run remotely from the notebook server and, as a result, there's no guarantee that a given path from one server will exist on another and be the same actual location. Kernels started in notebook go through the session manager - who's model knows about 'path' - and converts that to 'cwd' which is what Popen uses to change the kernel process's working directory. EG uses Are you running JKG local to your notebook server? If so, why? If remote, are you mounting your home directory on the JKG node? If we made some change, if think merely flowing |
Thanks for your reply, @kevin-bates. I'm running JKG remotely by mounting work directory on the JKG node. Flowing |
The |
I'll stick around the related changes. @kevin-bates, Thanks for all your great job here. |
Hey @kevin-bates, I have a bit different use case, but want to achieve somewhat similar thing - make Kernel Gateway (KG) create a kernel process under needed CWD. In my case, KG is running in a container exposing its API. Then, a custom code (no Jupyter Notebook code is involved) control kernel creation and code execution via that API. Is there a way to instruct KG to create a new kernel under specific CWD? I may have a few kernels that may need to have different CWDs (so should not be a global config, but set on the level of specific kernel, perhaps during creation). |
Hi @roma-glushko - this is not possible for local kernels (launched from JKG) without changes. The container-based kernels provided by EG and gateway-provisioners do flow
Or subclass |
The text was updated successfully, but these errors were encountered: