Skip to content

Commit 07e57df

Browse files
committed
Added delay step 3 to give time for MCAD to process subtrees.
Signed-off-by: dmatch01 <darroyo@us.ibm.com>
1 parent 140c13b commit 07e57df

File tree

12 files changed

+197
-174
lines changed

12 files changed

+197
-174
lines changed
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
# Verify AppWrapper was dispatched and pod was created
2-
apiVersion: mcad.ibm.com/v1beta1
3-
kind: AppWrapper
1+
# Verify delay step
2+
apiVersion: batch/v1
3+
kind: Job
44
metadata:
5-
name: job3-1replica
5+
name: job-delay-step
66
namespace: test
7-
labels:
8-
quota_context: "gold"
9-
quota_service: "service-root"
107
status:
11-
state: Running
12-
---
13-
apiVersion: v1
14-
kind: Pod
15-
metadata:
16-
name: job3-1replica-0
17-
namespace: test
8+
succeeded: 1
Lines changed: 12 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,15 @@
1-
apiVersion: mcad.ibm.com/v1beta1
2-
kind: AppWrapper
1+
apiVersion: batch/v1
2+
kind: Job
33
metadata:
4-
name: job3-1replica
4+
name: job-delay-step
55
namespace: test
6-
labels:
7-
quota_context: "gold"
8-
quota_service: "service-root"
96
spec:
10-
service:
11-
spec: {}
12-
resources:
13-
metadata: {}
14-
Items: []
15-
GenericItems:
16-
- metadata: {}
17-
replicas: 1
18-
generictemplate:
19-
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
20-
kind: StatefulSet
21-
metadata:
22-
name: job3-1replica
23-
namespace: test
24-
labels:
25-
app: job3-1replica
26-
spec:
27-
selector:
28-
matchLabels:
29-
app: job3-1replica
30-
replicas: 1
31-
template:
32-
metadata:
33-
labels:
34-
app: job3-1replica
35-
size: "1"
36-
spec:
37-
containers:
38-
- name: job3-1replica
39-
image: registry.access.redhat.com/ubi8/ubi:latest
40-
command:
41-
- /bin/sh
42-
- -c
43-
- while true; do sleep 10; done
44-
resources:
45-
requests:
46-
cpu: "0.6"
47-
memory: "95Mi"
48-
limits:
49-
cpu: "0.6"
50-
memory: "95Mi"
7+
template:
8+
spec:
9+
containers:
10+
- name: job-delay-step
11+
image: ubuntu:latest
12+
command: [ "/bin/bash", "-c", "--" ]
13+
args: [ "sleep 10;" ]
14+
restartPolicy: Never
15+
backoffLimit: 4
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
# Verify that quota management is enabled by checking the queuing is happening (e.g. no available quota for quota ids provided in AW)
1+
# Verify AppWrapper was dispatched and pod was created
22
apiVersion: mcad.ibm.com/v1beta1
33
kind: AppWrapper
44
metadata:
5-
name: job4-10replica
5+
name: job-gold-lo-pri-1replica
66
namespace: test
77
labels:
8-
quota_context: "context-root2"
9-
quota_service: "service-root2"
8+
quota_context: "gold"
9+
quota_service: "service-root"
1010
status:
11-
state: Pending
11+
state: Running
12+
---
13+
apiVersion: v1
14+
kind: Pod
15+
metadata:
16+
name: job-gold-lo-pri-1replica-0
17+
namespace: test
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,50 @@
11
apiVersion: mcad.ibm.com/v1beta1
22
kind: AppWrapper
33
metadata:
4-
name: job4-10replica
4+
name: job-gold-lo-pri-1replica
55
namespace: test
66
labels:
7-
quota_context: "context-root2"
8-
quota_service: "service-root2"
7+
quota_context: "gold"
8+
quota_service: "service-root"
99
spec:
1010
service:
1111
spec: {}
1212
resources:
1313
metadata: {}
14+
Items: []
1415
GenericItems:
1516
- metadata: {}
1617
replicas: 1
1718
generictemplate:
1819
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
1920
kind: StatefulSet
2021
metadata:
21-
name: job4-10replica
22+
name: job-gold-lo-pri-1replica
2223
namespace: test
2324
labels:
24-
app: job4-10replica
25+
app: job-gold-lo-pri-1replica
2526
spec:
2627
selector:
2728
matchLabels:
28-
app: job4-10replica
29-
replicas: 10
29+
app: job-gold-lo-pri-1replica
30+
replicas: 1
3031
template:
3132
metadata:
3233
labels:
33-
app: job4-10replica
34+
app: job-gold-lo-pri-1replica
3435
size: "1"
3536
spec:
3637
containers:
37-
- name: job4-10replica
38+
- name: job-gold-lo-pri-1replica
3839
image: registry.access.redhat.com/ubi8/ubi:latest
3940
command:
4041
- /bin/sh
4142
- -c
4243
- while true; do sleep 10; done
4344
resources:
4445
requests:
45-
cpu: "0.1"
46+
cpu: "0.6"
4647
memory: "95Mi"
4748
limits:
48-
cpu: "0.1"
49+
cpu: "0.6"
4950
memory: "95Mi"
Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,11 @@
1-
# Verify that quota management preempted lower priority job
1+
# Verify that quota management is enabled by checking the queuing is happening (e.g. no available quota for quota ids provided in AW)
22
apiVersion: mcad.ibm.com/v1beta1
33
kind: AppWrapper
44
metadata:
5-
name: job5-1replica
6-
namespace: test
7-
labels:
8-
quota_context: "gold"
9-
quota_service: "service-root"
10-
status:
11-
state: Running
12-
---
13-
apiVersion: v1
14-
kind: Pod
15-
metadata:
16-
name: job5-1replica-0
17-
namespace: test
18-
---
19-
apiVersion: mcad.ibm.com/v1beta1
20-
kind: AppWrapper
21-
metadata:
22-
name: job4-10replica
5+
name: job-bad-quota-id-10replica
236
namespace: test
247
labels:
258
quota_context: "context-root2"
269
quota_service: "service-root2"
2710
status:
2811
state: Pending
29-
---
30-
apiVersion: mcad.ibm.com/v1beta1
31-
kind: AppWrapper
32-
metadata:
33-
name: job3-1replica
34-
namespace: test
35-
labels:
36-
quota_context: "gold"
37-
quota_service: "service-root"
38-
status:
39-
state: Pending
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
apiVersion: mcad.ibm.com/v1beta1
22
kind: AppWrapper
33
metadata:
4-
name: job5-1replica
4+
name: job-bad-quota-id-10replica
55
namespace: test
66
labels:
7-
quota_context: "gold"
8-
quota_service: "service-root"
7+
quota_context: "context-root2"
8+
quota_service: "service-root2"
99
spec:
1010
service:
1111
spec: {}
12-
priority: 1000
1312
resources:
1413
metadata: {}
1514
GenericItems:
@@ -19,32 +18,32 @@ spec:
1918
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
2019
kind: StatefulSet
2120
metadata:
22-
name: job5-1replica
21+
name: job-bad-quota-id-10replica
2322
namespace: test
2423
labels:
25-
app: job5-1replica
24+
app: job-bad-quota-id-10replica
2625
spec:
2726
selector:
2827
matchLabels:
29-
app: job5-1replica
30-
replicas: 1
28+
app: job-bad-quota-id-10replica
29+
replicas: 10
3130
template:
3231
metadata:
3332
labels:
34-
app: job5-1replica
33+
app: job-bad-quota-id-10replica
3534
size: "1"
3635
spec:
3736
containers:
38-
- name: job5-1replica
37+
- name: job-bad-quota-id-10replica
3938
image: registry.access.redhat.com/ubi8/ubi:latest
4039
command:
4140
- /bin/sh
4241
- -c
4342
- while true; do sleep 10; done
4443
resources:
4544
requests:
46-
cpu: "0.6"
45+
cpu: "0.1"
4746
memory: "95Mi"
4847
limits:
49-
cpu: "0.6"
48+
cpu: "0.1"
5049
memory: "95Mi"

test/e2e-kuttl/quota-forest/06-assert.yaml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
1-
# Verify that quota management is enabled using different quota ids
1+
# Verify that quota management preempted lower priority job
22
apiVersion: mcad.ibm.com/v1beta1
33
kind: AppWrapper
44
metadata:
5-
name: job6-1replica
6-
namespace: test
7-
labels:
8-
quota_context: "bronze"
9-
quota_service: "service-root"
10-
status:
11-
state: Running
12-
---
13-
apiVersion: v1
14-
kind: Pod
15-
metadata:
16-
name: job6-1replica-0
17-
namespace: test
18-
---
19-
apiVersion: mcad.ibm.com/v1beta1
20-
kind: AppWrapper
21-
metadata:
22-
name: job5-1replica
5+
name: job-gold-high-pri-1replica
236
namespace: test
247
labels:
258
quota_context: "gold"
@@ -30,13 +13,13 @@ status:
3013
apiVersion: v1
3114
kind: Pod
3215
metadata:
33-
name: job5-1replica-0
16+
name: job-gold-high-pri-1replica-0
3417
namespace: test
3518
---
3619
apiVersion: mcad.ibm.com/v1beta1
3720
kind: AppWrapper
3821
metadata:
39-
name: job4-10replica
22+
name: job-bad-quota-id-10replica
4023
namespace: test
4124
labels:
4225
quota_context: "context-root2"
@@ -47,7 +30,7 @@ status:
4730
apiVersion: mcad.ibm.com/v1beta1
4831
kind: AppWrapper
4932
metadata:
50-
name: job3-1replica
33+
name: job-gold-lo-pri-1replica
5134
namespace: test
5235
labels:
5336
quota_context: "gold"
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
apiVersion: mcad.ibm.com/v1beta1
22
kind: AppWrapper
33
metadata:
4-
name: job6-1replica
4+
name: job-gold-high-pri-1replica
55
namespace: test
66
labels:
7-
quota_context: "bronze"
7+
quota_context: "gold"
88
quota_service: "service-root"
99
spec:
1010
service:
@@ -19,32 +19,32 @@ spec:
1919
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
2020
kind: StatefulSet
2121
metadata:
22-
name: job6-1replica
22+
name: job-gold-high-pri-1replica
2323
namespace: test
2424
labels:
25-
app: job6-1replica
25+
app: job-gold-high-pri-1replica
2626
spec:
2727
selector:
2828
matchLabels:
29-
app: job6-1replica
29+
app: job-gold-high-pri-1replica
3030
replicas: 1
3131
template:
3232
metadata:
3333
labels:
34-
app: job6-1replica
34+
app: job-gold-high-pri-1replica
3535
size: "1"
3636
spec:
3737
containers:
38-
- name: job6-1replica
38+
- name: job-gold-high-pri-1replica
3939
image: registry.access.redhat.com/ubi8/ubi:latest
4040
command:
4141
- /bin/sh
4242
- -c
4343
- while true; do sleep 10; done
4444
resources:
4545
requests:
46-
cpu: "0.4"
46+
cpu: "0.6"
4747
memory: "95Mi"
4848
limits:
49-
cpu: "0.4"
49+
cpu: "0.6"
5050
memory: "95Mi"

0 commit comments

Comments
 (0)