In vscode, how to open julia's REPL on the current compute node and run code with ctrl+shift

In vscode, how to open julia’s REPL on the current compute node and run code with ctrl+shift

Something that I have done in the past is to use remote-ssh to connect to the login-node,
then start an interactive session and start julia there from the terminal. Then you can connect the REPL with the “Connect external REPL” command (type ctrl+shift+p and search for connect external REPL, this gives you some code that you can paste into the REPL)

I did something similar to @Salmon.
Following and adapting from this tutorial.

  1. Do the tutorial once to set up (maybe you can manage without, but this was very convenient)

Then every time you wanna connect.

  1. SHH on the cluster, and set up an interactive node on some node (let say 12).
  2. Then using the again SSH remote from VSCode (thanks to the tutorial) I could SSH on that interactive node 12.
  3. Then VSCode session uses the Julia extension normally i.e. as your local machine (plots panel, ctr+shift etc).
    This was amazing!
    1*) Cherry on the top, set up the interactive node in step 1. in a “screen” session so that you can close this SHH and run 2), 3) without leaving open the first session.

Of course, once the wall time of the node expired the Julia VSCode ssh remote session will crash.

Every time I enter the REPL, I automatically jump back to the REPL of the login node. I expect to be able to start the REPL on the compute node once I have entered it.

I modified it according to the tutorial, but it still cannot be used. This is the corresponding error output in vscode, but I don’t know how to solve it

So you have some ssh connection like this?

your computer → login node → compute node

And the VSCode client is running on your computer and the VSCode server is running on the login node?

If that is the case, I don’t think you can connect to a REPL located on a different node than where the VSCode server is by default, though I might very well be wrong here.

Either make sure you connect VSCode directly to the compute node, or try e.g. GitHub - c42f/RemoteREPL.jl: Connect a REPL to a remote Julia process which looks like it could help with connecting two REPLs on different machines IIUC.

1 Like