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

[Refactor] Remove cleanupInvalidVolumeMounts #2104

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Apr 25, 2024

Why are these changes needed?

cleanupInvalidVolumeMounts verifies and modifies the Pod spec directly which may introduce some unknown unknowns for users. KubeRay should only verify the RayCluster, RayJob, and RayCluster specs. For other resource specs, such as Kubernetes Pods, Jobs, and Services, we should not verify them; instead, we should only propagate the errors.

Related issue number

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(
  • Step 1: Create a RayCluster with https://gist.github.com/kevin85421/22c0f1792fe475bb80c3ec7a3180915a. The Ray container in the head Pod mounts a non-existent volume.
    volumeMounts:
      - mountPath: /home/ray/samples
        name: ray-example-configmap
      - mountPath: /home/ray/
        name: not-exist
  • Step 2: We can find the error by running kubectl describe raycluster xxxx.
    Screenshot 2024-04-25 at 3 43 27 PM

@kevin85421 kevin85421 changed the title [Refactor] Remove cleanupInvalidVolumeMounts [Refactor] Remove cleanupInvalidVolumeMounts Apr 25, 2024
@kevin85421 kevin85421 marked this pull request as ready for review April 25, 2024 22:45
@kevin85421 kevin85421 requested a review from jjyao April 25, 2024 22:45
@@ -321,10 +321,6 @@ func BuildPod(ctx context.Context, podTemplateSpec corev1.PodTemplateSpec, rayNo
addEmptyDir(ctx, &pod.Spec.Containers[utils.RayContainerIndex], &pod, RayLogVolumeName, RayLogVolumeMountPath, corev1.StorageMediumDefault)
addEmptyDir(ctx, &pod.Spec.Containers[autoscalerContainerIndex], &pod, RayLogVolumeName, RayLogVolumeMountPath, corev1.StorageMediumDefault)
}
cleanupInvalidVolumeMounts(&pod.Spec.Containers[utils.RayContainerIndex], &pod)
if len(pod.Spec.InitContainers) > utils.RayContainerIndex {
Copy link
Member Author

Choose a reason for hiding this comment

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

I can't understand the logic to compare the number of init containers and RayContainerIndex.

@kevin85421 kevin85421 merged commit bafb009 into ray-project:master Apr 26, 2024
24 checks passed
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.

2 participants