diff --git a/ci-operator/config/openshift/installer/openshift-installer-master.yaml b/ci-operator/config/openshift/installer/openshift-installer-master.yaml index 6bba1be2c0a94..70f82e57c9874 100644 --- a/ci-operator/config/openshift/installer/openshift-installer-master.yaml +++ b/ci-operator/config/openshift/installer/openshift-installer-master.yaml @@ -198,7 +198,6 @@ tests: openshift_installer_upi: cluster_profile: vsphere - as: e2e-steps - commands: "" steps: cluster_profile: aws - workflow: ipi + workflow: origin-e2e diff --git a/ci-operator/step-registry/origin/OWNERS b/ci-operator/step-registry/origin/OWNERS new file mode 100644 index 0000000000000..f14198cff70e7 --- /dev/null +++ b/ci-operator/step-registry/origin/OWNERS @@ -0,0 +1,11 @@ +approvers: +- smarterclayton +- wking +- stevekuznetsov +- vrutkovs +- abhinavdahiya +- deads2k +- crawford +- ewolinetz +- csrwng +- staebler diff --git a/ci-operator/step-registry/origin/e2e/OWNERS b/ci-operator/step-registry/origin/e2e/OWNERS new file mode 100644 index 0000000000000..f14198cff70e7 --- /dev/null +++ b/ci-operator/step-registry/origin/e2e/OWNERS @@ -0,0 +1,11 @@ +approvers: +- smarterclayton +- wking +- stevekuznetsov +- vrutkovs +- abhinavdahiya +- deads2k +- crawford +- ewolinetz +- csrwng +- staebler diff --git a/ci-operator/step-registry/origin/e2e/origin-e2e-workflow.yaml b/ci-operator/step-registry/origin/e2e/origin-e2e-workflow.yaml new file mode 100644 index 0000000000000..c63580da951ce --- /dev/null +++ b/ci-operator/step-registry/origin/e2e/origin-e2e-workflow.yaml @@ -0,0 +1,12 @@ +workflow: + as: origin-e2e + steps: + pre: + - ref: ipi-conf + - chain: ipi-install + test: + - ref: origin-e2e-test + post: + - chain: ipi-deprovision + documentation: |- + The Origin E2E workflow executes the common end-to-end test suite. diff --git a/ci-operator/step-registry/origin/e2e/test/OWNERS b/ci-operator/step-registry/origin/e2e/test/OWNERS new file mode 100644 index 0000000000000..f14198cff70e7 --- /dev/null +++ b/ci-operator/step-registry/origin/e2e/test/OWNERS @@ -0,0 +1,11 @@ +approvers: +- smarterclayton +- wking +- stevekuznetsov +- vrutkovs +- abhinavdahiya +- deads2k +- crawford +- ewolinetz +- csrwng +- staebler diff --git a/ci-operator/step-registry/origin/e2e/test/origin-e2e-test-commands.sh b/ci-operator/step-registry/origin/e2e/test/origin-e2e-test-commands.sh new file mode 100644 index 0000000000000..465112596b74e --- /dev/null +++ b/ci-operator/step-registry/origin/e2e/test/origin-e2e-test-commands.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +set -o nounset +set -o errexit +set -o pipefail + +cluster_profile=/var/run/secrets/ci.openshift.io/cluster-profile +export AWS_SHARED_CREDENTIALS_FILE=${cluster_profile}/.awscred +export AZURE_AUTH_LOCATION=${cluster_profile}/osServicePrincipal.json +export GCP_SHARED_CREDENTIALS_FILE=${cluster_profile}/gce.json +export HOME=/tmp/home +export PATH=/usr/libexec/origin:$PATH + +trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM + +mkdir -p "${HOME}" + +# if the cluster profile included an insights secret, install it to the cluster to +# report support data from the support-operator +if [[ -f "${cluster_profile}/insights-live.yaml" ]]; then + oc create -f "${cluster_profile}/insights-live.yaml" || true +fi + +# set up cloud-provider-specific env vars +KUBE_SSH_BASTION="$( oc --insecure-skip-tls-verify get node -l node-role.kubernetes.io/master -o 'jsonpath={.items[0].status.addresses[?(@.type=="ExternalIP")].address}' ):22" +KUBE_SSH_KEY_PATH=${cluster_profile}/ssh-privatekey +export KUBE_SSH_BASTION KUBE_SSH_KEY_PATH +case "${CLUSTER_TYPE}" in +gcp) + export GOOGLE_APPLICATION_CREDENTIALS="${GCP_SHARED_CREDENTIALS_FILE}" + export KUBE_SSH_USER=core + mkdir -p ~/.ssh + cp "${cluster_profile}/ssh-privatekey" ~/.ssh/google_compute_engine || true + export TEST_PROVIDER='{"type":"gce","region":"us-east1","multizone": true,"multimaster":true,"projectid":"openshift-gce-devel-ci"}' + ;; +aws) + mkdir -p ~/.ssh + cp "${cluster_profile}/ssh-privatekey" ~/.ssh/kube_aws_rsa || true + export PROVIDER_ARGS="-provider=aws -gce-zone=us-east-1" + # TODO: make openshift-tests auto-discover this from cluster config + REGION="$(oc get -o jsonpath='{.status.platformStatus.aws.region}' infrastructure cluster)" + ZONE="$(oc get -o jsonpath='{.items[0].metadata.labels.failure-domain\.beta\.kubernetes\.io/zone}' nodes)" + export TEST_PROVIDER="{\"type\":\"aws\",\"region\":\"${REGION}\",\"zone\":\"${ZONE}\",\"multizone\":true,\"multimaster\":true}" + export KUBE_SSH_USER=core + ;; +azure4) export TEST_PROVIDER=azure;; +*) echo >&2 "Unsupported cluster type '${CLUSTER_TYPE}'"; exit 1;; +esac + +mkdir -p /tmp/output +cd /tmp/output + +if [[ "${CLUSTER_TYPE}" == gcp ]]; then + pushd /tmp + curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-256.0.0-linux-x86_64.tar.gz + tar -xzf google-cloud-sdk-256.0.0-linux-x86_64.tar.gz + export PATH=$PATH:/tmp/google-cloud-sdk/bin + mkdir gcloudconfig + export CLOUDSDK_CONFIG=/tmp/gcloudconfig + gcloud auth activate-service-account --key-file="${GCP_SHARED_CREDENTIALS_FILE}" + gcloud config set project openshift-gce-devel-ci + 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}" \ + -o /tmp/artifacts/e2e.log \ + --junit-dir /tmp/artifacts/junit diff --git a/ci-operator/step-registry/origin/e2e/test/origin-e2e-test-ref.yaml b/ci-operator/step-registry/origin/e2e/test/origin-e2e-test-ref.yaml new file mode 100644 index 0000000000000..c7e4fe10d7a00 --- /dev/null +++ b/ci-operator/step-registry/origin/e2e/test/origin-e2e-test-ref.yaml @@ -0,0 +1,12 @@ +ref: + as: origin-e2e-test + from: stable:tests + commands: origin-e2e-test-commands.sh + resources: + requests: + cpu: "3" + memory: 600Mi + limits: + memory: 4Gi + documentation: |- + The Origin E2E step executes the common end-to-end test suite.