Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Visual Studio Code is a popular free and open-source code editing application that can be deployed on Linux, macOS and Windows. It has an integrated terminal within its user interface that removes the need to switch between command-line tasks and code editing. The functionality of VS Code can easily be extended by installing extensions. These extensions allow for almost arbitrary language support, debugging or remote development.

Column
width900px


Warning
titleVisual Studio Code can cause several problems in login nodes and user's own quota

VS code is a very popular tool, but it has caused severe problems on Setonix shared resources. So, users should be aware of its potential problems, which generally affect not only the intial user, but the rest of users accessing our shared resources. And, therefore, use the tool with care and strictly following the recommendations/settings indicated in Pawsey Documentation for coping with possible nasty issues created by this tool.

Current list of know issues are:

  • VS code can create enough files to fill up your $HOME quota. To avoid this, try to stick to only installing extensions that are needed, as many extensions can take up more space than you'd like. You can occasionally remove the `~/.vscode-server` directory, which can accumulate excess files.
  • VS code can leave orphan processes running (and occupying resources indefinitely) in the login nodes. To avoid this, users should explicitly close the remote connections once they have finished their working session. Users should also regularly check for orphan processes in the login nodes.
  • VS code can overload resources in the login nodes when automatic filewatcher and search is active. To avoid this, users should restrict the extent of action of these tools together with the TypeScript and JavaScript language services.

Detailed recommendations are given in the rest of this page, so VS code users should read the whole page and follow the settings/recommendations within.


Installation and intial settings

Please refer to the Visual Studio HomePage (external site) to learn more about Visual Studio Code and for downloading and installation instructions. The default terminal shell is bash on Linux and macOS, and PowerShell on Windows.  

...

(Windows users must install Git for Windows (external site) to then configure the default terminal shell to bash.)

Although the integrated terminal on Visual Studio Code can be used directly to SSH login to Pawsey systems, the Remote Development extension pack provides the ability to open remote directories and text files on Visual Studio Code for in-app code editing and building. The Remote Development extension pack is easily installed from the Marketplace within the application. There are instructions for downloading the Remove Development extension here. See also the instructions on the official web page Remote Development using SSH (external site).

Column
width900px


Tip

After the standard installation procedure, you may also need to check the box for Remote.SSH: Lockfiles in Tmp, under Settings, in order to connect to Pawsey systems.

.

...

width900px


Warning
titleVisual Studio Code can fill your Home quota

VS code can create enough files to fill up your $HOME quota. To avoid this, try to stick to only installing extensions that are needed, as many extensions can take up more space than you'd like. You can occasionally remove the `~/.vscode-server` directory, which can accumulate excess files.

Preventing unexpected behaviour from Visual Studio Code

Best practices and recommendations

Preventing the leftover of orphan processes running in login nodes indefinitely

Always end the remote session with explicit click in the "Close Remote Connection" button

If you want to end your remote session, click the green box in the lower left corner. In the input box that opens, select the "Close Remote Connection" option. If you simply close your VS Code window, some server-side components of VS Code will continue to run remotely.

...

Column
width900px

Figure 2. Example of Visual Studio Code screen feature that allows clean disconnection from SSH session.

Kill the leftover orphan processes in the login nodes

If Visual Studio Code has left some related processes running on the login nodes, these may use CPU and prevent you from logging in to Setonix via Visual Studio Code. If you are unable to login to Setonix with Visual Studio Code, instead use a different command line interface such as Terminal to ssh into Setonix. From there you can you can identify any leftover Visual Studio Code processes using the 'ps' command. 

...

Column
width900px


Code Block
languagebash
themeDJango
titleTerminal 3. Purging the VS Code files
$ rm -rf ~/.vscode-server/


Preventing Visual Studio Code overloading the login nodes

Part One:

The Visual Studio Code filewatcher and file searcher (rg) indexes all the files you have access to in your workspace. If you have a large dataset (e.g. machine learning) this can take a lot of resources on the login nodes. Please note that making some changes to your settings.json file on Setonix can prevent this issue. 

Column
width900px


Code Block
languagebash
themeDJango
titleTerminal 4. Updating the settings.json file
# Create the settings.json file

$ touch ~/.vscode-server/data/Machine/settings.json

# add the following information to settings.json with your favourite text editor

"files.watcherExclude": {
  "**/.git/objects/**": true,
  "**/.git/subtree-cache/**": true,     
  "**/node_modules/*/**": true,
  "/usr/local/**": true,
  "/scratch/**": true},

"search.followSymlinks": false,

"search.exclude": {     
  "**/.git/objects/**": true,
  "**/.git/subtree-cache/**": true,     
  "**/node_modules/*/**": true,
  "/usr/local/**": true,
  "/scratch/**": true},


Part Two:

It's also important to disable the TypeScript and JavaScript Language Services. 

...