Slurm Lua Plugins Workflow (`dev-slurm-lua`)
1. Preconditions & Inputs
Before modifying or testing the Slurm Lua scripts, inspect:
hack/cli_filter.lua: Client-side Lua plugin on login pods (CliFilterParameters=workload_mixing_partitions=<csv>inslurm.conf).hack/job_submit.lua: Server-side Lua plugin onslurmctld(WORKLOAD_MIXING_PARTITIONSenv var).test/e2e/slurm_flag_rejection_test.go,test/e2e/partition_priority_mapping_test.go, andtest/e2e/e2e_test.go: Paired E2E specs validating CLI flag rejection and submission holds.
2. Guardrails
- Test
job_submit.luamodification rules as a non-root user: Run tests viarunuser -u <nonroot-user> -- ...(kubectl execdefaults toroot, andslurm_job_modifyinhack/job_submit.luaexemptsroot/slurm). - Preserve cross-component markers and rejection message formats:
- Keep
AutoHoldMarkerininternal/controller/slurmjob/translator.goand"k8s-bridge-auto-hold"inhack/job_submit.luain sync. - The paired E2E specs in Section 1 assert on
REJECTION_MESSAGEinhack/cli_filter.lua. - Use long option names without leading dashes in
ALLOWED_OPTIONS(hack/cli_filter.lua):slurm.json_cli_optionsnormalizes short flags automatically.
3. Step-by-Step Procedure
Step 1: Modify `hack/cli_filter.lua` or `hack/job_submit.lua`
- CLI flag allowlist (
hack/cli_filter.lua): UpdateALLOWED_OPTIONSorpre_submit_validatewhile preserving existing hetjob,argv, andspank:handling. - Submission & modification hooks (
hack/job_submit.lua): Updateslurm_job_submitorslurm_job_modifywhile preserving existingAutoHoldMarkerhold/unhold and non-admin immutability invariants. - Sync paired E2E tests: Update the paired E2E specs in Section 1 whenever
ALLOWED_OPTIONSor Lua rejection rules change.
Step 2: Update Lua Scripts in an Active Cluster
Select the option matching your deployment. In both options, wait ~60s for kubelet ConfigMap propagation into slurm-controller-0 (or verify sha256sum /etc/slurm/cli_filter.lua in slurmctld matches hack/cli_filter.lua) before running scontrol reconfigure:
- Option A — Helm-Deployed Slinky Slurm Cluster (
slurmrelease inslurmnamespace):
helm upgrade slurm oci://ghcr.io/slinkyproject/charts/slurm \
--namespace slurm --reuse-values \
--set-file 'configFiles.job_submit\.lua=hack/job_submit.lua' \
--set-file 'configFiles.cli_filter\.lua=hack/cli_filter.lua' \
--wait
kubectl -n slurm exec slurm-controller-0 -c slurmctld -- scontrol reconfigure
- Option B — Kind E2E Cluster (
test/e2e/testdata/slurm_cluster.yaml):
kubectl -n slurm create configmap slurm-job-submit-lua --from-file=job_submit.lua=hack/job_submit.lua --dry-run=client -o yaml | kubectl apply -f -
kubectl -n slurm create configmap slurm-cli-filter-lua --from-file=cli_filter.lua=hack/cli_filter.lua --dry-run=client -o yaml | kubectl apply -f -
kubectl -n slurm exec slurm-controller-0 -c slurmctld -- scontrol reconfigure
4. Verification
- Non-root verification on a running cluster: Run scripts/test-nonroot-submission.sh (defaults to
deploy/slurm-login-slinkyandk8s-partition, or passLOGIN_DEPLOY=deploy/slurm-login PARTITION=workloadmixing-partition TEST_USER=fooon a Kind E2E cluster) to verify CLI option filtering, multi-partition rejection, and user-hold release takeover. - Automated E2E verification: Run the flag rejection and partition mapping specs via skills/test-e2e-cluster/SKILL.md.
5. Handoffs & Related Skills
- To run or update the Kind E2E flag rejection tests: Read skills/test-e2e-cluster/SKILL.md.
- To modify how
k8s-bridgetranslates held jobs or handles holds in Go: Read skills/dev-controller-and-translator/SKILL.md. - To configure bridged partition names across
slurm.confandWorkloadMixing: Read skills/infra-configure-crs/SKILL.md.