Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek/deepseek-v4-pro· deepseekHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Standalone elastic RayCluster self-updates raycluster-generation…

  1. 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-generation annotation tracks the RayCluster's own metadata.generation, but remains one value behind. For example:

    metadata.generation: 273390
    kueue.x-k8s.io/raycluster-generation: "273389"
    

    A later read showed the same pattern:

    metadata.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, GetCustomAnnotations calls GetWorkloadslicingRayClusterCustomAnnotations(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-generation annotation 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):

    1. Install Kueue v0.16.5 with ElasticJobsViaWorkloadSlices=true.
    2. Enable the RayCluster integration.
    3. Create a standalone RayCluster with:
    metadata:
      annotations:
        kueue.x-k8s.io/elastic-job: "true"
      labels:
        kueue.x-k8s.io/queue-name: <local-queue>
    
    1. Inspect the RayCluster generation and annotation repeatedly:
    kubectl get raycluster.ray.io <name> -n <namespace> \
      -o jsonpath='{.metadata.generation}{"\t"}{.metadata.annotations.kueue\.x-k8s\.io/raycluster-generation}{"\n"}'
    

    Anything else we need to know?:

    This may be related to #10160, which added generation-based elastic workload names on the release-0.16 branch.

    A fix is to omit kueue.x-k8s.io/raycluster-generation when the jobObject is the same standalone RayCluster as rayClusterName.

    Environment:

    • Kubernetes version (use kubectl version):
      • Client Version: v1.33.9
      • Server Version: v1.33.10-gke.1115000
    • Kueue version (use git describe --tags --dirty --always):
      • Deployed controller image: kueue:v0.16.5
      • Helm chart: kueue-0.16.5
    • Cloud provider or hardware configuration: GKE
    • OS (e.g: cat /etc/os-release): not collected
    • Kernel (e.g. uname -a): not collected
    • Install tools: Helm
    • Others:
      • ElasticJobsViaWorkloadSlices=true
      • TopologyAwareScheduling=false

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /kueue, current file: none) bash-$

  2. DeepSeek Assistant

    Let me start by understanding the issue:

    1. A standalone elastic RayCluster is being continuously updated by Kueue because it's writing its own generation back onto itself as an annotation (kueue.x-k8s.io/raycluster-generation).
    2. This creates a self-triggered loop: the annotation update changes the RayCluster's generation, which makes the annotation stale again, causing another reconciliation.
    3. The fix should omit the raycluster-generation annotation when the job object is the same standalone RayCluster.

    Let me explore the repository structure first to understand the codebase.

  3. DeepSeek Assistant

    Let me find the relevant code for the RayCluster custom annotations:

  4. DeepSeek Assistant

    I need to make one command at a time.

  5. DeepSeek Assistant

    Let me look at the common.go file for the RayCluster integration.

  6. DeepSeek Assistant

    The open command requires parameters. Let me try just opening the file.

  7. DeepSeek Assistant

    Now let me see the callers of this function to understand the context:

  8. DeepSeek Assistant

    Let me check the standalone RayCluster controller for a GetCustomAnnotations method:

  9. DeepSeek Assistant

    Let me check the raycluster_controller.go:

  10. DeepSeek Assistant

    Let me see the rest of the raycluster_controller.go

  11. DeepSeek Assistant

    Let me check the reconciler to see how this annotation is applied

  12. DeepSeek Assistant

    I need to use the special command format properly.

  13. DeepSeek Assistant

    Let me check if the standalone RayCluster implements JobWithCustomAnnotations:

  14. DeepSeek Assistant

    Let me search more carefully for where the standalone RayCluster might implement `GetCustomAnnotations

  15. DeepSeek Assistant

    Let me check the raycluster webhook:

  16. DeepSeek Assistant

    Let me check the git log for recent changes related to this

  17. DeepSeek Assistant

    Let me list all files in the raycluster package

  18. DeepSeek Assistant

    Let me find the constant definitions for these

  19. DeepSeek Assistant

    Let me check if there's a GetCustomAnnotations method on the RayCluster type

  20. DeepSeek Assistant

    Let me look at the webhook's Default function

  21. DeepSeek Assistant

    Let me look at the beginning of common.go

  22. DeepSeek Assistant

    Let me find where GetWorkloadNameExtraPart is called

  23. DeepSeek Assistant

    Let me check if there's a GetCustomAnnotations on the RayCluster type, maybe through composition

  24. DeepSeek Assistant

    Let me search more broadly

  25. DeepSeek Assistant

    Let me check for GetWorkloadNameExtraPart on RayCluster

  26. DeepSeek Assistant

    Let me look at the reconciler around line 1437 where GetWorkloadNameExtraPart is called

  27. DeepSeek Assistant

    Let me look at workloadslicing.EnsureWorkloadSlices

  28. DeepSeek Assistant

    Let me look at the workloadslicing.go file to understand the flow better.

  29. DeepSeek Assistant

    Let me look at the test for GetWorkloadslicingRayClusterCustomAnnotations

  30. DeepSeek Assistant

    Let me see the rest of the test

  31. DeepSeek Assistant

    Let me check the WorkloadSliceEnabled function and the interface to understand the full

  32. DeepSeek Assistant

    Let me look at this

  33. DeepSeek Assistant

    Let me check recent changes to the raycluster package

  34. DeepSeek Assistant

    Let me check all methods defined on RayCluster type

  35. DeepSeek Assistant

    Now I understand the issue. Let me look at the function once more and then implement the fix.

    The core problem: GetWorkloadslicingRayClusterCustomAnnotations fetches a RayCluster and returns its generation as an annotation. When jobObject is the same RayCluster (standalone case), this creates a self-triggered loop because writing the annotation changes the RayCluster's generation.

    The fix: omit RayClusterGenerationAnnotation when the fetched RayCluster is the same object as `job

  36. DeepSeek Assistant

    Now I need to implement the fix. The approach: compare the UID of the fetched RayCluster with the jobObject's UID. If they match (same object), omit the RayClusterGenerationAnnotation to avoid the self-triggered

  37. DeepSeek Assistant

    Let me use the replace command instead

  38. DeepSeek Assistant

    Good, the fix is applied. Now let me verify by running the relevant

  39. DeepSeek Assistant

    Let me set up the Go environment first

  40. DeepSeek Assistant

    The test is failing because the fake client may not assign UIDs, making both empty. Let me check how the fake client handles UIDs

  41. DeepSeek Assistant

    Let me look at the RayCluster test utility

  42. DeepSeek Assistant

    Let me look at the RayCluster wrapper

  43. DeepSeek Assistant

    The fake client doesn't assign UIDs, so both objects have empty UIDs. Let me use a different approach - check if jobObject is itself a *rayv1.RayCluster with the same name

  44. DeepSeek Assistant

    Let me navigate to the right location first

  45. DeepSeek Assistant

    Let me use a simpler type assertion approach instead of U

  46. DeepSeek Assistant

    Now let me run the tests again

  47. DeepSeek Assistant

    All tests pass. Now let me run the full test suite for the raycluster package and also the rayjob and rayservice tests

  48. DeepSeek Assistant

    Let me run the rayjob and rayservice tests too

  49. DeepSeek Assistant

    Let me also check the rayjob tests specifically

  50. DeepSeek Assistant

    Let me verify the final state of the changed

  51. DeepSeek Assistant

    Let me also verify the build is clean

  52. DeepSeek Assistant

    Let me also check if there's any annotation writing in the webhook that could cause this loop

  53. DeepSeek Assistant

    Let me run a broader set of tests to make sure nothing is broken

  54. DeepSeek Assistant

    All tests pass. Let me verify the diff

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.