Skip to content

[rebased] feat: shared annotation#4

Open
cgetzen wants to merge 1 commit intomainfrom
cg/feat-shared-annotation-rebased
Open

[rebased] feat: shared annotation#4
cgetzen wants to merge 1 commit intomainfrom
cg/feat-shared-annotation-rebased

Conversation

@cgetzen
Copy link
Copy Markdown
Collaborator

@cgetzen cgetzen commented Apr 23, 2026

[TBD]


Note

Medium Risk
Touches admission validation and Slurm job submission parameters; incorrect handling could change scheduling/isolation semantics for workloads. Guardrails limit support to single-pod jobs and freeze changes once the external job is running.

Overview
Adds support for a new slurmjob.slinky.slurm.net/shared annotation (allowed values: none, user) to control Slurm’s job sharing policy for single-pod workloads.

The scheduler translation now parses and validates the annotation into the Slurm job IR, and Slurm job submission sets JobDescMsg.Shared accordingly, defaulting to SharedNone (exclusive) and forcing SharedNone for group workloads.

Admission webhooks now validate the annotation on create/update, reject it for group workload pods (PodGroup, LeaderWorkerSet), and prevent changes once the external Slurm job is already running. Documentation and unit tests were updated to reflect the new annotation and constraints.

Reviewed by Cursor Bugbot for commit ed3335f. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ed3335f. Configure here.

if !ok {
shared = api.V0044JobDescMsgSharedNone
}
return &[]api.V0044JobDescMsgShared{shared}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exclusive field is set but never read

Medium Severity

The new sharedForJob function only reads slurmJobIR.JobInfo.Shared, completely ignoring the Exclusive field. However, Exclusive is still populated by parseAnnotations when the AnnotationExclusive annotation is present. This makes the Exclusive field, its annotation constant, and its parsing logic dead code. Users relying on the old exclusive: false annotation will silently get exclusive (SharedNone) behavior instead of non-exclusive, with no warning or error.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ed3335f. Configure here.

if !ok {
shared = api.V0044JobDescMsgSharedNone
}
return &[]api.V0044JobDescMsgShared{shared}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing SubmitJob test broken by behavioral change

Medium Severity

The sharedForJob function now always returns a single-element slice, but the existing test "Submit external job slurmJobIR.Exclusive false yields empty Shared (non-exclusive)" in slurmcontrol_test.go (line 510) expects an empty Shared slice when Exclusive is false. The test interceptor rejects any Shared with len != 0, so the test will fail because sharedForJob returns SharedNone (len=1) for the zero-pod slurmJobIR.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ed3335f. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant