diff --git a/.github/workflows/canary-integration-suite.yml b/.github/workflows/canary-integration-suite.yml new file mode 100644 index 000000000..b13ad4f49 --- /dev/null +++ b/.github/workflows/canary-integration-suite.yml @@ -0,0 +1,32 @@ +name: Canary integration tests +on: + push: + tags: + - v* + branches: + - master + - release-* + pull_request: + branches: + - master + - release-* + paths-ignore: + - "Documentation/**" + - "design/**" + +defaults: + run: + # reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell + shell: bash --noprofile --norc -eo pipefail -x {0} + +# cancel the in-progress workflow when PR is refreshed. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + canary-tests: + uses: ./.github/workflows/canary-integration-test.yml + with: + ceph_images: '["quay.io/ceph/ceph:v18"]' + secrets: inherit diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index e200aa74e..54e6aeef3 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -1,23 +1,11 @@ -name: Canary integration tests +name: Reusable canary integration tests on: - push: - tags: - - v* - branches: - - master - - release-* - pull_request: - branches: - - master - - release-* - paths-ignore: - - "Documentation/**" - - "design/**" + # ONLY on.workflow_call ; call this from other files if needed workflow_call: inputs: - ceph-image: - description: 'Ceph image for creating Ceph cluster' - default: 'quay.io/ceph/ceph:v18' + ceph_images: + description: 'JSON list of Ceph images for creating Ceph cluster' + default: '["quay.io/ceph/ceph:v18"]' type: string defaults: @@ -25,15 +13,13 @@ defaults: # reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell shell: bash --noprofile --norc -eo pipefail -x {0} -# cancel the in-progress workflow when PR is refreshed. -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - jobs: canary: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -49,7 +35,7 @@ jobs: uses: ./.github/workflows/canary-test-config - name: set Ceph version in CephCluster manifest - run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ github.event.inputs.ceph-image }}" + run: tests/scripts/github-action-helper.sh replace_ceph_image "deploy/examples/cluster-test.yaml" "${{ matrix.ceph-image }}" - name: validate-yaml run: tests/scripts/github-action-helper.sh validate_yaml @@ -276,11 +262,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: canary + name: ${{ github.job }}-${{ matrix.ceph-image }} raw-disk: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -344,11 +333,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: canary + name: ${{ github.job }}-${{ matrix.ceph-image }} two-osds-in-device: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -390,11 +382,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: canary + name: ${{ github.job }}-${{ matrix.ceph-image }} osd-with-metadata-partition-device: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -435,11 +430,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: canary + name: ${{ github.job }}-${{ matrix.ceph-image }} osd-with-metadata-device: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -488,11 +486,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: canary + name: ${{ github.job }}-${{ matrix.ceph-image }} encryption: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -535,11 +536,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: canary + name: ${{ github.job }}-${{ matrix.ceph-image }} lvm: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -587,11 +591,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: canary + name: ${{ github.job }}-${{ matrix.ceph-image }} pvc: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -660,11 +667,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: pvc + name: ${{ github.job }}-${{ matrix.ceph-image }} pvc-db: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -709,11 +719,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: pvc-db + name: ${{ github.job }}-${{ matrix.ceph-image }} pvc-db-wal: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -761,11 +774,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: pvc-db-wal + name: ${{ github.job }}-${{ matrix.ceph-image }} encryption-pvc: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -826,11 +842,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: encryption-pvc + name: ${{ github.job }}-${{ matrix.ceph-image }} encryption-pvc-db: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -877,11 +896,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: encryption-pvc-db + name: ${{ github.job }}-${{ matrix.ceph-image }} encryption-pvc-db-wal: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -938,11 +960,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: encryption-pvc-db-wal + name: ${{ github.job }}-${{ matrix.ceph-image }} encryption-pvc-kms-vault-token-auth: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -1021,11 +1046,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: encryption-pvc-kms-vault-token-auth + name: ${{ github.job }}-${{ matrix.ceph-image }} - encryption-pvc-kms-vault-k8s-auth: + encryption-pvc-kms-vault-k: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -1084,11 +1112,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: encryption-pvc-kms-vault-k8s-auth + name: ${{ github.job }}-${{ matrix.ceph-image }} lvm-pvc: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -1138,11 +1169,14 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: lvm-pvc + name: ${{ github.job }}-${{ matrix.ceph-image }} multi-cluster-mirroring: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -1393,11 +1427,15 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: multi-cluster-mirroring + name: ${{ github.job }}-${{ matrix.ceph-image }} + additional-namespace: rook-ceph-secondary rgw-multisite-testing: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -1415,16 +1453,18 @@ jobs: - name: run RGW multisite test uses: ./.github/workflows/rgw-multisite-test - - name: upload test result - uses: actions/upload-artifact@v4 + - name: collect common logs if: always() + uses: ./.github/workflows/collect-logs with: - name: rgw-multisite-testing - path: test + name: ${{ github.job }}-${{ matrix.ceph-image }} encryption-pvc-kms-ibm-kp: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - uses: actions/checkout@v4 with: @@ -1445,17 +1485,14 @@ jobs: ibm-instance-id: ${{ secrets.IBM_INSTANCE_ID }} ibm-service-api-key: ${{ secrets.IBM_SERVICE_API_KEY }} github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: upload test result - uses: actions/upload-artifact@v4 - if: always() - with: - name: encryption-pvc-kms-ibm-kp - path: test + artifact-name: ${{ github.job }}-${{ matrix.ceph-image }} multus-cluster-network: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -1532,11 +1569,15 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: canary-multus + name: ${{ github.job }}-${{ matrix.ceph-image }} + additional-namespace: kube-system csi-hostnetwork-disabled: runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + strategy: + matrix: + ceph-image: ${{ fromJson(inputs.ceph_images) }} steps: - name: checkout uses: actions/checkout@v4 @@ -1584,4 +1625,4 @@ jobs: if: always() uses: ./.github/workflows/collect-logs with: - name: csi-hostnetwork-disabled + name: ${{ github.job }}-${{ matrix.ceph-image }} diff --git a/.github/workflows/collect-logs/action.yaml b/.github/workflows/collect-logs/action.yaml index 4bb3c2d72..dfbf6feb5 100644 --- a/.github/workflows/collect-logs/action.yaml +++ b/.github/workflows/collect-logs/action.yaml @@ -5,17 +5,37 @@ inputs: name: description: Name to use for the workflow required: true + additional-namespace: + description: Additional namespace to collect + required: false runs: using: "composite" steps: + - name: sanitize input name + id: sanitize + shell: bash --noprofile --norc -eo pipefail -x {0} + run: | + raw="${{ inputs.name }}" + no_colon="${raw//:/-}" + no_slash="${no_colon////-}" + # echo to $GITHUB_OUTPUT doesn't work in composite steps: + # https://github.com/actions/runner/issues/2009#issuecomment-1793565031 + echo "ARTIFACT_NAME=${no_slash}" >> $GITHUB_ENV + - name: collect common logs shell: bash --noprofile --norc -eo pipefail -x {0} run: | - tests/scripts/collect-logs.sh ${{ inputs.name }} + export ADDITIONAL_NAMESPACE="${{ inputs.additional-namespace }}" + tests/scripts/collect-logs.sh + + - name: log artifact name + shell: bash --noprofile --norc -eo pipefail {0} + run: | + echo ${{ env.ARTIFACT_NAME }} - name: Upload canary test result - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: ${{ inputs.name }} + name: ${{ env.ARTIFACT_NAME }} path: test diff --git a/.github/workflows/daily-nightly-jobs.yml b/.github/workflows/daily-nightly-jobs.yml index b5e28acb5..5742876ae 100644 --- a/.github/workflows/daily-nightly-jobs.yml +++ b/.github/workflows/daily-nightly-jobs.yml @@ -395,18 +395,8 @@ jobs: name: ceph-upgrade-suite-quincy-artifact path: /home/runner/work/rook/rook/tests/integration/_output/tests/ - # run default canary suite canary-tests: uses: ./.github/workflows/canary-integration-test.yml - secrets: inherit - - # run canary suite with relevant ceph devel versions - canary-tests-devel: - uses: ./.github/workflows/canary-integration-test.yml - strategy: - matrix: - ceph-image-tag: - ["latest-main-devel", "latest-quincy-devel", "latest-reef-devel"] with: - ceph-image: quay.io/ceph/daemon-base:${{ matrix.ceph-image-tag }} + ceph_images: '["quay.io/ceph/ceph:v18", "quay.io/ceph/daemon-base:latest-main-devel", "quay.io/ceph/daemon-base:latest-quincy-devel", "quay.io/ceph/daemon-base:latest-reef-devel"]' secrets: inherit diff --git a/.github/workflows/encryption-pvc-kms-ibm-kp/action.yml b/.github/workflows/encryption-pvc-kms-ibm-kp/action.yml index 0746b37dc..4e9975eab 100644 --- a/.github/workflows/encryption-pvc-kms-ibm-kp/action.yml +++ b/.github/workflows/encryption-pvc-kms-ibm-kp/action.yml @@ -7,6 +7,9 @@ inputs: ibm-service-api-key: description: IBM_KP_SERVICE_API_KEY from the calling workflow required: true + artifact-name: + description: the name of the artifact where logs will be stored + required: true runs: using: "composite" @@ -75,7 +78,7 @@ runs: if: always() uses: ./.github/workflows/collect-logs with: - name: encryption-pvc-kms-ibm-kp + name: ${{ inputs.artifact-name }} - name: teardown cluster so that keys are removed from the KMS shell: bash --noprofile --norc -eo pipefail -x {0} diff --git a/.github/workflows/rgw-multisite-test/action.yml b/.github/workflows/rgw-multisite-test/action.yml index aa10c8627..5fa7c8176 100644 --- a/.github/workflows/rgw-multisite-test/action.yml +++ b/.github/workflows/rgw-multisite-test/action.yml @@ -73,9 +73,3 @@ runs: not_committed_msg="there are no changes to commit for RGW configuration period for CephObjectStore" tests/scripts/github-action-helper.sh wait_for_operator_log_message "${not_committed_msg} ${ns_name_primary_object_zone}" 600 tests/scripts/github-action-helper.sh wait_for_operator_log_message "${not_committed_msg} ${ns_name_secondary_object_zone}" 600 - - - name: collect common logs - if: always() - shell: bash --noprofile --norc -eo pipefail -x {0} - run: | - tests/scripts/collect-logs.sh diff --git a/.mergify.yml b/.mergify.yml index 50b223943..8cbbf4fde 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -296,6 +296,64 @@ pull_request_rules: dismiss_reviews: {} delete_head_branch: {} + # release-1.14 branch + - name: automerge backport release-1.14 + conditions: + - author=mergify[bot] + - base=release-1.14 + - label!=do-not-merge + - "status-success=DCO" + - "check-success=linux-build-all (1.21)" + - "check-success=unittests" + - "check-success=golangci-lint" + - "check-success=codegen" + - "check-success=codespell" + - "check-success=lint" + - "check-success=modcheck" + - "check-success=Shellcheck" + - "check-success=yaml-linter" + - "check-success=lint-test" + - "check-success=gen-rbac" + - "check-success=crds-gen" + - "check-success=docs-check" + - "check-success=pylint" + - "check-success=canary (quay.io/ceph/ceph:v18)" + - "check-success=raw-disk (quay.io/ceph/ceph:v18)" + - "check-success=two-osds-in-device (quay.io/ceph/ceph:v18)" + - "check-success=osd-with-metadata-partition-device (quay.io/ceph/ceph:v18)" + - "check-success=osd-with-metadata-device (quay.io/ceph/ceph:v18)" + - "check-success=encryption (quay.io/ceph/ceph:v18)" + - "check-success=lvm (quay.io/ceph/ceph:v18)" + - "check-success=pvc (quay.io/ceph/ceph:v18)" + - "check-success=pvc-db (quay.io/ceph/ceph:v18)" + - "check-success=pvc-db-wal (quay.io/ceph/ceph:v18)" + - "check-success=encryption-pvc (quay.io/ceph/ceph:v18)" + - "check-success=encryption-pvc-db (quay.io/ceph/ceph:v18)" + - "check-success=encryption-pvc-db-wal (quay.io/ceph/ceph:v18)" + - "check-success=encryption-pvc-kms-vault-token-auth (quay.io/ceph/ceph:v18)" + - "check-success=encryption-pvc-kms-vault-k8s-auth (quay.io/ceph/ceph:v18)" + - "check-success=lvm-pvc (quay.io/ceph/ceph:v18)" + # - "check-success=multi-cluster-mirroring (quay.io/ceph/ceph:v18)" + - "check-success=rgw-multisite-testing (quay.io/ceph/ceph:v18)" + # - "check-success=encryption-pvc-kms-ibm-kp (quay.io/ceph/ceph:v18)" + - "check-success=multus-cluster-network (quay.io/ceph/ceph:v18)" + - "check-success=csi-hostnetwork-disabled (quay.io/ceph/ceph:v18)" + - "check-success=TestCephSmokeSuite (v1.23.17)" + - "check-success=TestCephSmokeSuite (v1.29.0)" + - "check-success=TestCephHelmSuite (v1.23.17)" + - "check-success=TestCephHelmSuite (v1.29.0)" + - "check-success=TestCephMultiClusterDeploySuite (v1.29.0)" + - "check-success=TestCephObjectSuite (v1.29.0)" + - "check-success=TestCephUpgradeSuite (v1.23.17)" + - "check-success=TestCephUpgradeSuite (v1.29.0)" + - "check-success=TestHelmUpgradeSuite (v1.23.17)" + - "check-success=TestHelmUpgradeSuite (v1.29.0)" + actions: + merge: + method: merge + dismiss_reviews: {} + delete_head_branch: {} + # release-1.8 branch - actions: backport: diff --git a/tests/scripts/collect-logs.sh b/tests/scripts/collect-logs.sh index 637d446a5..c71267e11 100755 --- a/tests/scripts/collect-logs.sh +++ b/tests/scripts/collect-logs.sh @@ -5,7 +5,7 @@ set -x # User parameters : "${CLUSTER_NAMESPACE:="rook-ceph"}" : "${OPERATOR_NAMESPACE:="$CLUSTER_NAMESPACE"}" -: "${KUBE_SYSTEM_NAMESPACE:="kube-system"}" +: "${ADDITIONAL_NAMESPACE:=""}" : "${LOG_DIR:="test"}" LOG_DIR="${LOG_DIR%/}" # remove trailing slash if necessary @@ -22,13 +22,8 @@ if [[ "$OPERATOR_NAMESPACE" != "$CLUSTER_NAMESPACE" ]]; then NAMESPACES+=("$OPERATOR_NAMESPACE") fi -if [ "$1" == "multi-cluster-mirroring" ]; then - NAMESPACES+=("rook-ceph-secondary") -fi - -# Add kube-system namespace for multus test only as we need to debug network in multus test -if [ "$1" == "canary-multus" ]; then - NAMESPACES+=("$KUBE_SYSTEM_NAMESPACE") +if [[ -n "${ADDITIONAL_NAMESPACE}" ]]; then + NAMESPACES+=("${ADDITIONAL_NAMESPACE}") fi for NAMESPACE in "${NAMESPACES[@]}"; do