Visual Studio Code (VS Code) is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages and runtimes (such as C++, C#, Java, Python, PHP, Go, .NET).
HCC provides Code Server as Open OnDemand App. However, this version does not provide access to extensions from the Microsoft Extension Marketplace that may be needed for your work.
The Microsoft version of VS Code available as system-wide module on Swan provides access to the Microsoft extensions. This way, you can launch VS Code within the Open OnDemand Interactive Desktop or use the Remote Tunnel feature to run the VS Code GUI locally and work on Swan.
Step 1: Launch the Open OnDemand Interactive Desktop App.
Step 2: Open the terminal within the Open OnDemand Interactive Desktop and type:
module purge
module load vs-code/1.90
code
With this, the VS Code GUI will be launched in the Interactive Desktop.
Step 1: Start an interactive job using the Swan terminal. The example below starts an interactive job with runtime of 24 hours and 16GBs of RAM, but please adjust these values accordingly.
srun --mem=16gb --nodes=1 --ntasks-per-node=4 --time=24:00:00 --pty $SHELL
Step 2: After the interactive job has started, the next step is to load the VS Code module.
module purge
module load vs-code-cli/1.90
code tunnel --accept-server-license-terms
Step 3: Once the VS Code module is loaded and you run code tunnel
, you can use the instructions here to run the GUI locally and work on Swan. In the prompt, you can login with either your Microsoft account or GitHub account. In the example below, we use GitHub account to login.
If you use GitHub account, then you need to login to https://github.com/login/device from your computer web browser and enter the provided code to grant access to the server.
After you grant access, you will be provided a link in the Swan terminal you used for the setup. You need to copy the provided link from your terminal and paste it into your computer web browser in order to start VS Code.
Please note that with this setup, you can launch the VS Code GUI on your computer, but work on Swan.