...
First, open a terminal, login to the cluster and request an interactive session on one of the compute nodes.
Remember the name of the compute node that was assigned to you, e.g.
n2cn1234
.Keep the terminal open until you’re done with your work.
Second, use VS Code’s remote extension to connect to the compute node via SSH.
For this to work, you need to be able to directly
ssh n2cn1234
to the compute node. To avoid many entires in your~/.ssh/config
(one for each compute node) you can use the following entries for Noctua 1 and 2 based on wildcards (the jump hosts are defined here):Code Block # Noctua 2 Host n2cn* n2lcn* n2gpu* n2fpga* HostName %h ProxyJump n2-jumphost User [USERNAME] IdentityFile [PATH TO PRIVATE KEY] IdentitiesOnly yes # Noctua 1 Host cn-* gpu-* HostName %h ProxyJump noctua-jumphost User [USERNAME] IdentityFile [PATH TO PRIVATE KEY] IdentitiesOnly yes
Alternative: Remote tunnels
Note: Most likely, you’ll need a GitHub account to use remote tunnels.
One time setup/preparation:
Download the VS Code CLI for Linux under https://code.visualstudio.com/download.
Direct link (as of April 2023): https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64
On Noctua 2, extract the archive and place the single binary
code
into~/.local/bin
(create the folder if it doesn’t exist).Make sure that
~/.local/bin
is onPATH
. To be safe, putexport PATH=$HOME/.local/bin:$PATH
into your.bashrc
.
Creating a tunnel (server):
On the login/compute node that you want to run your computations on (e.g. allocated via SLURM), run
code tunnel --verbose
and, if you do this for the first time, follow the steps in the terminal.Afterwards, open VS Code on you local machine (client) and install the extension “Remote - Tunnels”.
Execute
Remote Tunnels: Connect to Tunnel...
and select the tunnel that you want to use.If you do this for the very first time, you need to authenticate yourself via GitHub.
Web-based alternative: code-server
...