VSCode on Compute Node
We have found that some of the VSCode extensions available are not well-behaved on our login nodes. In some instances, VSCode extensions have launched thousands of processes on the login node, severely impacting other users. We recommend that if you are using VSCode to do development work, you allocate an interactive compute node for this.
The following process requires either a GitHub or Microsoft account.
Initial Set-up
First, you will need to install the VSCode server into your home directory:
SSH into LCC/MCC and go to your home directory.
ssh linkblue@mcc.uky.edu cd ~
Download and extract the VSCode server
curl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz tar -xf vscode_cli.tar.gz
Now, you will need to request an interactive compute node via SLURM.
srun --nodes=1 --cpus-per-task=4 --time=8:00:00 --partition=normal --account=coa_PIlinkblue_uksr --pty bash -i
After the node has been allocated, your prompt will change to reflect you are working on the compute node (for example, it will change from [linkblue@mcc-login001] to [linkblue@romeXXX] for MCC).
Start the VSCode server and initiate a tunnel.You will see the following prompt. Using up/down arrows, highlight which account you would like to use and press enter.
Go to the provided web address and enter the authentication code generated by VSCode. You will be asked to log into the service that you select. You can use your linkblue@uky.edu address for the Microsoft account. Confirm that you are logging in to VSCode.
In your SSH session, you will now be prompted to provide a name for the machine. The default value is the hostname of the node you are connected to (in this example rome115 on MCC). I have entered ‘MCC’ as this tunnel will work for all MCC nodes.
Go to the provided link. At the top of the page, you will be prompted to select which account you used to start the tunnel.
Once the account is selected, a new window will pop up requesting that you log in again. Once logged in, VSCode will initialize in the browser. It may take some time, as the server must be downloaded to MCC and you will see the following notification in the lower-right corner.
When completed, your SSH session will show “Server started”.
Now, you can add this tunnel to your VSCode application. Select “Remote Explorer” from the left-hand icons, then click the icon beside Tunnels. Select the account you used to set up the tunnel in the top action bar. You may be required to log in again. The tunnel will populate in the drop-down from the action bar, select it and a new VSCode window will appear. This window is connected to the interactive compute node.
Establishing a new connection after initial set-up.
You must do this whenever you want to connect to an interactive node.
SSH into LCC/MCC.
Request an interactive node (be sure to set time accordingly, this example is for 8 hours):
Once the job as been allocated a resource, start the VSCode server from your home directory:
Select the account you would like to use. Go to the provided website and enter the authentication code. You can now connect to the tunnel from VSCode > Remote Explorer > Tunnels
Center for Computational Sciences