CR Configuration, Slurm Partitions, and Workload Setup (`infra-configure-crs`)
1. Preconditions & Inputs
- Base operators installed:
cert-manager,slurm-operator,JobSet,Kueue, andk8s-bridgemust be running in the cluster. If not, read skills/infra-deploy-stack/SKILL.md first. If cloud node pools or GPU labels are needed, read skills/infra-provision-cluster/SKILL.md first. - Select the target scenario guide and manifests (read the linked
docs/guide for scenario commands and manifests instead of writing YAML from memory):
| Scenario | Repository Guide | Kueue / ComputeClass Manifests | WorkloadMixing Manifest |
|---|---|---|---|
| Base CPU Quickstart | docs/quickstart.md | docs/examples/quickstart/kueue-resources.yaml | docs/examples/quickstart/workloadmixing.yaml |
| Existing Kueue / Slurm Infra | docs/existing-infra.md | Existing Kueue queues (docs/existing-infra.md) | Inline manifest in docs/existing-infra.md |
| GKE Custom Compute Classes (CCC) | docs/gke/ccc.md | docs/examples/ccc/computeclass.yaml + docs/examples/ccc/kueue-resources.yaml | docs/examples/quickstart/workloadmixing.yaml |
| Priority & Preemption (prod / batch) | docs/priorities-and-preemption.md | docs/examples/priority-preemption/kueue-resources.yaml | docs/examples/priority-preemption/workloadmixing-priority.yaml |
| Pre-Provisioned GPU Workloads | docs/gpu-workloads.md | docs/examples/gpu/kueue-resources.yaml | docs/examples/gpu/workloadmixing-gpu.yaml |
| GKE DWS Flex-Start GPU Workloads | docs/gke/gpu-dws-workloads.md | docs/examples/gpu-dws/kueue-resources.yaml | docs/examples/gpu-dws/workloadmixing-gpu.yaml |
2. Guardrails
- Confirmation gate: Show the target cluster context (
kubectl config current-context), namespace (slurm), and plannedhelmorkubectlcommands. Get user confirmation before installing, upgrading, or deleting theslurmHelm release or cluster CRs. - Enforce 3-place partition parity: Every bridged partition name must match across all three places:
1. controller.slurmctld.env -> WORKLOAD_MIXING_PARTITIONS="part1,part2" (kubectl -n slurm exec slurm-controller-0 -c slurmctld -- printenv WORKLOAD_MIXING_PARTITIONS).
2. controller.extraConf (slurm.conf) -> CliFilterParameters=workload_mixing_partitions=part1,part2 (kubectl -n slurm exec deploy/slurm-login-slinky -c login -- grep CliFilterParameters /run/slurm/conf/slurm.conf and scontrol show config | grep CliFilterParameters).
3. WorkloadMixing.spec.partitionsMapping[].partition (kubectl -n slurm get workloadmixing -o jsonpath='{..partitionsMapping[*].partition}').
- Enforce
DynamicNodeFeatureparity andignore_constraint_validation: WorkloadMixing.spec.partitionsMapping[].dynamicNodeFeaturemust matchFeature=on the partition'sNodeSetinslurm.conf(NodeSet=k8s_nodes Feature=k8s_dynamic).controller.extraConfmust includeSchedulerParameters=ignore_constraint_validation.- Mount both Lua scripts on every
helm install/upgrade slurm: Pass--set-file 'configFiles.job_submit\.lua=hack/job_submit.lua'and--set-file 'configFiles.cli_filter\.lua=hack/cli_filter.lua'. - Specify a valid
slurmdimage inWorkloadMixing.spec.podTemplate: OmittingpodTemplatedefaults the image toDefaultSlurmdImageininternal/controller/slurmjob/translator.go(ImagePullBackOff). - GPU
mappedResources(resourceName: "gpu"only):docs/examples/gpu*/workloadmixing-gpu.yamlonly defines a typed GPU entry (--gres=gpu:<type>:N); to also accept untyped--gpus=N/--gres=gpu:Njobs, add a second entry withresourceTypeomitted (docs/gpu-workloads.md).
3. Step-by-Step Procedure
Step 1: Create the `slurm` Namespace and Apply Kueue & `ComputeClass` CRs
Follow the Kueue (and ComputeClass for GKE CCC) section in your selected scenario guide from Section 1 (kubectl create namespace slurm and kubectl apply -f <SCENARIO_KUEUE_RESOURCES_YAML>).
- For GKE DWS Flex-start GPUs (docs/gke/gpu-dws-workloads.md): Do not create a Kueue
ProvisioningRequestConfig;docs/examples/gpu-dws/kueue-resources.yamltriggers GKE DWS viaResourceFlavorlabels and tolerations.
Step 2: Install or Upgrade the Slinky `slurm` Cluster with Partition & Lua Plugin Config
Follow the Slurm installation section in your selected scenario guide from Section 1 (including both --set-file Lua flags from Section 2; when combining scenarios, merge controller.extraConf and configFiles from each docs/examples/*/slurm-values.yaml).
- Drain before
helm upgrade slurmor SlinkyNodeSetchanges: Both restartslurm-controller-0(wiping in-memory state whenpersistence.enabled: false); cancel active jobs and wait forJobSetobjects to finalize first (ops-cleanup-state). - After upgrading
slurm.confor Lua scripts: Restartslurm-controller-0(kubectl -n slurm delete pod slurm-controller-0) if restart-onlyslurm.confparameters (GresTypes,SelectType,MaxNodeCount) changed. Delete the login pod (kubectl -n slurm delete pod -l app.kubernetes.io/name=login— Slinky'sLoginSetcontroller revertsrollout restart) to refresh/run/slurm/conf/and re-create anyuseraddtest users. - Immutable
clusterNameacross example files: Ifhelm upgrade slurmacrossdocs/examples/*/slurm-values.yamlfails on immutableClusterName, pass--set clusterName=<live-value>(nullifkubectl -n slurm get controller -o jsonpath='{..clusterName}'is empty).
Step 3: Apply the `WorkloadMixing` CR
Apply the WorkloadMixing manifest for your scenario from Section 1 (delete any previous WorkloadMixing CR in namespace slurm first if switching scenarios on the same cluster).
podTemplatemerge & mutation rules (internal/controller/slurmjob/translator.go): Onlyslurmdcpu/memoryrequests(CPU rounded up tothreadsPerCore, default2; memory enforcing thedefaultMemoryPerCPUMBper-CPU floor),gpurequests/limits, andslurmdManagedEnvNamesenv vars are overwritten. StaticpodTemplateorLimitRangelimitsmust cover those rounded requests, and extra/sidecar requests must be inClusterQueuecoveredResources. Custom/etc/slurmvolumeMountsor--conf-serverargsskip automatic secret/controller injection.WorkloadMixingedits apply only to newJobSets.
(Stop here and proceed to Section 4 Verification when configuring partitions or CRs. Run Step 4 only when asked to remove the CRs and Slurm release.)
Step 4: CR & Slurm Release Teardown (Run ONLY When Requested to Remove CRs)
Get user confirmation before deleting CRs or uninstalling releases. Delete all WorkloadMixing CRs first and wait until kubectl get jobsets -A -l app.kubernetes.io/managed-by=k8s-bridge returns no resources (so JobSet finalizers complete; see ops-cleanup-state if stuck) before uninstalling the slurm Helm release, Kueue/ComputeClass CRs, or base operators (infra-deploy-stack).
4. Verification
- Verify
WorkloadMixingisAvailable=True(kubectl -n slurm wait --for=condition=Available workloadmixing --all --timeout=60s) and bridged partitions appear insinfo(kubectl -n slurm exec deploy/slurm-login-slinky -c login -- sinfo). - Ensure a non-root user (
someuser) exists on the login pod (docs/quickstart.md) and run the scenario verification job, omitting-itin non-interactive shells (prependrunuser -u someuser --if not already present, plus--chdir=/tmpforsbatchin docs/priorities-and-preemption.md):
- Batch (
sbatch) caveats: Checkscontrol show job <JOB_ID>beforeMinJobAgeexpires (--chdir=/tmpwrites output to the ephemeral worker pod; briefReason=PartitionConfigduring dynamic node registration is normal). - GPU
srunvssbatchLD_LIBRARY_PATH: Forsrun, pass--export=ALL,LD_LIBRARY_PATH=/usr/local/nvidia/lib64(docs/gpu-workloads.md); forsbatch, setLD_LIBRARY_PATHinside--wrapinstead of--export=ALL,...to avoiduser_env_retrieval_failed_requeued_held.
5. Handoffs & Related Skills
- To create or update GKE clusters and CCC or DWS Flex-start node pools: Read skills/infra-provision-cluster/SKILL.md.
- To install, upgrade, or tear down the base operators (
cert-manager,slurm-operator,JobSet,Kueue,k8s-bridge): Read skills/infra-deploy-stack/SKILL.md. - If a submitted job is rejected, stays held, or fails with
Translation failed:orBadConstraints: Read skills/ops-diagnose-workload/SKILL.md.