jupyter_server icon indicating copy to clipboard operation
jupyter_server copied to clipboard

Get directory of the notebook initialising the kernel in remote_ikernel

Open divyansshhh opened this issue 3 years ago • 1 comments

Problem

I have a fork of remote_ikernel which I use to connect to a kernel on a remote host. I also have a contents manager that overrides the / directory to mount a virtual filesystem (this is not a physical location on disk) so when I open a notebook from this virtual filesystem, remote_ikernel thinks the cwd is /, which is incorrect.

(the notebook path could be from something like - /<virtual-dir-prefix>/u/$USER/Untitled.ipynb, I expect the cwd to be /u/$USER/ on the remote host but it is set to /)

I want a way to communicate to remote_ikernel what the correct path is.

Proposed Solution

I propose adding an environment variable (say, JPY_NOTEBOOK_DIR) which I can use in my fork of remote_ikernel to switch to the correct cwd.

Additional context

I have tried using a custom SessionManager to do this but the current implementation adds alot of maintenance overhead to keep our version in sync with the latest releases of jupyter_server. Hence I propose making the change in jupyter_server itself.

divyansshhh avatar Sep 14 '22 07:09 divyansshhh

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Sep 14 '22 07:09 welcome[bot]