-
Notifications
You must be signed in to change notification settings - Fork 275
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
jupyter + ssh-remote: persistent kernels #15723
Comments
I usually start a jupyter server in a tmux session for this |
@vishu-tyagi does tmux allow for persistent kernels (see above), while |
Sorry, I haven't used screen but tmux works fine for me. I don't usually use notebooks where I have to keep the kernel alive for days, so I haven't tested that. But the issue you described, tmux will keep the jupyter kernel alive even if your ssh disconnects (whether or not you have running code). You can give it a try. |
You are running the jupyter kernels on a remote server? In my case, I'm using a slurm cluster, so the workflow is as follows:
If VS Code loses the ssh connection to the particular node, all of the Jupyter kernels die, and then one must re-run the notebooks once they re-establish the ssh connection. |
When you ssh into the node, how are you starting the jupyter server? This is my workflow (might help). vscode command palette >> Remote-SSH: Connect to Host... >> cd into directory where Then, you can do some work in your notebook and save it, disconnect, and ssh again. You should see your saved work. I haven't tried this on a cluster, but don't think it should be any different. |
So you are not starting up the Jupyter notebooks directly in VS Code. With VS Code, you don't have to run |
@nick-youngblut @vishu-tyagi |
@DonJayamanne sorry for not seeing that other issue. It has quite a few upvotes. Using Jupyter through VS Code is great (e.g., easy enabling copilot), but this issue with non-persisting kernels really limits what one can do with VS Code + Jupyter. |
@nick-youngblut Absolutely no need to apologize |
Using vscode-jupyter on a remote machine with ssh-remote has the issue that all running kernels are killed if the ssh connection is lost.
This is unlike running Jupyter Lab (or Notebook) directly on a remote machine (and connect via port forwarding), in which running kernels will persist, even if one loses their ssh connection.
Due to this "killed-kernels" issue, large-scale data analysis is not practical with VS Code + Jupyter, since one must re-run their notebooks if they lose their ssh connection, and one cannot have long running code in their Jupyter notebooks (e.g., running over night).
Feature request: allow kernel jobs to persist even if the ssh connection is lost.
The text was updated successfully, but these errors were encountered: