Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix operator: show resource limit values in RayCluster.Status #3118

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidxia
Copy link
Contributor

@davidxia davidxia commented Feb 26, 2025

instead of resource request values to be consistent with these docs.

On the other hand CPU, GPU, and memory requests will be ignored by Ray. For
this reason, it is best when possible to set resource requests equal to
resource limits
.

Also make "nvidia.com/gpu" and "google.com/tpu" into shared constants.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

Comment on lines -454 to +459
containerResource := container.Resources.Requests
containerResource := container.Resources.Limits
if containerResource == nil {
containerResource = corev1.ResourceList{}
}
for name, quantity := range container.Resources.Limits {
for name, quantity := range container.Resources.Requests {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the important change

@@ -841,3 +842,58 @@ func TestIsGCSFaultToleranceEnabled(t *testing.T) {
})
}
}

func TestCalculatePodResource(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add a test

instead of resource request values to be consistent with [these docs].

> On the other hand CPU, GPU, and memory **requests** will be ignored by Ray. For
> this reason, it is best when possible to **set resource requests equal to
> resource limits**.

Also make `"nvidia.com/gpu"` and `"google.com/tpu"` into shared constants.

[these docs]: https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/config.html#resources:~:text=On%20the%20other%20hand%20CPU%2C%20GPU%2C%20and%20memory%20requests%20will%20be%20ignored%20by%20Ray.%20For%20this%20reason%2C%20it%20is%20best%20when%20possible%20to%20set%20resource%20requests%20equal%20to%20resource%20limits.

Signed-off-by: David Xia <[email protected]>
Copy link
Contributor Author

@davidxia davidxia Feb 27, 2025

Choose a reason for hiding this comment

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

Looks like Volcano depends on the requests not limits? Seems like this goes against KubeRay best practices?

On the other hand CPU, GPU, and memory requests will be ignored by Ray. For this reason, it is best when possible to set resource requests equal to resource limits.

Is this a breaking change that cannot be made?

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