From f04bfd8a2532ddbd6913eae1c312d6bc198da1c5 Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Thu, 31 Aug 2023 20:41:30 +0530 Subject: [PATCH] chore: change cron and enable slack notify for ppc64le e2e (#821) * chore: change cron and enable slack notify for ppc64le e2e Signed-off-by: Yussuf Shaikh * add destroy command in loop to prevent next cluster create errors Signed-off-by: Yussuf Shaikh --------- Signed-off-by: Yussuf Shaikh --- .github/workflows/e2e-nightly-ppc64le.yaml | 27 +++++++++++----------- hack/ppc64le/destroy_cluster.sh | 21 ++++++++++++++++- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e-nightly-ppc64le.yaml b/.github/workflows/e2e-nightly-ppc64le.yaml index cec7aa445..03f3a1556 100644 --- a/.github/workflows/e2e-nightly-ppc64le.yaml +++ b/.github/workflows/e2e-nightly-ppc64le.yaml @@ -11,7 +11,7 @@ on: description: 'quay-operator-index tag. Defaults to 3.10-unstable' required: false schedule: - - cron: '15 11 * * *' + - cron: '0 0 * * 3,5' jobs: deploy: @@ -74,15 +74,16 @@ jobs: 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 }} + - 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 }} + * **Contact**: @yshaikh diff --git a/hack/ppc64le/destroy_cluster.sh b/hack/ppc64le/destroy_cluster.sh index 676ff620e..ff4042e3f 100755 --- a/hack/ppc64le/destroy_cluster.sh +++ b/hack/ppc64le/destroy_cluster.sh @@ -10,6 +10,25 @@ function info { echo "INFO $(date '+%Y-%m-%dT%H:%M:%S') $*" } + +NO_OF_RETRY=${NO_OF_RETRY:-"3"} +function retry { + cmd=$1 + for i in $(seq 1 "$NO_OF_RETRY"); do + echo "Attempt: $i/$NO_OF_RETRY" + ret_code=0 + $cmd || ret_code=$? + if [ $ret_code = 0 ]; then + break + elif [ "$i" == "$NO_OF_RETRY" ]; then + echo "All retry attempts failed!" + exit $ret_code + else + sleep 10 + fi + done +} + CLUSTER_ID=quay-e2e OCP_INSTALL_DIR=quaye2e CCO_DIR=ccodir @@ -21,5 +40,5 @@ fi if [[ -f ./openshift-install ]]; then info 'destroying the cluster...' - ./openshift-install destroy cluster --dir $OCP_INSTALL_DIR --log-level=info + retry "./openshift-install destroy cluster --dir $OCP_INSTALL_DIR --log-level=info" fi