Skip to content
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

Get directory of the notebook initialising the kernel in remote_ikernel #980

Open
divyansshhh opened this issue Sep 14, 2022 · 1 comment

Comments

@divyansshhh
Copy link
Contributor

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.

@welcome
Copy link

welcome bot commented Sep 14, 2022

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

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! 👋

Welcome to the Jupyter community! 🎉

divyansshhh added a commit to divyansshhh/jupyter_server that referenced this issue Sep 14, 2022
This is done to get the dir of the notebook where notebook initialising the kernel belongs.

jupyter-server#980
divyansshhh added a commit to divyansshhh/jupyter_server that referenced this issue Sep 14, 2022
This is done to get the dir of the notebook where notebook initialising the kernel belongs.

jupyter-server#980
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant