Standalone elastic RayCluster self-updates raycluster-generation annotation What…
- User
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
I’ll apply the repository’s AGENTS.md instructions; note that AGENTS.md usage is experimental and carries no guarantees of backward or future compatibility. I’ll treat your supplied implementation directive as acknowledgment and proceed to trace the Ray annotation path, patch it, and run focused tests.
- Assistant
rgis unavailable in this checkout, so I’m using targetedgrep/findsearches. The relevant behavior appears narrow enough to cover with the existing Ray integration unit tests. - Assistant
The loop originates in the shared helper’s unconditional fetch-and-return of the RayCluster generation. I’m narrowing that behavior by recognizing when the job object itself is the named RayCluster: replica-size metadata remains available, but the self-referential generation key is omitted and no self-fetch is needed. RayJob and RayService behavior stays unchanged.
- Assistant
The production change is in place and formatted. I’m now running the shared helper tests plus RayJob/RayService package tests to confirm the retained generation behavior and catch integration regressions.
- Assistant
The first test run hit the container’s process limit during parallel Go compilation, not a code failure. I’m retrying with serialized package/build parallelism so the same checks can complete within the environment constraints.
- Assistant
The serialized test run is still compiling dependencies and has not reported any failures. The slower mode is intentional to avoid the process-cap failure; I’ll let it finish, then run the required diff checks.
- Assistant
Compilation is taking longer than usual but remains active with no errors or output. I’m continuing the focused run rather than broadening scope; dependency caches should make any follow-up check much faster.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.