diff --git a/.github/workflows/e2e-nightly-ppc64le.yaml b/.github/workflows/e2e-nightly-ppc64le.yaml new file mode 100644 index 000000000..cec7aa445 --- /dev/null +++ b/.github/workflows/e2e-nightly-ppc64le.yaml @@ -0,0 +1,88 @@ +--- +name: E2E Nightly ppc64le + +on: + workflow_dispatch: + inputs: + branch: + description: 'Branch to run tests from. Defaults to redhat-3.10' + required: false + tag: + description: 'quay-operator-index tag. Defaults to 3.10-unstable' + required: false + schedule: + - cron: '15 11 * * *' + +jobs: + deploy: + name: Deploy the operator + runs-on: 'ubuntu-latest' + env: + BRANCH: ${{ github.event.inputs.branch || 'redhat-3.10' }} + TAG: ${{ github.event.inputs.tag || '3.10-unstable' }} + CATALOG_PATH: ./bundle/quay-operator.catalogsource.yaml + OG_PATH: ./bundle/quay-operator.operatorgroup.yaml + SUBSCRIPTION_PATH: ./bundle/quay-operator.subscription.yaml + QUAY_SAMPLE_PATH: ./config/samples/managed.quayregistry.yaml + OPERATOR_PKG_NAME: quay-operator-test + NAMESPACE: quay-operator-e2e-nightly + WAIT_TIMEOUT: 10m + KUBECONFIG: ${{ github.workspace }}/quaye2e/auth/kubeconfig + steps: + - name: check out the repo + uses: actions/checkout@v3 + with: + ref: ${{ env.BRANCH }} + + - name: install CLI tools from OpenShift Mirror + uses: redhat-actions/openshift-tools-installer@v1 + with: + oc: "4" + + - name: create ppc64le cluster + env: + IBMCLOUD_API_KEY: ${{ secrets.PPC64LE_IBMCLOUD_API_KEY }} + run: | + mkdir -p ${{ github.workspace }}/quaye2e/ + mkdir -p ~/.powervs + printf "${{ secrets.PPC64LE_INSTALL_CONFIG }}" | base64 --decode > ${{ github.workspace }}/quaye2e/install-config.yaml + printf "${{ secrets.PPC64LE_POWERVS_CONFIG }}" | base64 --decode > ~/.powervs/config.json + printf "${{ secrets.PPC64LE_PULL_SECRET }}" | base64 --decode > ~/.pull-secret + ./hack/ppc64le/create_cluster.sh + + - name: setup storage + run: ./hack/storage.sh + + - name: deploy + env: + CATALOG_IMAGE: quay.io/projectquay/quay-operator-index:${{ env.TAG }} + run: ./hack/deploy.sh + + - name: E2E Tests + env: + KUBECONFIG: ${{ github.workspace }}/quaye2e/auth/kubeconfig + run: make test-e2e + + - name: teardown deployment + if: always() + run: ./hack/teardown.sh + + - name: destroy ppc64le cluster + if: always() + env: + IBMCLOUD_API_KEY: ${{ secrets.PPC64LE_IBMCLOUD_API_KEY }} + run: | + ./hack/ppc64le/destroy_cluster.sh + + # - name: Notify slack + # if: ${{ always() }} + # uses: rtCamp/action-slack-notify@v2 + # env: + # SLACK_CHANNEL: team-quay-bots + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + # SLACK_COLOR: ${{ job.status }} + # SLACK_TITLE: "${{ github.workflow }}: ${{ job.status }}" + # SLACK_MESSAGE: | + # * **Repo**: ${{ github.repository }} + # * **Workflow**: ${{ github.workflow }} + # * **Result**: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/hack/ppc64le/create_cluster.sh b/hack/ppc64le/create_cluster.sh new file mode 100755 index 000000000..b06abf3d0 --- /dev/null +++ b/hack/ppc64le/create_cluster.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +# deploys a ppc64le cluster on IBM CLoud Power Virtual Server +# using the a stable openshift-install binary for ppc64le. +# +# REQUIREMENTS: +# * env variable `IBMCLOUD_API_KEY` +# * `oc` binary +set -e + +# prints pre-formatted info output. +function info { + echo "INFO $(date '+%Y-%m-%dT%H:%M:%S') $*" +} + +# prints pre-formatted error output. +function error { + >&2 echo "ERROR $(date '+%Y-%m-%dT%H:%M:%S') $*" +} + +RESOURCE_GROUP=Default +CLUSTER_ID=quay-e2e +OCP_INSTALL_DIR=quaye2e +CCO_DIR=ccodir +PULL_SEC_LOC=~/.pull-secret + +info 'oc client version:' +oc version + +# Install openshift-install amd64 version and extract ccoctl +curl -LO https://mirror.openshift.com/pub/openshift-v4/amd64/clients/ocp/stable-4.13/openshift-install-linux.tar.gz +tar zxvf openshift-install-linux.tar.gz +info 'openshift-install version:' +./openshift-install version +info 'extracting ccoctl with amd64 binary...' +RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}') +CCO_IMAGE=$(oc adm release info --image-for='cloud-credential-operator' "$RELEASE_IMAGE" -a $PULL_SEC_LOC) +oc image extract "$CCO_IMAGE" --file="/usr/bin/ccoctl" -a $PULL_SEC_LOC +chmod 775 ccoctl + + + +if [[ -d $OCP_INSTALL_DIR && -f $OCP_INSTALL_DIR/install-config.yaml ]]; then + info 'found install config' +else + error 'missing install config or dir' + exit 1 +fi + +# delete the amd64 version of openshift-install and install ppc64le version +rm -f openshift-install-linux.tar.gz openshift-install +curl -LO https://mirror.openshift.com/pub/openshift-v4/ppc64le/clients/ocp/stable-4.13/openshift-install-linux-amd64.tar.gz +tar zxvf openshift-install-linux-amd64.tar.gz +info 'openshift-install version:' +./openshift-install version +info 'creating manifests...' +./openshift-install create manifests --dir $OCP_INSTALL_DIR --log-level info + + +info 'extracting cco request objects...' +oc adm release extract --cloud=powervs --credentials-requests "$RELEASE_IMAGE" --to=$CCO_DIR +./ccoctl ibmcloud create-service-id --credentials-requests-dir $CCO_DIR --name $CLUSTER_ID --output-dir $OCP_INSTALL_DIR --resource-group-name $RESOURCE_GROUP &> /dev/null + + +info 'creating cluster...' +./openshift-install create cluster --dir $OCP_INSTALL_DIR --log-level=info diff --git a/hack/ppc64le/destroy_cluster.sh b/hack/ppc64le/destroy_cluster.sh new file mode 100755 index 000000000..676ff620e --- /dev/null +++ b/hack/ppc64le/destroy_cluster.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# destroy a ppc64le cluster on IBM CLoud Power Virtual Server +# using the a stable openshift-install binary for ppc64le. +# +# REQUIREMENTS: +# * env variable `IBMCLOUD_API_KEY` + +# prints pre-formatted info output. +function info { + echo "INFO $(date '+%Y-%m-%dT%H:%M:%S') $*" +} + +CLUSTER_ID=quay-e2e +OCP_INSTALL_DIR=quaye2e +CCO_DIR=ccodir + +if [[ -f ./ccoctl ]]; then + info 'deleting cco request objects...' + ./ccoctl ibmcloud delete-service-id --credentials-requests-dir $CCO_DIR --name $CLUSTER_ID +fi + +if [[ -f ./openshift-install ]]; then + info 'destroying the cluster...' + ./openshift-install destroy cluster --dir $OCP_INSTALL_DIR --log-level=info +fi