Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 36 additions & 11 deletions docs/access/vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ After downloading, copy the `code` executable to a location in your PATH, so tha
export PATH=$HOME/.local/$(uname -m)/bin:$PATH
```
The `uname -m` command will print `aarch64` or `x86_64`, according to the microarchitecture of the node it is run on.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove whitespace that was introduced on these lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Then create the path, and copy the `code` executable to the architecture-specific path:
```
mkdir -p $HOME/.local/$(uname -m)/bin
Expand Down Expand Up @@ -82,9 +82,9 @@ Once you have finished registering the service with GitHub, in VSCode on your PC
Tunnels
Sign in to tunnels registered with GitHub
```

If you have not signed in to GitHub with VS Code editor, you will be redirected to the browser to sign in.

After signing in and authorizing VSCode, the open tunnel should be visible under REMOTES (TUNNELS/SSH) -> Tunnels.

### Using with uenv
Expand Down Expand Up @@ -112,11 +112,6 @@ Once the tunnel is configured, you can access it from VSCode.
If you plan to do any intensive work: repeated compilation of large projects or running python code in Jupyter, please see the guide to running on a compute node below.
Running intensive workloads on login nodes, which are shared resources between all users, is against CSCS [fair usage][ref-policies-fair-use] of Shared Resources policy.

### Using with containers

!!! todo
write a guide

### Running on a compute node

If you plan to do computation using your VSCode, then you should first allocate resources on a compute node and set up your environment there.
Expand All @@ -132,7 +127,7 @@ If you plan to do computation using your VSCode, then you should first allocate
* `-t120` requests a 2 hour (120 minute) reservation
* `-n1` requests a single rank - only one rank/process is required for VSCode
* `--pty` allows forwarding of terminal I/O, required to sign in to Github

Once the job allocation is granted, you will be prompted to log into GitHub, the same as starting a session on the login node.
If you don't want to use a uenv, the command is even simpler:
```
Expand All @@ -148,16 +143,46 @@ If you plan to do computation using your VSCode, then you should first allocate

# start an interactive shell session
srun -t120 -n1 --pty bash

# set up the environment before starting the tunnel
uenv start prgenv-gnu/24.11:v1 --view=default
code tunnel --name=$CLUSTER_NAME-tunnel
```

* `-t120` requests a 2 hour (120 minute) reservation
* `-n1` requests a single rank - only one rank/process is required for VSCode
* `--pty` allows forwarding of terminal I/O, for bash to work interactively



### Using with containers

This will use CSCS's custom **Container Engine** which can easily pull a container from a registry like DockerHub. Same setup process as earlier with GitHub.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This will use CSCS's custom **Container Engine** which can easily pull a container from a registry like DockerHub. Same setup process as earlier with GitHub.
This uses [Container Engine][ref-container-engine].
First, use the same setup process as earlier with GitHub.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also "Same setup process as earlier with GitHub" is a bit vague.

Maybe something like "Note that this process also requires that you have a GitHub account, and that VS Code on your laptop has been connected to it (see above)."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


#### TOML File with Image and Mount Paths

```toml
image = "nvcr.io#nvidia/pytorch:24.01-py3" # example of PyTorch NGC image
writable = true
mounts = ["/paths/on/scratch/or/home:path/on/the/container",
"/path/if/same/on/both"]
workdir = "default/working/dir/path"
```

#### Launch Container & Tunnel

```bash
# launch container on compute node
srun -N 1 --environment=/absolute/path/to/tomlfile.toml --pty bash

start tunnel

cd /path/to/code/executable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is implicit that the VS Code executable is either

  • already in the container image
  • in a path that has been mounted in the image

Can you add some information about how to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

./code tunnel --name=$CLUSTER_NAME-tunnel
```



## Connecting via VSCode UI

!!! warning
Expand Down