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

RayService: Omits Min and Max replicas from hash calculation #2172

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ray-operator/controllers/ray/rayservice_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,8 @@ func generateHashWithoutReplicasAndWorkersToDelete(rayClusterSpec rayv1.RayClust
updatedRayClusterSpec := rayClusterSpec.DeepCopy()
for i := 0; i < len(updatedRayClusterSpec.WorkerGroupSpecs); i++ {
updatedRayClusterSpec.WorkerGroupSpecs[i].Replicas = nil
updatedRayClusterSpec.WorkerGroupSpecs[i].MaxReplicas = nil
updatedRayClusterSpec.WorkerGroupSpecs[i].MinReplicas = nil
updatedRayClusterSpec.WorkerGroupSpecs[i].ScaleStrategy.WorkersToDelete = nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func TestGetClusterAction(t *testing.T) {
Replicas: pointer.Int32(2),
MinReplicas: pointer.Int32(1),
MaxReplicas: pointer.Int32(4),
GroupName: "worker-group-1",
},
},
}
Expand All @@ -85,7 +86,7 @@ func TestGetClusterAction(t *testing.T) {

// Test Case 3: Different WorkerGroupSpecs should lead to RolloutNew.
clusterSpec3 := clusterSpec1.DeepCopy()
clusterSpec3.WorkerGroupSpecs[0].MinReplicas = pointer.Int32(5)
clusterSpec3.WorkerGroupSpecs[0].GroupName = "worker-group-2"
action, err = getClusterAction(clusterSpec1, *clusterSpec3)
assert.Nil(t, err)
assert.Equal(t, RolloutNew, action)
Expand Down Expand Up @@ -145,7 +146,7 @@ func TestGetClusterAction(t *testing.T) {

// Test Case 9: Changing an existing WorkerGroupSpec outside of Replicas/WorkersToDelete *and* adding a new WorkerGroupSpec should lead to RolloutNew.
clusterSpec9 := clusterSpec1.DeepCopy()
clusterSpec9.WorkerGroupSpecs[0].MaxReplicas = pointer.Int32(5)
clusterSpec9.WorkerGroupSpecs[0].GroupName = "worker-group-3"
clusterSpec9.WorkerGroupSpecs = append(clusterSpec9.WorkerGroupSpecs, rayv1.WorkerGroupSpec{
Replicas: pointer.Int32(2),
MinReplicas: pointer.Int32(1),
Expand Down
Loading