Skip to content

Commit f66edc9

Browse files
gbenhaimfilariowhugares
authored
KFLUXINFRA-2161: Control AWS IP requests using Kueue (#7773)
* KFLUXINFRA-2161: Control AWS IP requests using Kueue For each requested platform from AWS, request an IP by specifying the "aws-ip" resource in the pipeline's annotation using tekton-kueue CEL expressions. This change will affect only the development overlay. Requires: konflux-ci/tekton-kueue#91 Assisted-By: Cursor Signed-off-by: Gal Ben Haim <[email protected]> * Update components/kueue/development/tekton-kueue/config.yaml Co-authored-by: Francesco Ilario <[email protected]> * Update components/kueue/development/tekton-kueue/config.yaml Co-authored-by: Hugo Arès <[email protected]> * Update components/kueue/development/tekton-kueue/config.yaml Co-authored-by: Francesco Ilario <[email protected]> * Use development in test-tekton-kueue-config.py Use development overlay in test-tekton-kueue-config.py when reading the tekton-kueue image * Fix pathtest-tekton-kueue-config.py * Update test-tekton-kueue-config.py Fix the expected results --------- Signed-off-by: Gal Ben Haim <[email protected]> Co-authored-by: Francesco Ilario <[email protected]> Co-authored-by: Hugo Arès <[email protected]>
1 parent c6b172c commit f66edc9

File tree

3 files changed

+180
-43
lines changed

3 files changed

+180
-43
lines changed

components/kueue/development/queue-config/cluster-queue.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ spec:
3838
- linux-amd64
3939
- linux-s390x
4040
- linux-ppc64le
41+
- aws-ip
4142
flavors:
4243
- name: default-flavor
4344
resources:
@@ -51,6 +52,8 @@ spec:
5152
nominalQuota: "10"
5253
- name: linux-ppc64le
5354
nominalQuota: "10"
55+
- name: aws-ip
56+
nominalQuota: "250"
5457
# When a Workload doesn't have cpu or memory requests, if there is a limit range
5558
# in the namespace, Kueue will assign the requests from it to the Workload.
5659
# We don't care about the cpu/memory for PipelineRuns, thus setting a high value for both.

components/kueue/development/tekton-kueue/config.yaml

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,34 @@ cel:
66
has(pipelineRun.spec.params) &&
77
pipelineRun.spec.params.exists(p, p.name == 'build-platforms') ?
88
pipelineRun.spec.params.filter(
9-
p,
9+
p,
1010
p.name == 'build-platforms')[0]
1111
.value.map(
1212
p,
13-
annotation("kueue.konflux-ci.dev/requests-" + replace(replace(p, "/", "-"), "_", "-"), "1")
13+
resource(replace(replace(p, "/", "-"), "_", "-"), 1)
14+
) : []
15+
16+
# Request AWS IP for AWS-based platforms
17+
- |
18+
has(pipelineRun.spec.params) &&
19+
pipelineRun.spec.params.exists(p, p.name == 'build-platforms') ?
20+
pipelineRun.spec.params.filter(
21+
p,
22+
p.name == 'build-platforms')[0]
23+
.value.filter(
24+
p,
25+
!(
26+
p in [
27+
'linux/ppc64le',
28+
'linux/s390x',
29+
'linux/x86_64',
30+
'local',
31+
'localhost',
32+
]
33+
)
34+
).map(
35+
p,
36+
resource('aws-ip', 1)
1437
) : []
1538
1639
# Set resource requests for multi platform pipelines which doesn't use the build-platforms parameter (old style)
@@ -24,7 +47,33 @@ cel:
2447
.filter(p, p.size() > 0)
2548
.map(
2649
p,
27-
annotation("kueue.konflux-ci.dev/requests-" + replace(replace(p[0].value, "/", "-"), "_", "-"), "1")
50+
resource(replace(replace(p[0].value, "/", "-"), "_", "-"), 1)
51+
) : []
52+
53+
# Request AWS IP for AWS-based platforms which doesn't use the build-platforms parameter (old style)
54+
- |
55+
has(pipelineRun.spec.pipelineSpec) &&
56+
pipelineRun.spec.pipelineSpec.tasks.size() > 0 ?
57+
pipelineRun.spec.pipelineSpec.tasks.map(
58+
task,
59+
has(task.params) ? task.params.filter(p, p.name == 'PLATFORM') : []
60+
)
61+
.filter(p, p.size() > 0)
62+
.filter(
63+
p,
64+
!(
65+
p[0].value in [
66+
'linux/ppc64le',
67+
'linux/s390x',
68+
'linux/x86_64',
69+
'local',
70+
'localhost',
71+
]
72+
)
73+
)
74+
.map(
75+
p,
76+
resource('aws-ip', 1)
2877
) : []
2978
3079
# Set the pipeline priority

0 commit comments

Comments
 (0)