Skip to content

Commit

Permalink
feat(KONFLUX-5670): Define computeResources for prefetch-dependencies…
Browse files Browse the repository at this point in the history
… tasks
  • Loading branch information
jhutar committed Dec 18, 2024
1 parent 90bff99 commit 52db40e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
11 changes: 11 additions & 0 deletions task-generator/trusted-artifacts/ta.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/remote"
resource "k8s.io/apimachinery/pkg/api/resource"
pipeline "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
core "k8s.io/api/core/v1"
)
Expand Down Expand Up @@ -334,6 +335,16 @@ func perform(task *pipeline.Task, recipe *Recipe) error {
},
},
Args: args,
ComputeResources: core.ResourceRequirements{
Requests: core.ResourceList{
core.ResourceCPU: resource.MustParse("1"),
core.ResourceMemory: resource.MustParse("3Gi"),
},
Limits: core.ResourceList{
core.ResourceCPU: resource.MustParse("1"),
core.ResourceMemory: resource.MustParse("3Gi"),
},
},
}

if task.Spec.StepTemplate == nil && !recipe.PreferStepTemplate {
Expand Down
7 changes: 7 additions & 0 deletions task/git-clone-oci-ta/0.1/git-clone-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,10 @@ spec:
env:
- name: IMAGE_EXPIRES_AFTER
value: $(params.ociArtifactExpiresAfter)
computeResources:
limits:
cpu: "1"
memory: 3Gi
requests:
cpu: "1"
memory: 3Gi
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,13 @@ spec:
cachi2 --log-level="$LOG_LEVEL" inject-files /var/workdir/cachi2/output \
--for-output-dir=/cachi2/output
computeResources:
limits:
cpu: "1"
memory: 3Gi
requests:
cpu: "1"
memory: 3Gi
- name: unregister-rhsm
image: quay.io/redhat-appstudio/cachi2:0.15.0@sha256:b141cb5cf4d98e6c5f668f1fe172e1d68f2a44ac1027403fbcff94ce1e68185d
script: |
Expand All @@ -417,3 +424,10 @@ spec:
env:
- name: IMAGE_EXPIRES_AFTER
value: $(params.ociArtifactExpiresAfter)
computeResources:
limits:
cpu: "1"
memory: 3Gi
requests:
cpu: "1"
memory: 3Gi
7 changes: 7 additions & 0 deletions task/prefetch-dependencies/0.1/prefetch-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ spec:
readOnly: true
- mountPath: /activation-key
name: activation-key
computeResources:
limits:
cpu: '1'
memory: 3Gi
requests:
cpu: '1'
memory: 3Gi
script: |
#!/bin/bash
Expand Down

0 comments on commit 52db40e

Please sign in to comment.