Visual Studio Code
Visual Studio Code (VS Code) is a popular code editor
that can edit files and run code on Roar.
You can use VS Code on the Portal,
or install it on your laptop
and connect to Roar via ssh.
Prerequisites
Before you begin, install on your local machine:
- Visual Studio Code;
- an SSH client;
- software for X forwarding.
Installation
- Open Visual Studio Code on your local machine.
- Go to the Extensions view by clicking on the square icon in the sidebar,
or pressingCtrl+Shift+X(Windows/Linux) orCmd+Shift+X(macOS). - Search for "Remote - SSH".
- Install the extension Remote - SSH by Microsoft.
Configuration
To connect to Roar easily, adjust your SSH config file:
- In VS Code, open the Command Palette, with
F1orCtrl+Shift+P(Windows/Linux)
orCmd+Shift+P(macOS). - Type and select Remote-SSH: Open Configuration File....
- Select your user config file (usually
~/.ssh/configorC:\Users\YourUser\.ssh\config). - Add the following host entry:
Host roar
HostName submit.hpc.psu.edu
User <your-userid>
Connecting
- Open the Command Palette (
F1orCtrl+Shift+P/Cmd+Shift+P). - Type and select Remote-SSH: Connect to Host....
- Select roar (or whatever name you gave
Hostin your config file). - A new VS Code window will open. You will be prompted for your password, and for two-factor authentication as for any login.
- Once connected, "SSH: roar" will appear in the bottom-left corner of the window.
Usage tips
- File Editing: You can open folders and files on Roar in VS Code, from File > Open Folder....
- Terminal: You can run commands on Roar from the VS Code terminal.
- Extensions: You can install extensions for the remote environment.
Heavy computations
Do not run heavy computational tasks on login nodes (where VS Code logs in). For intensive work, submit batch jobs or use an interactive job.