-
Notifications
You must be signed in to change notification settings - Fork 666
Fix: spec validation in right place #4116
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
base: master
Are you sure you want to change the base?
Fix: spec validation in right place #4116
Conversation
d05d922 to
717af47
Compare
win5923
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s keep this PR focused on replicas validation and handle the CI migration in another one.
that would make it easier to review.
3f37ada to
40b97cf
Compare
|
Hi @nu1lspaxe, Sorry we merged a Volcano PR which introduced some conflicts. |
1. Remove validation logic in GetWorkerGroupDesiredReplicas (utils.go), and append to ValidateRayClusterSpec. 2. Add other validation logic for worker group specs. 3. Remove unnecessary test cases in GetWorkerGroupDesiredReplicas. Fix: MinReplicas / MaxReplicas should verify if autoscaling is not enabled 1. fix golangci-lint test (unused ctx)
6452117 to
98ef48b
Compare
Signed-off-by: Erica Lin <nu1lspaxe.anonym0ux@gmail.com>
Future-Outlier
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @JiangJiaWei1103 @machichima @CheyuWu help review this PR.
|
Hi @nu1lspaxe, would you mind rebasing with the master branch? Thanks. |
| // Check if autoscaling is enabled once to avoid repeated calls | ||
| isAutoscalingEnabled := IsAutoscalingEnabled(spec) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we move the replica validation logic here and below, could we add unit tests for them? Thanks.
| } | ||
| // When autoscaling is enabled, the Ray Autoscaler will manage replicas and | ||
| // eventually adjust them to fall within minReplicas/maxReplicas bounds. | ||
| if workerGroup.Replicas != nil && !isAutoscalingEnabled && workerGroup.MinReplicas != nil && workerGroup.MaxReplicas != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if workerGroup.Replicas != nil && !isAutoscalingEnabled && workerGroup.MinReplicas != nil && workerGroup.MaxReplicas != nil { | |
| if !isAutoscalingEnabled && workerGroup.Replicas != nil { |
- Put
isAutoscalingEnabledfirst to short-circuit the check if autoscaling is enabled - Remove redundant checks which are already done at line 51
- If we reach this line with autoscaling disabled, it means
MinReplicas != nil && MaxReplicas != nil.
- If we reach this line with autoscaling disabled, it means
Why are these changes needed?
Move worker group replica validation from GetWorkerGroupDesiredReplicas to ValidateRayClusterSpec to centralize and improve spec validation, and remove redundant tests.
Related issue number
#4101 (Move Replica validation to
validation.go)Checks