Commit 999ac325 authored by Chris Hines's avatar Chris Hines
Browse files

Update vscode.md

parent 3917daf7
Pipeline #18052 failed with stage
in 4 minutes and 21 seconds
......@@ -14,18 +14,75 @@ Steps
Please follow the excelent instructions here https://code.visualstudio.com/docs/remote/ssh#_installation ... When you get to the section "Connect to a remote host" please come back here
2. Configure VSCode
2. Setup ssh-agent and keys (optional HIGHLY recommended)
Skip down to here https://code.visualstudio.com/docs/remote/ssh#_remember-hosts-and-advanced-settings For your "SSH Connection Command" enter
2.1 Generate a key
If you are still using passwords, you should definitly switch to keys
open a terminal and run the command
```
ssh-keygen -t ed25519
```
you will be asked to enter a passphrase. This is used to encrypt the output file on your computer.
on mac and linux run
```
cat .ssh/id_ed25519.pub
```
on windows
```
type .ssh/id_ed25519.pub
```
copy the line of text printed out. Using Strudel2 (beta.cloud.cvl.org.au), select Terminal -> Run on Login node
when the new window opens type
```
echo <paste the line you just copied> >> .ssh/authorized_keys
```
2.2 Setup the agent
Windows only (the agent is already running on linux and mac)
It is possible to start the inbuild windows ssh-agent. But I'm having difficulty finding a good link to follow. If you find one please tell me. This https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement is sort of OK, but could be better.
Open a terminal and type `ssh-add .ssh/id_ed25519` you'll be asked for that key passphrase, but then your computer will remember the key (until the next reboot)
3. Configure VSCode
Skip down to here https://code.visualstudio.com/docs/remote/ssh#_remember-hosts-and-advanced-settings. If you are on linux or mac, for your "SSH Connection Command" enter
```
ssh VSCode -o ProxyCommand="ssh <username>@m3.massive.org.au /usr/local/sv2/sshnc.sh"
ssh -l <username> VSCode -o ProxyCommand="ssh <username>@m3.massive.org.au /usr/local/sv2/sshnc.sh"
```
On windows enter
```
ssh -l <username> VSCode -o ProxyCommand="ssh.exe <username>@m3.massive.org.au /usr/local/sv2/sshnc.sh"
```
The proxycommand allows us to connect, not to the login nodes but to a node allocated just to you. This is different than a regular VSCode setup because youre on an HPC cluster, not a regular server.
3. Start remote server.
4. Start remote server.
Using strudel2 https://beta.cloud.cvl.org.au login to CVL and select the VSCode application on the left. Fill in how many CPUs which GPU and how much RAM you need for how long and click launch
5. Switching back to vscode, Remote-ssh: Connect to host and select the VSCode host
If you didn't add the key to the agent, VSCode will ask you for either you key passphrase or your M3 password. It will ask twice (once to the connect to the login nodes, then again to connect to the node running the remote server)
VSCode will also ask you what type of server it is (linux)
Then you should be good to good
FAQ:
====
Q: I see a message about "Connection Reset by peer":
A: This happend to me a couple of times. It turned out the compute node had banned the login node due to too many failed passwords. Wait 10 minutes, try again. If its still wonky let us know (also switch to keys ASAP)
Using strudel2 https://beta.cloud.cvl.org.au login to CVL and select the VSCode application on the left. Fill in how many CPUs which GPU and how much RAM you need for how long and click launch
Q: I keep getting prompted for a password even though I'm using a key
4. Switching back to vscode, Remote-ssh: Connect to host and select the VSCode host
\ No newline at end of file
A: Check that your connection command includes the username everwhere you need it (it should be in there twice, once for the login node and once for the compute node)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment