1. connect to Hoffman2 via terminal (you can use vscode if you so choose), run at the prompt this command:
run-vscode-compute-ssh-setup
and follow the instructions for the initial setup, in a nutshell write to your local $HOME/.ssh/config file (you can do so in VSCode via: Control/Command+Shift+P and type Configure SSH hosts - assuming that you have already installed the Remte-SSH VS code extension) the following:
Host h2compute
Hostname 127.0.0.1
User <YOUR-HOFFMAN2-ACCOUNTNAME>
Port 7022
IdentityFile ~/.ssh/id_rsa_pc2h2
ForwardX11Trusted yes
ForwardX11 yes
Host hoffman2
Hostname hoffman2.idre.ucla.edu
User <YOUR-HOFFMAN2-ACCOUNTNAME>
IdentityFile ~/.ssh/id_rsa_pc2h2
ForwardX11Trusted yes
ForwardX11 yes
WHERE: "~/.ssh/id_rsa_pc2h2" is the ssh key that you will have created according to the steps given by the output of "run-vscode-compute-ssh-setup". If you don't create a key you will need to enter your password (you may still decide to protect your key with a passphrase which is the preferred, more secure, way). If you don't create an ssh key pair you may want to remove the IdentityFile line.
2. on the terminal connected to Hoffman2 request the interactive session (qrsh ...) and run the command:
run-vscode-compute
and follow the information from the output, which basically will instruct you to open a terminal on your local machine and start the following SSH port forwarding:
ssh -N -L 7022:h2-node:22 hoffman2
WHERE: h2-node will be the compute node on which your interactive session is running.
3. Open a new VS code window and connect to the h2compute host which will appear in your list of hosts
you should finally have your VSCode session open on the compute node.
h2jupynb -u <YOUR-HOFFMAN2-ACCOUNTNAME> -p 7022 #any other needed options-- on a vscode window go to "Show and Run Commands >" (generally Ctrl + shift + P or Command + shift + P)
-- select "Create New Jupyter Notebook"
-- navigate to "Select kernel"
-- select "Existing Jupyter Server..."
-- select "Enter the URL of the running Jupyter Server..." and enter the URL from the webpage on which your session has started
-- when connected select the kernel you would like to connect to on the Hoffman2 Cluster