Hi @cbull,
I didn’t follow it through with NCI.
Even though is a bit “clunky”, you can still connect to an ARE session via VSCode by using the Remote - SSH VSCode extension.
The other information needed is the hostname of the computing node you are connected to through ARE.
In general, I would suggest the following workflow to make things a bit simpler and quicker:
1. Install the Remote - SSH
VSCode extension
You can do this manually, or from a local terminal you can run:
code --install-extension ms-vscode-remote.remote-ssh
This step only needs to be carried out once.
2. Add SSH configuration for compute node hosts
Add the following (by changing <your-gadi-username>
with your Gadi username) to your ~/.ssh/config
file (before the Host *
if present):
Match exec "echo %n | grep -q '^gadi-cpu-'"
ProxyJump <your-gadi-username>@gadi.nci.org.au
User <your-gadi-username>
ForwardX11 true
ForwardX11Trusted yes
This will enable to connect to a compute node (hostname always in the form gadi-cpu-...
) via SSH (by automatically using a proxyjump).
This step only needs to be carried out once.
3. Start an ARE session
Start an ARE session (VDI or Jupyterlab).
Once the session starts, your ARE Dashboard will tell you the name of your compute node Host:
Copy the compute node Host (for simplicity, you can click on it and then in the new tab copy the last portion of the URL).
4. Use the compute node Host as the hostname for VSCode remote - SSH
You can paste the compute host manually in VSCode’s Remote - SSH: Connect to Host....
command, when asked “Select configured SSH host or enter user@host”.
Alternatively, you can run the following command on a local terminal:
code --file-uri vscode-remote://ssh-remote+<compute-node-host>
For the example in the image above, the command to run would be:
code --file-uri vscode-remote://ssh-remote+gadi-cpu-bdw-0031.gadi.nci.org.au
This opens a new “blank” VSCode session connected to the compute node.
Extra
1 ex. Connect to a specific folder (automatically creating a workspace)
You can also connect to a specific folder on Gadi and automatically create a VSCode workspace using the --folder-uri
option in the command above:
code --folder-uri vscode-remote://ssh-remote+<compute-node-host><path/to/folder/on/gadi>
For example, with the comput host of the image above, to connect to the /scratch/public
folder, run:
code --folder-uri vscode-remote://ssh-remote+gadi-cpu-bdw-0031.gadi.nci.org.au/scratch/public
2 ex. Automate the connection with a script/alias
You can also write a bash function or alias (in your local ~/.bashrc
), to automate the connection.
For example, if you want to connect to ARE though VSCode using arecode <compute-node-host>
, you can add the following to your local ~/.bashrc
file:
alias arecode="code --file-uri vscode-remote://ssh-remote+${1}"
Then (in a new bash session, or after sourcing the ~/.bashrc
), to connect to the ARE session of the example image above, you could run:
arecode gadi-cpu-bdw-0031.gadi.nci.org.au
Hope this helps simplify workflows!
Davide