Shared ML Training Platform: Fair Queues, Gang Admission and Preemption-Safe Training on Kubernetes

Build a shared training platform for three teams on one Kubernetes cluster: Kueue queues with guaranteed quotas that lend idle capacity and reclaim it by preemption, all-or-nothing admission for distributed jobs, on-demand and spot flavors, KubeRay jobs running PyTorch data-parallel training with Ray Train that resume exactly from checkpoints, tenant guardrails, a validating CLI, and Prometheus alerts and showback. It runs on your computer with kind.

AI/ML Platform Engineer. Advanced.

What you will build and explain

  • Design Kueue queues, cohorts, quotas, borrowing and lending limits and priorities that give each team a guarantee, let idle capacity be used and return it on demand, and explain every admission and preemption.
  • Prevent distributed-job deadlocks with all-or-nothing admission, and release the quota of jobs whose pods cannot start with waitForPodsReady, requeue backoff and deactivation.
  • Steer work to on-demand or interruptible capacity with ResourceFlavors, taints and tolerations, and schedule accelerators as Kubernetes extended resources.
  • Run distributed PyTorch training on a Ray cluster per job with KubeRay and Ray Train, and make it resume after preemption, worker loss and node drains with exactly the weights of an uninterrupted run.
  • Separate teams with namespace RBAC, a CEL ValidatingAdmissionPolicy, Pod Security restricted, network policies and bucket-scoped storage credentials, and test each boundary as a team member.
  • Give teams a golden-path CLI that validates and explains their jobs, alert on what needs a person with tested Prometheus rules, and report accelerator-hours per team within quota and borrowed.

Before you begin

  • Kubernetes objects and kubectl (pods, Jobs, namespaces, labels, requests and limits), container images, Python with virtual environments and pytest, and a basic model training loop
  • Running commands from a terminal, Git, YAML and JSON
  • A Linux (x86-64 or arm64) or macOS computer with Docker giving 8 CPUs and 16 GB of memory, 40 GB of free disk, kind 0.33, kubectl 1.36, Helm 4.3, Python 3.12 or later, GNU Make, curl and jq

Who this is for

For platform, MLOps and Kubernetes engineers who run training for several teams, and want to share accelerators fairly with Kueue, start distributed Ray jobs all at once, make them survive preemption without losing results, and keep teams apart with policies they can test.

Curriculum

Learning topics (19)
  1. Check your starting skills and prepare your computer

    This project assumes you already work with Kubernetes and have trained a model, and teaches what changes when several teams share scarce accelerators. Check the list below honestly: each item is used without explanation later, and each has a short way to fill the gap.

  2. One cluster, three teams, and work that survives preemption

    Quarrystone's three teams share sixteen accelerators. On a plain Kubernetes cluster, whoever submits first gets them: a weekend sweep starves the nightly retrain, two distributed jobs each grab half the workers they need and wait for each other forever, and an interrupted job starts again from step zero. The platform in this project fixes those problems with three ideas that the rest of the page builds on:

  3. Admit whole jobs before placing pods, with Kueue

    Kubernetes was built to keep services running: when a pod is created, the scheduler finds a node for it as soon as one has room. Training jobs need something different. A four-worker job is useless with three workers, a team's sweep should not take capacity another team was promised, and a job that cannot run now should wait in line rather than fail. This lesson explains why the default scheduler cannot provide that, and how Kueue adds admission in front of it.

  4. Guarantees that lend idle capacity and take it back

    Quarrystone split its nodes per team once, and Forecasting's share sat idle all day while Vision queued. Then it tried "no limits", and one sweep took the whole cluster. A shared platform needs both: a guarantee each team can count on, and a way to use what a team is not using right now. This lesson explains how Kueue expresses that with nominal quotas, cohorts and borrowing and lending limits, and works through the numbers this project uses.

  5. Decide which job yields, and what happens to it

    Borrowing only works if the lender can get its quota back, and a team only trusts its queue if urgent work can overtake routine work. Both need preemption: stopping admitted work to make room. This lesson explains how Kueue decides what to preempt, what happens to a preempted RayJob, and the rules this project chose.

  6. Start distributed jobs all at once, or not at all

    Two Vision jobs, each needing four workers, started on a cluster with six free accelerators. The default scheduler gave each three. Both waited for their fourth worker, forever, holding six accelerators that did no work. This is the classic gang scheduling problem: the pods of a distributed job are only useful together. This lesson explains how Kueue avoids it and how it handles the gap between being admitted and actually running.

  7. On-demand and spot capacity, and accelerators as extended resources

    Not all capacity is equal. Cloud providers sell interruptible ("spot") machines at a large discount and take them back at short notice; a nightly retrain with a deadline should not run there, while a research sweep that checkpoints often can. Accelerators come in models, too. This lesson explains how Kubernetes keeps work off capacity it should not use, how Kueue chooses capacity per job, and how the lab simulates accelerators so the same rules apply on a laptop.

  8. A Ray cluster per job with KubeRay

    Kueue decides when a job may run. Something still has to turn "run this training job on four workers" into processes that find each other, share work and report back. This project uses Ray for that, run on Kubernetes by the KubeRay operator. This lesson explains what a Ray cluster is, what KubeRay creates for one RayJob, and the settings that make it fit the platform.

  9. Data-parallel training with Ray Train and PyTorch

    A job with four accelerators should finish in roughly a quarter of the time of a job with one. The usual way to get there is data parallelism: every worker holds a full copy of the model, trains on a different part of each batch, and the workers average their gradients before every update. This lesson explains data-parallel training with PyTorch, how Ray Train starts and coordinates the workers, and how this project's training loop is written so that a run can stop and contin

  10. Checkpoints that make a resumed run end exactly where it would have

    The platform preempts jobs on purpose: to give a team its quota back, to let urgent work overtake a sweep, to drain a queue for maintenance. Spot capacity disappears on its own. All of that is acceptable only if a stopped job loses little work and, when it continues, ends where it would have ended anyway. This lesson explains what a checkpoint must contain for that, how Ray Train restores it after a worker loss and after a whole-job restart, and how the run record shows what

  11. RBAC, an admission policy, Pod Security, network and storage boundaries

    Quotas only mean something if nobody can go around them, and a shared cluster is only safe if one team cannot read another's data or tamper with its jobs. Quarrystone's teams had run unreviewed images, forgotten limits and read each other's buckets. This lesson builds the boundaries in four layers, each catching what the others cannot: permissions, an admission policy, Pod Security, and network and storage separation.

  12. A golden path that validates jobs and explains their state

    The previous lessons produced a RayJob with about 150 lines of YAML: labels, digests, requests, security contexts, shared memory, logical resources, a token, a deadline. No data scientist should write that, and a platform that requires it will be bypassed. A golden path is the supported, easy way to do the common thing correctly. Here it is trainctl: teams describe what to train in ten lines, and the tool adds how to run it on this platform, then explains what happens to the

  13. Alerts that ask for an action, and usage per team

    A shared platform needs to answer two kinds of questions without anyone opening a terminal on the cluster. Is it working? Is production work getting through, is anything stuck forever, is one team preempting another over and over? And who used what? How many accelerator-hours did each team use, and how much of that was borrowed? This lesson builds both from Kueue's metrics with Prometheus.

  14. Test the platform's promises, from files to live scenarios

    A platform's promises are behaviours: "Forecasting's retrain starts at once", "a preempted job resumes from its last checkpoint with identical results", "Vision cannot reach Forecasting's Ray head". YAML that looks right proves none of them, and neither does a cluster that starts. This lesson explains how the project tests its promises at four levels, from file checks that run in a second to scenarios that drive the live lab as three teams.

  15. The kind lab, releases, maintenance and alert runbooks

    The platform runs on one computer, yet it is a real Kubernetes cluster with the same components and failure modes as a larger one. This lesson explains how the lab is assembled and why, how to run the platform day to day (maintenance, node drains, releases), and the runbook for each alert.

  16. Build the lab and exercise the platform

    This is the single ordered procedure for the lab: tools, local checks, the cluster, the platform, the trainer image, a first job, the sharing and guardrail experiments, observability and the scenario suite. The Step-by-Step Guide shows these sections inline. Removing everything is in Cleanup, which you can run at any point, including after a failed step.

  17. Diagnose a shared platform from evidence

    Shared platforms rarely fail loudly. A job waits and nobody knows why; a quota change made last week starts to bite tonight; a resumed run looks fine and quietly differs. The skill this lesson practises is turning "my job doesn't run" into a specific, testable explanation, using the platform's own records before guessing.

  18. Explain the platform in an interview

    The questions in this section ask you to explain the platform's decisions the way an interviewer for an AI/ML platform role would probe them: walk through a flow, justify a choice against an alternative, and adapt when a constraint changes. They are original practice questions for this project, not a list from any employer.

  19. Remove the lab and check for leftovers

    Everything the lab creates lives on your computer: the kind cluster's node containers and their volumes, the registry container, Docker images, the .venv/ and .lab/ folders and the evidence/ files. Nothing runs in a cloud account. You can run these steps at any point, including after a failed or interrupted step; each is safe to repeat.

Practical build steps (11)
  1. Install the tools and run the local checks

    You start with your own copy of the source and finish with every tool installed at the expected version and the platform's configuration and trainctl checked, all without a cluster.

  2. Prove exact resumption in the trainer image

    You start with Docker running and finish with the trainer image built locally and its tests passed: deterministic data, complete checkpoints, exact resumption with one process and with two DDP processes, and Ray Train recovering from a worker failure with identical final weights.

  3. Create the cluster

    You start with Docker and kind installed and finish with a five-node kind cluster named quarrystone: one control plane, two on-demand workers and two tainted spot workers, each worker offering four simulated accelerators, and a registry on 127.0.0.1:5001 that every node can pull from.

  4. Install the platform

    You start with an empty cluster and finish with the platform installed: the KubeRay operator, Kueue with this project's configuration, the flavors, priorities and three team ClusterQueues, the team namespaces with their queues, permissions, limits and network policies, the RayJob admission policy, object storage with a bucket per team, and Prometheus with the platform's rules.

  5. Publish the trainer image and verify the platform

    You start with the platform installed and finish with the trainer image in the lab registry, its digest published to every team's limits, the image present on every node, and make verify reporting every component ready.

  6. Submit and follow a job as a team member

    You start with a verified platform and finish having run the Forecasting nightly retrain as a Forecasting member: rendered, submitted, admitted, trained on two workers, checkpointed, and read back from its run record.

  7. Watch sharing, reclaiming and resumption

    You start with idle queues and finish having watched Forecasting borrow Vision's idle quota, Vision reclaim it by preemption, and the preempted job resume from its last checkpoint.

  8. Check the tenant guardrails

    You start with a running platform and finish having tested each guardrail as a Vision member: what RBAC allows and refuses, the admission policy's messages for unsafe RayJobs, and the network and storage boundaries between teams.

  9. Observe the platform and report usage

    You start with a platform that has run some jobs and finish having read Kueue's metrics, the recording rules and the alerts in Prometheus, and the accelerator-hours each team used, split into within quota and borrowed.

  10. Run the scenario suite and release a new image

    You start with a verified platform and finish with every scenario test passed and its evidence in evidence/, and with a new trainer image released to the teams and rolled back.

  11. Remove the lab and check for leftovers

    You start with the lab in any state, including half-built after a failed step, and finish with the cluster, the registry and the generated credentials gone, confirmed by make leftovers. Optionally the images and local files go too.

Access

Learning Access: INR 199 plus 18% GST. Source Pack: INR 399 plus 18% GST. 90 days of online access. No auto-renewal.

Cloud costs and boundaries

No cloud account or spending is needed: the lab is a kind cluster on your own computer, publishes ports only on 127.0.0.1, and its images and packages take about 4 GB of disk. The accelerators are simulated and the models train on CPU. GitHub Actions is optional; it is free on public repositories and uses your account's included minutes on private ones. The teams, models and data are invented. This is a learning project, not a hardened cluster or a production-readiness guarantee.

Licence and completion

Vectametric Project Source Licence (2026-09-27): lawfully obtained source may be copied, modified and deployed for personal learning and interview preparation, including personal portfolio demonstrations with attribution. These permissions continue after online access expires. Do not resell or redistribute the Source Pack or its original source files, unchanged or modified. Commercial or client production use requires separate written permission. Third-party components, such as Ray, PyTorch, Kueue, KubeRay, Kubernetes, SeaweedFS and Prometheus, retain their own licences. See LICENSE.txt and the Project Source Licence section of the site Terms for the full rules.

Questions about projects

Do I need a cloud account?

You can read the project material without deploying it. Running a cloud build requires the accounts, permissions and tools listed in that project's prerequisites. Deployment runs in your environment, not in a hosted Vectametric lab.

Can I read the code with Learning Access?

Yes. Learning Access includes the online source-file browser and explanations. The Source Pack adds the downloadable reference repository where available. The project's licence governs use of the source.

Are cloud charges included?

No. Cloud and CI usage are separate. Read the project's cost notice, set a budget and stop deadline, and follow its destruction and leftover-resource checks.

Does the project include troubleshooting and interview preparation?

The project curriculum lists the available scenarios and interview topics. These focus on understanding the architecture and explaining decisions; they are not a promise of particular interview questions or a job.

How long can I use the project?

The project page and checkout show the online access period for your selected plan. Access does not auto-renew. Downloaded source remains subject to its licence; future releases are not automatically included.

Review the Terms and No-Refund Policy before confirming access. All sales are final; Vectametric does not offer refunds.

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy