Connecting Desktop VS Code
If you prefer to use Visual Studio Code (VS Code) as your editor, you can connect VS Code to Unity and run your Jupyter Notebooks through VS Code. The following instructions will guide you through how to connect the VS Code Desktop App to Unity.
Configure SSH
To connect your local VS Code to Unity using the Remote-SSH feature, you must configure your ssh client to be able to hop through the login node to a compute node.
To configure your ssh client, add the following lines to your ~/.ssh/config
file.
Be sure to change:
unity_user_name
to your own Unity username~/.ssh/id_privkey.key
to the name of the key you are using (which should also be in~/.ssh
)
Host unity
Hostname unity.rc.umass.edu
User unity_user_name
ForwardAgent yes
IdentityFile ~/.ssh/id_privkey.key
Host *.unity.rc.umass.edu
User unity_user_name
IdentityFile ~/.ssh/id_privkey.key
ProxyJump unity
Start an interactive job
After configuring your ssh client, you must start an interactive job with the resources you need. Make note of the hostname since you will need it for the next step.
For example:
salloc --gpus=1 --partition=gpu-preempt -q short -t 4:00:00 --pty /bin/bash
hostname -f
Connect VS Code
Once an interactive job is set up, you can connect VS Code to Unity.
To do so, select “Remote-SSH: Connect to host” from the command pallette and type in the hostname from above (e.g., cpu001.unity.rc.umass.edu
).
Install additional VS Code extensions remotely
For some extensions to work properly, you must install them on the server even if you already have them installed locally.
To do so, choose “View” and then “Extensions” from the menu.
Next, scroll through your extensions and look for buttons that say “Install on SSH: …”.
To run Jupyter Notebooks, install the extensions Jupyter, Jupyter Renderers, and Python on SSH.