Skip to content

Kubernetes

FLAME runs on Kubernetes, an open-source platform for running containerized workloads. You don't need to become a Kubernetes expert to use FLAME, but understanding a few core concepts will help you make sense of how things work.

Nodes

A node is a physical machine in the cluster. Kubernetes schedules workloads onto node, you never choose or access a node directly yourself.1 A single node might be running work from many different groups at once.

Containers and images

In Kubernetes, your code runs inside a container, started from a container image:

  • A container is an isolated group of processes with its own filesystem. It's similar to a virtual machine, but without the performance overhead.
  • A container image is a packaged snapshot of a filesystem (like a virtual machine image).

Why use containers? Most research code depends on a specific tangle of libraries and system packages. Run the same code on another machine (a colleague's laptop, a different cluster, your own laptop a year later) and you'll hit a wall of missing-dependency errors. A container image bundles everything a piece of code needs to run, so results are reproducible. Containers also give you flexibility. Have you ever been using a traditional HPC cluster and discovered that it was missing an necessary package with your, then had to get the admin to install it for you? With containers, you can build your own custom environment that has whatever software you need for your work, without having to wait for admin intervention.

For more, see The Turing Way's chapter on containers. FLAME provides base images with PyTorch, CUDA, and common tools, which notebooks and TrainJobs use by default. To build your own image for use on FLAME, see Building a custom container image.

Pods

A pod is the basic unit of work in Kubernetes — a wrapper around one or more containers that run together. It's what Kubernetes actually schedules onto a node.

When you launch a JupyterHub notebook, FLAME creates a pod for your session. When you submit a training job, that also runs inside one or more pods.

Jobs

A Job is a way to run a task to completion. You define what container image to use, what command to run, and what resources you need (CPUs, GPUs, memory). Kubernetes starts the pod, runs your code, and cleans up when it finishes.

Jobs are the primary way to run batch workloads -- things like training a model overnight or processing a large dataset.

TrainJobs

A TrainJob is a training-specific batch primitive from Kubeflow Trainer. It's a higher-level, ML-focused alternative to a plain Job: instead of wiring up a pod by hand, you reference a built-in training runtime (for example torch-rtxa6000, the cluster's PyTorch runtime for RTX A6000 GPUs) and describe just the parts that vary — the container image, the command, and how many GPUs per node (resourcesPerNode). On FLAME there is one runtime per GPU class, named torch-<class>, so the runtime you reference also selects which GPU type your job runs on.

TrainJobs are the recommended way to run training on FLAME, and they're what multi-GPU and multi-node distributed training build on. For a single-GPU walkthrough, see Training a simple Vision Transformer.

Storage

A container's filesystem lasts only as long as the container. When a pod is deleted, everything it wrote to its own filesystem is gone, and the next pod starts from a clean copy of its image. To keep data beyond the life of a single pod, Kubernetes uses volumes: storage mounted into a container at a path, the way you'd plug in an external drive.

Persistent storage in Kubernetes is made of a few pieces:

  • A PersistentVolumeClaim (PVC) is a request for storage of a given size, made in a namespace. It's the object you work with: a pod lists the PVCs it wants and the path to mount each one at. A PVC exists independently of any pod, so its contents survive when pods stop, and the next pod that mounts it sees the same files.
  • A PersistentVolume (PV) is the actual storage that fulfills a claim. You rarely deal with PVs directly.
  • A StorageClass says what kind of storage to create when a PVC asks for it. Kubernetes hands the request to the storage system's Container Storage Interface (CSI) driver, which creates the storage and connects it to whichever node your pod lands on.

You'll rarely need to deal with StorageClasses directly on FLAME. Each workspace has its own StorageClass, named weka-<namespace>, set up by FLAME and backed by the workspace's own filesystem on FLAME's Weka storage system. When a PVC uses it, Weka's CSI driver creates a directory in that filesystem for the volume, with a quota equal to the size the PVC requested. FLAME fills in this StorageClass automatically for any PVC created in your workspace, and doesn't allow PVCs to use another workspace's class, so your volumes always live in your workspace's storage.

A PVC's access mode says how many pods can use it at once. FLAME's PVCs are ReadWriteMany: any number of pods, on any number of nodes, can mount and write to them at the same time, which is what distributed training relies on.

Storage on FLAME

FLAME creates PVCs for every workspace and mounts them into notebooks, Jobs, and TrainJobs automatically: a home PVC for each member at /home/ubuntu, and the shared workspace storage at /workspace. See Storage for what each is for and how much space you get.

You can also create your own PVCs with standard Kubernetes tooling (kubectl, YAML manifests) and mount them in your workloads, if you'd like to organize your data differently. Leave storageClassName out: FLAME fills in your workspace's storage class, which puts the PVC on the same Weka filesystem as your home and workspace storage. See Custom volumes for an example.

Completed workload retention

FLAME keeps completed and failed batch workloads for 14 days so you can inspect their status and troubleshoot failures. After that period:

  • Kubernetes removes a standalone Job and its Pods.
  • Kubernetes removes a standalone JobSet and its Jobs and Pods.
  • FLAME removes a completed or failed TrainJob together with the JobSet, Jobs, and Pods it created.
  • FLAME removes a directly-created (ownerless) Pod that has succeeded or failed.

If you set an explicit ttlSecondsAfterFinished on a Job or JobSet, FLAME preserves your value instead of replacing it with the 14-day default. Running, queued, and pending workloads are not subject to completed-workload cleanup.

Workload cleanup does not delete your home or workspace storage. Files, checkpoints, and model artifacts saved there remain available after the Kubernetes workload objects are removed.

A failed TrainJob keeps the pod that crashed, with its logs, for this period. See Failures and retries.

Namespaces

A namespace is an isolated workspace within the cluster. Your workspace has its own namespace, which keeps your work separate from other workspaces. When you interact with FLAME, you work within your workspace's namespace.

CPU architecture (you can usually ignore this)

FLAME's GPU nodes use ARM (arm64) CPUs rather than the x86_64/amd64 found in most laptops and workstations. FLAME's own base images — and any image you build through the Forgejo CI system — are built for both architectures, so you never have to think about this. It only matters if you bring a third-party image from elsewhere: it must include an arm64 build, or its pod won't start on a GPU node.


For a deeper introduction, see the official Kubernetes documentation.


  1. If you've used a traditional HPC cluster, this will feel familiar. It's the same model as a Slurm cluster: you submit work to a scheduler that places it on whichever compute node has capacity, rather than picking a machine and logging into it yourself. Kubernetes has a scheduler that plays the role Slurm does, but additionally using containers to isolate multiple user's work. ↩