Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
734 changes: 734 additions & 0 deletions operator/e2e/tests/gang_termination_test.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions operator/e2e/utils/k8s_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func WaitForPods(ctx context.Context, restConfig *rest.Config, namespaces []stri

for _, pod := range pods.Items {
totalPods++
if isPodReady(&pod) {
if IsPodReady(&pod) {
readyPods++
} else {
allReady = false
Expand Down Expand Up @@ -307,8 +307,8 @@ func getGVRFromGVK(restMapper meta.RESTMapper, gvk schema.GroupVersionKind) (sch
return mapping.Resource, nil
}

// isPodReady checks if a pod is ready
func isPodReady(pod *v1.Pod) bool {
// IsPodReady checks if a pod is ready
func IsPodReady(pod *v1.Pod) bool {
// First check that the pod is in Running phase
if pod.Status.Phase != v1.PodRunning {
return false
Expand Down Expand Up @@ -408,7 +408,7 @@ func CountPodsByPhase(pods *v1.PodList) PodPhaseCount {
func CountReadyPods(pods *v1.PodList) int {
readyCount := 0
for _, pod := range pods.Items {
if isPodReady(&pod) {
if IsPodReady(&pod) {
readyCount++
}
}
Expand Down
4 changes: 4 additions & 0 deletions operator/e2e/yaml/workload1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
spec:
replicas: 1
template:
terminationDelay: 10s
cliques:
- name: pc-a
labels:
Expand All @@ -19,6 +20,7 @@ spec:
minAvailable: 2
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -48,6 +50,7 @@ spec:
minAvailable: 1
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -77,6 +80,7 @@ spec:
minAvailable: 3
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
4 changes: 4 additions & 0 deletions operator/e2e/yaml/workload2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
spec:
replicas: 1
template:
terminationDelay: 10s
cliques:
- name: pc-a
labels:
Expand All @@ -19,6 +20,7 @@ spec:
minAvailable: 1
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -48,6 +50,7 @@ spec:
minAvailable: 1
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -77,6 +80,7 @@ spec:
minAvailable: 1
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
4 changes: 4 additions & 0 deletions operator/e2e/yaml/workload3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
spec:
replicas: 1
template:
terminationDelay: 10s
cliqueStartupType: CliqueStartupTypeInOrder
cliques:
- name: pc-a
Expand All @@ -20,6 +21,7 @@ spec:
minAvailable: 2
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -49,6 +51,7 @@ spec:
minAvailable: 1
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -78,6 +81,7 @@ spec:
minAvailable: 3
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
4 changes: 4 additions & 0 deletions operator/e2e/yaml/workload4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
spec:
replicas: 1
template:
terminationDelay: 10s
cliqueStartupType: CliqueStartupTypeInOrder
cliques:
- name: pc-a
Expand All @@ -20,6 +21,7 @@ spec:
minAvailable: 1
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -49,6 +51,7 @@ spec:
minAvailable: 1
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -78,6 +81,7 @@ spec:
minAvailable: 1
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
4 changes: 4 additions & 0 deletions operator/e2e/yaml/workload5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
spec:
replicas: 1
template:
terminationDelay: 10s
cliqueStartupType: CliqueStartupTypeExplicit
cliques:
- name: pc-a
Expand All @@ -20,6 +21,7 @@ spec:
minAvailable: 2
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -51,6 +53,7 @@ spec:
- pc-c
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -80,6 +83,7 @@ spec:
minAvailable: 3
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
4 changes: 4 additions & 0 deletions operator/e2e/yaml/workload6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
spec:
replicas: 1
template:
terminationDelay: 10s
cliqueStartupType: CliqueStartupTypeExplicit
cliques:
- name: pc-a
Expand All @@ -20,6 +21,7 @@ spec:
minAvailable: 1
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -51,6 +53,7 @@ spec:
- pc-c
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -80,6 +83,7 @@ spec:
minAvailable: 1
podSpec:
schedulerName: kai-scheduler
terminationGracePeriodSeconds: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Loading