Skip to content

Commit c27fb91

Browse files
authored
vscode --name
1 parent 499839f commit c27fb91

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/access/vscode.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ run the `code` executable that you downloaded the `tunnel` argument.
5757
You will be asked to choose whether to log in to Microsoft or GitHub (we have tested with GitHub):
5858

5959
```
60-
> code tunnel
60+
> code tunnel --name=$CLUSTER_NAME-tunnel
6161
...
6262
? How would you like to log in to Visual Studio Code? ›
6363
Microsoft Account
6464
❯ GitHub Account
6565
```
6666

67+
* `--name` sets a name for the tunnel, which will be later listed on the VSCode UI
68+
6769
You will be requested to go to [github.com/login/device](https://github.com/login/device) and enter an 8-digit code.
6870
Once you have finished registering the service with GitHub, in VSCode on your PC/laptop open the "remote explorer" pane on the left hand side of the main window, and the connection will be visible under REMOTES (TUNNELS/SSH) -> Tunnels.
6971

@@ -91,13 +93,13 @@ ssh daint
9193
# start a uenv session on the login node
9294
uenv start --view=default prgenv-gnu/24.11:v1
9395
# then start the tunnel
94-
code tunnel
96+
code tunnel --name=$CLUSTER_NAME-tunnel
9597
```
9698

9799
Alternatively, you can execute `code tunnel` directly in the environment:
98100
```
99101
ssh daint
100-
uenv run --view=default prgenv-gnu/24.11:v1 -- code tunnel
102+
uenv run --view=default prgenv-gnu/24.11:v1 -- code tunnel --name=$CLUSTER_NAME-tunnel
101103
```
102104

103105
Once the tunnel is configured, you can access it from VSCode.
@@ -119,7 +121,7 @@ If you plan to do computation using your VSCode, then you should first allocate
119121
You can directly execute the `code tunnel` command using srun:
120122
```
121123
ssh daint
122-
srun --uenv=prgenv-gnu/24.11:v1 --view=default -t120 -n1 --pty code tunnel
124+
srun --uenv=prgenv-gnu/24.11:v1 --view=default -t120 -n1 --pty code tunnel --name=$CLUSTER_NAME-tunnel
123125
```
124126

125127
* `--uenv` and `--view` set up the uenv
@@ -131,7 +133,7 @@ If you plan to do computation using your VSCode, then you should first allocate
131133
If you don't want to use a uenv, the command is even simpler:
132134
```
133135
ssh daint
134-
srun -t120 -n1 --pty code tunnel
136+
srun -t120 -n1 --pty code tunnel --name=$CLUSTER_NAME-tunnel
135137
```
136138

137139
!!! example "log into a node before starting"
@@ -145,7 +147,7 @@ If you plan to do computation using your VSCode, then you should first allocate
145147

146148
# set up the environment before starting the tunnel
147149
uenv start prgenv-gnu/24.11:v1 --view=default
148-
code tunnel
150+
code tunnel --name=$CLUSTER_NAME-tunnel
149151
```
150152

151153
* `-t120` requests a 2 hour (120 minute) reservation

0 commit comments

Comments
 (0)