Using Visual Studio Code
Visual Studio Code (VS Code) is an integrated development environment developed by Microsoft for Windows, Linux, macOS and web browsers. Please find below recommendations for use in the CC-IN2P3 ecosystem.
Getting started
Note
This also applies for derivatives/alternatives of VSCode/VSCodium, including Antigravity, Cursor, Positron, Zed, etc.
connect to the interactive servers using a SSH client (not VS Code, but PuTTY, OpenSSH, etc.),
get the hostname of the server you connected to:
% hostname cca042
start VS Code on that server (following the previous example, on
cca042.in2p3.frinstead ofcca.in2p3.fr),start your interactive session from a SSH connection (not from a VS Code terminal), so your
srunis more likely to persist even if your VS Code dies/disconnects,wait for VS Code to complete initializing, especially if did not follow the working directory troubleshooting recommandations here below.
Troubleshooting
Working directory
When VS Code boots, it runs the command git status -z -uall on its working directory. This command is not optimized for a directory containing a lot of files and/or large size files: please run VS Code from a directory with a small number of files.
As a general rule, please favor a subdirectory from your home directory (HOME) rather than one from your GROUP directory.
Jupyter Notebook Server
VS Code allows you to launch an integrated Jupyter Notebook server. If the integrated Jupyter is launched while connected to a cca interactive server, its use may exceed the accepted limits, and its execution will be interrupted.
To run your notebooks, we suggest to use the Plateforme Notebook service provided by CC-IN2P3.
Loss of connection
If the internet connection on your workstation may be interrupted by your screen standby (the case of Mac users with a Thunderbolt connexion, i.e.: a connection to the Ethernet network wired on the screen), your VS Code windows will be closed due to the lack of connection. Below is the description of what is happening:
VS Code creates an SSH connection to a
ccaserver and launches (on the interactive)Node.js,the user temporarily interrupts his activity,
the workstation detects the lack of activity and puts the screen on standby: the network is disconnected and
the SSH connection disappears,
but VS Code’s
Node.jspersists,the ghost VS Code is detected by the interactives monitoring (and killed).
Performance optimization
To solve some performance problems with VScode from an interactive server, you may add the following lines in your configuration file ~/.vscode-server/data/Machine/settings.json.
{ "files.watcherExclude": { "**/.git/objects/**": true, "**/.git/subtree-cache/**": true, "**/node_modules/*/**": true, "**/.cache/**": true, "**/.conda/**": true, "**/.local/**": true, "**/.nextflow/**": true }
You may obviously modify or add any directory to the list.
Over-exploitation of resources
By default upon startup, VS Code looks for the names of the symbols in the source code for its auto-completion functions. For this purpose, it uses ripgrep which uses all the cores of the machine to do a quick scan.
Attention
It is recommended, if possible, to disable this collection with ripgrep (or to configure it to be less aggressive) to avoid too much load on the interactive server.
To disable rigrep add the following line to the VS Code configuration file:
"search.useRipgrep": false
Configuration file localization:
on Linux :
$HOME/.config/Code/User/settings.jsonon macOS :
$HOME/Library/Application Support/Code/User/settings.json