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

[Feature] Make replicas optional for WorkerGroupSpec #1443

Merged
merged 10 commits into from
Sep 25, 2023

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Sep 22, 2023

Why are these changes needed?

Some GitOps systems, like Flux, will revert changes that are not initiated by the system itself. The Ray Autoscaler modifies the Replicas field to scale the Ray cluster up or down. Consequently, a conflict arises where the Autoscaler makes updates to the field, and Flux continuously reverts them. To address this issue, this PR makes the Replicas field optional. If the field is optional, Flux will not have the reverting behavior.

Related issue number

Closes #1154
Closes #1120
Closes #265

Checks

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

@kevin85421 kevin85421 marked this pull request as ready for review September 23, 2023 06:42
@kevin85421
Copy link
Member Author

cc @hongchaodeng

Copy link
Contributor

@architkulkarni architkulkarni left a comment

Choose a reason for hiding this comment

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

Somewhere in the code, should add a comment describing the reasons described in your PR description? Otherwise it might be hard to trace back the reason for making it optional if people look at the code later.

Ideally we can link to some Argo documentation for "If the field is optional, ArgoCD will not have the reverting behavior."

Otherwise just minor questions/concerns, looks good to me

@@ -215,11 +215,26 @@ func GenerateIdentifier(clusterName string, nodeType rayv1alpha1.RayNodeType) st
return fmt.Sprintf("%s-%s", clusterName, nodeType)
}

func GetWorkerGroupDesiredReplicas(workerGroupSpec rayv1alpha1.WorkerGroupSpec) int32 {
// Always adhere to min/max replicas constraints. If minReplicas > maxReplicas, minReplicas will be used.
Copy link
Contributor

Choose a reason for hiding this comment

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

If minReplicas > maxReplicas shouldn't we raise an error instead of silently using minReplicas? At the very least should we add a warning log?

@kevin85421
Copy link
Member Author

Somewhere in the code, should add a comment describing the reasons described in your PR description? Otherwise it might be hard to trace back the reason for making it optional if people look at the code later.

Done

Ideally we can link to some Argo documentation for "If the field is optional, ArgoCD will not have the reverting behavior."

Update the PR description.

@kevin85421 kevin85421 merged commit 1ed0b7f into ray-project:master Sep 25, 2023
kevin85421 added a commit to kevin85421/kuberay that referenced this pull request Oct 17, 2023
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.

[Feature] Make Replicas optional [Feature] Make Replicas field in WorkerGroupSpec optional
2 participants