From 8f30c30355a5a1b7ca2288485fcbf3d70c5afb4b Mon Sep 17 00:00:00 2001 From: Przemek Pokrywka <12400578+dekiel@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:42:05 +0200 Subject: [PATCH] Remove kyma v1 release jobs. (#11062) Move cleanup jobs to test infra directory. --- .../kyma-components-static-checks.yaml | 2 - .../kyma/kyma-release-pr-image-guard.yaml | 37 ------ .../kyma-project/kyma/kyma-validation.yaml | 117 ------------------ .../kyma/releases/release-cluster.yaml | 117 ------------------ .../kyma-gardener-cleanup.yaml | 0 .../{kyma => test-infra}/periodics.yaml | 0 templates/data/go-toolkit-validation.yaml | 25 ---- templates/data/kyma-validation-data.yaml | 72 ----------- .../kyma-gardener-cleanup-data.yaml | 4 +- 9 files changed, 2 insertions(+), 372 deletions(-) delete mode 100644 prow/jobs/kyma-project/kyma/components/kyma-components-static-checks.yaml delete mode 100644 prow/jobs/kyma-project/kyma/kyma-release-pr-image-guard.yaml delete mode 100644 prow/jobs/kyma-project/kyma/kyma-validation.yaml delete mode 100644 prow/jobs/kyma-project/kyma/releases/release-cluster.yaml rename prow/jobs/kyma-project/{kyma => test-infra}/kyma-gardener-cleanup.yaml (100%) rename prow/jobs/kyma-project/{kyma => test-infra}/periodics.yaml (100%) delete mode 100644 templates/data/go-toolkit-validation.yaml delete mode 100644 templates/data/kyma-validation-data.yaml rename templates/data/{ => test-infra}/kyma-gardener-cleanup-data.yaml (92%) diff --git a/prow/jobs/kyma-project/kyma/components/kyma-components-static-checks.yaml b/prow/jobs/kyma-project/kyma/components/kyma-components-static-checks.yaml deleted file mode 100644 index c67203b5c1c5..000000000000 --- a/prow/jobs/kyma-project/kyma/components/kyma-components-static-checks.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# Code generated by rendertemplates. DO NOT EDIT. - diff --git a/prow/jobs/kyma-project/kyma/kyma-release-pr-image-guard.yaml b/prow/jobs/kyma-project/kyma/kyma-release-pr-image-guard.yaml deleted file mode 100644 index 50737ee3b9f7..000000000000 --- a/prow/jobs/kyma-project/kyma/kyma-release-pr-image-guard.yaml +++ /dev/null @@ -1,37 +0,0 @@ -presubmits: # runs on PRs - kyma-project/kyma: - - name: pre-release-pr-image-guard - annotations: - description: "Check if chart and manifests files use PR images." - owner: "neighbors" - labels: - prow.k8s.io/pubsub.project: "sap-kyma-prow" - prow.k8s.io/pubsub.runID: "pre-release-pr-image-guard" - prow.k8s.io/pubsub.topic: "prowjobs" - always_run: true - skip_report: false - decorate: true - cluster: untrusted-workload - max_concurrency: 10 - branches: - - ^release-.*$ - spec: - containers: - - image: "europe-docker.pkg.dev/kyma-project/prod/testimages/alpine:v20240619-abcecd95" - securityContext: - privileged: false - seccompProfile: - type: RuntimeDefault - allowPrivilegeEscalation: false - command: - - "/bin/ash" - args: - - "-c" - - |- - res=$(grep -e 'version:\s.*[Pp][Rr]-.*' -e 'image:.*:[Pp][Rr]-.*' -e 'tag:\s.*[Pp][Rr]-.*' -r ./resources -r ./tests -B 2) - exit $(echo $res | grep -c -) - resources: - requests: - memory: 3Gi - cpu: 2 - \ No newline at end of file diff --git a/prow/jobs/kyma-project/kyma/kyma-validation.yaml b/prow/jobs/kyma-project/kyma/kyma-validation.yaml deleted file mode 100644 index b922b70bb256..000000000000 --- a/prow/jobs/kyma-project/kyma/kyma-validation.yaml +++ /dev/null @@ -1,117 +0,0 @@ -# Code generated by rendertemplates. DO NOT EDIT. - - -presubmits: # runs on PRs - kyma-project/kyma: - - name: pre-main-kyma-validate-image-definitions - annotations: - description: "validates if all charts use correct image definition format" - owner: "neighbors" - labels: - prow.k8s.io/pubsub.project: "sap-kyma-prow" - prow.k8s.io/pubsub.runID: "pre-main-kyma-validate-image-definitions" - prow.k8s.io/pubsub.topic: "prowjobs" - run_if_changed: '^resources/' - optional: true - skip_report: false - decorate: true - cluster: untrusted-workload - max_concurrency: 10 - branches: - - ^master$ - - ^main$ - extra_refs: - - org: kyma-project - repo: test-infra - base_ref: main - spec: - containers: - - image: "europe-docker.pkg.dev/kyma-project/prod/test-infra/ko/image-url-helper:v20240619-5863afab" - securityContext: - privileged: false - seccompProfile: - type: RuntimeDefault - allowPrivilegeEscalation: false - command: - - "/ko-app/image-url-helper" - args: - - "--resources-directory" - - "/home/prow/go/src/github.com/kyma-project/kyma/resources/" - - "check" - resources: - requests: - memory: 1.5Gi - cpu: 0.8 - - name: pre-main-kyma-validate-image-existence - annotations: - description: "his tool validates if all images defined in charts exist" - owner: "neighbors" - labels: - prow.k8s.io/pubsub.project: "sap-kyma-prow" - prow.k8s.io/pubsub.runID: "pre-main-kyma-validate-image-existence" - prow.k8s.io/pubsub.topic: "prowjobs" - run_if_changed: '^resources/' - optional: true - skip_report: false - decorate: true - cluster: untrusted-workload - max_concurrency: 10 - branches: - - ^master$ - - ^main$ - extra_refs: - - org: kyma-project - repo: test-infra - base_ref: main - spec: - containers: - - image: "europe-docker.pkg.dev/kyma-project/prod/test-infra/ko/image-url-helper:v20240619-5863afab" - securityContext: - privileged: false - seccompProfile: - type: RuntimeDefault - allowPrivilegeEscalation: false - command: - - "/ko-app/image-url-helper" - args: - - "--resources-directory" - - "/home/prow/go/src/github.com/kyma-project/kyma/resources/" - - "missing" - resources: - requests: - memory: 1.5Gi - cpu: 0.8 - - name: pre-main-kyma-validate-dockerfiles - annotations: - description: "Validate Dockerfiles, run hadolint." - owner: "neighbors" - labels: - prow.k8s.io/pubsub.project: "sap-kyma-prow" - prow.k8s.io/pubsub.runID: "pre-main-kyma-validate-dockerfiles" - prow.k8s.io/pubsub.topic: "prowjobs" - run_if_changed: '.*Dockerfile$' - skip_report: false - decorate: true - cluster: untrusted-workload - max_concurrency: 10 - branches: - - ^master$ - - ^main$ - spec: - containers: - - image: "europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-hadolint:v20240619-abcecd95" - securityContext: - privileged: false - seccompProfile: - type: RuntimeDefault - allowPrivilegeEscalation: false - command: - - "/bin/bash" - args: - - "-c" - - "shopt -s globstar; hadolint --config .hadolint.yaml --no-color **/Dockerfile" - resources: - requests: - memory: 1.5Gi - cpu: 0.8 - \ No newline at end of file diff --git a/prow/jobs/kyma-project/kyma/releases/release-cluster.yaml b/prow/jobs/kyma-project/kyma/releases/release-cluster.yaml deleted file mode 100644 index c3adb330c9ea..000000000000 --- a/prow/jobs/kyma-project/kyma/releases/release-cluster.yaml +++ /dev/null @@ -1,117 +0,0 @@ -postsubmits: - kyma-project/kyma: - - name: post-kyma-release-cluster - annotations: - description: "GCP Release cluster job for Kyma" - owner: "neighbors" - labels: - prow.k8s.io/pubsub.project: "sap-kyma-prow" - prow.k8s.io/pubsub.runID: "post-kyma-release-cluster" - prow.k8s.io/pubsub.topic: "prowjobs" - preset-sa-gke-kyma-integration: "true" - preset-gc-project-env: "true" - preset-gc-compute-envs: "true" - preset-cluster-version: "true" - decorate: true - always_run: true - branches: # official regexp https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string - - ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ - cluster: trusted-workload - reporter_config: - slack: - channel: kyma-skr-release - spec: - containers: - - image: "europe-docker.pkg.dev/kyma-project/prod/testimages/e2e-gcloud:v20240619-abcecd95" - securityContext: - privileged: false - seccompProfile: - type: RuntimeDefault - allowPrivilegeEscalation: false - command: ["bash", "-c"] - args: - - |- - set -e - OS="$(uname -s)" - ARCH="$(uname -m)" - curl -Lo kyma.tar.gz "https://github.com/kyma-project/cli/releases/latest/download/kyma_${OS}_${ARCH}.tar.gz" && tar -zxvf kyma.tar.gz && chmod +x ./kyma && rm -f kyma.tar.gz - gcloud auth activate-service-account --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" - CLUSTER_NAME="gke-release-${PULL_BASE_REF//./-}" - echo ">>> create networks for a cluster" - NET_NAME="${CLUSTER_NAME}-net" - SUBNET_NAME="${CLUSTER_NAME}-subnet" - gcloud compute networks create "$NET_NAME" \ - --project="$CLOUDSDK_CORE_PROJECT" \ - --subnet-mode=custom - gcloud compute networks subnets create "$SUBNET_NAME" \ - --network="$NET_NAME" \ - --range=10.0.0.0/22 - echo "Provisioning cluster $CLUSTER_NAME" - NOW="$(date +%s)" - gcloud beta container clusters create "$CLUSTER_NAME" \ - --project="$CLOUDSDK_CORE_PROJECT" \ - --cluster-version="$GKE_CLUSTER_VERSION" \ - --region="$CLOUDSDK_COMPUTE_REGION" \ - --machine-type=n2-standard-4 \ - --num-nodes=1 \ - --security-"group=gke-security-groups@sap.com" \ - --disk-type=pd-ssd \ - --preemptible \ - --labels=created-at=$NOW,ttl=168,volatile=true - - echo ">>> Install Kyma from local sources" - ./kyma deploy --ci \ - --source=local \ - --workspace=. \ - --profile=production \ - --timeout 60m - - echo ">>> create cluster-admin binding for kyma_developers@sap.com" - kubectl create clusterrolebinding kyma_developers --clusterrole cluster-admin --group kyma_developers@sap.com - - echo ">>> generate service account and kubeconfig with cluster-admin rights" - namespace="default" - serviceAccount="admin-user" - secretName="$serviceAccount-secret" - - server="https://$(gcloud container clusters describe "$CLUSTER_NAME" --region "$CLOUDSDK_COMPUTE_REGION" | awk '/endpoint:/ {print $2}')" - kubectl create serviceaccount -n "$namespace" "$serviceAccount" - kubectl apply -f - < kubeconfig - - echo ">>> Publish kubeconfig" - pubsub_message=$(jq -c --null-input "{\"cluster_name\": \"${CLUSTER_NAME}\", \"kyma_version\": \"${PULL_BASE_REF}\", \"kubeconfig\": \"$(cat kubeconfig)\"}") - gcloud pubsub topics publish --project="sap-kyma-prow" "release-cluster-created" --message="${pubsub_message}" diff --git a/prow/jobs/kyma-project/kyma/kyma-gardener-cleanup.yaml b/prow/jobs/kyma-project/test-infra/kyma-gardener-cleanup.yaml similarity index 100% rename from prow/jobs/kyma-project/kyma/kyma-gardener-cleanup.yaml rename to prow/jobs/kyma-project/test-infra/kyma-gardener-cleanup.yaml diff --git a/prow/jobs/kyma-project/kyma/periodics.yaml b/prow/jobs/kyma-project/test-infra/periodics.yaml similarity index 100% rename from prow/jobs/kyma-project/kyma/periodics.yaml rename to prow/jobs/kyma-project/test-infra/periodics.yaml diff --git a/templates/data/go-toolkit-validation.yaml b/templates/data/go-toolkit-validation.yaml deleted file mode 100644 index bf9d3005cb73..000000000000 --- a/templates/data/go-toolkit-validation.yaml +++ /dev/null @@ -1,25 +0,0 @@ -templates: - - from: generic.tmpl - render: - - to: ../../prow/jobs/kyma-project/kyma/components/kyma-components-static-checks.yaml - localSets: - linting: - skip_report: "false" - max_concurrency: "10" - optional: "true" - decorate: "true" - image: "europe-docker.pkg.dev/kyma-project/prod/test-infra/golangci-lint:v20240610-c4997bfe" - pubsub_project: "sap-kyma-prow" - pubsub_topic: "prowjobs" - request_memory: 200Mi - request_cpu: 80m - testing: - skip_report: "false" - max_concurrency: "10" - optional: "true" - decorate: "true" - image: "europe-docker.pkg.dev/kyma-project/prod/testimages/buildpack-go:v20240619-abcecd95" - pubsub_project: "sap-kyma-prow" - pubsub_topic: "prowjobs" - request_memory: 1Gi - request_cpu: 100m diff --git a/templates/data/kyma-validation-data.yaml b/templates/data/kyma-validation-data.yaml deleted file mode 100644 index 1b94c07b0142..000000000000 --- a/templates/data/kyma-validation-data.yaml +++ /dev/null @@ -1,72 +0,0 @@ -templates: - - from: generic.tmpl - render: - - to: ../../prow/jobs/kyma-project/kyma/kyma-validation.yaml - localSets: - smaller_requests: - request_memory: "1.5Gi" - request_cpu: "0.8" - jobConfigs: - - repoName: "github.com/kyma-project/kyma" - jobs: - - jobConfig: - name: "pre-main-kyma-validate-image-definitions" - annotations: - description: "validates if all charts use correct image definition format" - owner: neighbors - run_if_changed: "^resources/" - image: europe-docker.pkg.dev/kyma-project/prod/test-infra/ko/image-url-helper:v20240619-5863afab - command: "/ko-app/image-url-helper" - args: - - --resources-directory - - /home/prow/go/src/github.com/kyma-project/kyma/resources/ - - check - optional: "true" - inheritedConfigs: - global: - - "jobConfig_default" - - "jobConfig_presubmit" - - "extra_refs_test-infra" - local: - - "smaller_requests" - - jobConfig: - name: "pre-main-kyma-validate-image-existence" - annotations: - description: "his tool validates if all images defined in charts exist" - owner: neighbors - run_if_changed: "^resources/" - image: europe-docker.pkg.dev/kyma-project/prod/test-infra/ko/image-url-helper:v20240619-5863afab - command: "/ko-app/image-url-helper" - args: - - --resources-directory - - /home/prow/go/src/github.com/kyma-project/kyma/resources/ - - missing - optional: "true" - inheritedConfigs: - global: - - "jobConfig_default" - - "jobConfig_presubmit" - - "extra_refs_test-infra" - local: - - "smaller_requests" - - jobConfig: - name: "pre-main-kyma-validate-dockerfiles" - annotations: - owner: neighbors - description: "Validate Dockerfiles, run hadolint." - run_if_changed: ".*Dockerfile$" - command: "/bin/bash" - args: - - "-c" - - "shopt -s globstar; - hadolint --config .hadolint.yaml --no-color **/Dockerfile" - image: europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-hadolint:v20240619-abcecd95 - inheritedConfigs: - local: - - "smaller_requests" - global: - - "jobConfig_default" - - "pubsub_labels" - preConfigs: - global: - - "jobConfig_presubmit" diff --git a/templates/data/kyma-gardener-cleanup-data.yaml b/templates/data/test-infra/kyma-gardener-cleanup-data.yaml similarity index 92% rename from templates/data/kyma-gardener-cleanup-data.yaml rename to templates/data/test-infra/kyma-gardener-cleanup-data.yaml index 1aaca287231b..9827e9797c22 100644 --- a/templates/data/kyma-gardener-cleanup-data.yaml +++ b/templates/data/test-infra/kyma-gardener-cleanup-data.yaml @@ -1,7 +1,7 @@ templates: - from: generic.tmpl render: - - to: ../../prow/jobs/kyma-project/kyma/kyma-gardener-cleanup.yaml + - to: ../../prow/jobs/kyma-project/test-infra/kyma-gardener-cleanup.yaml localSets: jobConfig_default: image: europe-docker.pkg.dev/kyma-project/prod/testimages/e2e-garden:v20240619-abcecd95 @@ -33,4 +33,4 @@ templates: - "jobConfig_periodic" - "extra_refs_test-infra" local: - - "jobConfig_default" + - "jobConfig_default" \ No newline at end of file