Skip to main content

Carnaval software stack

How software reaches the carnaval cluster: golden images (templates) built once, published to every node through the NAS, then lab VMs stamped out of them for the week's scenario. The hardware page describes the machines and their template inventory; the labs process page is the day-to-day VM handling; this page is the image lifecycle and the account model.

The big picture​

The ubuntu-2404-base templates (9000–9002) are simpler and stay out of the diagram: each node builds its own directly from the Ubuntu cloud image (carnaval-guests.sh --templates), nothing to distribute. The CUDA image goes through the pipeline above because it is expensive to build (~10 min) and may carry manual tuning that a re-run of a recipe cannot reproduce.

Build and publish an image​

Fully scripted change (a new package, a version bump): put it in the recipe — carnaval-guests.sh, GUEST block — never in a template by hand, or the next rebuild silently loses it. Then:

# destroy the current CUDA templates first (the script refuses to overwrite;
# qm destroy itself refuses while linked clones exist — destroy the week's VMs first,
# and the k8s VMs too: they are clones of the same template)
ssh root@carnaval0 'qm destroy 9100 --purge 1' # idem 9101/carnaval1, 9102/carnaval2 …

./provisioning/pve/carnaval-guests.sh --cuda # build once on the first node of NODES, publish to the rest

With a manual-tuning window in the middle — the reason this pipeline exists:

./provisioning/pve/carnaval-guests.sh --cuda-prepare # scripted install, build VM left running
ssh -J root@carnaval0 ubuntu@192.168.91.200 # tune by hand, as long as you like (.200+N)
NOTE='what was tuned' ./provisioning/pve/carnaval-guests.sh --cuda-seal

NODES="carnaval9 carnaval8" picks the build node and the publish targets (2026-09-18: built on carnaval9, carnaval0–2 and 8 online). A node that is off at publish time gets the image later: destroy its old 910N, then NODES="<build node> carnavalN" carnaval-guests.sh --cuda-seal.

--cuda-seal does, in order: guest hygiene (shell histories, apt caches, machine-id, cloud-init clean last, so nothing done by hand leaks into the clones' identity), seal on carnaval0, vzdump to nas-library, qmrestore onto the other two nodes, and re-sizing per host — carnaval2 has less RAM and fewer cores, and a GPU guest sized for carnaval0 would not fit it. The three templates end up bit-identical; NOTE lands in their description so the manual part stays visible.

Re-running --cuda-seal on an already-sealed template skips straight to dump + restore — that is also how a template gets re-published, or its cold copy refreshed, without a rebuild.

The build VM is driven through the node, never directly

The build addresses .200–.210 sit outside the NetBird resource carnaval-labs (192.168.91.128/26), so the operator's machine cannot reach them — polling from it looks like a VM that never booted (cost a failed build, 2026-08-15). The script polls and installs via ssh -J root@<node>; do the same for any manual step.

Deploy VMs from the image​

One command per VM; the address is allocated (or given as the octet) inside 192.168.91.128–.191, and the DNS names are registered on the CCR before the VM is even reachable:

provisioning/pve/carnaval-lab-vm.sh carnaval0 1160 160 --gpu --dns=gpu0

Every VM answers to lab-<vmid> / lab-<vmid>.isc3; --dns=<alias> adds the name students actually type for the week's scenario (gpu0, slurm0, k8s-master…), and the alias simply moves to whichever VM carries it the following week. A week's fleet is a loop:

n=0; for node in carnaval0 carnaval1 carnaval2; do
provisioning/pve/carnaval-lab-vm.sh $node $((1160+n)) $((160+n)) --gpu --dns=gpu$n
n=$((n+1))
done

Each VMID has a fixed SSH host key (ed25519, one pair per VMID in secretzone/hostkeys/, created by the script on first use and written into the guest by cloud-init, no other key type generated — since 2026-10-08). A gpuN recreated under its usual VMID therefore presents the same key as before, so nobody's known_hosts sees HOST IDENTIFICATION HAS CHANGED at the weekly rebuild. A VM created before that date gets its key without a rebuild through provisioning/pve/carnaval-hostkey-apply.sh <vmid>.

The login banner is ours (provisioning/pve/carnaval-motd.sh: name, address, GPU, load, RAM, disk, NAS homes, Slurm — Ubuntu's stock scripts are switched off), needrestart is silenced, and the recipe's extra tools are installed (chafa since 2026-10-08; python3-venv, python3-pip, imagemagick, clangd, unzip, btop since 2026-10-27; libsdl2-dev since 2026-10-28, also in the clone's cloud-init packages). provisioning/pve/carnaval-vm-maintain.sh <vmid>... puts the banner and those tools on VMs cloned before a rebuild, and nothing else. The image is upgraded only when the template is rebuilt; between rebuilds, unattended-upgrades (on by default in the cloud image) installs the security updates every morning, and the remaining updates are a decision: carnaval-vm-maintain.sh --upgrade applies them and reboots when the kernel asks for it, with the Slurm node drained meanwhile (--no-reboot to defer). Any other fleet-wide command goes through provisioning/pve/carnaval-vm-run.sh (cheatsheet).

Tear-down goes through the same script — carnaval-lab-vm.sh <node> <vmid> --destroy — which also purges every DNS record pointing at the VM's address, alias included. The current standing fleet (gpu0–10, VMIDs 1160+N, all eleven since 2026-10-09) and the rest of the day-to-day handling live on the labs process page.

Who gets in — the account model​

Accounts are not per-VM: every lab VM carries the whole cohort, so students find their account on any machine of the week. The sources, all in this repository:

QuestionSource
Who gets an accountprovisioning/keycloak/roster.csv, lines carrying vpn-carnaval — the same file that drives Keycloak and NetBird, so access is granted in one place and the git diff is the authorization change
Who gets rootthe roster's role-rack-admins lines (passwordless sudo). Students never do: root on any box in 192.168.91.0/24 can become any student over NFS
How they log inprovisioning/keycloak/ssh-keys — one <name> <key> line per key, blank line between people. Deliberately not the Ansible tree, which is shared with calc
Their numeric UIDstat'ed live from their NAS home's ownership at VM-creation time — the one source NFS actually enforces (why)

Every guest also has an ubuntu account (passwordless sudo) whose keys are those of the roster's role-rack-admins, read by provisioning/pve/admin-keys.sh at creation — the break-glass login on a lab VM whose roster block failed, and the only account on the k8s servers. Since 2026-09-18 that list is not a constant in the scripts any more.

A roster member without a NAS home is skipped with a warning; one without a key gets their account but no way in. As of August 2026 the 25/26 cohort has no keys collected yet — ops todo → Carnaval.

The cohort is baked in at VM creation, so someone added to the roster mid-week only reaches the next stamped VM. For the fleet already running, provisioning/pve/carnaval-refresh-users.sh --commit regenerates the account block from the current roster and pushes it into every running lab VM over qm guest exec — add-only: removing someone still happens at the weekly re-stamp.

Slurm and MPI — one cluster across the GPU VMs​

Since 2026-10-19 the GPU VMs gpu0–gpu9 are the compute nodes of one Slurm cluster, carnaval, whose controller is the LXC srv-slurm (CT 113, 192.168.91.113, on carnaval0): slurmctld, slurmdbd and MariaDB, built by provisioning/pve/carnaval-slurm-ctl.sh. An MPI job can span machines (sbatch -N 3); each node still carries its own card as gres/gpu:1. gpu10 (carnaval10, Tesla T4) stays a one-node cluster of its own, as every GPU VM was before.

Nodesdynamic and configless: a VM boots with the munge key and the controller's name (/etc/slurm/join/, written by carnaval-lab-vm.sh from secretzone/slurm/), slurmd --conf-server srv-slurm -Z --conf Gres=gpu:1 registers it with its CPUs and memory, and the config comes from the controller. Nothing per VM lives on srv-slurm; a re-stamped VM is a new node with the old name. carnaval-slurm-join.sh gpuN switches a VM already running
Configone slurm.conf / gres.conf / cgroup.conf on the controller, written by carnaval-slurm-ctl.sh — edit the script, re-run it, scontrol reconfigure. A VM without join files generates a one-node cluster at first boot as before (carnaval-slurm-setup.service)
Partitiongpu, default, every registered node; MaxNodes=3 per job (EnforcePartLimits=ALL: -N 4 is refused at submit, not queued), 24 h max, 1 h default, DefMemPerCPU=1700
Default allocationa GPU job that asks for nothing else gets 8 cores and ~13 GB (DefCpuPerGPU=8); the memory cgroup is enforced, so ask with --cpus-per-task / --mem rather than let a job be killed. Nodes are shared between jobs (CR_Core_Memory); --exclusive takes a whole machine
GPUsrun --gres=gpu:1 … / #SBATCH --gres=gpu:1, one card per node asked; a job that does not ask for the card does not see it
MPImpicc prog.c && srun -N 2 --ntasks-per-node=4 ./prog — MpiDefault=pmix, ranks launched by srun; OpenMPI pinned to the 91 subnet (btl_tcp_if_include). The binary must be on the NAS home (~/nas_home, the same path on every node); /home is per VM. 1 GbE between nodes: ~100 µs latency, ~110 MB/s
Accountingslurmdbd + MariaDB on srv-slurm; sacct works from any node. One association per rostered vpn-carnaval person in the account students or staff (carnaval-slurm-accounts.sh, run by onboard.sh), fair-share over 7 days. AccountingStorageEnforce=limits: a person with no association cannot submit ("Invalid account"). The controller also carries the same name/UID pairs as login-less users, because Slurm names a job's owner through the controller's own passwd
BackupCT 113 nightly at 03:30 to PBS, namespace carnaval of the datastore rumba (carnaval-pbs.sh), the only backed-up guest of the cluster
VersionSlurm 23.11.4, OpenMPI 4.1.6, PMIx 5.0.1 on both sides (the controller is Ubuntu 24.04 for that reason); cgroup v2

Verified 2026-10-19: a ring over 3 nodes × 3 ranks, -N 4 refused, a --gres=gpu:1 job on two nodes, sacct listing them; a freshly stamped VM registers itself with no action on the controller, and --destroy deletes its node entry there.

Kubernetes — the teaching cluster​

A k3s cluster in three VMs, one per node on carnaval0–2, each with the node's GPU passed through. Deployed 2026-08-28 by provisioning/pve/carnaval-k8s.sh up; the design and its reasons are on the future page (phase 2, student access, is still open there).

Not running since 2026-09-18

The three VMs were destroyed on 2026-09-18: gpu0–gpu2 hold the cards (lab VMs), and the VMs were linked clones of the CUDA templates being rebuilt. carnaval-k8s.sh up recreates the cluster from the current template in about ten minutes, once the lab VM on each node is stopped — one GPU, one running VM. The table below describes the cluster as built.

VMsk8s0–k8s2 = VMID 110–112 = 192.168.91.110–.112, 16 vCPU / 32 GB pinned, 120 GB root on fast-vm, onboot
APIhttps://k8s.isc3:6443 — kube-vip VIP 192.168.91.115, ARP mode, floats between the three servers
SSHubuntu@k8sN through its node (ssh -J root@carnavalN), keys = the roster's role-rack-admins; carnaval-k8s.sh keys pushes the current list to the running servers
Versionsk3s v1.36.4+k3s1 (three servers, embedded etcd, all schedulable), kube-vip v1.2.3, NVIDIA device plugin v0.20.0 — pinned in the script
GPUsone nvidia.com/gpu per node; the nvidia RuntimeClass is created by k3s itself once nvidia-container-toolkit is on the VM (cloud-init)
Storagek3s local-path-provisioner: PVs live on the VM disk. No Longhorn, no NFS PVs
Ingress / LBk3s's bundled traefik and servicelb, untouched
Imagesdocker.io pulls go through the pull-through cache registry.isc3:5000 on rumba (since 2026-09-09; provisioning/k8s/registries.yaml), other registries direct
Manifestsprovisioning/k8s/ — kube-vip, device plugin, Headlamp; cohort namespaces come with phase 2
Web UIHeadlamp v0.45.0 at http://k8s.isc3 (traefik ingress on the VIP); login with a token from carnaval-k8s.sh token <name> [720h], which also creates a named cluster-admin ServiceAccount — revoke with kubectl -n headlamp delete sa <name>
Kubeconfigcarnaval-k8s.sh kubeconfig → ~/.kube/carnaval.yaml (root admin), or a per-person one built on a token
Backupsnone — destroy + up rebuilds it in ~10 min; anything worth keeping is a manifest in git

Reaching it: the NetBird resource carnaval-infra (192.168.91.96/27) is in net-carnaval-guests (since 2026-09-08; admin-only in net-carnaval-hosts from 2026-08-28 until then), so API and web UI answer for every vpn-carnaval member — the same reach as the lab VMs. Reach is not access: the API takes a token, and until phase 2 the only tokens are the cluster-admin ones carnaval-k8s.sh token issues. The deployment script itself goes through the node (ssh -J), so it works before the route does.

While the cluster runs, the three cards on carnaval0–2 are taken: GPU lab VMs go on carnaval3–10.

The library — nas-library​

An NFS storage on all three nodes (/volume2/pve-library on the FS2500, 6.7 TB volume, added 2026-08-16), content types iso,vztmpl,snippets,backup. It exists for exactly two things: shared ISOs/CT templates uploaded once instead of per node, and the CUDA template dumps — the transport of the pipeline above and the cluster's only cold copy (first dump 2026-08-16; the 2026-09-18 rebuild left two identical ~4.9 GB dumps of 9109, 14:04 from the build and 14:17 from the republish — one can go).

Not a home for guest disks, not a backup target

Guest disks stay on each node's local fast-vm — that is what makes clones instant; a template served from NFS would pull 15–20 GB through the node's 1 GbE at every clone. And carnaval's no-backups rule stands: nothing schedules vzdumps here, and lab VMs don't get manual ones either. Template dumps via --cuda-seal are the one sanctioned use of backup.

Open items: ops todo → Carnaval.