VSCode
Overview
A guide on setting up VSCode for remote tunneling into the supercomputers using a local client or web browser.
It is not advised to connect to the supercomputers using VSCode’s Remote SSH. Doing so will cause several persistent processes to run on the login nodes, resulting in usage violation emails.
Please use one of the following methods below instead
VSCode Setup
VSCode is for both managing remote files stored on supercomputer storage, as well as providing a rich IDE for development. This can be accomplished through the use of the Visual Studio Code CLI Server. Follow these steps to prepare a job allocation for the VSCode background server.
There are three ways to set up VSCode:
Create a VSCode Tunnel Via the Web Portal
Navigate to the web portal (https://sol.asu.edu or https://phx.rc.asu.edu )
Under Interactive Apps, Select “VSCode Server”
Fill out the job options, and click “Launch”
Once the GitHub Code is shown, click “Copy Code and Login To GitHub”
Sign in with Github, using the code that was automatically copied to your clipboard
See the Logging in With GitHub section below for information
Go back to the web portal, after 20-30 seconds, a button will appear to launch VSCode in your browser or desktop. If the button does not appear, try refreshing the page.
In order to connect with VSCode desktop, the Remote - Tunnels extension must be installed. If prompted, always select “GitHub Authentication”
Create a VSCode Tunnel Via the Command-line
Log into the supercomputer and start the VSCode tunnel with the shortcut
vscode
. A separate job session will be created in the background to run the service daemon.
[wdizon@login02:~]$ vscode
*
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
To grant access to the server, please log into https://github.com/login/device and use code 1EAB-9CE6
The
vscode
command takes all the same arguments asinteractive
. Additional arguments you wish to pass to your job allocation can be done in the same command, e.g.,vscode -t 1-0
(for 1 day long), etc. See Slurm - SBATCH Header / Flag Cheat Sheet for more options.
If a GPU is required, use the command: vscode -p general --gres=gpu:1
where gpu:1
can be any valid GPU designation, e.g., gpu:a100:1
or gpu:a30:3
. Using gpu:1
gets the first-available GPU.
Review the previous output and identify both the
github
login URL and accompanying code:..., please log into https://github.com/login/device and use code 1EAB-9CE6
See the Logging in With GitHub section below for information
The terminal session will now provide additional guidance for connecting your IDE:
To grant access to the server, ...
Open this link in your browser https://vscode.dev/tunnel/sol/packages/apps/vscode
Run the Open-Source Code Server From the Web Portal
Navigate to the web portal (https://sol.asu.edu or https://phx.rc.asu.edu )
Under Interactive Apps, Select “VSCode Server”
Fill out the job options, and click “Launch”
Once the job starts, click “Connect to VSCode Server”
Start coding in the provided web-based code server
Logging In With GitHub
Open up the URL in your workstation browser:
First, log into your GitHub account (required). The browser will then prompt you for the above code.
Authorize GitHub with the Green button:
The connection should now be complete:
If using a terminal session, you will now see additional guidance for connecting your IDE:
If using the Web Portal, within a minute you see the Open in VSCode Web/Desktop buttons