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][Status][11/n] Refactor the suspend operation #1782

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Dec 28, 2023

Why are these changes needed?

  • Only RayJob with the status Running and Initializing allows transitioning to Suspended. This PR adds a test to ensure there is no state transition from Complete to Suspended.
  • Resume a suspended RayJob by setting suspend to false:
    • Without this PR, it will fail to get RayCluster because Status.RayClusterName is empty.
    • This PR explicitly defines that the RayJob will transition from Suspended to New. Consequently, the RayCluster will be created upon resumption. However, there is still an issue with the submitter Job. If users don't set shutDownAfterFinishes, the submitter Job will become Complete after suspension. When we resume the RayJob, a new Kubernetes Job will not be created because one already exists. This is a follow-up issue.

Related issue number

Checks

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

@kevin85421 kevin85421 changed the title [RayJob][Status][11/n] [RayJob][Status][11/n] Refactor the suspend operation Dec 28, 2023
@kevin85421 kevin85421 marked this pull request as ready for review December 28, 2023 22:53
@@ -164,7 +174,7 @@ func (r *RayJobReconciler) Reconcile(ctx context.Context, request ctrl.Request)
return ctrl.Result{RequeueAfter: time.Duration(delta) * time.Second}, nil
} else {
if err = r.releaseComputeResources(ctx, rayJobInstance); err != nil {
return ctrl.Result{RequeueAfter: RayJobDefaultRequeueDuration}, nil
return ctrl.Result{RequeueAfter: RayJobDefaultRequeueDuration}, err
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

@kevin85421 kevin85421 merged commit 4ff389b into ray-project:master Dec 28, 2023
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.

None yet

2 participants