Skip to content

Commit 3986e41

Browse files
authored
vscode --name (#22)
1 parent 499839f commit 3986e41

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/access/vscode.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,16 @@ 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+
!!! tip
68+
Give the tunnel a unique name using the `--name` flag, which will later be listed on the VSCode UI.
69+
6770
You will be requested to go to [github.com/login/device](https://github.com/login/device) and enter an 8-digit code.
6871
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.
6972

@@ -91,13 +94,13 @@ ssh daint
9194
# start a uenv session on the login node
9295
uenv start --view=default prgenv-gnu/24.11:v1
9396
# then start the tunnel
94-
code tunnel
97+
code tunnel --name=$CLUSTER_NAME-tunnel
9598
```
9699

97100
Alternatively, you can execute `code tunnel` directly in the environment:
98101
```
99102
ssh daint
100-
uenv run --view=default prgenv-gnu/24.11:v1 -- code tunnel
103+
uenv run --view=default prgenv-gnu/24.11:v1 -- code tunnel --name=$CLUSTER_NAME-tunnel
101104
```
102105

103106
Once the tunnel is configured, you can access it from VSCode.
@@ -119,7 +122,7 @@ If you plan to do computation using your VSCode, then you should first allocate
119122
You can directly execute the `code tunnel` command using srun:
120123
```
121124
ssh daint
122-
srun --uenv=prgenv-gnu/24.11:v1 --view=default -t120 -n1 --pty code tunnel
125+
srun --uenv=prgenv-gnu/24.11:v1 --view=default -t120 -n1 --pty code tunnel --name=$CLUSTER_NAME-tunnel
123126
```
124127

125128
* `--uenv` and `--view` set up the uenv
@@ -131,7 +134,7 @@ If you plan to do computation using your VSCode, then you should first allocate
131134
If you don't want to use a uenv, the command is even simpler:
132135
```
133136
ssh daint
134-
srun -t120 -n1 --pty code tunnel
137+
srun -t120 -n1 --pty code tunnel --name=$CLUSTER_NAME-tunnel
135138
```
136139

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

146149
# set up the environment before starting the tunnel
147150
uenv start prgenv-gnu/24.11:v1 --view=default
148-
code tunnel
151+
code tunnel --name=$CLUSTER_NAME-tunnel
149152
```
150153

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

0 commit comments

Comments
 (0)