From 9760729567beda621b8d8207f2f591943d54078f Mon Sep 17 00:00:00 2001 From: Sajia Zafreen <42818305+zafs23@users.noreply.github.com> Date: Wed, 6 Sep 2023 09:57:08 -0700 Subject: [PATCH] Request ephemeral storage to run 1-28-test-presubmit on fargate (#537) * Move 1-28-test-presubmit to presubmit cluster * Test ephemeral storage to run 1-28-test-presubmit on fargate * edit indent * increase ephemeral storage --- .../eks-distro/kubernetes-1-28-test-presubmits.yaml | 13 ++++++------- linter/main.go | 9 --------- .../eks-distro/kubernetes-1-X-test-presubmits.yaml | 9 ++++++--- templater/jobs/types/types.go | 5 +++-- templater/templates/presubmits.yaml | 3 +++ 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/jobs/aws/eks-distro/kubernetes-1-28-test-presubmits.yaml b/jobs/aws/eks-distro/kubernetes-1-28-test-presubmits.yaml index 3a9aae69e..b76bab62f 100644 --- a/jobs/aws/eks-distro/kubernetes-1-28-test-presubmits.yaml +++ b/jobs/aws/eks-distro/kubernetes-1-28-test-presubmits.yaml @@ -24,20 +24,18 @@ presubmits: always_run: false run_if_changed: "projects/kubernetes/kubernetes/1-28/(GIT_TAG|patches)" max_concurrency: 10 - cluster: "prow-postsubmits-cluster" + cluster: "prow-presubmits-cluster" skip_report: false decoration_config: gcs_configuration: - bucket: s3://prowdataclusterstack-316434458-prowbucket7c73355c-1n9f9v93wpjcm + bucket: s3://prowpresubmitsdataclusterstack-prowbucket7c73355c-vfwwxd2eb4gp path_strategy: explicit s3_credentials_secret: s3-credentials labels: disk-usage: "true" spec: - serviceaccountName: postsubmits-build-account + serviceaccountName: presubmits-build-account automountServiceAccountToken: false - nodeSelector: - arch: AMD64 containers: - name: build-container image: public.ecr.aws/eks-distro-build-tooling/builder-base:standard-db4232c256f3148b52205cce52f15716beec4011.2 @@ -55,8 +53,9 @@ presubmits: value: "1-28" resources: requests: - memory: "16Gi" - cpu: "4" + memory: "32Gi" + cpu: "16" + ephemeralStorage: "50Gi" - command: - sh args: diff --git a/linter/main.go b/linter/main.go index fcd089069..c47704d96 100644 --- a/linter/main.go +++ b/linter/main.go @@ -124,9 +124,6 @@ func PresubmitBucketCheck(jc *JobConstants) presubmitCheck { if strings.Contains(presubmitConfig.JobBase.Name, "kubernetes-1-27-test-presubmit") { return true, 0, "" } - if strings.Contains(presubmitConfig.JobBase.Name, "kubernetes-1-28-test-presubmit") { - return true, 0, "" - } if presubmitConfig.JobBase.UtilityConfig.DecorationConfig.GCSConfiguration.Bucket != jc.Bucket { return false, findLineNumber(fileContentsString, "bucket:"), fmt.Sprintf(`Incorrect bucket configuration, please configure S3 bucket as => bucket: %s`, jc.Bucket) } @@ -151,9 +148,6 @@ func PresubmitClusterCheck(jc *JobConstants) presubmitCheck { if strings.Contains(presubmitConfig.JobBase.Name, "kubernetes-1-27-test-presubmit") { return true, 0, "" } - if strings.Contains(presubmitConfig.JobBase.Name, "kubernetes-1-28-test-presubmit") { - return true, 0, "" - } if presubmitConfig.JobBase.Cluster != jc.Cluster { return false, findLineNumber(fileContentsString, "cluster:"), fmt.Sprintf(`Incorrect cluster configuration, please configure cluster as => cluster: "%s"`, jc.Cluster) } @@ -178,9 +172,6 @@ func PresubmitServiceAccountCheck(jc *JobConstants) presubmitCheck { if strings.Contains(presubmitConfig.JobBase.Name, "kubernetes-1-27-test-presubmit") { return true, 0, "" } - if strings.Contains(presubmitConfig.JobBase.Name, "kubernetes-1-28-test-presubmit") { - return true, 0, "" - } if presubmitConfig.JobBase.Spec.ServiceAccountName != jc.ServiceAccountName { return false, findLineNumber(fileContentsString, "serviceaccountName:"), fmt.Sprintf(`Incorrect service account configuration, please configure service account as => serviceaccountName: %s`, jc.ServiceAccountName) } diff --git a/templater/jobs/presubmit/eks-distro/kubernetes-1-X-test-presubmits.yaml b/templater/jobs/presubmit/eks-distro/kubernetes-1-X-test-presubmits.yaml index 39a583511..bda920636 100755 --- a/templater/jobs/presubmit/eks-distro/kubernetes-1-X-test-presubmits.yaml +++ b/templater/jobs/presubmit/eks-distro/kubernetes-1-X-test-presubmits.yaml @@ -9,7 +9,7 @@ envVars: # The following `if` block is a temp solution while awaiting more storage in presubmits from Fargate team. # Once we have more space available we should move this back to the presubmit cluster -{{if or (eq .releaseBranch "1-27") (eq .releaseBranch "1-28")}} +{{ if eq .releaseBranch "1-27" }} architecture: AMD64 cluster: prow-postsubmits-cluster resources: @@ -19,7 +19,7 @@ resources: requests: cpu: 4 memory: 16Gi -{{else}} +{{ else }} resources: limits: cpu: 16 @@ -27,4 +27,7 @@ resources: requests: cpu: 16 memory: 32Gi -{{end}} + {{ if eq .releaseBranch "1-28" }} + ephemeralStorage: "50Gi" + {{ end }} +{{ end }} diff --git a/templater/jobs/types/types.go b/templater/jobs/types/types.go index d3998c0ed..ec543d707 100644 --- a/templater/jobs/types/types.go +++ b/templater/jobs/types/types.go @@ -17,8 +17,9 @@ type Resources struct { } type ResourceConfig struct { - CPU string `json:"cpu,omitempty"` - Memory string `json:"memory,omitempty"` + CPU string `json:"cpu,omitempty"` + Memory string `json:"memory,omitempty"` + EphemeralStorage string `json:"ephemeralStorage,omitempty"` } type HostPath struct { diff --git a/templater/templates/presubmits.yaml b/templater/templates/presubmits.yaml index e21358693..0c4c274e5 100644 --- a/templater/templates/presubmits.yaml +++ b/templater/templates/presubmits.yaml @@ -116,6 +116,9 @@ presubmits: requests: memory: "{{ .resources.Requests.Memory }}" cpu: "{{ .resources.Requests.CPU }}" + {{- if .resources.Requests.EphemeralStorage }} + ephemeralStorage: "{{ .resources.Requests.EphemeralStorage }}" + {{- end }} {{- end }} {{- end }} {{- if .volumeMounts }}