Commit 974dc392 authored by Chris Hines's avatar Chris Hines
Browse files

Update vscode.md

parent 7f8b6efd
Pipeline #18070 failed with stage
in 4 minutes and 10 seconds
......@@ -10,98 +10,89 @@ By default, if you follow those instructions, you will end up running the VS Cod
## Steps
1. Setup VS Code (install remote server extension)
### Setup VS Code (install remote server extension)
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
1. Setup ssh-agent and keys (optional HIGHLY recommended)
i. Generate a key
If you are still using passwords, you should definitly switch to keys open a terminal (mac and linux) or a powershell (windows) 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.
Next enter
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
```
cat ~/.ssh/id_ed25519.pub
```
### Setup ssh-agent and keys (optional HIGHLY recommended)
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
```
i. Setup the agent
####. Generate a key
If you are still using passwords, you should definitly switch to keys open a terminal (mac and linux) or a powershell (windows) 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.
Next enter
```
cat ~/.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
```
#### Setup the agent
Windows only (the agent is already running on linux and mac)
Windows only (the agent is already running on linux and mac)
### ALERT ALERT THIS DOCUMENTATION IS INCOMPLETE!!!!!
##### ALERT ALERT THIS DOCUMENTATION IS INCOMPLETE!!!!!
I *think* you may have to install openssh on windows, but it may be pre-installed.
```
To install the OpenSSH components:
Open Settings, select Apps > Apps & Features, then select Optional Features.
Scan the list to see if the OpenSSH is already installed. If not, at the top of the page, select Add a feature, then:
On Windows 10, find OpenSSH Client, then click Install
```
I *think* you may have to install openssh on windows, but it may be pre-installed.
```
To install the OpenSSH components:
Open Settings, select Apps > Apps & Features, then select Optional Features.
Scan the list to see if the OpenSSH is already installed. If not, at the top of the page, select Add a feature, then:
On Windows 10, find OpenSSH Client, then click Install
```
Next you need to start the OpenSSH SSH agent. You have two options
### Via GUI:
I think you command
1. Press the windows key (to begin search) and type "Services". Hit enter to open the services app
##### Option 1 Via GUI:
2. Scroll down to OpenSSH Authentication Agent and double click
1. Press the windows key (to begin search) and type "Services". Hit enter to open the services app
1. Scroll down to OpenSSH Authentication Agent and double click
1. Change "Startup type" to "Automatic"
1. Click start
3. Change "Startup type" to "Automatic"
##### Option 2 Via PowerShell:
4. Click start
Start a powershell as administrator and run the following
```
Install-Module -Force OpenSSHUtils -Scope AllUsers
Get-Service -Name ssh-agent | Set-Service -StartupType Automatic
Start-Service ssh-agent
```
### Via PowerShell:
#### Add the key to the agent
Start a powershell as administrator and run the following
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)
```
Install-Module -Force OpenSSHUtils -Scope AllUsers
Get-Service -Name ssh-agent | Set-Service -StartupType Automatic
Start-Service ssh-agent
```
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 VS Code
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
###. Configure VS Code
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 -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"
```
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.
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.
4. Allocate a computer for the remote server
###. Allocate a computer for the remote server
Using strudel2 https://beta.cloud.cvl.org.au login to CVL and select the VS Code application on the left. Fill in how many CPUs which GPU and how much RAM you need for how long and click launch
Using strudel2 https://beta.cloud.cvl.org.au login to CVL and select the VS Code application on the left. Fill in how many CPUs which GPU and how much RAM you need for how long and click launch
5. Start the remote server
###. Start the remote server
Switching back to vscode, Remote-ssh: Connect to host and select the VS Code host If you didn't add the key to the agent, VS Code 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)
Switching back to vscode, Remote-ssh: Connect to host and select the VS Code host If you didn't add the key to the agent, VS Code 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)
VS Code will also ask you what type of server it is (linux)
VS Code will also ask you what type of server it is (linux)
Then you should be good to good
Then you should be good to good
## FAQ:
......
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