Skip to content

Using Visual Studio Code (VS Code) via OnDemand

Code execution

VS Code is provided for code editing only and not for code execution. Please use a job script or interactive qlogin session for executing your code on a compute node. You can submit a job script or request a qlogin session via the integrated VS Code terminal or via a separate dedicated SSH login session.

Compute processes on the frontend nodes will be killed as per our Usage Policy.

Visual Studio Code (VS Code) is a code editor redefined and optimized for building and debugging modern web and cloud applications. It provides an intuitive web interface for developing your code interactively. Using VS Code on Apocrita via OnDemand allows you to view and edit your code directly on Apocrita. Please refer to the overview section for instructions on how to login to OnDemand.

Starting a VS Code session

Select Code Server from the Servers list of the Interactive Apps drop-down menu, or from the My Interactive Sessions page.

VS Code resources

Select a version from the dropdown, as well as your working directory (the default is your home directory if this box is left blank).

Choose the resources your job will need. Select 1 or 2 cores and 2, 4, 8 or 16GB RAM.

Choosing a 1 hour maximum running time is the best option for getting a session quickly, but you may wish to choose 8 or 24 hours if you know you are going to be editing your code for a longer period.

Once clicking Launch, the request will be queued, and when resources have been allocated, you will be presented with the option to connect to the session by clicking on the blue Connect to VS Code button.

Once connected, the familiar VS Code interface is presented, and you will be able to use the allocated resources, and access your research data located on Apocrita.

VS Code session

Loading modules

You may require additional modules whilst editing your code. These can be loaded using the integrated terminal of VS Code (View > Terminal):

VS Code Modules

Extensions

One of the most popular features of VS Code is the ability to install extensions. These can be installed by selecting the "Extensions" tab on the left-hand side of the VS Code window:

VS Code Extensions

Extension support

Please note that there are over 40,000 extensions in the VS Code Marketplace at the time of writing. As a result, we can't offer support for any issues that arise due to the use of extensions.

Proprietary extensions

Please note that some popular extensions such Pylance are not available for installation on the OnDemand version of VS Code as this would be a violation of their license.

User settings directory

Your user settings will be saved in your home directory on Apocrita in the following path:

${HOME}/.local/share/code-server

Please note that if you have previously used a locally-running version of VS Code on your own machine connected to Apocrita via SSH, the settings for that can be found in:

${HOME}/.vscode-server

It is recommended to keep these two directories separate due to the fact that some extensions that are available for a locally-run version of VS Code aren't available for VS Code running on OnDemand (see above). It is also best practice, as the version of VS Code you run on your local machine might be different to that running on OnDemand.

Exiting the session

If a session exceeds the requested running time, it will be killed. It's good practice to exit the session cleanly when you have finished.

To cleanly exit VS Code, close the current browser tab/window and then release resources back to the cluster queues by clicking the red Delete button for the relevant session on the My Interactive Sessions page.