sanjeevrg89/arete/jobset-leaderworkerset
Claude Code and agent skill by sanjeevrg89/arete
- community
Checking that the SKILL.md file is still in the repository.
JobSet and LeaderWorkerSet for multi-host ML on Kubernetes — gang restarts, startup and failure policies, exclusive placement, leader+worker groups for multi-node vLLM. Use when authoring or debugging them, or pods can't find each other.
Install
npx vskill@latest install sanjeevrg89/arete/jobset-leaderworkersetSKILL.md
The same SKILL.md was published earlier as sanjeevrg89/arete/jobset-leaderworkerset.
JobSet & LeaderWorkerSet (multi-host ML on Kubernetes)
Apply the judgment of an engineer who has run multi-host training and multi-host LLM inference in production on GPU/TPU clusters for years. JobSet and LWS exist because raw Jobs/StatefulSets do not model a gang — a set of pods that must start together, share a stable network identity, and restart as a unit. Pick the right API, get the gang semantics right, and the rest is plumbing.
Scope and triggers
Production mastery of JobSet (jobset.sigs.k8s.io/v1alpha2) and LeaderWorkerSet / LWS (leaderworkerset.x-k8s.io/v1) — the SIG-driven Kubernetes workload APIs for multi-host ML. Use when authoring or debugging multi-host distributed training or multi-host LLM inference manifests: replicatedJobs / replicas / startupPolicy / successPolicy / failurePolicy / coordinator / exclusive placement for JobSet; leaderWorkerTemplate / size / replicas / subGroupPolicy / rolloutStrategy / restartPolicy for LWS. Triggers on JobSet or LeaderWorkerSet CRDs, gang restart of a Job group, multi-node vLLM/SGLang serving (leader+workers, headless Service, predictable hostnames), TPU/GPU multi-host pods, "stuck group", "startup ordering", "pods can't resolve each other", and choosing JobSet vs LWS vs raw StatefulSet/indexed Job. Pairs with Kueue, GKE node pools, vLLM/SGLang.
How to use this skill
- Read `jobset-leaderworkerset-guide.md` in this directory — the full reference (mental model,
both APIs' spec fields, gang/restart semantics, networking, Kueue/GKE integration, troubleshooting). Apply it to the task.
- For correct, annotated manifests to imitate — a multi-host training JobSet and a multi-host vLLM
LWS — read `examples.md`.
- Match the surrounding cluster's conventions (node-pool labels, scheduler, quota). Apply the gang
correctness rules (start ordering, all-or-nothing restart, stable hostnames) regardless.
- These APIs evolve fast (it is 2026). Treat exact field/enum names here as a strong prior, but
verify against kubectl explain jobset.spec / kubectl explain leaderworkerset.spec and the project docs for the version installed in the cluster.
Essentials (full detail in jobset-leaderworkerset-guide.md)
- JobSet = a group of Jobs managed as one unit.
spec.replicatedJobs[]each have aname,
replicas, and a template (a full JobTemplateSpec). Child Jobs are <jobset>-<replicatedJob>-<jobIndex>; pods get stable DNS hostnames via a headless Service when spec.network.enableDNSHostnames: true. Use it for distributed training and multi-host batch.
- LWS = groups of (1 leader + N workers) as the unit of replication.
spec.replicas= number of
groups; spec.leaderWorkerTemplate.size = pods per group (leader counts as 1). leaderTemplate + workerTemplate are separate pod templates. Built for multi-host inference where one model is sharded across hosts (vLLM/SGLang TP+PP across nodes).
- Gang restart is the whole point. JobSet
failurePolicy.restartStrategy: BlockingRecreate
tears down all child Jobs before recreating — true gang restart. LWS restartPolicy: RecreateGroupOnPodRestart recreates the entire group when any pod fails. Do not hand-roll this with bare Jobs.
- Startup ordering. JobSet
startupPolicy.startupPolicyOrder: InOrderstarts replicatedJobs
sequentially in list order (e.g. driver/launcher before workers). LWS startupPolicy: LeaderReady makes the leader become Ready before workers start; LeaderCreated starts them together.
- Success targeting. JobSet
successPolicy.operator: All|Anyover
targetReplicatedJobs — e.g. JobSet succeeds when the single driver replicatedJob completes, ignoring long-lived workers. Default (empty target) means all.
- Scale LWS by groups, not pods. It exposes a
scalesubresource onspec.replicas, so an HPA
targets number of model replicas (groups). Never autoscale size — that's the model's shard count.
- Stable identity is load-bearing for ML. Torch
MASTER_ADDR, NCCL/torchrunrendezvous, and
vLLM Ray head all need a fixed, resolvable hostname. Both APIs give you predictable hostnames + a headless Service. Validate DNS resolves before blaming the framework.
- Exclusive placement pins one replicatedJob (JobSet) or one group (LWS) per topology domain
(node pool / rack / TPU slice) via an annotation — critical for TPU slices and tight-coupling.
- Put a real Service in front of LWS that selects only leader pods (
role: leader) for inference
traffic; the headless Service is for intra-group pod-to-pod, not for clients.
- Queue both with [[kueue-advanced]]. JobSet and LWS both have native Kueue integration for gang
admission and quota. JobSet itself uses owner refs + foreground deletion (no finalizer on the JobSet object); finalizers you see usually come from Kueue.
- JobSet vs LWS vs StatefulSet/Job: training/batch that runs to completion → JobSet; long-running
multi-host serving → LWS; single-host serving → Deployment; single-host stateful → StatefulSet; single multi-pod batch → indexed Job. Don't force a StatefulSet to be a training gang.
Related skills
[[kueue-advanced]]— gang admission, quotas, MultiKueue, topology-aware scheduling for both APIs.[[serving-frameworks]]— vLLM/SGLang/Dynamo multi-node, what runs in the LWS leader vs workers.[[training-frameworks]]— FSDP/DeepSpeed/Megatron/torchrun/MaxText that run inside JobSet.[[aiml-on-kubernetes]]— umbrella: where these fit in the training/inference stack.[[gke-master]]— GPU/TPU node pools, multi-host TPU slices,localQueue/placement on GKE.[[autoscaling-kubernetes]]— HPA on the LWSscalesubresource; cluster autoscaler/NAP for gangs.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/jobset-leaderworkerset/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sanjeevrg89/arete/jobset-leaderworkerset)