Launching Remote IDEs On Nova's Compute Nodes

Using remote VS Code (Visual Studio Code) to connect to a compute node in a cluster lets you write and test code directly on powerful remote hardware while using a smooth local interface.

Note - the following instructions are for VSCode but the process is similar for other IDEs.

Prepare SSH Access

Users will first want to set up SSH key based authentication to avoid password prompts.  Instructions can be found here: Key-Based authentication

Install VSCode Extension - Remote SSH

On the left side of your VSCode GUI select the extensions icon (image is of three blocks stacked neatly and one tipped) and in the search bar look for "remote - ssh".  You should receive a list of potential plugins, install the Remote - SSH extension.

Salloc a Session

Users will first need to obtain their compute node before SSHing into it from their IDE.  Use your standard SLURM arguments to spin up a resource.  Example: salloc -N1 -n 8 --time=2:00:00 --mem=8G sleep infinity

Note the sleep infinity this will run sleep indefinitely on your resource node while you use it.  Make note of which resource node you were assigned.  For this example we will be using: nova18-wide-11

Edit Your Local SSH Config

You'll need to edit your local SSH config, which can be found here:

  • macOS/Linux: /Users/USERNAME/.ssh/config
  • Windows: C:\Users\USERNAME\.ssh\config

It's also possible to edit it directly in VSCode.  Above the extensions icon is the Remote Explorer.  Select it and next to SSH there is a cogwheel you can select to edit your config in the IDE directly.  

Edit config Menu

First enter a block for the login node:

Host nova-login
    ControlMaster auto  
    ControlPath ~/.ssh/%r@%h:%p
    HostName nova-login-2.its.iastate.edu
    User $YOURNETID

Then we enter a block for our compute node

Host nova18-wide-11
    ForwardAgent yes
    StrictHostKeyChecking no
    ProxyJump nova-login
    User $YOURNETID

Note:  You must change nova18-wide-11 to the name of your active compute node found in the terminal.  The example below shows identifying nova18-wide-11 as the active compute node.

Select Your Instance from Remote Explorer

Select your remote instance and right click choosing whether you want to spawn in the current window or a new window.

If you have a green connection then you are attached the compute node.

ActiveLink