VS Code

From UMIACS
Revision as of 18:26, 15 May 2024 by Mbaney (talk | contribs)
Jump to navigation Jump to search

Visual Studio (VS) Code is a multi-platform source-code editor developed by Microsoft. It can be used with a variety of programming languages and can have its base functionality extended through use of extensions available via its marketplace. The base editor itself is free, but some extensions may require paid subscriptions.

Cluster Usage

It can be convenient when using our SLURM computing clusters to open a connection to a VS Code Server session on the submission node(s) that you have access to via VS Code's Remote - SSH extension. Steps to set this up can be found here.

Best Practices

Because of the multi-tenant nature of our submission nodes, using the Remote - SSH extension to connect to a VS Code Server running on a submission node can have adverse affects on other users simultaneously using the submission nodes if not properly managed. The following is a list of "best practices" that we ask you please follow to minimize the chance of impacting others on submission nodes. We have compiled the list through observation as well as through discussion with users.

Do not open large files

Files that you open on a remote machine through the Remote - SSH extension are loaded entirely into RAM on the remote machine. Because of the persistence of VS Code Server processes, opening several unique files may result in them all remaining in RAM for extended periods of time even if you no longer have a tab open for them in the Tab Bar.

As such, please refrain from opening large files (more than a few MB) in VS Code itself on submission nodes. Either use a lighter-weight command-line based text editor such as vim or otherwise on the submission node itself, or first transfer the files that you would like to open to either a less-used remote machine or your local machine before opening them.

If you absolutely need to open one or more large files for a very brief period of time on a submission node, please clean up your server sessions (see below section) as soon as possible when done.

Cleaning up when done

If you are done using VS Code for an extended period of time (several hours / overnight), consider manually killing your server session on the submission node when exiting. By default, VS Code Server will keep the processes used by your session active for a few hours after you disconnect, keeping the RAM you were using allocated despite no longer actively being used.

This can be done by opening the Command Palette (Ctrl+Shift+P) and searching "Kill VS Code Server on Host...".

VSCode-killremote1.png

Select the submission node you were using and click on it.

VSCode-killremote2.png

Wait a few seconds and you should get a message confirming the command went through.

VSCode-killremote3.png