Infra configure crs

From GoogleCloudPlatform/k8s-bridge · View interactive version

Infra configure crs is an AI agent skill from the GitHub repository GoogleCloudPlatform/k8s-bridge. Configures, applies, and removes all workload-mixing Custom Resources (CRs) and Slurm partitions for CPU, GPU, priority, and GKE CCC workloads: Kueue CRs (ResourceFlavor, ClusterQueue, LocalQueue, WorkloadPriorityClass), GKE ComputeClass CRs, Slinky slurm Helm release (slurm-values.yaml and Lua plug

How to use this skill

Skill file

CR Configuration, Slurm Partitions, and Workload Setup (`infra-configure-crs`)

1. Preconditions & Inputs

  1. Base operators installed: cert-manager, slurm-operator, JobSet, Kueue, and k8s-bridge must 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.
  2. 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

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}').


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>).

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).

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).

(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

  1. Verify WorkloadMixing is Available=True (kubectl -n slurm wait --for=condition=Available workloadmixing --all --timeout=60s) and bridged partitions appear in sinfo (kubectl -n slurm exec deploy/slurm-login-slinky -c login -- sinfo).
  2. Ensure a non-root user (someuser) exists on the login pod (docs/quickstart.md) and run the scenario verification job, omitting -it in non-interactive shells (prepend runuser -u someuser -- if not already present, plus --chdir=/tmp for sbatch in docs/priorities-and-preemption.md):

5. Handoffs & Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.