ISSUE DESCRIPTION Standalone elastic RayCluster self-updates raycluster-generation…
- User
ISSUE DESCRIPTION
Standalone elastic RayCluster self-updates raycluster-generation annotation What happened:
A standalone Kueue-managed elastic RayCluster is continuously updated by Kueue.
The
kueue.x-k8s.io/raycluster-generationannotation tracks the RayCluster's ownmetadata.generation, but remains one value behind. For example:consolemetadata.generation: 273390 kueue.x-k8s.io/raycluster-generation: "273389"A later read showed the same pattern:
consolemetadata.generation: 273462 kueue.x-k8s.io/raycluster-generation: "273461"Kueue logs showed repeated RayCluster reconciles followed by RayCluster update webhook calls from the Kueue controller manager.
This is a self-triggered loop in the RayCluster custom annotation path. For standalone RayClusters,
GetCustomAnnotationscallsGetWorkloadslicingRayClusterCustomAnnotations(ctx, c, j.Object(), podSets, j.Name). That helper fetches the same RayCluster and returns the fetched RayCluster generation as an annotation to write back onto the RayCluster. The metadata patch then advances the RayCluster generation, making the annotation stale again.What you expected to happen:
Kueue should not continuously patch a standalone elastic RayCluster when its replica counts have not changed.
The
raycluster-generationannotation is useful for RayJob and RayService, where the top-level object needs to account for an underlying RayCluster generation. A standalone RayCluster should not write its own generation back onto itself.How to reproduce it (as minimally and precisely as possible):
- Install Kueue v0.16.5 with
ElasticJobsViaWorkloadSlices=true. - Enable the RayCluster integration.
- Create a standalone RayCluster with:
yamlmetadata: annotations: kueue.x-k8s.io/elastic-job: "true" labels: kueue.x-k8s.io/queue-name: <local-queue>- Inspect the RayCluster generation and annotation repeatedly:
sh - Install Kueue v0.16.5 with
Assistant
Use
SetAnnotationinstead.Assistant
Reproduced the bug at the function level. Now let's implement the fix in
common.go.Assistant
Build succeeds. Now re-run the reproduction test to confirm the fix, and run existing tests.
Assistant
Fix confirmed. Now remove the temp repro test and run the full existing test suite for raycluster, rayjob, rayservice, and jobframework packages.
Assistant
All tests pass. Let's view the final diff.
Assistant
Now let's run the broader test suite for the ray-related integration tests to be extra safe (if they exist and can run without a real cluster, e.g., using envtest — might be heavy, but let's at least try unit-level integration tests if present).
Assistant
Good, only the "other get error" test expects an error, consistent with our fix (already passed). Let's do a final full test run for the whole repo's affected packages plus a broader
go build/go vetto be thorough.Assistant
All tests pass across the whole
pkg/...tree (no FAIL lines, only "ok" and "no test files"). Let's view the final diff once more for clarity.Assistant
Clean, only the intended file is modified, temp repro test file removed. Now going through the checklist:
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.