Skip to content

Visual Studio Code

Simon Byrne edited this page Mar 28, 2023 · 14 revisions

Visual Studio Code

Running on the cluster

Install VSCode CLI on the cluster

This can be downloaded from https://code.visualstudio.com/download# (you want the x64 CLI version), or directly via:

wget https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64

extract this to your home directory, and put it somewhere in your path.

Check it works on the login node

Run the following

code tunnel

and follow the prompts. You can connect either via the browser, or via your local VSCode by installing the "Remote - tunnels" extension, and connecting via the remote explorer tab.

You can close the session on the server via Ctrl-C.

Create script

Save the following as vscode.sh:

#!/bin/bash

#SBATCH --job-name=vscode
#SBATCH --output=vscode.out
#SBATCH --time=8:00:00
#SBATCH --reservation=clima
#SBATCH --cpus-per-task=8

module load git/2.37.2 julia/1.8.5 cuda/11.2 ucx/1.13.1_cuda-11.2 openmpi/4.1.5_cuda-11.2 hdf5/1.14.0-ompi415
export JULIA_CUDA_USE_BINARYBUILDER=false
export JULIA_NUM_PRECOMPILE_TASKS=8
code tunnel

Submit and connect

  1. Submit the job via sbatch vscode.sh.
  2. Check the output of cat vscode.out and authenticate the token.
  3. You should now be able to connect as before, but this time you should be running on a compute node.
Clone this wiki locally