...
Code Block | ||||
---|---|---|---|---|
| ||||
#!/bin/bash
#SBATCH --partition plgrid
#SBATCH --nodes 1
#SBATCH --ntasks-per-node 6
#SBATCH --time 0:30:00
#SBATCH --job-name code-server
#SBATCH --output code-server-log-%J.txt
module load vscode/1.86.1
mkdir -p $SCRATCH/vscodedata
ln -s $TMPDIR /tmp/${SLURM_JOB_ID}
export TMPDIR=/tmp/${SLURM_JOB_ID}
## start an rserver instance
start-vscode-web --server-data-dir $SCRATCH/vscodedata |
...
To preserve the VSCode server data and VSCode environment, use the option --server-data-dir
pointing at some directory of your choice. The location should be the same each time to save configuration. In this example, we have used $SCRATCH/vscodedata
path as the storage location.
if If you wish to end your sbatch, use scancel <JOBID>
command, where JOBID is your tunnel JOBID you can look it up with hpc-jobs
or squeue -u $USER
commands.
...
Code Block | ||||
---|---|---|---|---|
| ||||
#!/bin/bash #SBATCH --partition plgrid-gpu-a100 #SBATCH --nodes 1 #SBATCH --ntasks-per-node 6 #SBATCH --time 0:30:00 #SBATCH --job-name code-server #SBATCH --output code-server-log-%J.txt module load VSCode/1.85.0 mkdir -p $SCRATCH/vscodedata ln -s $TMPDIR /tmp/${SLURM_JOB_ID} export TMPDIR=/tmp/${SLURM_JOB_ID} ## start an rserver instance start-vscode-web --server-data-dir $SCRATCH/vscodedata |
Another way to use the VSCode remotely on the cluster is via a tunnel with a standard desktop GUI. Using this approach is similar with the one for setting up web browser access.
To begin with, we need to install the extension