Skip to content

Commit b26d8e6

Browse files
authored
Merge branch 'development' into pubtools-sign-blob
2 parents f094cd4 + f37eaf5 commit b26d8e6

File tree

31 files changed

+449
-26
lines changed

31 files changed

+449
-26
lines changed

.github/scripts/tkn_check_compute_resources.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,22 @@ for file in ${CHANGED_FILES}; do
4444
fail=1
4545
fi
4646

47+
# Ensure limits.cpu equals requests.cpu
48+
limits_cpu=$(yq '.cpu' <<< "$limits")
49+
requests_cpu=$(yq '.cpu' <<< "$requests")
50+
if [[ "$limits_cpu" == "null" || "$requests_cpu" == "null" || "$limits_cpu" != "$requests_cpu" ]]; then
51+
echo "ERROR: $file step $step_name (index $i) limits.cpu and requests.cpu must be defined and equal"
52+
fail=1
53+
fi
54+
4755
# Check no other keys exist in computeResources (order-agnostic)
4856
if ! yq -e 'keys | contains(["limits","requests"]) and length == 2' <<< "$compute_resources" > /dev/null 2>&1; then
4957
echo "ERROR: $file step $step_name (index $i) computeResources has extra or missing keys"
5058
fail=1
5159
else
52-
# Check that limits only has memory and/or cpu, requests only has cpu and memory (order-agnostic)
53-
if ! yq -e 'keys - ["cpu","memory"] | length == 0' <<< "$limits" > /dev/null 2>&1; then
54-
echo "ERROR: $file step $step_name (index $i) computeResources.limits has keys other than memory and cpu"
60+
# Check that limits has exactly cpu and memory, requests only has cpu and memory (order-agnostic)
61+
if ! yq -e 'keys | contains(["cpu","memory"]) and length == 2' <<< "$limits" > /dev/null 2>&1; then
62+
echo "ERROR: $file step $step_name (index $i) computeResources.limits must have exactly cpu and memory"
5563
fail=1
5664
fi
5765
if ! yq -e 'keys | contains(["cpu","memory"]) and length == 2' <<< "$requests" > /dev/null 2>&1; then
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: PR AI Labeler
3+
4+
on:
5+
pull_request_target:
6+
types: [opened, synchronize]
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
jobs:
13+
label-pr:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Label PR using shared action
17+
uses: konflux-ci/release-service-automations/pr-ai-labeler@26b8ead8ea7af6dabb73ba72b238b7757ccddb56 # main
18+
with:
19+
github-token: ${{ secrets.GITHUB_TOKEN }}
20+
pr-number: ${{ github.event.pull_request.number }}
21+
repository: ${{ github.repository }}

CONTRIBUTING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,17 @@ All steps in the [managed](tasks/managed) and [internal](tasks/internal) tasks h
114114
If you are contributing a new managed or internal task (or adding a step to an existing one), you must provide appropriate `computeResources`. If you do not do this, your PR will fail
115115
the linting check due to the check defined in [this script](.github/scripts/tkn_check_compute_resources.sh).
116116

117-
When setting `computeResources`, you should set the `limits.memory` and `requests.memory` to the same value. No `limits.cpu` should be defined, but a `requests.cpu` should be.
118-
Here is an example
117+
When setting `computeResources`, you should set:
118+
- `limits.memory` and `requests.memory` to the same value
119+
- `limits.cpu` and `requests.cpu` to the same value
120+
121+
Here is an example:
119122
```yaml
120123
- name: my-new-step
121124
computeResources:
122125
limits:
123126
memory: 256Mi
127+
cpu: 250m
124128
requests:
125129
memory: 256Mi
126130
cpu: 250m

tasks/internal/check-embargoed-cves-task/check-embargoed-cves-task.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ spec:
5656
computeResources:
5757
limits:
5858
memory: 32Mi
59+
cpu: 20m
5960
requests:
6061
memory: 32Mi
6162
cpu: 20m

tasks/internal/check-fbc-opt-in/check-fbc-opt-in.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ spec:
7777
computeResources:
7878
limits:
7979
memory: 512Mi
80+
cpu: 200m
8081
requests:
8182
memory: 512Mi
8283
cpu: 200m

tasks/internal/check-signing-certificates/check-signing-certificates.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ spec:
4141
computeResources:
4242
limits:
4343
memory: 128Mi
44+
cpu: 100m
4445
requests:
4546
memory: 128Mi
4647
cpu: 100m

tasks/internal/collect-blob-signing-params/collect-blob-signing-params.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ spec:
3838
computeResources:
3939
limits:
4040
memory: 64Mi
41+
cpu: 25m
4142
requests:
4243
memory: 64Mi
4344
cpu: 25m

tasks/internal/collect-simple-signing-params/collect-simple-signing-params.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ spec:
7070
computeResources:
7171
limits:
7272
memory: 64Mi
73+
cpu: 25m
7374
requests:
7475
memory: 64Mi
7576
cpu: 25m

tasks/internal/create-advisory-oci-artifact-task/create-advisory-oci-artifact-task.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ spec:
6666
computeResources:
6767
limits:
6868
memory: 256Mi
69+
cpu: 150m
6970
requests:
7071
memory: 256Mi
7172
cpu: 150m

tasks/internal/create-advisory-task/create-advisory-task.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ spec:
9090
computeResources:
9191
limits:
9292
memory: 256Mi
93+
cpu: '1'
9394
requests:
9495
memory: 256Mi
95-
cpu: '1' # 1 is the max allowed by at least the staging cluster
96+
cpu: '1'
9697
volumeMounts:
9798
- name: advisory-secret
9899
mountPath: /mnt/advisory_secret

0 commit comments

Comments
 (0)