Visual Studio Code - CliMA/slurm-buildkite GitHub Wiki
Running on the cluster
Install VSCode CLI on the cluster
-
SSH to the login node on the cluster
-
Download and extract the "x64 CLI" binary from https://code.visualstudio.com/download# by running the following:
wget https://code.visualstudio.com/sha/download\?build\=stable\&os\=cli-alpine-x64 -O vscode-cli.tar.gz tar -xzf vscode-cli.tar.gzMove the
codeexecutable somewhere in yourPATH. -
Check that it works by running the following
code tunnel, or
./code tunnelin the
codedirectory ifcodeis not in yourPATH, 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 a script to run code tunnel
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_CUDA_MEMORY_POOL=none
export JULIA_NUM_PRECOMPILE_TASKS=8
# disables encryption of login token, so you don't need to re-enter code when switching machines
export VSCODE_CLI_DISABLE_KEYCHAIN_ENCRYPT=1
code tunnel
Submit and connect
- Submit the job via
sbatch vscode.sh. - Check the output of
cat vscode.outand authenticate the token. - You should now be able to connect as before, but this time you should be running on a compute node.
Shutting down
You can close the server by canceling the slurm job
scancel --me --name=vscode