Skip to content

aguinot/vscode_slurm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vscode_slurm

Allow one to start VSCode tunnel on Slurm compute nodes.

Setup VSCode on the cluster

You can find information here.

 1. Get VSCode CLI on the cluster

 curl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz
 tar -xf vscode_cli.tar.gz

Once you have un-tar the archive you will get an executable code which you can add to your PATH.

 2. Setup the tunnel on the cluster (this is done only once).

code tunnel

Note: It is possible that you need re-authenticate later. If the connection does not start, check the log file (--log below), it will contain a link and a code to authenticate. It looks like authentication through token is under development (see here).

 3. Setup the tunnel localy. Follow the instruction here.

Install the script

pip install .

Code options

-h
 Help message.

mode
start: Open the tunnel
stop: Close the tunnel
--ssh_command
 Allow one to specify a different ssh command to access a cluster.
 Default: ssh candide.iap.fr
--slurm_dir
 Allow one to specify a different slurm directory.
 Default: /usr/local/slurm/latest/bin/
--n_cpu
 Specify the number of CPU to use.
 Default: 1
--mem
 Specify the amount of memory per CPU to use (inGo).
 Default: 8
--time
 Specify the walltime for the job. The format is the same as the one use in sbatch.
 Default: 4:00:00
--log
 Specify where to store the log file from sbatch command on the cluster.
 Default: \$HOME/vscode_tunnel.log
Note: if you want to use an environment variable such as $HOME, it has to done as \$HOME.
--node
 Specify on which node to open the tunnel. Use the node names from the cluster.
 Default: Let the cluster decide.
Note: If you don't specify the right partition you might get an error.
--partition
 Specify which sbatch partion to use.
 Default: Let the cluster decide.
--exclusive
 Specify if the job should be exclusive.

Using the tunnel

  • To open a tunnel:
    • vscode_slurm start
    • vscode_slurm start --n_cpu=10 --time=10:00:00 --node=n03
    • vscode_slurm start --exclusive
  • To close the tunnel:
    • vscode_slurm stop

Once the tunnel is open, the remote server will be available in VSCode.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages