From 73591367bffd9914c25087ca78f750536aac7c39 Mon Sep 17 00:00:00 2001 From: framework-automation <41898282+framework-automation[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:02:24 +0000 Subject: [PATCH] Upgrade CI (02 Apr 2024 11:02:24) --- .github/workflows/debug.yaml | 30 +++++++++++++++++++ .github/workflows/operator_convert.yaml | 2 +- .github/workflows/operator_release.yaml | 13 ++++++-- .../workflows/operator_release_manual.yaml | 9 ++++-- 4 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/debug.yaml diff --git a/.github/workflows/debug.yaml b/.github/workflows/debug.yaml new file mode 100644 index 000000000..4d797370f --- /dev/null +++ b/.github/workflows/debug.yaml @@ -0,0 +1,30 @@ + +name: Debug +on: + workflow_dispatch: + inputs: + os: + required: true + type: choice + options: + - ubuntu-latest + - ubuntu-22.04 + - ubuntu-20.04 + +jobs: + debug: + runs-on: "${{ github.event.inputs.os }}" + #container: quay.io/operator_testing/operator-test-playbooks:latest + steps: + - name: Run debug tests + run: | + set -x + id + uname -a + cat /etc/os-release + cat /etc/subuid + cat /etc/subgid + docker version + docker run -it --rm quay.io/quay/busybox date + sleep 5 + echo done diff --git a/.github/workflows/operator_convert.yaml b/.github/workflows/operator_convert.yaml index e962d1d47..06ae6595c 100644 --- a/.github/workflows/operator_convert.yaml +++ b/.github/workflows/operator_convert.yaml @@ -78,7 +78,7 @@ jobs: ANSIBLE_TAGS="operator_info" cd $PROJECT_DIR echo "Moving bundle for '$op' ..." - [ -e $PROJECT_DIR/operators/$op/ci.yaml ] && mv $PROJECT_DIR/operators/$op/ci.yaml /tmp/operator-test/operators/$op/ || echo "ci.yaml file does not exist, skipping ..." + mv $PROJECT_DIR/operators/$op/ci.yaml /tmp/operator-test/operators/$op/ rm -rf $PROJECT_DIR/operators/$op mv /tmp/operator-test/operators/$op $PROJECT_DIR/operators/$op find $PROJECT_DIR/operators/$op -name 'bundle.Dockerfile' -delete diff --git a/.github/workflows/operator_release.yaml b/.github/workflows/operator_release.yaml index d6a8ede48..a70531949 100644 --- a/.github/workflows/operator_release.yaml +++ b/.github/workflows/operator_release.yaml @@ -222,13 +222,22 @@ jobs: OPP_OP_INFO_PARALLEL: 1 OPP_OP_INFO_PARALLEL_BATCH: 20 + THIS_OPERATOR: ${{ needs.pr-check.outputs.opp_name }} OPP_AUTO_LABEL: 1 ANSIBLE_FORCE_COLOR: 1 ANSIBLE_DISPLAY_SKIPPED_HOSTS: 0 ANSIBLE_STDOUT_CALLBACK: "yaml" run: | - OPP_FORCE_OPERATORS=${OPP_FORCE_OPERATORS// /,} - echo $OPP_FORCE_OPERATORS + + echo "Operators out of sync: ${OPP_FORCE_OPERATORS}" + OTHER_OPERATORS=$(echo ${OPP_FORCE_OPERATORS} | tr ' ' '\n' | grep -v "^${THIS_OPERATOR}$" | shuf | head -2 | xargs echo | tr ' ' ',') + if [ -n "${OTHER_OPERATORS}" ] ; then + OPP_FORCE_OPERATORS="${THIS_OPERATOR},${OTHER_OPERATORS}" + else + OPP_FORCE_OPERATORS="${THIS_OPERATOR}" + fi + + echo "Syncing: ${OPP_FORCE_OPERATORS}" [ "$OPP_AUTO_LABEL" = '1' ] && ANSIBLE_ARGS="-e automatic_cluster_version_label=true" || ANSIBLE_ARGS="-e automatic_cluster_version_label=false" [ "$OPP_OP_INFO_PARALLEL" = '1' ] && ANSIBLE_ARGS="$ANSIBLE_ARGS -e op_info_parallel=true -e op_info_parallel_batch=$OPP_OP_INFO_PARALLEL_BATCH" || ANSIBLE_ARGS="$ANSIBLE_ARGS -e op_info_parallel=false" echo $ANSIBLE_ARGS diff --git a/.github/workflows/operator_release_manual.yaml b/.github/workflows/operator_release_manual.yaml index 948d40de6..6a26bd0b5 100644 --- a/.github/workflows/operator_release_manual.yaml +++ b/.github/workflows/operator_release_manual.yaml @@ -210,7 +210,7 @@ jobs: for index in $(echo '${{ github.event.inputs.index }}' | jq -r .[]); do TARGET_INDEX_RAW=$(echo $index|cut -d '-' -f1) - TARGET_INDEX_UNDERLINE=$(echo $TARGET_INDEX_RAW|tr '.' '_') + TARGET_INDEX_UNDERLINE=$(echo $TARGET_INDEX_RAW|tr '.' '_') export OPP_FORCE_OPERATORS_$TARGET_INDEX_UNDERLINE="${{ github.event.inputs.list_of_operators }}" echo "opp_uncomplete_operators_$TARGET_INDEX_UNDERLINE=${{ github.event.inputs.list_of_operators }}" >> $GITHUB_OUTPUT done @@ -229,13 +229,16 @@ jobs: OPP_OP_INFO_PARALLEL: 1 OPP_OP_INFO_PARALLEL_BATCH: 20 + THIS_OPERATOR: ${{ needs.pr-check.outputs.opp_name }} OPP_AUTO_LABEL: 1 ANSIBLE_FORCE_COLOR: 1 ANSIBLE_DISPLAY_SKIPPED_HOSTS: 0 ANSIBLE_STDOUT_CALLBACK: "yaml" run: | + OPP_FORCE_OPERATORS=${OPP_FORCE_OPERATORS// /,} - echo $OPP_FORCE_OPERATORS + + echo "Syncing: ${OPP_FORCE_OPERATORS}" [ "$OPP_AUTO_LABEL" = '1' ] && ANSIBLE_ARGS="-e automatic_cluster_version_label=true" || ANSIBLE_ARGS="-e automatic_cluster_version_label=false" [ "$OPP_OP_INFO_PARALLEL" = '1' ] && ANSIBLE_ARGS="$ANSIBLE_ARGS -e op_info_parallel=true -e op_info_parallel_batch=$OPP_OP_INFO_PARALLEL_BATCH" || ANSIBLE_ARGS="$ANSIBLE_ARGS -e op_info_parallel=false" echo $ANSIBLE_ARGS @@ -344,7 +347,7 @@ jobs: for index in $(echo '${{ github.event.inputs.index }}' | jq -r .[]); do TARGET_INDEX_RAW=$(echo $index|cut -d '-' -f1) - TARGET_INDEX_UNDERLINE=$(echo $TARGET_INDEX_RAW|tr '.' '_') + TARGET_INDEX_UNDERLINE=$(echo $TARGET_INDEX_RAW|tr '.' '_') export OPP_FORCE_OPERATORS_$TARGET_INDEX_UNDERLINE="${{ github.event.inputs.list_of_operators }}" done