Skip to main content
Close menu William & Mary

Using VScode and AI agents on the RC/HPC clusters

Visual Studio Code (VS Code) and AI coding agents provide powerful tools for software development, debugging, data analysis, and research computing. However, these tools can consume significant CPU and memory resources, even when running in the background.

10/20/26 - Running VS Code Server and AI coding agents directly on Research Computing's Slurm and Kubernetes front-end/login nodes is no longer permitted.

Our front-ends are used for user access, job submission, and data management.

Research Computing provides two supported alternatives:

  • Option 1: Use the development server, dev.sciclone.wm.edu, for lightweight VS Code and AI-assisted development, file management, and job submission.
  • Option 2: Launch an interactive Slurm job through VS Code for development requiring dedicated CPU, memory, or GPU resources.

Option #1  - using dev.sciclone.wm.edu

Option #2 - Using a SLURM node instead of dev.sciclone.wm.edu

 

Option 1: Using the Development Server (dev)

The Research Computing development server provides a central environment for VS Code, AI coding assistants, file management, and interaction with Research Computing's Slurm and Kubernetes clusters.

Intended Uses

  • VS Code Remote SSH connections and lightweight code development

  • AI coding assistants and agents

  • Preparing, submitting, and monitoring Slurm jobs

  • Managing authorized Kubernetes workloads using kubectl

  • Editing, organizing, and transferring files

  • Preparing scripts, software environments, and configurations for compute jobs

Resource Usage and Restrictions

The dev server is not a compute node. It is a shared development and job-management system.

High CPU or memory usage may cause processes to be terminated automatically. These limits also apply to commands executed by AI coding agents.

Computationally intensive workloads, including large compilations, intensive data processing, and GPU-intensive applications, must run on Slurm or Kubernetes compute nodes.

Local Storage

Each user has a persistent local directory:

/local/<USER>

Replace <USER> with your Research Computing username.

This directory is intended primarily for VS Code Server installations, remote development tools, and regenerable development data.

  • Files are persistent and are not automatically purged.

  • Files are not backed up.

  • Data may be lost if the server or local storage fails.

  • Important research data and source code should reside on appropriate Research Computing storage systems.

Users should configure VS Code Server to store its installation in /local/<USER> rather than in the shared home directory.

Available Software and Environment Modules

The development server provides software through the environment module system.

Use module avail to list available modules.

Module

Description

miniforge3/24.9.2-0

Miniforge Python distribution and Conda environment management

python/3.12.7

Python 3.12.7

uv/0.13.1

Fast Python package and virtual environment manager

slurm/astral

Astral Slurm cluster

slurm/bora

Bora Slurm cluster, including Hima resources

slurm/femto

Femto Slurm cluster

slurm/gulf

Gulf Slurm cluster

slurm/gust

Gust Slurm cluster

slurm/kuro

Kuro Slurm cluster

 

Python Development Environments

Python environments can be prepared on dev, but intensive applications should run on compute nodes.
The development server includes Python, Miniforge, and uv.

Load Miniforge:

module load miniforge3/24.9.2-0

Load Python:

module load python/3.12.7

Load uv:

module load uv/0.13.1

More information about using uv can be found here: https://docs.astral.sh/uv/

Also, see this page regarding creating Python environments with pip: https://docs.astral.sh/uv/pip/environments/ 

Connecting to dev.sciclone.wm.edu Using VS Code

Install the Remote - SSH extension in VS Code on your local computer.

Configure an SSH connection to the development server, then use Remote-SSH: Connect to Host... to establish a connection.

The VS Code Server installation should be stored under:

/local/<USER>

By default, VS Code installs its remote server software in the user's home directory under ~/.vscode-server.

On dev, users should instead store these files on the server's local filesystem:

/local/<USER>/.vscode-server

This reduces disk usage on shared home directories and keeps VS Code Server files on the development server's dedicated local storage.

To configure this:

  • Open VS Code on your local computer.
  • Press Ctrl+Shift+P to open the Command Palette.
  • Select Preferences: Open User Settings (JSON).
  • Add the following setting, replacing <USER> with your Research Computing username:
{
    "remote.SSH.serverInstallPath": {
    "dev": "/local/<USER>"
    }
}

Selecting a Slurm Cluster and interacting with SLURM queues

The slurm/XXX modules configure the environment so that Slurm commands communicate with the corresponding cluster.

For example, to manage jobs on Astral, use the following commands:

module load slurm/astral
sinfo
squeue -u $USER
sbatch job.sh

To switch from Astral to Bora:

module unload slurm/astral
module load slurm/bora

Slurm commands such as sbatch, squeue, sacct, scancel, and sinfo operate on the selected cluster.

Users can submit and manage jobs on any supported Slurm cluster by loading the corresponding module.

For example, enter the following commands:

module load slurm/astral
sinfo
squeue -u $USER
sbatch job.sh

Jobs execute on the selected Slurm cluster, not on dev.   See:  Running Jobs with Slurm for more information about using SLURM on the HPC/RC clusters

Kubernetes Access

Kubernetes access is enabled by default on dev. No additional environment module is required.

For example: 

kubectl get pods -n YOUR_NAMESPACE
kubectl get jobs -n YOUR_NAMESPACE
kubectl describe pod POD_NAME -n YOUR_NAMESPACE
Kubernetes access is subject to existing user permissions. Workloads execute on Kubernetes worker nodes rather than on dev.

Option 2: Running VScode Directly on a Slurm Compute Node

Users who need dedicated CPU, memory, or GPU resources can configure VS Code to automatically request a Slurm allocation and connect directly to an allocated compute node.
This allows VS Code Server, development tools, and AI coding agents to run on compute resources instead of shared login nodes.
How It Works
  1. The user selects a configured SSH connection in VS Code.

  2. SSH connects to the appropriate Slurm login node, optionally through the university bastion host.

  3. An interactive allocation is requested using salloc.

  4. Slurm assigns a compute node when resources become available.

  5. SSH connects to the allocated compute node.

  6. VS Code Server starts on that compute node.

The interactive allocation is limited by the requested resources and Slurm time limit.

Configuring Your Local SSH Client to launch interactive SLURM jobs via VScode

Edit the SSH configuration file on your local computer:
~/.ssh/config
Create the file if it does not already exist.
Add one or more of the following entries.
Important: Replace every occurrence of <USER> with your Research Computing username, without the angle brackets.

Example 1: Bora — Interactive CPU Job (On-Campus)

Host vscode-bora
User <USER>
ForwardAgent yes
StrictHostKeyChecking no
ProxyCommand ssh -l <USER> bora.sciclone.wm.edu "/usr/local/slurm/bin/salloc -t 2:00:00 --job-name=IVScode /bin/bash -c 'nc \$SLURM_NODELIST 22'"

This configuration requests a two-hour interactive Slurm allocation on Bora using the cluster's default CPU and memory resources.

 

Example 2: Astral — Interactive GPU Job (On-Campus)

Host vscode-as01-gpu
User <USER>
ProxyCommand ssh -l <USER> astral.sciclone.wm.edu "/usr/local/slurm/bin/salloc --gpus=1 -t 2:00:00 --job-name=IVScode /bin/bash -c 'nc \$SLURM_NODELIST 22'"
This configuration requests one GPU on Astral, with a two-hour time limit.

 

Example 3: Gulf — Interactive GPU Job (On-Campus)

Host vscode-gulf-gpu
User <USER>
ProxyCommand ssh -l <USER> gulf.sciclone.wm.edu "/usr/local/slurm/bin/salloc --gpus=1 -t 2:00:00 --job-name=IVScode /bin/bash -c 'nc \$SLURM_NODELIST 22'"

This configuration requests one GPU on Gulf, with a two-hour time limit.

Remote Access Through the University Bastion Host

Users connecting from outside the university network can access Research Computing clusters through the bastion.wm.edu host.  Please see:  SSH Keys for bastion.wm.edu for information about setting up access to on-campus resources through the bastion host.   The University VPN may also be used.

The SSH -J option establishes the connection through the bastion before reaching the Slurm login node.

Once connected, the remainder of the process is the same: Slurm allocates resources and VS Code connects to the assigned compute node.

Example 4: Gulf — Interactive GPU Job (Remote)

Host vscode-gulf-gpu-remote
User <USER>
ProxyCommand ssh -J <USER>@bastion.wm.edu <USER>@gulf.sciclone.wm.edu "/usr/local/slurm/bin/salloc --gpus=1 -t 2:00:00 --job-name=IVScode /bin/bash -c 'nc \$SLURM_NODELIST 22'"

This connection uses the university bastion host, connects to Gulf, requests one GPU for two hours, and then connects VS Code to the allocated compute node.

Example 5: Hima — Interactive CPU Job (Remote)

Hima is accessed through the Bora Slurm cluster. The -C hi option requests nodes with the hi feature, selecting Hima resources.

Host vscode-hima-remote
    User <USER>
    ProxyCommand ssh -J <USER>@bastion.wm.edu <USER>@bora.sciclone.wm.edu "/usr/local/slurm/bin/salloc -C hi -t 2:00:00 --job-name=IVScode /bin/bash -c 'nc \$SLURM_NODELIST 22'"

The ProxyCommand runs an SSH session on the cluster login node and requests an interactive Slurm allocation.

For example:

/usr/local/slurm/bin/salloc --gpus=1 -t 2:00:00 --job-name=IVScode /bin/bash -c 'nc \$SLURM_NODELIST 22'

The options specify:

  • --gpus=1: Request one GPU.

  • -t 2:00:00: Request two hours.

  • --job-name=IVScode: Set the Slurm job name.

  • $SLURM_NODELIST: Identifies the allocated node or nodes.

  • nc ... 22: Opens a connection to SSH port 22 on the compute node.

These examples assume a single-node allocation and that SSH access to the allocated compute node is permitted.

Connecting Through VS Code

After configuring ~/.ssh/config:

  1. Open VS Code.

  2. Install the Remote - SSH extension, if necessary.

  3. Press Ctrl+Shift+P to open the Command Palette.

  4. Select Remote-SSH: Connect to Host...

  5. Select the desired connection, such as vscode-bora, vscode-as01-gpu, vscode-gulf-gpu-remote, or vscode-hima-remote.

  6. VS Code requests an interactive Slurm allocation.

  7. When resources become available, VS Code connects to the compute node.

Users can then open files, launch terminals, run development tools, and use AI coding assistants within their allocated Slurm resources.

Important Considerations

  • Resource availability: Slurm allocations may wait in the queue before starting.

  • Time limits: Connections are subject to the allocation's Slurm time limit.

  • Resource limits: Applications must remain within the allocated CPU, memory, and GPU resources.

  • Reconnections: A new SSH connection may request a new Slurm allocation, potentially on a different compute node.

  • VS Code connections: VS Code may establish more than one SSH connection during startup, which can result in multiple allocations with this configuration.

  • File storage: Important files should be saved on appropriate shared storage, not temporary compute-node storage.

  • AI agents: AI coding tools operate under the same resource limits as other applications running in the Slurm allocation.

    Choosing the Appropriate Development Environment

    Activity

    Recommended Environment

    Editing code and scripts

    dev

    Lightweight VS Code development

    dev

    Lightweight AI coding assistance

    dev

    Submitting and monitoring Slurm jobs

    dev

    Managing Kubernetes workloads

    dev

    File management

    dev

    CPU-intensive development and testing

    Interactive Slurm compute node

    GPU-enabled AI development

    Interactive Slurm GPU allocation

    Memory-intensive development

    Interactive Slurm compute node

    Large-scale computation or analysis

    Slurm batch jobs or Kubernetes workloads

    VS Code Server and AI coding agents must not run directly on Research Computing Slurm or Kubernetes front-end/login nodes.

    Use the development server for lightweight interactive development and cluster management, or an interactive Slurm allocation for development requiring dedicated computational resources.