-
Notifications
You must be signed in to change notification settings - Fork 1
Visual Studio Code
Simon Byrne edited this page Apr 17, 2023
·
14 revisions
-
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.gz
Move the
code
executable somewhere in yourPATH
. -
Check that it works by running the following
code tunnel
, or
./code tunnel
in the
code
directory ifcode
is 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.
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 the job via
sbatch vscode.sh
. - Check the output of
cat vscode.out
and authenticate the token. - You should now be able to connect as before, but this time you should be running on a compute node.
You can close the server by canceling the slurm job
scancel --me --name=vscode