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

[Enhancement] GPU RayCluster doesn't work on GKE Autopilot #1470

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions ray-operator/controllers/ray/common/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,19 @@ func DefaultWorkerPodTemplate(instance rayv1alpha1.RayCluster, workerSpec rayv1a
// For more details, please refer to: https://docs.ray.io/en/latest/ray-core/configure.html#tls-authentication.
Env: deepCopyRayContainer.Env,
VolumeMounts: deepCopyRayContainer.VolumeMounts,
// If users specify ResourceQuota for the namespace, the init container need to specify resource explicitly.
Resources: deepCopyRayContainer.Resources,
// If users specify a ResourceQuota for the namespace, the init container needs to specify resources explicitly.
// GKE's Autopilot does not support GPU-using init containers, so we explicitly specify the resources for the
// init container instead of reusing the resources of the Ray container.
Resources: v1.ResourceRequirements{
Limits: v1.ResourceList{
v1.ResourceCPU: resource.MustParse("200m"),
v1.ResourceMemory: resource.MustParse("256Mi"),
},
Requests: v1.ResourceList{
v1.ResourceCPU: resource.MustParse("200m"),
v1.ResourceMemory: resource.MustParse("256Mi"),
Copy link
Contributor

Choose a reason for hiding this comment

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

A comment here with some indication of why these numbers were chosen would be useful, perhaps a brief reminder of what the init container does

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated 9039f24

},
},
}
podTemplate.Spec.InitContainers = append(podTemplate.Spec.InitContainers, initContainer)
}
Expand Down
2 changes: 0 additions & 2 deletions ray-operator/controllers/ray/common/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,9 +903,7 @@ func TestDefaultInitContainer(t *testing.T) {
}
}

// The values of `Resources` should be the same in both Ray container and health-check container.
assert.NotEmpty(t, rayContainer.Resources, "The test only makes sense if the Ray container has resource limit/request.")
assert.Equal(t, rayContainer.Resources, healthCheckContainer.Resources)
}

func TestDefaultInitContainerImagePullPolicy(t *testing.T) {
Expand Down
Loading