Connect to an SCF login node¶
To connect to the SCF using VS Code, you’ll need to have installed the
Remote Development extension pack (which includes the Remote SSH extension) for your local VS Code. Then to
connect to the SCF, click on the green Remote “Quick Access” status bar button
labelled >< in the lower left corner:

and choose “Host”, providing one of the SCF login nodes. You can then access your SCF files from within your local VS Code instance.
Remote Development using SSH describes this workflow in more detail.
Connect to an SCF cluster node¶
On one of the SCF login servers, request a Slurm “allocation” using with
salloc, e.g.,salloc -c 4 -t 1:00:00for one hour on four cores on the high (default) partition. The flags are the same flags one uses withsrunandsbatch.Modify your
~/.ssh/configfile on your local computer to include this new stanza:Host scf-slurm # This must be the cluster node that `salloc` gave you. HostName scf-sm20.berkeley.edu # This must be the login server on which you ran `salloc`. ProxyJump gandalf.berkeley.eduProxyJump ssh configuration
Now in VS Code on your personal machine, use the remote SSH extension to connect to the host
scf-slurmby clicking on the blue icon labelled ‘><’ in the lower left corner and setting “Host” toscf-slurm.
scf-run script¶
We have prepared a shell
script that you could
run on your Mac or Linux machine that will carry out Steps 1 and 2 above for
you. You can run scf-srun, followed by your Slurm job syntax. For example:
scf-srun -c 4 -t 1:00:00Port forwarding (e.g., for web services such as dashboards)¶
VS Code can forward ports to your local machine. This is particularly helpful if software you are using has started a web service on the SCF machine you are accessing. One example is that the Python Dask.distributed package will start a dashboard on (by default) port 8787. You can view that service in the browser on your own machine as follows.
Determine the port being used by the web service (e.g., port 8787).
If not already open, open the Panel toolbar. You can do this via
Ctrl-backtickor by opening a Terminal.Click on the
PORTStab in the toolbar (it will be next to theTERMINALtab).Enter the port from #1 above as the port to forward.
You should see a URL in the
Forwarded Addresscolumn, which will be something likelocalhost:8787. Go to that URL in the browser on your machine (or click on the browser icon in that column).