Lab docs

Instructions for a coding assistant on this lab cluster

Give this file to your coding assistant as context. It describes how the cluster is meant to be used. It does not authorize administrative actions, sharing data or unbounded GPU time: the user's current request decides what you may do. Confirm the user's actual grants and the live state before acting.

Rules that always apply

Python

SSH

Alias Address Use
lab-nas 45.93.201.108, port 2223, keys only Shell, Slurm, notebook tunnels, ProxyJump to node2
lab-nas-vscode same address, port 2224 VS Code only
lab-node2 100.97.86.62 via ProxyJump lab-nas Notebook tunnels; needs an active allocation

Slurm

Machines: debug = node2 (RTX 3060, 12 GB, up to 4 h, QOS student-node2); ingest = CPU on node2; batch = rig (RTX 3090, QOS student-rig), currently waiting for an OS reinstall. Check sinfo and the user's associations before assuming any of them:

sacctmgr -nP show assoc user="$USER" cluster=lab format=QOS
squeue -u "$USER"
srun --partition=debug --qos=student-node2 --time=00:10:00 --cpus-per-task=1 --mem=1G hostname
srun --partition=debug --qos=student-node2 --time=00:10:00 --cpus-per-task=2 --mem=4G --gres=gpu:1 nvidia-smi

Always set a bounded time, CPU count, memory and GPU count. Use only the allocated GPU (CUDA_VISIBLE_DEVICES). Do not guess or broaden QOS or accounts.

#!/bin/bash
#SBATCH --partition=debug
#SBATCH --qos=student-node2
#SBATCH --time=00:30:00
#SBATCH --cpus-per-task=2
#SBATCH --mem=4G
#SBATCH --gres=gpu:1
#SBATCH --output=slurm-%j.out
set -euo pipefail
umask 077
export PYTHONNOUSERSITE=1
mountpoint -q /mnt/bulk/datasets/public || { echo "NAS datasets not mounted" >&2; exit 1; }
findmnt -T /mnt/bulk/datasets/public -o TARGET,SOURCE,FSTYPE
lab-mlflow -- /opt/lab/envs/teaching-2026d/bin/python train.py

On node2, continue only if findmnt shows TARGET exactly /mnt/bulk/datasets/public, FSTYPE nfs/nfs4 and a NAS export as SOURCE. Never create a stand-in directory at an unmounted path.

Preemptible training

Long GPU work goes to the long partition with --qos=scavenger-node2 (7 days per segment; segments chain).

MLflow

import mlflow
mlflow.set_experiment("YOUR_USERNAME/project")
with mlflow.start_run(run_name="baseline-seed42"):
    mlflow.log_params({"seed": 42, "environment": "teaching-2026d"})
    mlflow.log_metric("validation_loss", 0.25, step=1)

Log parameters, seeds, code revision, the environment and chosen artifacts, not datasets or every checkpoint. If MLflow is down, keep local results and report it; nothing uploads later automatically.

Storage

Shared area (/mnt/bulk/datasets/shared): anyone can delete anyone's files, and there is no backup.

Path Notes
/mnt/bulk/datasets/public Read-only: qanats, solar, yolo_filtered_dataset. Explore with ls; do not invent paths.
/mnt/bulk/datasets/private-projects/NAME Members only; a new login or job picks up membership.
Home 5 GiB, not backed up: advise the user to keep their own copies.
node2 /local/$USER, /scratch/$SLURM_JOB_ID Local SSD, disposable. Not NAS paths. Never use the Windows NVMe.

MCP connections

Both are optional and granted per user. Keep approval prompts on for job submissions and cancellations, NAS file and project changes, Garage writes, and Overleaf edits and compiles.

  1. Lab over SSH (ssh -T lab-nas /usr/local/bin/lab-mcp). Reconnect the Lab MCP session after a server update to load the tools.
    • Slurm. Use slurm_jobs, slurm_history, slurm_submit, slurm_output and slurm_cancel for your own jobs. slurm_output returns the state, exit code, and last 64 KiB of the MCP job log.
    • Garage. Use garage_list, garage_stat, garage_read and garage_put with your own storage grants. Reads and writes are capped at 1 MiB per object.
    • NAS projects. With Slurm access and a private NAS home, use nas_project_create to make a project under ~/projects. Use the returned absolute path with the NAS file tools. nas_project_configure reads or updates the title and description. Supply the current settings SHA-256 to update them. Shared project membership is managed by the administrator.
    • NAS files. Use nas_list to browse a configured project and nas_stat for file size or a SHA-256 of up to 128 MiB. Use nas_read_text and nas_write_text for up to 1 MiB of UTF-8 text. Supply the current file SHA-256 to replace an existing file. For larger models/ZIPs, use nas_stat(path, sha256=True) and copy the returned absolute path with SCP/SFTP through the same SSH profile as Lab MCP. Download to a temporary file, compare SHA-256, preserve any old destination outside the package, then replace it. Keep the SSH profile's port/jump host (the student example uses port 2223); never send the binary as base64 chunks through MCP. This requires local SSH execution; MCP-only clients must use a separate local terminal.
  2. Overleaf at https://mcp.smtornado.com/mcp (OAuth with the central account; remembered login up to 30 days). Setup: https://docs.smtornado.com/OVERLEAF_MCP.html. Fourteen tools: list_projects, project_tree, read_file, write_file, edit_file, create_text_file, upload_file, compile_project, get_compile_log, create_folder, delete_file, delete_folder, rename_entity, move_entity.
    • Read before editing and pass the fresh SHA256. edit_file replaces one exact, unique passage.
    • Text up to 1 MiB; uploads up to 4 MiB decoded (base64). Create files only under a free name in an existing folder.
    • Delete, rename and move need a fresh expected_id from project_tree. delete_folder removes empty folders only, never the root. Empty folder_path means the project root.
    • Compilation returns IDs for get_compile_log. After a timeout, check the browser before compiling again.
    • Review TeX before compiling; Overleaf CE does not sandbox compilation. Never enable unrestricted shell escape.

Use only these published endpoints. Do not install other agents, daemons or gateways on lab hosts.

For a Mac download, substitute the absolute path and SHA-256 from nas_stat below. This creates a new staging directory and leaves existing local models untouched:

stage_dir=$(mktemp -d "$HOME/Downloads/lab-download.XXXXXX")
scp -p 'lab-nas:/ABSOLUTE/NAS/PROJECT/PATH/models.pkl' "$stage_dir/models.pkl"
printf '%s  %s\n' 'SHA256_FROM_NAS_STAT' "$stage_dir/models.pkl" | shasum -a 256 -c -

Proceed only after the checksum reports OK. If the intended package already contains models.pkl, copy that old file to a dated backup outside the package and verify the backup before replacing it with the staged copy. Repeat nas_stat after transfer if the remote artifact may still be changing; require the same size/hash. An agent with local SSH access can carry out these steps within the user's requested transfer, preserving the old file and reporting the final path/hash.

Telegram bot and notifications

Reporting

Report the job ID, partition, state, output and checkpoint paths, and the MLflow run link, without secrets. GPU-hours count reserved GPU time, idle included; per-person figures are visible only to the administrator.

Owner only: CoolerControl

Only the lab owner's central account can open these: NAS, mainlinux, node2, OrangePi, Pi. Read monitoring only when asked. Change fans, pumps, relays or profiles only on the owner's explicit instruction, and keep existing curves. If sign-in fails, report it; never reset passwords or bypass TLS or authentication.