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

[RayJob] Follow up of RayJob deletion policy PR #2763

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

kevin85421
Copy link
Member

Why are these changes needed?

Related issue number

Checks

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

Signed-off-by: kaihsun <[email protected]>
@@ -321,15 +321,15 @@ func TestUpdateRayJobStatus(t *testing.T) {

func TestValidateRayJobSpec(t *testing.T) {
err := validateRayJobSpec(&rayv1.RayJob{})
assert.Error(t, err, "The RayJob is invalid because both `RayClusterSpec` and `ClusterSelector` are empty")
Copy link
Member Author

Choose a reason for hiding this comment

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

Several subtests don't return the error from the validation rule we want to test, so I use ErrorContains instead.

@kevin85421 kevin85421 marked this pull request as ready for review January 17, 2025 00:56
@@ -896,6 +885,10 @@ func validateRayJobSpec(rayJob *rayv1.RayJob) error {
if rayJob.Spec.Suspend && !rayJob.Spec.ShutdownAfterJobFinishes {
return fmt.Errorf("a RayJob with shutdownAfterJobFinishes set to false is not allowed to be suspended")
}
if rayJob.Spec.Suspend && rayJob.Spec.DeletionPolicy != nil && *rayJob.Spec.DeletionPolicy != rayv1.DeleteClusterDeletionPolicy {
// This is a restriction for Kueue.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it safe to assume that Kueue is the only consumer of the suspend API?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, Kueue has it's own validation webhook https://github.com/kubernetes-sigs/kueue/blob/main/pkg/controller/jobs/rayjob/rayjob_webhook.go#L93-L136

Putting the validation check there is probably safer

Copy link
Member Author

@kevin85421 kevin85421 Jan 17, 2025

Choose a reason for hiding this comment

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

Putting the validation check there is probably safer

makes sense

Copy link
Member Author

Choose a reason for hiding this comment

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

removed the check

Signed-off-by: kaihsun <[email protected]>
@kevin85421 kevin85421 merged commit 370fc44 into ray-project:master Jan 17, 2025
24 checks passed
win5923 pushed a commit to win5923/kuberay that referenced this pull request Jan 20, 2025
win5923 pushed a commit to win5923/kuberay that referenced this pull request Jan 20, 2025
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.

3 participants