From 6b00ac3819ab88fbfb3ffe9c8ea3fa1826b5732f Mon Sep 17 00:00:00 2001 From: Alex Pavel Date: Wed, 3 Jun 2020 11:46:58 -0700 Subject: [PATCH] config: add periodic job that runs upgrades using multistage tests --- .../openshift-release-master__ocp-4.5-ci.yaml | 28 +++++++ .../openshift-release-master-periodics.yaml | 81 +++++++++++++++++++ .../ipi/conf/aws/ipi-conf-aws-ref.yaml | 5 +- .../ipi/conf/ipi-conf-commands.sh | 2 - .../step-registry/ipi/conf/ipi-conf-ref.yaml | 5 +- .../install/ipi-install-install-commands.sh | 7 +- .../install/ipi-install-install-ref.yaml | 3 + .../e2e/test/openshift-e2e-test-commands.sh | 25 ++++-- .../e2e/test/openshift-e2e-test-ref.yaml | 3 + 9 files changed, 147 insertions(+), 12 deletions(-) create mode 100644 ci-operator/config/openshift/release/openshift-release-master__ocp-4.5-ci.yaml diff --git a/ci-operator/config/openshift/release/openshift-release-master__ocp-4.5-ci.yaml b/ci-operator/config/openshift/release/openshift-release-master__ocp-4.5-ci.yaml new file mode 100644 index 0000000000000..73b881d73c385 --- /dev/null +++ b/ci-operator/config/openshift/release/openshift-release-master__ocp-4.5-ci.yaml @@ -0,0 +1,28 @@ +releases: + initial: + release: + channel: stable + version: "4.4" + latest: + candidate: + product: ocp + stream: ci + version: "4.5" +resources: + '*': + requests: + cpu: 100m + memory: 200Mi +tests: +- as: e2e-upgrade-informer + cron: 0 */6 * * * + steps: + cluster_profile: aws + env: + OPENSHIFT_UPGRADE: "true" + workflow: openshift-e2e-aws +zz_generated_metadata: + branch: master + org: openshift + repo: release + variant: ocp-4.5-ci diff --git a/ci-operator/jobs/openshift/release/openshift-release-master-periodics.yaml b/ci-operator/jobs/openshift/release/openshift-release-master-periodics.yaml index 4b873f5e28b2a..b9554b19e838d 100644 --- a/ci-operator/jobs/openshift/release/openshift-release-master-periodics.yaml +++ b/ci-operator/jobs/openshift/release/openshift-release-master-periodics.yaml @@ -248,6 +248,87 @@ periodics: - name: result-aggregator secret: secretName: result-aggregator +- agent: kubernetes + cluster: api.ci + cron: 0 */6 * * * + decorate: true + decoration_config: + skip_cloning: true + extra_refs: + - base_ref: master + org: openshift + repo: release + labels: + ci-operator.openshift.io/prowgen-controlled: "true" + ci-operator.openshift.io/variant: ocp-4.5-ci + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: periodic-ci-openshift-release-master-ocp-4.5-ci-e2e-upgrade-informer + spec: + containers: + - args: + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --kubeconfig=/etc/apici/kubeconfig + - --lease-server-password-file=/etc/boskos/password + - --report-password-file=/etc/report/password.txt + - --report-username=ci + - --secret-dir=/secrets/ci-pull-credentials + - --secret-dir=/usr/local/e2e-upgrade-informer-cluster-profile + - --target=e2e-upgrade-informer + - --variant=ocp-4.5-ci + command: + - ci-operator + image: ci-operator:latest + imagePullPolicy: Always + name: "" + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /etc/apici + name: apici-ci-operator-credentials + readOnly: true + - mountPath: /etc/boskos + name: boskos + readOnly: true + - mountPath: /secrets/ci-pull-credentials + name: ci-pull-credentials + readOnly: true + - mountPath: /usr/local/e2e-upgrade-informer-cluster-profile + name: cluster-profile + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: apici-ci-operator-credentials + secret: + items: + - key: sa.ci-operator.apici.config + path: kubeconfig + secretName: apici-ci-operator-credentials + - name: boskos + secret: + items: + - key: password + path: password + secretName: boskos-credentials + - name: ci-pull-credentials + secret: + secretName: ci-pull-credentials + - name: cluster-profile + projected: + sources: + - secret: + name: cluster-secrets-aws + - name: pull-secret + secret: + secretName: regcred + - name: result-aggregator + secret: + secretName: result-aggregator - agent: kubernetes cluster: api.ci cron: 0 0 * * 1 diff --git a/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-ref.yaml b/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-ref.yaml index cdf1d2e3f183c..dbefb55d9f6ab 100644 --- a/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-ref.yaml +++ b/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-ref.yaml @@ -1,6 +1,9 @@ ref: as: ipi-conf-aws - from: base + from_image: + namespace: origin + name: centos + tag: '8' commands: ipi-conf-aws-commands.sh resources: requests: diff --git a/ci-operator/step-registry/ipi/conf/ipi-conf-commands.sh b/ci-operator/step-registry/ipi/conf/ipi-conf-commands.sh index 95d353145d53f..26b45b6583e19 100755 --- a/ci-operator/step-registry/ipi/conf/ipi-conf-commands.sh +++ b/ci-operator/step-registry/ipi/conf/ipi-conf-commands.sh @@ -13,8 +13,6 @@ if [[ -z "$RELEASE_IMAGE_LATEST" ]]; then exit 1 fi -echo "Installing from release ${RELEASE_IMAGE_LATEST}" - ssh_pub_key=$(<"${CLUSTER_PROFILE_DIR}/ssh-publickey") pull_secret=$(<"${CLUSTER_PROFILE_DIR}/pull-secret") diff --git a/ci-operator/step-registry/ipi/conf/ipi-conf-ref.yaml b/ci-operator/step-registry/ipi/conf/ipi-conf-ref.yaml index 5379dac28d44f..0ecd76dd04a37 100644 --- a/ci-operator/step-registry/ipi/conf/ipi-conf-ref.yaml +++ b/ci-operator/step-registry/ipi/conf/ipi-conf-ref.yaml @@ -1,6 +1,9 @@ ref: as: ipi-conf - from: base + from_image: + namespace: origin + name: centos + tag: '8' commands: ipi-conf-commands.sh resources: requests: diff --git a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh index 7ec20a7fc0b54..726fcd82798c3 100755 --- a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh +++ b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh @@ -13,7 +13,12 @@ fi export SSH_PRIV_KEY_PATH=${CLUSTER_PROFILE_DIR}/ssh-privatekey export PULL_SECRET_PATH=${CLUSTER_PROFILE_DIR}/pull-secret -export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=${RELEASE_IMAGE_LATEST} +if [[ "${OPENSHIFT_UPGRADE:-false}" == "false" ]]; then + export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=${RELEASE_IMAGE_LATEST} +else + export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=${RELEASE_IMAGE_INITIAL} +fi +echo "Installing from release ${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE}" export OPENSHIFT_INSTALL_INVOKER=openshift-internal-ci/${JOB_NAME}/${BUILD_ID} export HOME=/tmp diff --git a/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml b/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml index 67eebe50f90d2..d9f2c955318de 100644 --- a/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml +++ b/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml @@ -6,5 +6,8 @@ ref: requests: cpu: 1000m memory: 2Gi + env: + - name: OPENSHIFT_UPGRADE + default: "false" documentation: |- The IPI install step runs the OpenShift Installer in order to bring up an OpenShift cluster, using the provided cluster profile to choose a target IaaS platform. Anything that needs to be configured using manifests should generate them before this step and put them in the SHARED_DIR with the filename manifest_(manifest_name).yml so that this step can pull in the manifest in. diff --git a/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-commands.sh b/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-commands.sh index c641265e03fd1..c49676e8c93b4 100644 --- a/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-commands.sh +++ b/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-commands.sh @@ -62,12 +62,23 @@ if [[ "${CLUSTER_TYPE}" == gcp ]]; then popd fi -test_suite=openshift/conformance/parallel -if [[ -e "${SHARED_DIR}/test-suite.txt" ]]; then - test_suite=$(<"${SHARED_DIR}/test-suite.txt") -fi - -openshift-tests run "${test_suite}" \ - --provider "${TEST_PROVIDER}" \ +if [[ "${OPENSHIFT_UPGRADE:-false}" == "false" ]]; then + test_suite=openshift/conformance/parallel + if [[ -e "${SHARED_DIR}/test-suite.txt" ]]; then + test_suite=$(<"${SHARED_DIR}/test-suite.txt") + fi + openshift-tests run "${test_suite}" \ + --provider "${TEST_PROVIDER}" \ + -o /tmp/artifacts/e2e.log \ + --junit-dir /tmp/artifacts/junit +else + test_suite=all + if [[ -e "${SHARED_DIR}/test-suite.txt" ]]; then + test_suite=$(<"${SHARED_DIR}/test-suite.txt") + fi + openshift-tests run-upgrade "${test_suite}" \ + --to-image "${IMAGE:-${RELEASE_IMAGE_LATEST}}" \ + --provider "${TEST_PROVIDER:-}" \ -o /tmp/artifacts/e2e.log \ --junit-dir /tmp/artifacts/junit +fi diff --git a/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-ref.yaml b/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-ref.yaml index 60329d4e34d8a..511d14316aa87 100644 --- a/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-ref.yaml +++ b/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-ref.yaml @@ -8,5 +8,8 @@ ref: memory: 600Mi limits: memory: 4Gi + env: + - name: OPENSHIFT_UPGRADE + default: "false" documentation: |- The Openshift E2E step executes the common end-to-end test suite.