Skip to content

Commit f2fdb97

Browse files
Remove check that the MinReplicas in each PodGroup of a PodGang need to be equal to the length of the PodReference slice. This allows auto-scaling to work at the Grove clique level (#293)
Signed-off-by: Sanjay Chatterjee <[email protected]>
1 parent 8a33935 commit f2fdb97

File tree

2 files changed

+0
-75
lines changed

2 files changed

+0
-75
lines changed

pkg/podgrouper/podgrouper/plugins/grove/grove_grouper.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,6 @@ func (gg *GroveGrouper) GetPodGroupMetadata(
105105
return nil, fmt.Errorf("missing podReferences in spec.podgroup[%v] of PodGang %s/%s",
106106
idx, pod.Namespace, podGangName)
107107
}
108-
minReplicas, found, err := unstructured.NestedInt64(pgr, "minReplicas")
109-
if err != nil {
110-
return nil, fmt.Errorf("failed to get minReplicas from spec.podgroup[%v] of PodGang %s/%s : %w",
111-
idx, pod.Namespace, podGangName, err)
112-
}
113-
if found && int(minReplicas) != len(podSlice) {
114-
return nil, fmt.Errorf("unsupported minReplicas in spec.podgroup[%v] of PodGang %s/%s : expected: %v, found: %v",
115-
idx, pod.Namespace, podGangName, len(podSlice), minReplicas)
116-
}
117108
minAvailable += int32(len(podSlice))
118109
}
119110
metadata.MinAvailable = minAvailable

pkg/podgrouper/podgrouper/plugins/grove/grove_grouper_test.go

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -132,69 +132,3 @@ func TestGetPodGroupMetadata(t *testing.T) {
132132
assert.Equal(t, constants.InferencePriorityClass, metadata.PriorityClassName)
133133
assert.Equal(t, "test_queue", metadata.Queue)
134134
}
135-
136-
func TestErrorPodGroupMinReplicas(t *testing.T) {
137-
podgang := &unstructured.Unstructured{
138-
Object: map[string]interface{}{
139-
"kind": "PodGang",
140-
"apiVersion": "scheduler.grove.io/v1alpha1",
141-
"metadata": map[string]interface{}{
142-
"name": "pgs2",
143-
"namespace": "test-ns",
144-
"uid": "2",
145-
"labels": map[string]interface{}{
146-
"test_label": "test_value",
147-
},
148-
"annotations": map[string]interface{}{
149-
"test_annotation": "test_value",
150-
},
151-
},
152-
"spec": map[string]interface{}{
153-
"podgroups": []interface{}{
154-
map[string]interface{}{
155-
"podReferences": []interface{}{
156-
map[string]interface{}{
157-
"namespace": "test-ns",
158-
"name": "pgs1-pga1",
159-
},
160-
map[string]interface{}{
161-
"namespace": "test-ns",
162-
"name": "pgs1-pga2",
163-
},
164-
map[string]interface{}{
165-
"namespace": "test-ns",
166-
"name": "pgs1-pga3",
167-
},
168-
map[string]interface{}{
169-
"namespace": "test-ns",
170-
"name": "pgs1-pga4",
171-
},
172-
},
173-
"minReplicas": int64(2),
174-
},
175-
},
176-
"priorityClassName": "inference",
177-
},
178-
},
179-
}
180-
181-
pod := &v1.Pod{
182-
TypeMeta: metav1.TypeMeta{},
183-
ObjectMeta: metav1.ObjectMeta{
184-
Name: "pgs1-pga1",
185-
Namespace: "test-ns",
186-
Labels: map[string]string{
187-
queueLabelKey: "test_queue",
188-
labelKeyPodGangName: "pgs2",
189-
},
190-
UID: "100",
191-
},
192-
Spec: v1.PodSpec{},
193-
Status: v1.PodStatus{},
194-
}
195-
196-
client := fake.NewClientBuilder().WithScheme(scheme.Scheme).WithRuntimeObjects(podgang).Build()
197-
grouper := NewGroveGrouper(client, defaultgrouper.NewDefaultGrouper(queueLabelKey, nodePoolLabelKey))
198-
_, err := grouper.GetPodGroupMetadata(podgang, pod)
199-
assert.EqualError(t, err, "unsupported minReplicas in spec.podgroup[0] of PodGang test-ns/pgs2 : expected: 4, found: 2")
200-
}

0 commit comments

Comments
 (0)