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 bce5491
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion task-generator/trusted-artifacts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/tektoncd/pipeline v0.66.0
github.com/zregvart/tkn-fmt v0.0.0-20240614122620-a2995427266c
k8s.io/api v0.30.1
k8s.io/apimachinery v0.30.1
mvdan.cc/sh/v3 v3.10.0
sigs.k8s.io/kustomize/api v0.18.0
sigs.k8s.io/kustomize/kyaml v0.18.1
Expand Down Expand Up @@ -87,7 +88,6 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apimachinery v0.30.1 // indirect
k8s.io/client-go v0.30.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a // indirect
Expand Down
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 bce5491

Please sign in to comment.