From ba429d0d2431cfedcc497f7ff4ea0c76acd1336c Mon Sep 17 00:00:00 2001 From: Jan Hutar Date: Mon, 5 Aug 2024 16:54:42 +0200 Subject: [PATCH] feat(KONFLUX-1503): Set some requests and limits so pods can spread across cluster nodes --- task/buildah/0.2/buildah.yaml | 64 ++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/task/buildah/0.2/buildah.yaml b/task/buildah/0.2/buildah.yaml index 1a4da2306a..0b93d1ec9e 100644 --- a/task/buildah/0.2/buildah.yaml +++ b/task/buildah/0.2/buildah.yaml @@ -168,10 +168,11 @@ spec: name: build computeResources: limits: - memory: 4Gi + memory: 8Gi + cpu: '4' requests: - memory: 512Mi - cpu: 250m + memory: 2Gi + cpu: '1' env: - name: COMMIT_SHA value: $(params.COMMIT_SHA) @@ -376,6 +377,13 @@ spec: # Respect Syft configuration if the user has it in the root of their repository # (need to set the workdir, see https://github.com/anchore/syft/issues/2465) workingDir: $(workspaces.source.path)/source + computeResources: + limits: + memory: 4Gi + cpu: '2' + requests: + memory: 1Gi + cpu: 500m script: | echo "Running syft on the source directory" syft dir:$(workspaces.source.path)/source --output cyclonedx-json=$(workspaces.source.path)/sbom-source.json @@ -389,6 +397,13 @@ spec: name: shared - name: analyse-dependencies-java-sbom image: quay.io/redhat-appstudio/hacbs-jvm-build-request-processor:127ee0c223a2b56a9bd20a6f2eaeed3bd6015f77 + computeResources: + limits: + memory: 512Mi + cpu: 200m + requests: + memory: 256Mi + cpu: 100m script: | if [ -f /var/lib/containers/java ]; then /opt/jboss/container/java/run/run-java.sh analyse-dependencies path $(cat /shared/container_path) -s $(workspaces.source.path)/sbom-image.json --task-run-name $(context.taskRun.name) --publishers $(results.SBOM_JAVA_COMPONENTS_COUNT.path) @@ -406,6 +421,13 @@ spec: - name: merge-syft-sboms image: registry.access.redhat.com/ubi9/python-39:1-192@sha256:01c9e53b32acd96f9fe7781727140df6868c91ebc916ed95dc58999fbf4d8ddd + computeResources: + limits: + memory: 512Mi + cpu: 200m + requests: + memory: 256Mi + cpu: 100m script: | #!/bin/python3 import json @@ -441,6 +463,13 @@ spec: - name: merge-cachi2-sbom image: quay.io/redhat-appstudio/cachi2:0.9.1@sha256:df67f9e063b544a8c49a271359377fed560562615e0278f6d0b9a3485f3f8fad + computeResources: + limits: + memory: 512Mi + cpu: 200m + requests: + memory: 256Mi + cpu: 100m script: | if [ -f "sbom-cachi2.json" ]; then echo "Merging contents of sbom-cachi2.json into sbom-cyclonedx.json" @@ -455,6 +484,13 @@ spec: - name: create-purl-sbom image: registry.access.redhat.com/ubi9/python-39:1-192@sha256:01c9e53b32acd96f9fe7781727140df6868c91ebc916ed95dc58999fbf4d8ddd + computeResources: + limits: + memory: 512Mi + cpu: 200m + requests: + memory: 256Mi + cpu: 100m script: | #!/bin/python3 import json @@ -473,6 +509,13 @@ spec: - name: create-base-images-sbom image: quay.io/redhat-appstudio/base-images-sbom-script@sha256:667669e3def018f9dbb8eaf8868887a40bc07842221e9a98f6787edcff021840 + computeResources: + limits: + memory: 512Mi + cpu: 200m + requests: + memory: 256Mi + cpu: 100m script: | python3 /app/base_images_sbom_script.py \ --sbom=sbom-cyclonedx.json \ @@ -484,7 +527,13 @@ spec: - name: inject-sbom-and-push image: quay.io/konflux-ci/buildah:latest@sha256:3fe211715717eca9eca1f19d326e19dd052c92fc6eb4f2434d8f903fe5b9aeb7 - computeResources: {} + computeResources: + limits: + memory: 4Gi + cpu: '4' + requests: + memory: 1Gi + cpu: '1' script: | #!/bin/bash set -e @@ -553,6 +602,13 @@ spec: - name: upload-sbom image: quay.io/redhat-appstudio/cosign:v2.1.1@sha256:c883d6f8d39148f2cea71bff4622d196d89df3e510f36c140c097b932f0dd5d5 + computeResources: + limits: + memory: 512Mi + cpu: 200m + requests: + memory: 256Mi + cpu: 100m args: - attach - sbom