-
Hi all, I’m exploring the workflow suggested by the diagram on positron.posit.co/remote-ssh and want to see if my understanding is correct. I should be able to manually launch a Positron server instance on a remote system (matching versions, of course) and then connect my local desktop Posit IDE to that headless remote server via SSH. My main goal is to run the headless server inside a Singularity container, like this: A few questions:
Anyone got experience in trying this? Thanks for the help! [EDIT: added a third question] |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Generally speaking, it is not currently possible to have headless Positron IDE sessions that you can connect to / disconnect from via remote SSH. This is a limitation of the underlying VS Code platform and also isn't supported by VS Code's remote development features. Read more about that here: microsoft/vscode-remote-release#3096 You might try setting the entry point for your Singularity container to be the SSH server rather than Positron server? In that case you'll get a new "session" every time but it'll all be in the same Singularity container so might achieve what you want. Positron's kernel supervisor also makes it possible to have long-running Python and R sessions that Positron can attach to / detach from -- so even though you get a new server instance each time, it will be connected to the same kernel. Positron will generally manage these long-running sessions itself. That's documented here: https://positron.posit.co/remote-ssh.html#long-running-sessions Another advanced move you could try if you're looking for long-running Python and R sessions in another environment is to start Positron's kernel supervisor manually in the environment where you want it to connect and then set the Lines 322 to 355 in 4b70a78 |
Beta Was this translation helpful? Give feedback.
I appreciate the detailed response. If I understand correctly, the idea is to launch the KernelSupervisor manually inside the image environment, then attach to it when connecting remotely—this makes it possible to run sessions inside containers and also keep them alive for long-running jobs.
I tested it out, and it works! 🎉 Here’s how I set it up:
1. Download and unpack the Positron server binary
Using the URL template (adjust ${arch}, ${os}, ${version} as needed):
2. Add environment variables to your remote
.bashrc
: