diff --git a/ci-operator/config/openshift-pipelines-test/openshift_pipelines_ci/OWNERS b/ci-operator/config/openshift-pipelines-test/openshift_pipelines_ci/OWNERS new file mode 100644 index 000000000000..ef1a7a06abd4 --- /dev/null +++ b/ci-operator/config/openshift-pipelines-test/openshift_pipelines_ci/OWNERS @@ -0,0 +1,7 @@ +approvers: +- jhutar +- pmacik +options: {} +reviewers: +- jhutar +- pmacik diff --git a/ci-operator/config/openshift-pipelines-test/openshift_pipelines_ci/openshift-pipelines-test-openshift_pipelines_ci-tests-main.yaml b/ci-operator/config/openshift-pipelines-test/openshift_pipelines_ci/openshift-pipelines-test-openshift_pipelines_ci-tests-main.yaml new file mode 100644 index 000000000000..8f478bd7b0bf --- /dev/null +++ b/ci-operator/config/openshift-pipelines-test/openshift_pipelines_ci/openshift-pipelines-test-openshift_pipelines_ci-tests-main.yaml @@ -0,0 +1,48 @@ +build_root: + image_stream_tag: + name: release + namespace: openshift + tag: golang-1.18 +images: +- dockerfile_literal: |- + FROM src + SHELL ["/bin/bash", "-c"] + + # Install jq, yq, kubectl, help and vcluster + RUN curl -Lso /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && chmod +x /usr/local/bin/jq + RUN curl -Lso /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.25.2/yq_linux_amd64 && chmod +x /usr/local/bin/yq + RUN curl -Lso /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl + RUN yum install -y httpd-tools + RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 700 get_helm.sh && ./get_helm.sh && helm version + RUN curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/download/v0.15.0/vcluster-linux-amd64" && install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster && vcluster --version + from: src + to: pipelines-test-runner +promotion: + name: redhat-appstudio + namespace: ci +releases: + latest: + release: + architecture: amd64 + channel: fast + version: "4.12" +resources: + '*': + limits: + cpu: 1000m + memory: 2Gi + requests: + cpu: 1000m + memory: 2Gi +tests: +- as: ocp-pipelines-load-test-ci-test + steps: + cluster_profile: aws + env: + SCENARIO: test + workflow: openshift-pipelines-test-load-test + timeout: 8h0m0s +zz_generated_metadata: + branch: tests-main + org: openshift-pipelines-test + repo: openshift_pipelines_ci diff --git a/ci-operator/jobs/openshift-pipelines-test/openshift_pipelines_ci/OWNERS b/ci-operator/jobs/openshift-pipelines-test/openshift_pipelines_ci/OWNERS new file mode 100644 index 000000000000..ef1a7a06abd4 --- /dev/null +++ b/ci-operator/jobs/openshift-pipelines-test/openshift_pipelines_ci/OWNERS @@ -0,0 +1,7 @@ +approvers: +- jhutar +- pmacik +options: {} +reviewers: +- jhutar +- pmacik diff --git a/ci-operator/jobs/openshift-pipelines-test/openshift_pipelines_ci/openshift-pipelines-test-openshift_pipelines_ci-tests-main-postsubmits.yaml b/ci-operator/jobs/openshift-pipelines-test/openshift_pipelines_ci/openshift-pipelines-test-openshift_pipelines_ci-tests-main-postsubmits.yaml new file mode 100644 index 000000000000..e59591e782c5 --- /dev/null +++ b/ci-operator/jobs/openshift-pipelines-test/openshift_pipelines_ci/openshift-pipelines-test-openshift_pipelines_ci-tests-main-postsubmits.yaml @@ -0,0 +1,62 @@ +postsubmits: + openshift-pipelines-test/openshift_pipelines_ci: + - agent: kubernetes + always_run: true + branches: + - ^tests-main$ + cluster: build03 + decorate: true + decoration_config: + skip_cloning: true + labels: + ci-operator.openshift.io/is-promotion: "true" + ci.openshift.io/generator: prowgen + max_concurrency: 1 + name: branch-ci-openshift-pipelines-test-openshift_pipelines_ci-tests-main-images + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --image-mirror-push-secret=/etc/push-secret/.dockerconfigjson + - --promote + - --report-credentials-file=/etc/report/credentials + - --target=[images] + command: + - ci-operator + image: ci-operator:latest + imagePullPolicy: Always + name: "" + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/push-secret + name: push-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: push-secret + secret: + secretName: registry-push-credentials-ci-central + - name: result-aggregator + secret: + secretName: result-aggregator diff --git a/ci-operator/jobs/openshift-pipelines-test/openshift_pipelines_ci/openshift-pipelines-test-openshift_pipelines_ci-tests-main-presubmits.yaml b/ci-operator/jobs/openshift-pipelines-test/openshift_pipelines_ci/openshift-pipelines-test-openshift_pipelines_ci-tests-main-presubmits.yaml new file mode 100644 index 000000000000..77b62079cc8b --- /dev/null +++ b/ci-operator/jobs/openshift-pipelines-test/openshift_pipelines_ci/openshift-pipelines-test-openshift_pipelines_ci-tests-main-presubmits.yaml @@ -0,0 +1,138 @@ +presubmits: + openshift-pipelines-test/openshift_pipelines_ci: + - agent: kubernetes + always_run: true + branches: + - ^tests-main$ + - ^tests-main- + cluster: build03 + context: ci/prow/images + decorate: true + decoration_config: + skip_cloning: true + labels: + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-openshift-pipelines-test-openshift_pipelines_ci-tests-main-images + rerun_command: /test images + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=[images] + command: + - ci-operator + image: ci-operator:latest + imagePullPolicy: Always + name: "" + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )images,?($|\s.*) + - agent: kubernetes + always_run: true + branches: + - ^tests-main$ + - ^tests-main- + cluster: build05 + context: ci/prow/ocp-pipelines-load-test-ci-test + decorate: true + decoration_config: + skip_cloning: true + timeout: 8h0m0s + labels: + ci-operator.openshift.io/cloud: aws + ci-operator.openshift.io/cloud-cluster-profile: aws + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-openshift-pipelines-test-openshift_pipelines_ci-tests-main-ocp-pipelines-load-test-ci-test + rerun_command: /test ocp-pipelines-load-test-ci-test + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --lease-server-credentials-file=/etc/boskos/credentials + - --report-credentials-file=/etc/report/credentials + - --secret-dir=/secrets/ci-pull-credentials + - --secret-dir=/usr/local/ocp-pipelines-load-test-ci-test-cluster-profile + - --target=ocp-pipelines-load-test-ci-test + command: + - ci-operator + image: ci-operator:latest + imagePullPolicy: Always + name: "" + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /etc/boskos + name: boskos + readOnly: true + - mountPath: /secrets/ci-pull-credentials + name: ci-pull-credentials + readOnly: true + - mountPath: /usr/local/ocp-pipelines-load-test-ci-test-cluster-profile + name: cluster-profile + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: boskos + secret: + items: + - key: credentials + path: credentials + secretName: boskos-credentials + - name: ci-pull-credentials + secret: + secretName: ci-pull-credentials + - name: cluster-profile + secret: + secretName: cluster-secrets-aws + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )ocp-pipelines-load-test-ci-test,?($|\s.*) diff --git a/ci-operator/step-registry/openshift-pipelines-test/OWNERS b/ci-operator/step-registry/openshift-pipelines-test/OWNERS new file mode 100644 index 000000000000..ef1a7a06abd4 --- /dev/null +++ b/ci-operator/step-registry/openshift-pipelines-test/OWNERS @@ -0,0 +1,7 @@ +approvers: +- jhutar +- pmacik +options: {} +reviewers: +- jhutar +- pmacik diff --git a/ci-operator/step-registry/openshift-pipelines-test/load-test/OWNERS b/ci-operator/step-registry/openshift-pipelines-test/load-test/OWNERS new file mode 100644 index 000000000000..ef1a7a06abd4 --- /dev/null +++ b/ci-operator/step-registry/openshift-pipelines-test/load-test/OWNERS @@ -0,0 +1,7 @@ +approvers: +- jhutar +- pmacik +options: {} +reviewers: +- jhutar +- pmacik diff --git a/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-commands.sh b/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-commands.sh new file mode 100755 index 000000000000..67af999cdf25 --- /dev/null +++ b/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-commands.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +set -o nounset +set -o errexit +set -o pipefail + +TEST=$(cat /usr/local/ci-secrets/redhat-appstudio-load-test/quay-oauth-user) +OPENSHIFT_API="$(yq e '.clusters[0].cluster.server' "$KUBECONFIG")" +OPENSHIFT_USERNAME="kubeadmin" + +export OPENSHIFT_PASSWORD +export BYOC_KUBECONFIG + +export TEST +export OPENSHIFT_API +export OPENSHIFT_USERNAME + +echo -e "[INFO] Start tests with user: ${GITHUB_USER}" + +yq -i 'del(.clusters[].cluster.certificate-authority-data) | .clusters[].cluster.insecure-skip-tls-verify=true' "$KUBECONFIG" +if [[ -s "$KUBEADMIN_PASSWORD_FILE" ]]; then + OPENSHIFT_PASSWORD="$(cat "$KUBEADMIN_PASSWORD_FILE")" +elif [[ -s "${SHARED_DIR}/kubeadmin-password" ]]; then + # Recommendation from hypershift qe team in slack channel.. + OPENSHIFT_PASSWORD="$(cat "${SHARED_DIR}/kubeadmin-password")" +else + echo "Kubeadmin password file is empty... Aborting job" + exit 1 +fi + +timeout --foreground 5m bash <<-"EOF" + while ! oc login "$OPENSHIFT_API" -u "$OPENSHIFT_USERNAME" -p "$OPENSHIFT_PASSWORD" --insecure-skip-tls-verify=true; do + sleep 20 + done +EOF +if [ $? -ne 0 ]; then + echo "Timed out waiting for login" + exit 1 +fi + +# Define a new environment for BYOC pointing to a kubeconfig with token. RHTAP environments only supports kubeconfig with token: +# See: https://issues.redhat.com/browse/GITOPSRVCE-554 +BYOC_KUBECONFIG="/tmp/token-kubeconfig" +cp "$KUBECONFIG" "$BYOC_KUBECONFIG" +if [[ -s "$BYOC_KUBECONFIG" ]]; then + echo -e "byoc kubeconfig exists!" +else + echo "Kubeconfig not exists in $BYOC_KUBECONFIG... Aborting job" + exit 1 +fi + +cd "$(mktemp -d)" + +git clone --branch main "https://github.com/openshift-pipelines-test/openshift_pipelines_ci.git" + +# Collect load test results at the end +trap './ci-scripts/collect-results.sh "$SCENARIO"; trap EXIT' SIGINT EXIT + +# Setup Tekton cluster +./ci-scripts/setup-cluster.sh + +# Execute load test +./ci-scripts/load-test.sh diff --git a/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-ref.metadata.json b/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-ref.metadata.json new file mode 100644 index 000000000000..8f686baa3a5c --- /dev/null +++ b/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-ref.metadata.json @@ -0,0 +1,13 @@ +{ + "path": "openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-ref.yaml", + "owners": { + "approvers": [ + "jhutar", + "pmacik" + ], + "reviewers": [ + "jhutar", + "pmacik" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-ref.yaml b/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-ref.yaml new file mode 100644 index 000000000000..78f830006628 --- /dev/null +++ b/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-ref.yaml @@ -0,0 +1,26 @@ +ref: + as: openshift-pipelines-test-load-test + best_effort: true + grace_period: 300s + cli: latest + timeout: 8h0m0s + commands: openshift-pipelines-test-load-test-commands.sh + env: + - name: SCENARIO + default: "concurrent" + documentation: Load test scenario to execute. + credentials: + - mount_path: /usr/local/ci-secrets/redhat-appstudio-qe + name: ci-secrets + namespace: test-credentials + - mount_path: /usr/local/ci-secrets/redhat-appstudio-load-test + name: rhtap-load-test + namespace: test-credentials + from_image: + name: redhat-appstudio + namespace: ci + tag: e2e-test-runner + resources: + requests: + cpu: 3000m + memory: 6Gi diff --git a/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-workflow.metadata.json b/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-workflow.metadata.json new file mode 100644 index 000000000000..02f71a7e9126 --- /dev/null +++ b/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-workflow.metadata.json @@ -0,0 +1,13 @@ +{ + "path": "openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-workflow.yaml", + "owners": { + "approvers": [ + "jhutar", + "pmacik" + ], + "reviewers": [ + "jhutar", + "pmacik" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-workflow.yaml b/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-workflow.yaml new file mode 100644 index 000000000000..697ec2f3dfd0 --- /dev/null +++ b/ci-operator/step-registry/openshift-pipelines-test/load-test/openshift-pipelines-test-load-test-workflow.yaml @@ -0,0 +1,19 @@ +workflow: + as: openshift-pipelines-test-load-test + steps: + env: + COMPUTE_NODE_REPLICAS: "3" + COMPUTE_NODE_TYPE: m6a.2xlarge + CONTROL_PLANE_INSTANCE_TYPE: m6a.2xlarge + pre: + - chain: ipi-aws-pre + test: + - ref: openshift-pipelines-test-load-test + timeout: 8h0m0s + resources: + requests: + cpu: 3000m + memory: 6Gi + post: + - ref: redhat-appstudio-gather + - chain: ipi-aws-post diff --git a/core-services/prow/02_config/openshift-pipelines-test/openshift_pipelines_ci/OWNERS b/core-services/prow/02_config/openshift-pipelines-test/openshift_pipelines_ci/OWNERS new file mode 100644 index 000000000000..affc768252a0 --- /dev/null +++ b/core-services/prow/02_config/openshift-pipelines-test/openshift_pipelines_ci/OWNERS @@ -0,0 +1,13 @@ +# DO NOT EDIT; this file is auto-generated using https://github.com/openshift/ci-tools. +# Fetched from https://github.com/redhat-appstudio/e2e-tests root OWNERS +# If the repo had OWNERS_ALIASES then the aliases were expanded +# Logins who are not members of 'openshift' organization were filtered out +# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md + +approvers: +- jhutar +- pmacik +options: {} +reviewers: +- jhutar +- pmacik diff --git a/core-services/prow/02_config/openshift-pipelines-test/openshift_pipelines_ci/_pluginconfig.yaml b/core-services/prow/02_config/openshift-pipelines-test/openshift_pipelines_ci/_pluginconfig.yaml new file mode 100644 index 000000000000..9c773fbd37ce --- /dev/null +++ b/core-services/prow/02_config/openshift-pipelines-test/openshift_pipelines_ci/_pluginconfig.yaml @@ -0,0 +1,67 @@ +approve: +- commandHelpLink: "" + repos: + - openshift-pipelines-test/openshift_pipelines_ci + require_self_approval: false +external_plugins: + openshift-pipelines-test/openshift_pipelines_ci: + - endpoint: http://refresh + events: + - issue_comment + name: refresh + - endpoint: http://cherrypick + events: + - issue_comment + - pull_request + name: cherrypick + - endpoint: http://needs-rebase + events: + - issue_comment + - pull_request + name: needs-rebase + - endpoint: http://backport-verifier + events: + - issue_comment + - pull_request + name: backport-verifier + - endpoint: http://payload-testing-prow-plugin + events: + - issue_comment + name: payload-testing-prow-plugin + - endpoint: http://jira-lifecycle-plugin + events: + - issue_comment + - pull_request + name: jira-lifecycle-plugin +lgtm: +- repos: + - openshift-pipelines-test/openshift_pipelines_ci + review_acts_as_lgtm: true +plugins: + openshift-pipelines-test/openshift_pipelines_ci: + plugins: + - assign + - blunderbuss + - cat + - dog + - heart + - golint + - goose + - help + - hold + - jira + - label + - lgtm + - lifecycle + - override + - pony + - retitle + - shrug + - sigmention + - skip + - trigger + - verify-owners + - owners-label + - wip + - yuks + - approve diff --git a/core-services/prow/02_config/openshift-pipelines-test/openshift_pipelines_ci/_prowconfig.yaml b/core-services/prow/02_config/openshift-pipelines-test/openshift_pipelines_ci/_prowconfig.yaml new file mode 100644 index 000000000000..6d0e0f6fe72d --- /dev/null +++ b/core-services/prow/02_config/openshift-pipelines-test/openshift_pipelines_ci/_prowconfig.yaml @@ -0,0 +1,14 @@ +tide: + queries: + - labels: + - approved + - lgtm + missingLabels: + - backports/unvalidated-commits + - do-not-merge/hold + - do-not-merge/invalid-owners-file + - do-not-merge/work-in-progress + - jira/invalid-bug + - needs-rebase + repos: + - openshift-pipelines-test/openshift_pipelines_ci