From 0ae55eb472a9822c5f195c219469d4947090ebb4 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Fri, 26 Aug 2022 08:37:40 +0530 Subject: [PATCH 1/5] ci: add right indentation for ci yaml and sh files these indenation where added by vscode extentions. for yaml I have extention ` YAML` by Red Hat for bash I have `shell-format` and `shellCheck`. Signed-off-by: subhamkrai --- .github/workflows/canary-integration-test.yml | 2243 ++++++++--------- .github/workflows/codegen.yml | 30 +- .github/workflows/crds-gen.yml | 30 +- .github/workflows/create-tag.yaml | 2 +- .github/workflows/daily-nightly-jobs.yml | 6 +- .../integration-test-config/action.yaml | 42 +- .../integration-test-helm-suite.yaml | 86 +- .../workflows/integration-test-mgr-suite.yaml | 78 +- .../integration-test-multi-cluster-suite.yaml | 80 +- .../integration-test-object-suite.yaml | 78 +- .../integration-test-smoke-suite.yaml | 78 +- .../integration-test-upgrade-suite.yaml | 146 +- .../integration-tests-on-release.yaml | 346 +-- .github/workflows/mod-check.yml | 22 +- .github/workflows/rbac-gen.yaml | 30 +- .github/workflows/stale.yaml | 58 +- .github/workflows/unit-test.yml | 24 +- tests/scripts/create-bluestore-partitions.sh | 54 +- 18 files changed, 1715 insertions(+), 1718 deletions(-) diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index 19bf2c68a..54290b195 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -26,1452 +26,1451 @@ jobs: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: validate-yaml - run: tests/scripts/github-action-helper.sh validate_yaml + - name: validate-yaml + run: tests/scripts/github-action-helper.sh validate_yaml - - name: use local disk and create partitions for osds - run: | - tests/scripts/github-action-helper.sh use_local_disk - tests/scripts/github-action-helper.sh create_partitions_for_osds + - name: use local disk and create partitions for osds + run: | + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/github-action-helper.sh create_partitions_for_osds - - name: deploy cluster - run: tests/scripts/github-action-helper.sh deploy_cluster + - name: deploy cluster + run: tests/scripts/github-action-helper.sh deploy_cluster - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready all 2 + - name: wait for ceph to be ready + run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready all 2 - - name: test external script create-external-cluster-resources.py - run: | - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - timeout 15 sh -c "until kubectl -n rook-ceph exec $toolbox -- ceph mgr dump -f json|jq --raw-output .active_addr|grep -Eosq \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\" ; do sleep 1 && echo 'waiting for the manager IP to be available'; done" - mgr_raw=$(kubectl -n rook-ceph exec $toolbox -- ceph mgr dump -f json|jq --raw-output .active_addr) - timeout 60 sh -c "until kubectl -n rook-ceph exec $toolbox -- curl --silent --show-error ${mgr_raw%%:*}:9283; do echo 'waiting for mgr prometheus exporter to be ready' && sleep 1; done" - kubectl -n rook-ceph exec $toolbox -- mkdir -p /etc/ceph/test-data - kubectl -n rook-ceph cp tests/ceph-status-out $toolbox:/etc/ceph/test-data/ - kubectl -n rook-ceph cp deploy/examples/create-external-cluster-resources.py $toolbox:/etc/ceph - kubectl -n rook-ceph cp deploy/examples/create-external-cluster-resources-tests.py $toolbox:/etc/ceph - timeout 10 sh -c "until kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool; do echo 'waiting for script to succeed' && sleep 1; done" - # print existing client auth - kubectl -n rook-ceph exec $toolbox -- ceph auth ls + - name: test external script create-external-cluster-resources.py + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + timeout 15 sh -c "until kubectl -n rook-ceph exec $toolbox -- ceph mgr dump -f json|jq --raw-output .active_addr|grep -Eosq \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\" ; do sleep 1 && echo 'waiting for the manager IP to be available'; done" + mgr_raw=$(kubectl -n rook-ceph exec $toolbox -- ceph mgr dump -f json|jq --raw-output .active_addr) + timeout 60 sh -c "until kubectl -n rook-ceph exec $toolbox -- curl --silent --show-error ${mgr_raw%%:*}:9283; do echo 'waiting for mgr prometheus exporter to be ready' && sleep 1; done" + kubectl -n rook-ceph exec $toolbox -- mkdir -p /etc/ceph/test-data + kubectl -n rook-ceph cp tests/ceph-status-out $toolbox:/etc/ceph/test-data/ + kubectl -n rook-ceph cp deploy/examples/create-external-cluster-resources.py $toolbox:/etc/ceph + kubectl -n rook-ceph cp deploy/examples/create-external-cluster-resources-tests.py $toolbox:/etc/ceph + timeout 10 sh -c "until kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool; do echo 'waiting for script to succeed' && sleep 1; done" + # print existing client auth + kubectl -n rook-ceph exec $toolbox -- ceph auth ls - - name: dry run external script create-external-cluster-resources.py - run: | - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name=replicapool --dry-run + - name: dry run external script create-external-cluster-resources.py + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name=replicapool --dry-run - - name: test external script create-external-cluster-resources.py if users already exist with different caps - run: | - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - # update client.csi-rbd-provisioner csi user caps - # print client.csi-rbd-provisioner user before update - kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-provisioner - kubectl -n rook-ceph exec $toolbox -- ceph auth caps client.csi-rbd-provisioner mon 'profile rbd, allow command "osd ls"' osd 'profile rbd' mgr 'allow rw' - # print client.csi-rbd-provisioner user after update - kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-provisioner - kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool - # print client.csi-rbd-provisioner user after running script - kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-provisioner + - name: test external script create-external-cluster-resources.py if users already exist with different caps + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + # update client.csi-rbd-provisioner csi user caps + # print client.csi-rbd-provisioner user before update + kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-provisioner + kubectl -n rook-ceph exec $toolbox -- ceph auth caps client.csi-rbd-provisioner mon 'profile rbd, allow command "osd ls"' osd 'profile rbd' mgr 'allow rw' + # print client.csi-rbd-provisioner user after update + kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-provisioner + kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool + # print client.csi-rbd-provisioner user after running script + kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-provisioner - - name: run external script create-external-cluster-resources.py unit tests - run: | - kubectl -n rook-ceph exec $(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[0].metadata.name}') -- python3 -m unittest /etc/ceph/create-external-cluster-resources-tests.py + - name: run external script create-external-cluster-resources.py unit tests + run: | + kubectl -n rook-ceph exec $(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[0].metadata.name}') -- python3 -m unittest /etc/ceph/create-external-cluster-resources-tests.py - - name: wait for the subvolumegroup to be created - run: | - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - timeout 60 sh -c "until kubectl -n rook-ceph exec $toolbox -- ceph fs subvolumegroup ls myfs|jq .[0].name|grep -q "group-a"; do sleep 1 && echo 'waiting for the subvolumegroup to be created'; done" + - name: wait for the subvolumegroup to be created + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + timeout 60 sh -c "until kubectl -n rook-ceph exec $toolbox -- ceph fs subvolumegroup ls myfs|jq .[0].name|grep -q "group-a"; do sleep 1 && echo 'waiting for the subvolumegroup to be created'; done" - - name: test subvolumegroup validation - run: | - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - # pass the correct subvolumegroup and cephfs_filesystem flag name - kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --subvolume-group group-a --cephfs-filesystem-name myfs - # pass the wrong subvolumegroup name - if output=$(kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --subvolume-group false-test-subvolume-group); then - echo "unexpectedly succeeded after passing the wrong subvolumegroup name: $output" - exit 1 - else - echo "script failed because wrong subvolumegroup name was passed" - fi + - name: test subvolumegroup validation + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + # pass the correct subvolumegroup and cephfs_filesystem flag name + kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --subvolume-group group-a --cephfs-filesystem-name myfs + # pass the wrong subvolumegroup name + if output=$(kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --subvolume-group false-test-subvolume-group); then + echo "unexpectedly succeeded after passing the wrong subvolumegroup name: $output" + exit 1 + else + echo "script failed because wrong subvolumegroup name was passed" + fi - - name: test of rados namespace - run: | - kubectl create -f deploy/examples/radosnamespace.yaml - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - timeout 60 sh -c "until kubectl -n rook-ceph exec $toolbox -- rbd namespace ls replicapool --format=json|jq .[0].name|grep -q "namespace-a"; do sleep 1 && echo 'waiting for the rados namespace to be created'; done" - kubectl delete -f deploy/examples/radosnamespace.yaml + - name: test of rados namespace + run: | + kubectl create -f deploy/examples/radosnamespace.yaml + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + timeout 60 sh -c "until kubectl -n rook-ceph exec $toolbox -- rbd namespace ls replicapool --format=json|jq .[0].name|grep -q "namespace-a"; do sleep 1 && echo 'waiting for the rados namespace to be created'; done" + kubectl delete -f deploy/examples/radosnamespace.yaml - - name: test rados namespace validation - run: | - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - # create `radosNamespace1` rados-namespace for `replicapool` rbd data-pool - kubectl -n rook-ceph exec $toolbox -- rbd namespace create replicapool/radosNamespace1 - kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rados-namespace radosNamespace1 - # test the rados namespace which not exit for replicapool(false testing) - if output=$(kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rados-namespace false-test-namespace); then - echo "unexpectedly succeeded after passing the wrong rados namespace: $output" - exit 1 - else - echo "script failed because wrong rados namespace was passed" - fi + - name: test rados namespace validation + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + # create `radosNamespace1` rados-namespace for `replicapool` rbd data-pool + kubectl -n rook-ceph exec $toolbox -- rbd namespace create replicapool/radosNamespace1 + kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rados-namespace radosNamespace1 + # test the rados namespace which not exit for replicapool(false testing) + if output=$(kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rados-namespace false-test-namespace); then + echo "unexpectedly succeeded after passing the wrong rados namespace: $output" + exit 1 + else + echo "script failed because wrong rados namespace was passed" + fi - - name: test external script with restricted_auth_permission flag and without having cephfs_filesystem flag - run: | - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --cluster-name rookstorage --restricted-auth-permission true + - name: test external script with restricted_auth_permission flag and without having cephfs_filesystem flag + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --cluster-name rookstorage --restricted-auth-permission true - - name: test external script with restricted_auth_permission flag - run: | - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --cephfs-filesystem-name myfs --rbd-data-pool-name replicapool --cluster-name rookstorage --restricted-auth-permission true + - name: test external script with restricted_auth_permission flag + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --cephfs-filesystem-name myfs --rbd-data-pool-name replicapool --cluster-name rookstorage --restricted-auth-permission true - - name: test the upgrade flag - run: | - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - # print existing client auth - kubectl -n rook-ceph exec $toolbox -- ceph auth ls - # update the existing non-restricted client auth with the new ones - kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --upgrade - # print ugraded client auth - kubectl -n rook-ceph exec $toolbox -- ceph auth ls + - name: test the upgrade flag + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + # print existing client auth + kubectl -n rook-ceph exec $toolbox -- ceph auth ls + # update the existing non-restricted client auth with the new ones + kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --upgrade + # print ugraded client auth + kubectl -n rook-ceph exec $toolbox -- ceph auth ls - - name: test the upgrade flag for restricted auth user - run: | - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - # print existing client auth - kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-node-rookstorage-replicapool - # restricted auth user need to provide --rbd-data-pool-name, - # --cluster-name and --run-as-user flag while upgrading - kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --upgrade --rbd-data-pool-name replicapool --cluster-name rookstorage --run-as-user client.csi-rbd-node-rookstorage-replicapool - # print ugraded client auth - kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-node-rookstorage-replicapool + - name: test the upgrade flag for restricted auth user + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + # print existing client auth + kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-node-rookstorage-replicapool + # restricted auth user need to provide --rbd-data-pool-name, + # --cluster-name and --run-as-user flag while upgrading + kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --upgrade --rbd-data-pool-name replicapool --cluster-name rookstorage --run-as-user client.csi-rbd-node-rookstorage-replicapool + # print ugraded client auth + kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-node-rookstorage-replicapool - - name: validate-rgw-endpoint - run: | - rgw_endpoint=$(kubectl get service -n rook-ceph | awk '/rgw/ {print $3":80"}') - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - # pass the valid rgw-endpoint of same ceph cluster - timeout 15 sh -c "until kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rgw-endpoint $rgw_endpoint; do sleep 1 && echo 'waiting for the rgw endpoint to be validated'; done" - # pass the invalid rgw-endpoint of different ceph cluster - if output=$(timeout 15 sh -c "until kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rgw-endpoint 10.108.96.128:80; do sleep 1 && echo 'waiting for the rgw endpoint to be validated'; done"); then - echo "unexpectedly succeeded after passing the wrong rgw-endpoint: $output" - exit 1 - else - echo "validation failed because wrong endpoint was provided" - fi - # pass the valid rgw-endpoint of same ceph cluster with --rgw-tls-cert-path - timeout 15 sh -c "until kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rgw-endpoint $rgw_endpoint --rgw-tls-cert-path my-cert; do sleep 1 && echo 'waiting for the rgw endpoint to be validated'; done" - # pass the valid rgw-endpoint of same ceph cluster with --rgw-skip-tls - timeout 15 sh -c "until kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rgw-endpoint $rgw_endpoint --rgw-skip-tls true; do sleep 1 && echo 'waiting for the rgw endpoint to be validated'; done" + - name: validate-rgw-endpoint + run: | + rgw_endpoint=$(kubectl get service -n rook-ceph | awk '/rgw/ {print $3":80"}') + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + # pass the valid rgw-endpoint of same ceph cluster + timeout 15 sh -c "until kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rgw-endpoint $rgw_endpoint; do sleep 1 && echo 'waiting for the rgw endpoint to be validated'; done" + # pass the invalid rgw-endpoint of different ceph cluster + if output=$(timeout 15 sh -c "until kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rgw-endpoint 10.108.96.128:80; do sleep 1 && echo 'waiting for the rgw endpoint to be validated'; done"); then + echo "unexpectedly succeeded after passing the wrong rgw-endpoint: $output" + exit 1 + else + echo "validation failed because wrong endpoint was provided" + fi + # pass the valid rgw-endpoint of same ceph cluster with --rgw-tls-cert-path + timeout 15 sh -c "until kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rgw-endpoint $rgw_endpoint --rgw-tls-cert-path my-cert; do sleep 1 && echo 'waiting for the rgw endpoint to be validated'; done" + # pass the valid rgw-endpoint of same ceph cluster with --rgw-skip-tls + timeout 15 sh -c "until kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --rgw-endpoint $rgw_endpoint --rgw-skip-tls true; do sleep 1 && echo 'waiting for the rgw endpoint to be validated'; done" - - name: check-ownerreferences - run: tests/scripts/github-action-helper.sh check_ownerreferences + - name: check-ownerreferences + run: tests/scripts/github-action-helper.sh check_ownerreferences - - name: test osd removal jobs - run: | - kubectl -n rook-ceph delete deploy/rook-ceph-operator - kubectl -n rook-ceph delete deploy/rook-ceph-osd-1 --grace-period=0 --force - sed -i 's//1/' deploy/examples/osd-purge.yaml - # the CI must force the deletion since we use replica 1 on 2 OSDs - sed -i 's/false/true/' deploy/examples/osd-purge.yaml - sed -i 's|rook/ceph:.*|rook/ceph:local-build|' deploy/examples/osd-purge.yaml - kubectl -n rook-ceph create -f deploy/examples/osd-purge.yaml - toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') - kubectl -n rook-ceph exec $toolbox -- ceph status - # wait until osd.1 is removed from the osd tree - timeout 120 sh -c "while kubectl -n rook-ceph exec $toolbox -- ceph osd tree|grep -qE 'osd.1'; do echo 'waiting for ceph osd 1 to be purged'; sleep 1; done" - kubectl -n rook-ceph exec $toolbox -- ceph status - kubectl -n rook-ceph exec $toolbox -- ceph osd tree + - name: test osd removal jobs + run: | + kubectl -n rook-ceph delete deploy/rook-ceph-operator + kubectl -n rook-ceph delete deploy/rook-ceph-osd-1 --grace-period=0 --force + sed -i 's//1/' deploy/examples/osd-purge.yaml + # the CI must force the deletion since we use replica 1 on 2 OSDs + sed -i 's/false/true/' deploy/examples/osd-purge.yaml + sed -i 's|rook/ceph:.*|rook/ceph:local-build|' deploy/examples/osd-purge.yaml + kubectl -n rook-ceph create -f deploy/examples/osd-purge.yaml + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + kubectl -n rook-ceph exec $toolbox -- ceph status + # wait until osd.1 is removed from the osd tree + timeout 120 sh -c "while kubectl -n rook-ceph exec $toolbox -- ceph osd tree|grep -qE 'osd.1'; do echo 'waiting for ceph osd 1 to be purged'; sleep 1; done" + kubectl -n rook-ceph exec $toolbox -- ceph status + kubectl -n rook-ceph exec $toolbox -- ceph osd tree - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: canary + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: canary - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 raw-disk: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: validate-yaml - run: tests/scripts/github-action-helper.sh validate_yaml + - name: validate-yaml + run: tests/scripts/github-action-helper.sh validate_yaml - - name: use local disk as OSD - run: | - tests/scripts/github-action-helper.sh use_local_disk - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only + - name: use local disk as OSD + run: | + tests/scripts/github-action-helper.sh use_local_disk + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only - - name: deploy cluster - run: tests/scripts/github-action-helper.sh deploy_cluster + - name: deploy cluster + run: tests/scripts/github-action-helper.sh deploy_cluster - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 + - name: wait for ceph to be ready + run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 - - name: check-ownerreferences - run: tests/scripts/github-action-helper.sh check_ownerreferences + - name: check-ownerreferences + run: tests/scripts/github-action-helper.sh check_ownerreferences - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: canary + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: canary - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 two-osds-in-device: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: validate-yaml - run: tests/scripts/github-action-helper.sh validate_yaml + - name: validate-yaml + run: tests/scripts/github-action-helper.sh validate_yaml - - name: use local disk as OSD - run: | - tests/scripts/github-action-helper.sh use_local_disk - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only + - name: use local disk as OSD + run: | + tests/scripts/github-action-helper.sh use_local_disk + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only - - name: deploy cluster - run: tests/scripts/github-action-helper.sh deploy_cluster two_osds_in_device + - name: deploy cluster + run: tests/scripts/github-action-helper.sh deploy_cluster two_osds_in_device - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 + - name: wait for ceph to be ready + run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 - - name: check-ownerreferences - run: tests/scripts/github-action-helper.sh check_ownerreferences + - name: check-ownerreferences + run: tests/scripts/github-action-helper.sh check_ownerreferences - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: canary + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: canary - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 osd-with-metadata-device: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: validate-yaml - run: tests/scripts/github-action-helper.sh validate_yaml + - name: validate-yaml + run: tests/scripts/github-action-helper.sh validate_yaml - - name: use local disk as OSD - run: | - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/github-action-helper.sh use_local_disk - tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only + - name: use local disk as OSD + run: | + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only - - name: create LV on disk - run: | - dd if=/dev/zero of=test-rook.img bs=1 count=0 seek=10G - # If we use metadata device, both data devices and metadata devices should be logical volumes or raw devices - tests/scripts/github-action-helper.sh create_LV_on_disk $(sudo losetup --find --show test-rook.img) + - name: create LV on disk + run: | + dd if=/dev/zero of=test-rook.img bs=1 count=0 seek=10G + # If we use metadata device, both data devices and metadata devices should be logical volumes or raw devices + tests/scripts/github-action-helper.sh create_LV_on_disk $(sudo losetup --find --show test-rook.img) - - name: deploy cluster - run: tests/scripts/github-action-helper.sh deploy_cluster osd_with_metadata_device + - name: deploy cluster + run: tests/scripts/github-action-helper.sh deploy_cluster osd_with_metadata_device - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 + - name: wait for ceph to be ready + run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 - - name: check-ownerreferences - run: tests/scripts/github-action-helper.sh check_ownerreferences + - name: check-ownerreferences + run: tests/scripts/github-action-helper.sh check_ownerreferences - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: canary + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: canary - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 encryption: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: validate-yaml - run: tests/scripts/github-action-helper.sh validate_yaml + - name: validate-yaml + run: tests/scripts/github-action-helper.sh validate_yaml - - name: use local disk as OSD - run: | - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/github-action-helper.sh use_local_disk - tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only + - name: use local disk as OSD + run: | + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only - - name: deploy cluster - run: tests/scripts/github-action-helper.sh deploy_cluster encryption + - name: deploy cluster + run: tests/scripts/github-action-helper.sh deploy_cluster encryption - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 + - name: wait for ceph to be ready + run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 - - name: check-ownerreferences - run: tests/scripts/github-action-helper.sh check_ownerreferences + - name: check-ownerreferences + run: tests/scripts/github-action-helper.sh check_ownerreferences - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: canary + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: canary - - name: setup tmate session for debugging when event is PR - if: failure() && github.event_name == 'pull_request' - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: setup tmate session for debugging when event is PR + if: failure() && github.event_name == 'pull_request' + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 lvm: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: validate-yaml - run: tests/scripts/github-action-helper.sh validate_yaml + - name: validate-yaml + run: tests/scripts/github-action-helper.sh validate_yaml - - name: use local disk as OSD - run: | - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/github-action-helper.sh use_local_disk - tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only + - name: use local disk as OSD + run: | + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only - - name: create LV on disk - run: | - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/github-action-helper.sh create_LV_on_disk $BLOCK + - name: create LV on disk + run: | + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/github-action-helper.sh create_LV_on_disk $BLOCK - - name: deploy cluster - run: tests/scripts/github-action-helper.sh deploy_cluster lvm + - name: deploy cluster + run: tests/scripts/github-action-helper.sh deploy_cluster lvm - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 + - name: wait for ceph to be ready + run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 - - name: check-ownerreferences - run: tests/scripts/github-action-helper.sh check_ownerreferences + - name: check-ownerreferences + run: tests/scripts/github-action-helper.sh check_ownerreferences - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: canary + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: canary - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 pvc: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: use local disk and create partitions for osds - run: | - tests/scripts/github-action-helper.sh use_local_disk - tests/scripts/github-action-helper.sh create_partitions_for_osds + - name: use local disk and create partitions for osds + run: | + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/github-action-helper.sh create_partitions_for_osds - - name: create cluster prerequisites - run: | - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/localPathPV.sh "$BLOCK" - tests/scripts/github-action-helper.sh create_cluster_prerequisites + - name: create cluster prerequisites + run: | + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/localPathPV.sh "$BLOCK" + tests/scripts/github-action-helper.sh create_cluster_prerequisites - - name: deploy cluster - run: | - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].encrypted" false - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].count" 2 - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].volumeClaimTemplates[0].spec.resources.requests.storage" 6Gi - kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml + - name: deploy cluster + run: | + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].encrypted" false + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].count" 2 + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].volumeClaimTemplates[0].spec.resources.requests.storage" 6Gi + kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 + - name: wait for ceph to be ready + run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 - - name: check-ownerreferences - run: tests/scripts/github-action-helper.sh check_ownerreferences + - name: check-ownerreferences + run: tests/scripts/github-action-helper.sh check_ownerreferences - - name: teardown cluster with cleanup policy - run: | - kubectl -n rook-ceph patch cephcluster rook-ceph --type merge -p '{"spec":{"cleanupPolicy":{"confirmation":"yes-really-destroy-data"}}}' - kubectl -n rook-ceph delete cephcluster rook-ceph - kubectl -n rook-ceph logs deploy/rook-ceph-operator - tests/scripts/github-action-helper.sh wait_for_cleanup_pod - lsblk - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - sudo head --bytes=60 ${BLOCK}1 - sudo head --bytes=60 ${BLOCK}2 + - name: teardown cluster with cleanup policy + run: | + kubectl -n rook-ceph patch cephcluster rook-ceph --type merge -p '{"spec":{"cleanupPolicy":{"confirmation":"yes-really-destroy-data"}}}' + kubectl -n rook-ceph delete cephcluster rook-ceph + kubectl -n rook-ceph logs deploy/rook-ceph-operator + tests/scripts/github-action-helper.sh wait_for_cleanup_pod + lsblk + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + sudo head --bytes=60 ${BLOCK}1 + sudo head --bytes=60 ${BLOCK}2 - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: pvc + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: pvc - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 pvc-db: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: use local disk - run: tests/scripts/github-action-helper.sh use_local_disk + - name: use local disk + run: tests/scripts/github-action-helper.sh use_local_disk - - name: create bluestore partitions and PVCs - run: tests/scripts/github-action-helper.sh create_bluestore_partitions_and_pvcs + - name: create bluestore partitions and PVCs + run: tests/scripts/github-action-helper.sh create_bluestore_partitions_and_pvcs - - name: create cluster prerequisites - run: tests/scripts/github-action-helper.sh create_cluster_prerequisites + - name: create cluster prerequisites + run: tests/scripts/github-action-helper.sh create_cluster_prerequisites - - name: deploy cluster - run: | - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].encrypted" false - cat tests/manifests/test-on-pvc-db.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml - kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml + - name: deploy cluster + run: | + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].encrypted" false + cat tests/manifests/test-on-pvc-db.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml + kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 + - name: wait for ceph to be ready + run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: pvc-db + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: pvc-db - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 pvc-db-wal: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: use local disk - run: tests/scripts/github-action-helper.sh use_local_disk + - name: use local disk + run: tests/scripts/github-action-helper.sh use_local_disk - - name: create bluestore partitions and PVCs for wal - run: tests/scripts/github-action-helper.sh create_bluestore_partitions_and_pvcs_for_wal + - name: create bluestore partitions and PVCs for wal + run: tests/scripts/github-action-helper.sh create_bluestore_partitions_and_pvcs_for_wal - - name: create cluster prerequisites - run: tests/scripts/github-action-helper.sh create_cluster_prerequisites + - name: create cluster prerequisites + run: tests/scripts/github-action-helper.sh create_cluster_prerequisites - - name: deploy rook - run: | - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].encrypted" false - cat tests/manifests/test-on-pvc-db.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml - cat tests/manifests/test-on-pvc-wal.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml - kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml + - name: deploy rook + run: | + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].encrypted" false + cat tests/manifests/test-on-pvc-db.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml + cat tests/manifests/test-on-pvc-wal.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml + kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: | - tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 - kubectl -n rook-ceph get pods + - name: wait for ceph to be ready + run: | + tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 + kubectl -n rook-ceph get pods - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: pvc-db-wal + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: pvc-db-wal - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 encryption-pvc: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: use local disk and create partitions for osds - run: | - tests/scripts/github-action-helper.sh use_local_disk - tests/scripts/github-action-helper.sh create_partitions_for_osds + - name: use local disk and create partitions for osds + run: | + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/github-action-helper.sh create_partitions_for_osds - - name: create cluster prerequisites - run: | - tests/scripts/localPathPV.sh $(lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/github-action-helper.sh create_cluster_prerequisites + - name: create cluster prerequisites + run: | + tests/scripts/localPathPV.sh $(lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/github-action-helper.sh create_cluster_prerequisites - - name: deploy cluster - run: | - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].count" 2 - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].volumeClaimTemplates[0].spec.resources.requests.storage" 6Gi - kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml + - name: deploy cluster + run: | + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].count" 2 + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].volumeClaimTemplates[0].spec.resources.requests.storage" 6Gi + kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: | - tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 - kubectl -n rook-ceph get secrets - sudo lsblk + - name: wait for ceph to be ready + run: | + tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 + kubectl -n rook-ceph get secrets + sudo lsblk - - name: test osd deployment removal and re-hydration - run: | - kubectl -n rook-ceph delete deploy/rook-ceph-osd-0 - tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 + - name: test osd deployment removal and re-hydration + run: | + kubectl -n rook-ceph delete deploy/rook-ceph-osd-0 + tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 - - name: teardown cluster with cleanup policy - run: | - kubectl -n rook-ceph patch cephcluster rook-ceph --type merge -p '{"spec":{"cleanupPolicy":{"confirmation":"yes-really-destroy-data"}}}' - kubectl -n rook-ceph delete cephcluster rook-ceph - kubectl -n rook-ceph logs deploy/rook-ceph-operator - tests/scripts/github-action-helper.sh wait_for_cleanup_pod - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - sudo head --bytes=60 ${BLOCK}1 - sudo head --bytes=60 ${BLOCK}2 - sudo lsblk + - name: teardown cluster with cleanup policy + run: | + kubectl -n rook-ceph patch cephcluster rook-ceph --type merge -p '{"spec":{"cleanupPolicy":{"confirmation":"yes-really-destroy-data"}}}' + kubectl -n rook-ceph delete cephcluster rook-ceph + kubectl -n rook-ceph logs deploy/rook-ceph-operator + tests/scripts/github-action-helper.sh wait_for_cleanup_pod + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + sudo head --bytes=60 ${BLOCK}1 + sudo head --bytes=60 ${BLOCK}2 + sudo lsblk - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: encryption-pvc + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: encryption-pvc - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 encryption-pvc-db: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: use local disk - run: tests/scripts/github-action-helper.sh use_local_disk + - name: use local disk + run: tests/scripts/github-action-helper.sh use_local_disk - - name: create bluestore partitions and PVCs - run: tests/scripts/github-action-helper.sh create_bluestore_partitions_and_pvcs + - name: create bluestore partitions and PVCs + run: tests/scripts/github-action-helper.sh create_bluestore_partitions_and_pvcs - - name: create cluster prerequisites - run: tests/scripts/github-action-helper.sh create_cluster_prerequisites + - name: create cluster prerequisites + run: tests/scripts/github-action-helper.sh create_cluster_prerequisites - - name: deploy cluster - run: | - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml - cat tests/manifests/test-on-pvc-db.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml - kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml + - name: deploy cluster + run: | + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml + cat tests/manifests/test-on-pvc-db.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml + kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: | - tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 - kubectl -n rook-ceph get pods - kubectl -n rook-ceph get secrets + - name: wait for ceph to be ready + run: | + tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 + kubectl -n rook-ceph get pods + kubectl -n rook-ceph get secrets - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: encryption-pvc-db + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: encryption-pvc-db - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 encryption-pvc-db-wal: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: use local disk - run: tests/scripts/github-action-helper.sh use_local_disk + - name: use local disk + run: tests/scripts/github-action-helper.sh use_local_disk - - name: create bluestore partitions and PVCs for wal - run: tests/scripts/github-action-helper.sh create_bluestore_partitions_and_pvcs_for_wal + - name: create bluestore partitions and PVCs for wal + run: tests/scripts/github-action-helper.sh create_bluestore_partitions_and_pvcs_for_wal - - name: create cluster prerequisites - run: tests/scripts/github-action-helper.sh create_cluster_prerequisites + - name: create cluster prerequisites + run: tests/scripts/github-action-helper.sh create_cluster_prerequisites - - name: deploy rook - run: | - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml - cat tests/manifests/test-on-pvc-db.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml - cat tests/manifests/test-on-pvc-wal.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml - kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml + - name: deploy rook + run: | + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml + cat tests/manifests/test-on-pvc-db.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml + cat tests/manifests/test-on-pvc-wal.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml + kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: | - tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 - kubectl -n rook-ceph get pods - kubectl -n rook-ceph get secrets + - name: wait for ceph to be ready + run: | + tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 + kubectl -n rook-ceph get pods + kubectl -n rook-ceph get secrets - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: encryption-pvc-db-wal + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: encryption-pvc-db-wal - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 encryption-pvc-kms-vault-token-auth: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: use local disk and create partitions for osds - run: | - tests/scripts/github-action-helper.sh use_local_disk - tests/scripts/github-action-helper.sh create_partitions_for_osds + - name: use local disk and create partitions for osds + run: | + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/github-action-helper.sh create_partitions_for_osds - - name: create cluster prerequisites - run: | - tests/scripts/localPathPV.sh $(lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/github-action-helper.sh create_cluster_prerequisites + - name: create cluster prerequisites + run: | + tests/scripts/localPathPV.sh $(lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/github-action-helper.sh create_cluster_prerequisites - - name: deploy vault - run: tests/scripts/deploy-validate-vault.sh deploy + - name: deploy vault + run: tests/scripts/deploy-validate-vault.sh deploy - - name: deploy cluster - run: | - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml - cat tests/manifests/test-kms-vault.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml - yq merge --inplace --arrays append tests/manifests/test-cluster-on-pvc-encrypted.yaml tests/manifests/test-kms-vault-spec-token-auth.yaml - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].count" 2 - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].volumeClaimTemplates[0].spec.resources.requests.storage" 6Gi - kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml - yq merge --inplace --arrays append tests/manifests/test-object.yaml tests/manifests/test-kms-vault-spec-token-auth.yaml - yq write -i tests/manifests/test-object.yaml "spec.security.kms.connectionDetails.VAULT_BACKEND_PATH" rook/ver2 - kubectl create -f tests/manifests/test-object.yaml - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml + - name: deploy cluster + run: | + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml + cat tests/manifests/test-kms-vault.yaml >> tests/manifests/test-cluster-on-pvc-encrypted.yaml + yq merge --inplace --arrays append tests/manifests/test-cluster-on-pvc-encrypted.yaml tests/manifests/test-kms-vault-spec-token-auth.yaml + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].count" 2 + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].volumeClaimTemplates[0].spec.resources.requests.storage" 6Gi + kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml + yq merge --inplace --arrays append tests/manifests/test-object.yaml tests/manifests/test-kms-vault-spec-token-auth.yaml + yq write -i tests/manifests/test-object.yaml "spec.security.kms.connectionDetails.VAULT_BACKEND_PATH" rook/ver2 + kubectl create -f tests/manifests/test-object.yaml + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: | - tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 - tests/scripts/validate_cluster.sh rgw - kubectl -n rook-ceph get pods - kubectl -n rook-ceph get secrets + - name: wait for ceph to be ready + run: | + tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 + tests/scripts/validate_cluster.sh rgw + kubectl -n rook-ceph get pods + kubectl -n rook-ceph get secrets - - name: validate osd vault - run: | - tests/scripts/deploy-validate-vault.sh validate_osd - sudo lsblk + - name: validate osd vault + run: | + tests/scripts/deploy-validate-vault.sh validate_osd + sudo lsblk - - name: validate rgw vault kv - run: | - tests/scripts/deploy-validate-vault.sh validate_rgw + - name: validate rgw vault kv + run: | + tests/scripts/deploy-validate-vault.sh validate_rgw - - name: validate rgw vault transit - run: | - kubectl delete -f tests/manifests/test-object.yaml - yq write -i tests/manifests/test-object.yaml "spec.security.kms.connectionDetails.VAULT_SECRET_ENGINE" transit - kubectl create -f tests/manifests/test-object.yaml - tests/scripts/validate_cluster.sh rgw - tests/scripts/deploy-validate-vault.sh validate_rgw + - name: validate rgw vault transit + run: | + kubectl delete -f tests/manifests/test-object.yaml + yq write -i tests/manifests/test-object.yaml "spec.security.kms.connectionDetails.VAULT_SECRET_ENGINE" transit + kubectl create -f tests/manifests/test-object.yaml + tests/scripts/validate_cluster.sh rgw + tests/scripts/deploy-validate-vault.sh validate_rgw - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: encryption-pvc-kms-vault-token-auth + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: encryption-pvc-kms-vault-token-auth - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 encryption-pvc-kms-vault-k8s-auth: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: use local disk and create partitions for osds - run: | - tests/scripts/github-action-helper.sh use_local_disk - tests/scripts/github-action-helper.sh create_partitions_for_osds + - name: use local disk and create partitions for osds + run: | + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/github-action-helper.sh create_partitions_for_osds - - name: create cluster prerequisites - run: | - tests/scripts/localPathPV.sh $(lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/github-action-helper.sh create_cluster_prerequisites + - name: create cluster prerequisites + run: | + tests/scripts/localPathPV.sh $(lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/github-action-helper.sh create_cluster_prerequisites - - name: deploy vault - run: KUBERNETES_AUTH=true tests/scripts/deploy-validate-vault.sh deploy + - name: deploy vault + run: KUBERNETES_AUTH=true tests/scripts/deploy-validate-vault.sh deploy - - name: deploy cluster - run: | - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml - yq merge --inplace --arrays append tests/manifests/test-cluster-on-pvc-encrypted.yaml tests/manifests/test-kms-vault-spec-k8s-auth.yaml - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].count" 2 - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].volumeClaimTemplates[0].spec.resources.requests.storage" 6Gi - kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml + - name: deploy cluster + run: | + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml + yq merge --inplace --arrays append tests/manifests/test-cluster-on-pvc-encrypted.yaml tests/manifests/test-kms-vault-spec-k8s-auth.yaml + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].count" 2 + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].volumeClaimTemplates[0].spec.resources.requests.storage" 6Gi + kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: | - tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 - kubectl -n rook-ceph get pods - kubectl -n rook-ceph get secrets + - name: wait for ceph to be ready + run: | + tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 + kubectl -n rook-ceph get pods + kubectl -n rook-ceph get secrets - - name: validate osd vault - run: | - tests/scripts/deploy-validate-vault.sh validate_osd - sudo lsblk + - name: validate osd vault + run: | + tests/scripts/deploy-validate-vault.sh validate_osd + sudo lsblk - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: encryption-pvc-kms-vault-k8s-auth + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: encryption-pvc-kms-vault-k8s-auth - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 lvm-pvc: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: create cluster prerequisites - run: tests/scripts/github-action-helper.sh create_cluster_prerequisites + - name: create cluster prerequisites + run: tests/scripts/github-action-helper.sh create_cluster_prerequisites - - name: use local disk - run: tests/scripts/github-action-helper.sh use_local_disk + - name: use local disk + run: tests/scripts/github-action-helper.sh use_local_disk - - name: create LV on disk - run: | - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/github-action-helper.sh create_LV_on_disk $BLOCK - tests/scripts/localPathPV.sh /dev/test-rook-vg/test-rook-lv + - name: create LV on disk + run: | + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/github-action-helper.sh create_LV_on_disk $BLOCK + tests/scripts/localPathPV.sh /dev/test-rook-vg/test-rook-lv - - name: deploy cluster - run: | - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml - yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].encrypted" false - kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml - tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml + - name: deploy cluster + run: | + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/operator.yaml + yq write -i tests/manifests/test-cluster-on-pvc-encrypted.yaml "spec.storage.storageClassDeviceSets[0].encrypted" false + kubectl create -f tests/manifests/test-cluster-on-pvc-encrypted.yaml + tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/toolbox.yaml - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 + - name: wait for ceph to be ready + run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 - - name: check-ownerreferences - run: tests/scripts/github-action-helper.sh check_ownerreferences + - name: check-ownerreferences + run: tests/scripts/github-action-helper.sh check_ownerreferences - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: lvm-pvc + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: lvm-pvc - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 multi-cluster-mirroring: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: use local disk into two partitions - run: | - tests/scripts/github-action-helper.sh use_local_disk - BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) - tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --osd-count 2 - sudo lsblk + - name: use local disk into two partitions + run: | + tests/scripts/github-action-helper.sh use_local_disk + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --osd-count 2 + sudo lsblk - - name: deploy first cluster rook - run: | - tests/scripts/github-action-helper.sh deploy_first_rook_cluster - cd deploy/examples/ - sed -i "/resources:/,/ # priorityClassName:/d" rbdmirror.yaml - sed -i "/resources:/,/ # priorityClassName:/d" filesystem-mirror.yaml - kubectl create -f rbdmirror.yaml -f filesystem-mirror.yaml + - name: deploy first cluster rook + run: | + tests/scripts/github-action-helper.sh deploy_first_rook_cluster + cd deploy/examples/ + sed -i "/resources:/,/ # priorityClassName:/d" rbdmirror.yaml + sed -i "/resources:/,/ # priorityClassName:/d" filesystem-mirror.yaml + kubectl create -f rbdmirror.yaml -f filesystem-mirror.yaml - # cephfs-mirroring is a push operation - # running bootstrap create on secondary and bootstrap import on primary. mirror daemons on primary. - - name: deploy second cluster rook - run: | - tests/scripts/github-action-helper.sh deploy_second_rook_cluster - cd deploy/examples/ - sed -i 's/namespace: rook-ceph/namespace: rook-ceph-secondary/g' rbdmirror.yaml - kubectl create -f rbdmirror.yaml + # cephfs-mirroring is a push operation + # running bootstrap create on secondary and bootstrap import on primary. mirror daemons on primary. + - name: deploy second cluster rook + run: | + tests/scripts/github-action-helper.sh deploy_second_rook_cluster + cd deploy/examples/ + sed -i 's/namespace: rook-ceph/namespace: rook-ceph-secondary/g' rbdmirror.yaml + kubectl create -f rbdmirror.yaml - - name: wait for ceph cluster 1 to be ready - run: | - mkdir -p test - tests/scripts/validate_cluster.sh osd 1 - kubectl -n rook-ceph get pods + - name: wait for ceph cluster 1 to be ready + run: | + mkdir -p test + tests/scripts/validate_cluster.sh osd 1 + kubectl -n rook-ceph get pods - - name: create replicated mirrored pool on cluster 1 - run: | - cd deploy/examples/ - yq w -i pool-test.yaml spec.mirroring.enabled true - yq w -i pool-test.yaml spec.mirroring.mode image - kubectl create -f pool-test.yaml - timeout 60 sh -c 'until [ "$(kubectl -n rook-ceph get cephblockpool replicapool -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for pool replicapool to created on cluster 1" && sleep 1; done' + - name: create replicated mirrored pool on cluster 1 + run: | + cd deploy/examples/ + yq w -i pool-test.yaml spec.mirroring.enabled true + yq w -i pool-test.yaml spec.mirroring.mode image + kubectl create -f pool-test.yaml + timeout 60 sh -c 'until [ "$(kubectl -n rook-ceph get cephblockpool replicapool -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for pool replicapool to created on cluster 1" && sleep 1; done' - - name: create replicated mirrored pool 2 on cluster 1 - run: | - cd deploy/examples/ - yq w -i pool-test.yaml metadata.name replicapool2 - kubectl create -f pool-test.yaml - timeout 60 sh -c 'until [ "$(kubectl -n rook-ceph get cephblockpool replicapool2 -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for pool replicapool2 to created on cluster 2" && sleep 1; done' - yq w -i pool-test.yaml metadata.name replicapool + - name: create replicated mirrored pool 2 on cluster 1 + run: | + cd deploy/examples/ + yq w -i pool-test.yaml metadata.name replicapool2 + kubectl create -f pool-test.yaml + timeout 60 sh -c 'until [ "$(kubectl -n rook-ceph get cephblockpool replicapool2 -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for pool replicapool2 to created on cluster 2" && sleep 1; done' + yq w -i pool-test.yaml metadata.name replicapool - - name: create replicated mirrored pool on cluster 2 - run: | - cd deploy/examples/ - yq w -i pool-test.yaml metadata.namespace rook-ceph-secondary - kubectl create -f pool-test.yaml - timeout 60 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephblockpool replicapool -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for pool replicapool to created on cluster 1" && sleep 1; done' + - name: create replicated mirrored pool on cluster 2 + run: | + cd deploy/examples/ + yq w -i pool-test.yaml metadata.namespace rook-ceph-secondary + kubectl create -f pool-test.yaml + timeout 60 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephblockpool replicapool -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for pool replicapool to created on cluster 1" && sleep 1; done' - - name: create replicated mirrored pool 2 on cluster 2 - run: | - cd deploy/examples/ - yq w -i pool-test.yaml metadata.name replicapool2 - kubectl create -f pool-test.yaml - timeout 60 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephblockpool replicapool -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for pool replicapool2 to created on cluster 2" && sleep 1; done' + - name: create replicated mirrored pool 2 on cluster 2 + run: | + cd deploy/examples/ + yq w -i pool-test.yaml metadata.name replicapool2 + kubectl create -f pool-test.yaml + timeout 60 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephblockpool replicapool -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for pool replicapool2 to created on cluster 2" && sleep 1; done' - - name: create images in the pools - run: | - kubectl exec -n rook-ceph deploy/rook-ceph-tools -ti -- rbd -p replicapool create test -s 1G - kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd mirror image enable replicapool/test snapshot - kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool info test - kubectl exec -n rook-ceph deploy/rook-ceph-tools -ti -- rbd -p replicapool2 create test -s 1G - kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd mirror image enable replicapool2/test snapshot - kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool2 info test + - name: create images in the pools + run: | + kubectl exec -n rook-ceph deploy/rook-ceph-tools -ti -- rbd -p replicapool create test -s 1G + kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd mirror image enable replicapool/test snapshot + kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool info test + kubectl exec -n rook-ceph deploy/rook-ceph-tools -ti -- rbd -p replicapool2 create test -s 1G + kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd mirror image enable replicapool2/test snapshot + kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool2 info test - - name: copy block mirror peer secret into the other cluster for replicapool - run: | - kubectl -n rook-ceph get secret pool-peer-token-replicapool -o yaml > pool-peer-token-replicapool.yaml - yq delete --inplace pool-peer-token-replicapool.yaml metadata.ownerReferences - yq write --inplace pool-peer-token-replicapool.yaml metadata.namespace rook-ceph-secondary - yq write --inplace pool-peer-token-replicapool.yaml metadata.name pool-peer-token-replicapool-config - kubectl create --namespace=rook-ceph-secondary -f pool-peer-token-replicapool.yaml + - name: copy block mirror peer secret into the other cluster for replicapool + run: | + kubectl -n rook-ceph get secret pool-peer-token-replicapool -o yaml > pool-peer-token-replicapool.yaml + yq delete --inplace pool-peer-token-replicapool.yaml metadata.ownerReferences + yq write --inplace pool-peer-token-replicapool.yaml metadata.namespace rook-ceph-secondary + yq write --inplace pool-peer-token-replicapool.yaml metadata.name pool-peer-token-replicapool-config + kubectl create --namespace=rook-ceph-secondary -f pool-peer-token-replicapool.yaml - - name: copy block mirror peer secret into the other cluster for replicapool2 (using cluster global peer) - run: | - kubectl -n rook-ceph get secret cluster-peer-token-my-cluster -o yaml > cluster-peer-token-my-cluster.yaml - yq delete --inplace cluster-peer-token-my-cluster.yaml metadata.ownerReferences - yq write --inplace cluster-peer-token-my-cluster.yaml metadata.namespace rook-ceph-secondary - yq write --inplace cluster-peer-token-my-cluster.yaml metadata.name cluster-peer-token-my-cluster-config - kubectl create --namespace=rook-ceph-secondary -f cluster-peer-token-my-cluster.yaml + - name: copy block mirror peer secret into the other cluster for replicapool2 (using cluster global peer) + run: | + kubectl -n rook-ceph get secret cluster-peer-token-my-cluster -o yaml > cluster-peer-token-my-cluster.yaml + yq delete --inplace cluster-peer-token-my-cluster.yaml metadata.ownerReferences + yq write --inplace cluster-peer-token-my-cluster.yaml metadata.namespace rook-ceph-secondary + yq write --inplace cluster-peer-token-my-cluster.yaml metadata.name cluster-peer-token-my-cluster-config + kubectl create --namespace=rook-ceph-secondary -f cluster-peer-token-my-cluster.yaml - - name: add block mirror peer secret to the other cluster for replicapool - run: | - kubectl -n rook-ceph-secondary patch cephblockpool replicapool --type merge -p '{"spec":{"mirroring":{"peers": {"secretNames": ["pool-peer-token-replicapool-config"]}}}}' + - name: add block mirror peer secret to the other cluster for replicapool + run: | + kubectl -n rook-ceph-secondary patch cephblockpool replicapool --type merge -p '{"spec":{"mirroring":{"peers": {"secretNames": ["pool-peer-token-replicapool-config"]}}}}' - - name: add block mirror peer secret to the other cluster for replicapool2 (using cluster global peer) - run: | - kubectl -n rook-ceph-secondary patch cephblockpool replicapool2 --type merge -p '{"spec":{"mirroring":{"peers": {"secretNames": ["cluster-peer-token-my-cluster-config"]}}}}' + - name: add block mirror peer secret to the other cluster for replicapool2 (using cluster global peer) + run: | + kubectl -n rook-ceph-secondary patch cephblockpool replicapool2 --type merge -p '{"spec":{"mirroring":{"peers": {"secretNames": ["cluster-peer-token-my-cluster-config"]}}}}' - - name: verify image has been mirrored for replicapool - run: | - # let's wait a bit for the image to be present - timeout 120 sh -c 'until [ "$(kubectl exec -n rook-ceph-secondary deploy/rook-ceph-tools -t -- rbd -p replicapool ls|grep -c test)" -eq 1 ]; do echo "waiting for image to be mirrored in pool replicapool" && sleep 1; done' + - name: verify image has been mirrored for replicapool + run: | + # let's wait a bit for the image to be present + timeout 120 sh -c 'until [ "$(kubectl exec -n rook-ceph-secondary deploy/rook-ceph-tools -t -- rbd -p replicapool ls|grep -c test)" -eq 1 ]; do echo "waiting for image to be mirrored in pool replicapool" && sleep 1; done' - - name: verify image has been mirrored for replicapool2 - run: | - # let's wait a bit for the image to be present - timeout 120 sh -c 'until [ "$(kubectl exec -n rook-ceph-secondary deploy/rook-ceph-tools -t -- rbd -p replicapool2 ls|grep -c test)" -eq 1 ]; do echo "waiting for image to be mirrored in pool replicapool2" && sleep 1; done' + - name: verify image has been mirrored for replicapool2 + run: | + # let's wait a bit for the image to be present + timeout 120 sh -c 'until [ "$(kubectl exec -n rook-ceph-secondary deploy/rook-ceph-tools -t -- rbd -p replicapool2 ls|grep -c test)" -eq 1 ]; do echo "waiting for image to be mirrored in pool replicapool2" && sleep 1; done' - - name: display cephblockpool and image status - run: | - timeout 80 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephblockpool replicapool -o jsonpath='{.status.mirroringStatus.summary.daemon_health}'|grep -c OK)" -eq 1 ]; do echo "waiting for mirroring status to be updated in replicapool" && sleep 1; done' - timeout 80 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephblockpool replicapool2 -o jsonpath='{.status.mirroringStatus.summary.daemon_health}'|grep -c OK)" -eq 1 ]; do echo "waiting for mirroring status to be updated in replicapool2" && sleep 1; done' - kubectl -n rook-ceph-secondary get cephblockpool replicapool -o yaml - kubectl -n rook-ceph-secondary get cephblockpool replicapool2 -o yaml - kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool info test - kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool2 info test + - name: display cephblockpool and image status + run: | + timeout 80 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephblockpool replicapool -o jsonpath='{.status.mirroringStatus.summary.daemon_health}'|grep -c OK)" -eq 1 ]; do echo "waiting for mirroring status to be updated in replicapool" && sleep 1; done' + timeout 80 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephblockpool replicapool2 -o jsonpath='{.status.mirroringStatus.summary.daemon_health}'|grep -c OK)" -eq 1 ]; do echo "waiting for mirroring status to be updated in replicapool2" && sleep 1; done' + kubectl -n rook-ceph-secondary get cephblockpool replicapool -o yaml + kubectl -n rook-ceph-secondary get cephblockpool replicapool2 -o yaml + kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool info test + kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool2 info test - - name: copy block mirror peer secret into the primary cluster for replicapool - run: | - kubectl -n rook-ceph-secondary get secret pool-peer-token-replicapool -o yaml |\ - sed 's/namespace: rook-ceph-secondary/namespace: rook-ceph/g; s/name: pool-peer-token-replicapool/name: pool-peer-token-replicapool-config/g' |\ - kubectl create --namespace=rook-ceph -f - + - name: copy block mirror peer secret into the primary cluster for replicapool + run: | + kubectl -n rook-ceph-secondary get secret pool-peer-token-replicapool -o yaml |\ + sed 's/namespace: rook-ceph-secondary/namespace: rook-ceph/g; s/name: pool-peer-token-replicapool/name: pool-peer-token-replicapool-config/g' |\ + kubectl create --namespace=rook-ceph -f - - - name: add block mirror peer secret to the primary cluster for replicapool - run: | - kubectl -n rook-ceph patch cephblockpool replicapool --type merge -p '{"spec":{"mirroring":{"peers": {"secretNames": ["pool-peer-token-replicapool-config"]}}}}' + - name: add block mirror peer secret to the primary cluster for replicapool + run: | + kubectl -n rook-ceph patch cephblockpool replicapool --type merge -p '{"spec":{"mirroring":{"peers": {"secretNames": ["pool-peer-token-replicapool-config"]}}}}' - - name: wait for rook-ceph-csi-mapping-config to be updated with cluster ID - run: | - timeout 60 sh -c 'until [ "$(kubectl get cm -n rook-ceph rook-ceph-csi-mapping-config -o jsonpath='{.data.csi-mapping-config-json}' | grep -c "rook-ceph-secondary")" -eq 1 ]; do echo "waiting for rook-ceph-csi-mapping-config to be created with cluster ID mappings" && sleep 1; done' + - name: wait for rook-ceph-csi-mapping-config to be updated with cluster ID + run: | + timeout 60 sh -c 'until [ "$(kubectl get cm -n rook-ceph rook-ceph-csi-mapping-config -o jsonpath='{.data.csi-mapping-config-json}' | grep -c "rook-ceph-secondary")" -eq 1 ]; do echo "waiting for rook-ceph-csi-mapping-config to be created with cluster ID mappings" && sleep 1; done' - - name: create replicated mirrored filesystem on cluster 1 - run: | - PRIMARY_YAML=deploy/examples/filesystem-test-primary.yaml - cp deploy/examples/filesystem-test.yaml "$PRIMARY_YAML" - yq merge --inplace --arrays append "$PRIMARY_YAML" tests/manifests/test-fs-mirror-spec.yaml - kubectl create -f "$PRIMARY_YAML" - timeout 120 sh -c 'until [ "$(kubectl -n rook-ceph get cephfilesystem myfs -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for filesystem to be created" && sleep 1; done' + - name: create replicated mirrored filesystem on cluster 1 + run: | + PRIMARY_YAML=deploy/examples/filesystem-test-primary.yaml + cp deploy/examples/filesystem-test.yaml "$PRIMARY_YAML" + yq merge --inplace --arrays append "$PRIMARY_YAML" tests/manifests/test-fs-mirror-spec.yaml + kubectl create -f "$PRIMARY_YAML" + timeout 120 sh -c 'until [ "$(kubectl -n rook-ceph get cephfilesystem myfs -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for filesystem to be created" && sleep 1; done' - - name: create replicated mirrored filesystem on cluster 2 - run: | - cd deploy/examples/ - yq w -i filesystem-test.yaml metadata.namespace rook-ceph-secondary - yq w -i filesystem-test.yaml spec.mirroring.enabled true - kubectl create -f filesystem-test.yaml - timeout 120 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephfilesystem myfs -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for filesystem to be created" && sleep 1; done' + - name: create replicated mirrored filesystem on cluster 2 + run: | + cd deploy/examples/ + yq w -i filesystem-test.yaml metadata.namespace rook-ceph-secondary + yq w -i filesystem-test.yaml spec.mirroring.enabled true + kubectl create -f filesystem-test.yaml + timeout 120 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephfilesystem myfs -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for filesystem to be created" && sleep 1; done' - - name: copy filesystem mirror peer secret from the secondary cluster to the primary one - run: | - kubectl -n rook-ceph-secondary get secret fs-peer-token-myfs -o yaml |\ - sed '/ownerReferences/,+6d' |\ - sed 's/namespace: rook-ceph-secondary/namespace: rook-ceph/g; s/name: fs-peer-token-myfs/name: fs-peer-token-myfs-config/g' |\ - kubectl create --namespace=rook-ceph -f - + - name: copy filesystem mirror peer secret from the secondary cluster to the primary one + run: | + kubectl -n rook-ceph-secondary get secret fs-peer-token-myfs -o yaml |\ + sed '/ownerReferences/,+6d' |\ + sed 's/namespace: rook-ceph-secondary/namespace: rook-ceph/g; s/name: fs-peer-token-myfs/name: fs-peer-token-myfs-config/g' |\ + kubectl create --namespace=rook-ceph -f - - - name: add filesystem mirror peer secret to the primary cluster - run: | - kubectl -n rook-ceph patch cephfilesystem myfs --type merge -p '{"spec":{"mirroring":{"peers": {"secretNames": ["fs-peer-token-myfs-config"]}}}}' + - name: add filesystem mirror peer secret to the primary cluster + run: | + kubectl -n rook-ceph patch cephfilesystem myfs --type merge -p '{"spec":{"mirroring":{"peers": {"secretNames": ["fs-peer-token-myfs-config"]}}}}' - - name: verify fs mirroring is working - run: | - timeout 45 sh -c 'until [ "$(kubectl -n rook-ceph exec -t deploy/rook-ceph-fs-mirror -- ls -1 /var/run/ceph/|grep -c asok)" -lt 3 ]; do echo "waiting for connection to peer" && sleep 1; done' - sockets=$(kubectl -n rook-ceph exec -t deploy/rook-ceph-fs-mirror -- ls -1 /var/run/ceph/) - status=$(for socket in $sockets; do minikube kubectl -- -n rook-ceph exec -t deploy/rook-ceph-fs-mirror -- ceph --admin-daemon /var/run/ceph/$socket help|awk -F ":" '/get filesystem mirror status/ {print $1}'; done) - if [ "${#status}" -lt 1 ]; then echo "peer addition failed" && exit 1; fi + - name: verify fs mirroring is working + run: | + timeout 45 sh -c 'until [ "$(kubectl -n rook-ceph exec -t deploy/rook-ceph-fs-mirror -- ls -1 /var/run/ceph/|grep -c asok)" -lt 3 ]; do echo "waiting for connection to peer" && sleep 1; done' + sockets=$(kubectl -n rook-ceph exec -t deploy/rook-ceph-fs-mirror -- ls -1 /var/run/ceph/) + status=$(for socket in $sockets; do minikube kubectl -- -n rook-ceph exec -t deploy/rook-ceph-fs-mirror -- ceph --admin-daemon /var/run/ceph/$socket help|awk -F ":" '/get filesystem mirror status/ {print $1}'; done) + if [ "${#status}" -lt 1 ]; then echo "peer addition failed" && exit 1; fi - - name: display cephfilesystem and fs mirror daemon status - run: | - kubectl -n rook-ceph get cephfilesystem myfs -o yaml - # the check is not super ideal since 'mirroring_failed' is only displayed when there is a failure but not when it's working... - timeout 60 sh -c 'while [ "$(kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- ceph fs snapshot mirror daemon status|jq -r '.[0].filesystems[0]'|grep -c "mirroring_failed")" -eq 1 ]; do echo "waiting for filesystem to be mirrored" && sleep 1; done' + - name: display cephfilesystem and fs mirror daemon status + run: | + kubectl -n rook-ceph get cephfilesystem myfs -o yaml + # the check is not super ideal since 'mirroring_failed' is only displayed when there is a failure but not when it's working... + timeout 60 sh -c 'while [ "$(kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- ceph fs snapshot mirror daemon status|jq -r '.[0].filesystems[0]'|grep -c "mirroring_failed")" -eq 1 ]; do echo "waiting for filesystem to be mirrored" && sleep 1; done' - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: multi-cluster-mirroring + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: multi-cluster-mirroring - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 rgw-multisite-testing: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: run RGW multisite test - uses: ./.github/workflows/rgw-multisite-test - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - # ceph-image: # use default + - name: run RGW multisite test + uses: ./.github/workflows/rgw-multisite-test + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + # ceph-image: # use default - - name: upload test result - uses: actions/upload-artifact@v2 - if: always() - with: - name: rgw-multisite-testing - path: test + - name: upload test result + uses: actions/upload-artifact@v2 + if: always() + with: + name: rgw-multisite-testing + path: test - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 encryption-pvc-kms-ibm-kp: runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: run encryption KMS IBM Key Protect - uses: ./.github/workflows/encryption-pvc-kms-ibm-kp - if: "env.IBM_KP_SERVICE_INSTANCE_ID != '' && env.IBM_KP_SERVICE_API_KEY != ''" - env: - IBM_KP_SERVICE_INSTANCE_ID: ${{ secrets.IBM_INSTANCE_ID }} - IBM_KP_SERVICE_API_KEY: ${{ secrets.IBM_SERVICE_API_KEY }} - with: - ibm-instance-id: ${{ secrets.IBM_INSTANCE_ID }} - ibm-service-api-key: ${{ secrets.IBM_SERVICE_API_KEY }} - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: run encryption KMS IBM Key Protect + uses: ./.github/workflows/encryption-pvc-kms-ibm-kp + if: "env.IBM_KP_SERVICE_INSTANCE_ID != '' && env.IBM_KP_SERVICE_API_KEY != ''" + env: + IBM_KP_SERVICE_INSTANCE_ID: ${{ secrets.IBM_INSTANCE_ID }} + IBM_KP_SERVICE_API_KEY: ${{ secrets.IBM_SERVICE_API_KEY }} + with: + 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@v2 - if: always() - with: - name: encryption-pvc-kms-ibm-kp - path: test + - name: upload test result + uses: actions/upload-artifact@v2 + if: always() + with: + name: encryption-pvc-kms-ibm-kp + path: test - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 multus-cluster-network: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: validate-yaml - run: tests/scripts/github-action-helper.sh validate_yaml + - name: validate-yaml + run: tests/scripts/github-action-helper.sh validate_yaml - - name: use local disk and create partitions for osds - run: | - tests/scripts/github-action-helper.sh use_local_disk - tests/scripts/github-action-helper.sh create_partitions_for_osds + - name: use local disk and create partitions for osds + run: | + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/github-action-helper.sh create_partitions_for_osds - - name: deploy multus - run: tests/scripts/github-action-helper.sh deploy_multus + - name: deploy multus + run: tests/scripts/github-action-helper.sh deploy_multus - - name: deploy multus cluster - run: tests/scripts/github-action-helper.sh deploy_multus_cluster + - name: deploy multus cluster + run: tests/scripts/github-action-helper.sh deploy_multus_cluster - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for ceph to be ready - run: IS_POD_NETWORK=true IS_MULTUS=true tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd_multus 2 + - name: wait for ceph to be ready + run: IS_POD_NETWORK=true IS_MULTUS=true tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd_multus 2 - - name: wait for ceph-csi configmap to be updated with network namespace - run: tests/scripts/github-action-helper.sh wait_for_ceph_csi_configmap_to_be_updated + - name: wait for ceph-csi configmap to be updated with network namespace + run: tests/scripts/github-action-helper.sh wait_for_ceph_csi_configmap_to_be_updated - - name: test ceph-csi-rbd plugin restart - run: tests/scripts/github-action-helper.sh test_csi_rbd_workload + - name: test ceph-csi-rbd plugin restart + run: tests/scripts/github-action-helper.sh test_csi_rbd_workload - - name: test ceph-csi-cephfs plugin restart - run: tests/scripts/github-action-helper.sh test_csi_cephfs_workload + - name: test ceph-csi-cephfs plugin restart + run: tests/scripts/github-action-helper.sh test_csi_cephfs_workload - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: canary-multus + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: canary-multus - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 csi-hostnetwork-disabled: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/canary-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: setup cluster resources + uses: ./.github/workflows/canary-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: use local disk and create partitions for osds + run: | + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/github-action-helper.sh create_partitions_for_osds - - name: use local disk and create partitions for osds - run: | - tests/scripts/github-action-helper.sh use_local_disk - tests/scripts/github-action-helper.sh create_partitions_for_osds + - name: deploy CSI hostNetworking disabled cluster + run: tests/scripts/github-action-helper.sh deploy_csi_hostnetwork_disabled_cluster - - name: deploy CSI hostNetworking disabled cluster - run: tests/scripts/github-action-helper.sh deploy_csi_hostnetwork_disabled_cluster + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod - - name: wait for prepare pod - run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + - name: wait for ceph to be ready + run: IS_POD_NETWORK=true tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 - - name: wait for ceph to be ready - run: IS_POD_NETWORK=true tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2 + - name: wait for ceph-csi configmap to be updated with network namespace + run: tests/scripts/github-action-helper.sh wait_for_ceph_csi_configmap_to_be_updated - - name: wait for ceph-csi configmap to be updated with network namespace - run: tests/scripts/github-action-helper.sh wait_for_ceph_csi_configmap_to_be_updated + - name: test ceph-csi-rbd plugin restart + run: tests/scripts/github-action-helper.sh test_csi_rbd_workload - - name: test ceph-csi-rbd plugin restart - run: tests/scripts/github-action-helper.sh test_csi_rbd_workload + - name: test ceph-csi-cephfs plugin restart + run: tests/scripts/github-action-helper.sh test_csi_cephfs_workload - - name: test ceph-csi-cephfs plugin restart - run: tests/scripts/github-action-helper.sh test_csi_cephfs_workload + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: csi-hostnetwork-disabled - - name: collect common logs - if: always() - uses: ./.github/workflows/collect-logs - with: - name: csi-hostnetwork-disabled + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 diff --git a/.github/workflows/codegen.yml b/.github/workflows/codegen.yml index 3c3027cc0..589f03874 100644 --- a/.github/workflows/codegen.yml +++ b/.github/workflows/codegen.yml @@ -29,22 +29,22 @@ jobs: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.19 + - uses: actions/setup-go@v2 + with: + go-version: 1.19 - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: copy working directory to GOPATH - run: sudo mkdir -p /home/runner/go/src/github.com && sudo cp -a /home/runner/work/rook /home/runner/go/src/github.com/ + - name: copy working directory to GOPATH + run: sudo mkdir -p /home/runner/go/src/github.com && sudo cp -a /home/runner/work/rook /home/runner/go/src/github.com/ - - name: run codegen - working-directory: /home/runner/go/src/github.com/rook/rook - run: GOPATH=$(go env GOPATH) make codegen + - name: run codegen + working-directory: /home/runner/go/src/github.com/rook/rook + run: GOPATH=$(go env GOPATH) make codegen - - name: validate codegen - working-directory: /home/runner/go/src/github.com/rook/rook - run: tests/scripts/validate_modified_files.sh codegen + - name: validate codegen + working-directory: /home/runner/go/src/github.com/rook/rook + run: tests/scripts/validate_modified_files.sh codegen diff --git a/.github/workflows/crds-gen.yml b/.github/workflows/crds-gen.yml index 1f86966b8..62877659a 100644 --- a/.github/workflows/crds-gen.yml +++ b/.github/workflows/crds-gen.yml @@ -28,22 +28,22 @@ jobs: crds-gen: runs-on: ubuntu-18.04 steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.18 + - uses: actions/setup-go@v2 + with: + go-version: 1.18 - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: copy working directory to GOPATH - run: sudo mkdir -p /home/runner/go/src/github.com && sudo cp -a /home/runner/work/rook /home/runner/go/src/github.com/ + - name: copy working directory to GOPATH + run: sudo mkdir -p /home/runner/go/src/github.com && sudo cp -a /home/runner/work/rook /home/runner/go/src/github.com/ - - name: run crds-gen - working-directory: /home/runner/go/src/github.com/rook/rook - run: GOPATH=$(go env GOPATH) make crds + - name: run crds-gen + working-directory: /home/runner/go/src/github.com/rook/rook + run: GOPATH=$(go env GOPATH) make crds - - name: validate crds-gen - working-directory: /home/runner/go/src/github.com/rook/rook - run: tests/scripts/validate_modified_files.sh crd + - name: validate crds-gen + working-directory: /home/runner/go/src/github.com/rook/rook + run: tests/scripts/validate_modified_files.sh crd diff --git a/.github/workflows/create-tag.yaml b/.github/workflows/create-tag.yaml index d7815a904..2758fd465 100644 --- a/.github/workflows/create-tag.yaml +++ b/.github/workflows/create-tag.yaml @@ -3,7 +3,7 @@ on: workflow_dispatch: inputs: version: - description: 'Release version (e.g. v1.7.0)' + description: "Release version (e.g. v1.7.0)" required: true defaults: diff --git a/.github/workflows/daily-nightly-jobs.yml b/.github/workflows/daily-nightly-jobs.yml index c200236f7..f3249779a 100644 --- a/.github/workflows/daily-nightly-jobs.yml +++ b/.github/workflows/daily-nightly-jobs.yml @@ -340,11 +340,7 @@ jobs: strategy: matrix: ceph-image-tag: - [ - "latest-master-devel", - "latest-quincy-devel", - "latest-pacific-devel", - ] + ["latest-master-devel", "latest-quincy-devel", "latest-pacific-devel"] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/integration-test-config/action.yaml b/.github/workflows/integration-test-config/action.yaml index 0f4031350..906edb9dc 100644 --- a/.github/workflows/integration-test-config/action.yaml +++ b/.github/workflows/integration-test-config/action.yaml @@ -11,28 +11,28 @@ inputs: runs: using: "composite" steps: - - name: setup golang - uses: actions/setup-go@v2 - with: - go-version: 1.18 + - name: setup golang + uses: actions/setup-go@v2 + with: + go-version: 1.18 - - name: setup minikube - uses: manusa/actions-setup-minikube@v2.6.0 - with: - minikube version: "v1.26.0" - kubernetes version: ${{ inputs.kubernetes-version }} - start args: --memory 6g --cpus=2 --addons ingress - github token: ${{ inputs.github-token }} + - name: setup minikube + uses: manusa/actions-setup-minikube@v2.6.0 + with: + minikube version: "v1.26.0" + kubernetes version: ${{ inputs.kubernetes-version }} + start args: --memory 6g --cpus=2 --addons ingress + github token: ${{ inputs.github-token }} - - name: print k8s cluster status - shell: bash --noprofile --norc -eo pipefail -x {0} - run: tests/scripts/github-action-helper.sh print_k8s_cluster_status + - name: print k8s cluster status + shell: bash --noprofile --norc -eo pipefail -x {0} + run: tests/scripts/github-action-helper.sh print_k8s_cluster_status - # This step is required for all the integration tests except the canary tests - - name: use local disk - shell: bash --noprofile --norc -eo pipefail -x {0} - run: tests/scripts/github-action-helper.sh use_local_disk_for_integration_test + # This step is required for all the integration tests except the canary tests + - name: use local disk + shell: bash --noprofile --norc -eo pipefail -x {0} + run: tests/scripts/github-action-helper.sh use_local_disk_for_integration_test - - name: build rook - shell: bash --noprofile --norc -eo pipefail -x {0} - run: tests/scripts/github-action-helper.sh build_rook + - name: build rook + shell: bash --noprofile --norc -eo pipefail -x {0} + run: tests/scripts/github-action-helper.sh build_rook diff --git a/.github/workflows/integration-test-helm-suite.yaml b/.github/workflows/integration-test-helm-suite.yaml index 3873412ed..ad8cef237 100644 --- a/.github/workflows/integration-test-helm-suite.yaml +++ b/.github/workflows/integration-test-helm-suite.yaml @@ -22,54 +22,54 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.17.17', 'v1.24.1'] + kubernetes-versions: ["v1.17.17", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: remove read permission from kube config file - run: sudo chmod go-r ~/.kube/config + - name: remove read permission from kube config file + run: sudo chmod go-r ~/.kube/config - - name: TestCephHelmSuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - tests/scripts/github-action-helper.sh create_helm_tag - tests/scripts/helm.sh up - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - SKIP_TEST_CLEANUP=false SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -failfast -run CephHelmSuite github.com/rook/rook/tests/integration + - name: TestCephHelmSuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + tests/scripts/github-action-helper.sh create_helm_tag + tests/scripts/helm.sh up + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + SKIP_TEST_CLEANUP=false SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -failfast -run CephHelmSuite github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="helm-ns" - export OPERATOR_NAMESPACE="helm-ns-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="helm-ns" + export OPERATOR_NAMESPACE="helm-ns-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-helm-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-helm-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 diff --git a/.github/workflows/integration-test-mgr-suite.yaml b/.github/workflows/integration-test-mgr-suite.yaml index 649b8d3dd..13b4dd098 100644 --- a/.github/workflows/integration-test-mgr-suite.yaml +++ b/.github/workflows/integration-test-mgr-suite.yaml @@ -21,49 +21,49 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.24.1'] + kubernetes-versions: ["v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestCephMgrSuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - go test -v -timeout 1800s -failfast -run CephMgrSuite github.com/rook/rook/tests/integration + - name: TestCephMgrSuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -failfast -run CephMgrSuite github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="mgr-ns" - export OPERATOR_NAMESPACE="mgr-ns-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="mgr-ns" + export OPERATOR_NAMESPACE="mgr-ns-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-mgr-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-mgr-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 diff --git a/.github/workflows/integration-test-multi-cluster-suite.yaml b/.github/workflows/integration-test-multi-cluster-suite.yaml index 19aa67365..e926513b8 100644 --- a/.github/workflows/integration-test-multi-cluster-suite.yaml +++ b/.github/workflows/integration-test-multi-cluster-suite.yaml @@ -22,50 +22,50 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.24.1'] + kubernetes-versions: ["v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestCephMultiClusterDeploySuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export TEST_SCRATCH_DEVICE=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1)1 - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - go test -v -timeout 1800s -failfast -run CephMultiClusterDeploySuite github.com/rook/rook/tests/integration + - name: TestCephMultiClusterDeploySuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export TEST_SCRATCH_DEVICE=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1)1 + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -failfast -run CephMultiClusterDeploySuite github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export OPERATOR_NAMESPACE="multi-core-system" - CLUSTER_NAMESPACE="multi-core" tests/scripts/collect-logs.sh - CLUSTER_NAMESPACE="multi-external" tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export OPERATOR_NAMESPACE="multi-core-system" + CLUSTER_NAMESPACE="multi-core" tests/scripts/collect-logs.sh + CLUSTER_NAMESPACE="multi-external" tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-multi-cluster-deploy-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-multi-cluster-deploy-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 diff --git a/.github/workflows/integration-test-object-suite.yaml b/.github/workflows/integration-test-object-suite.yaml index c3c643919..2c86cbb64 100644 --- a/.github/workflows/integration-test-object-suite.yaml +++ b/.github/workflows/integration-test-object-suite.yaml @@ -22,49 +22,49 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.17.17', 'v1.24.1'] + kubernetes-versions: ["v1.17.17", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestCephObjectSuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -failfast -run CephObjectSuite github.com/rook/rook/tests/integration + - name: TestCephObjectSuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -failfast -run CephObjectSuite github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="object-ns" - export OPERATOR_NAMESPACE="object-ns-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="object-ns" + export OPERATOR_NAMESPACE="object-ns-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-object-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-object-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 diff --git a/.github/workflows/integration-test-smoke-suite.yaml b/.github/workflows/integration-test-smoke-suite.yaml index 7a30ea1e2..91f1c1e42 100644 --- a/.github/workflows/integration-test-smoke-suite.yaml +++ b/.github/workflows/integration-test-smoke-suite.yaml @@ -22,49 +22,49 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.17.17', 'v1.24.1'] + kubernetes-versions: ["v1.17.17", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestCephSmokeSuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -failfast -run CephSmokeSuite github.com/rook/rook/tests/integration + - name: TestCephSmokeSuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -failfast -run CephSmokeSuite github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="smoke-ns" - export OPERATOR_NAMESPACE="smoke-ns-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="smoke-ns" + export OPERATOR_NAMESPACE="smoke-ns-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-smoke-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-smoke-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 diff --git a/.github/workflows/integration-test-upgrade-suite.yaml b/.github/workflows/integration-test-upgrade-suite.yaml index 858aa7ceb..63c0da283 100644 --- a/.github/workflows/integration-test-upgrade-suite.yaml +++ b/.github/workflows/integration-test-upgrade-suite.yaml @@ -22,44 +22,44 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.17.17', 'v1.24.1'] + kubernetes-versions: ["v1.17.17", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestCephUpgradeSuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - go test -v -timeout 1800s -failfast -run CephUpgradeSuite/TestUpgradeRook github.com/rook/rook/tests/integration + - name: TestCephUpgradeSuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -failfast -run CephUpgradeSuite/TestUpgradeRook github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="upgrade" - export OPERATOR_NAMESPACE="upgrade-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="upgrade" + export OPERATOR_NAMESPACE="upgrade-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-upgrade-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-upgrade-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ - - name: setup tmate session for debugging when event is PR - if: failure() && github.event_name == 'pull_request' - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: setup tmate session for debugging when event is PR + if: failure() && github.event_name == 'pull_request' + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 TestHelmUpgradeSuite: if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} @@ -67,52 +67,52 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.19.16', 'v1.24.1'] + kubernetes-versions: ["v1.19.16", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestHelmUpgradeSuite - run: | - tests/scripts/github-action-helper.sh create_helm_tag - tests/scripts/helm.sh up + - name: TestHelmUpgradeSuite + run: | + tests/scripts/github-action-helper.sh create_helm_tag + tests/scripts/helm.sh up - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - go test -v -timeout 1800s -failfast -run CephUpgradeSuite/TestUpgradeHelm github.com/rook/rook/tests/integration + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -failfast -run CephUpgradeSuite/TestUpgradeHelm github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="upgrade" - export OPERATOR_NAMESPACE="upgrade-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="upgrade" + export OPERATOR_NAMESPACE="upgrade-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-upgrade-helm-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-upgrade-helm-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ - - name: consider debugging - if: failure() && github.event_name == 'pull_request' - run: | - # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run - if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi + - name: consider debugging + if: failure() && github.event_name == 'pull_request' + run: | + # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run + if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then + echo USE_TMATE=1 >> $GITHUB_ENV + fi - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 - timeout-minutes: 60 + - name: set up tmate session for debugging + if: failure() && env.USE_TMATE + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 diff --git a/.github/workflows/integration-tests-on-release.yaml b/.github/workflows/integration-tests-on-release.yaml index 73a44a1dd..3d230243e 100644 --- a/.github/workflows/integration-tests-on-release.yaml +++ b/.github/workflows/integration-tests-on-release.yaml @@ -18,201 +18,201 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.17.17','v1.19.16','v1.21.7','v1.24.1'] + kubernetes-versions: ["v1.17.17", "v1.19.16", "v1.21.7", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestCephHelmSuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - tests/scripts/github-action-helper.sh create_helm_tag - tests/scripts/helm.sh up - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - SKIP_TEST_CLEANUP=false SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -run CephHelmSuite github.com/rook/rook/tests/integration + - name: TestCephHelmSuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + tests/scripts/github-action-helper.sh create_helm_tag + tests/scripts/helm.sh up + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + SKIP_TEST_CLEANUP=false SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -run CephHelmSuite github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="helm-ns" - export OPERATOR_NAMESPACE="helm-ns-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="helm-ns" + export OPERATOR_NAMESPACE="helm-ns-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-helm-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-helm-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ TestCephMultiClusterDeploySuite: runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.17.17','v1.19.16','v1.21.7','v1.24.1'] + kubernetes-versions: ["v1.17.17", "v1.19.16", "v1.21.7", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestCephMultiClusterDeploySuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export TEST_SCRATCH_DEVICE=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1)1 - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - go test -v -timeout 1800s -run CephMultiClusterDeploySuite github.com/rook/rook/tests/integration + - name: TestCephMultiClusterDeploySuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export TEST_SCRATCH_DEVICE=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1)1 + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -run CephMultiClusterDeploySuite github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export OPERATOR_NAMESPACE="multi-core-system" - CLUSTER_NAMESPACE="multi-core" tests/scripts/collect-logs.sh - CLUSTER_NAMESPACE="multi-external" tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export OPERATOR_NAMESPACE="multi-core-system" + CLUSTER_NAMESPACE="multi-core" tests/scripts/collect-logs.sh + CLUSTER_NAMESPACE="multi-external" tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-multi-cluster-deploy-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-multi-cluster-deploy-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ TestCephSmokeSuite: runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.17.17','v1.19.16','v1.21.7','v1.24.1'] + kubernetes-versions: ["v1.17.17", "v1.19.16", "v1.21.7", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestCephSmokeSuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -run CephSmokeSuite github.com/rook/rook/tests/integration + - name: TestCephSmokeSuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -run CephSmokeSuite github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="smoke-ns" - export OPERATOR_NAMESPACE="smoke-ns-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="smoke-ns" + export OPERATOR_NAMESPACE="smoke-ns-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-smoke-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-smoke-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ TestCephUpgradeSuite: runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.17.17','v1.19.16','v1.21.7','v1.24.1'] + kubernetes-versions: ["v1.17.17", "v1.19.16", "v1.21.7", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestCephUpgradeSuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - go test -v -timeout 1800s -run CephUpgradeSuite/TestUpgradeRook github.com/rook/rook/tests/integration + - name: TestCephUpgradeSuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -run CephUpgradeSuite/TestUpgradeRook github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="upgrade" - export OPERATOR_NAMESPACE="upgrade-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="upgrade" + export OPERATOR_NAMESPACE="upgrade-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-upgrade-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-upgrade-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ TestHelmUpgradeSuite: runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.19.16','v1.21.7', 'v1.24.1'] + kubernetes-versions: ["v1.19.16", "v1.21.7", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestHelmUpgradeSuite - run: | - tests/scripts/github-action-helper.sh create_helm_tag - tests/scripts/helm.sh up + - name: TestHelmUpgradeSuite + run: | + tests/scripts/github-action-helper.sh create_helm_tag + tests/scripts/helm.sh up - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - go test -v -timeout 1800s -run CephUpgradeSuite/TestUpgradeHelm github.com/rook/rook/tests/integration + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -run CephUpgradeSuite/TestUpgradeHelm github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="upgrade" - export OPERATOR_NAMESPACE="upgrade-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="upgrade" + export OPERATOR_NAMESPACE="upgrade-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-upgrade-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-upgrade-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ TestCephObjectSuite: if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} @@ -220,36 +220,36 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.17.17', 'v1.24.1'] + kubernetes-versions: ["v1.17.17", "v1.24.1"] steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup cluster resources + uses: ./.github/workflows/integration-test-config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} - - name: TestCephObjectSuite - run: | - tests/scripts/github-action-helper.sh collect_udev_logs_in_background - export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) - SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -failfast -run CephObjectSuite github.com/rook/rook/tests/integration + - name: TestCephObjectSuite + run: | + tests/scripts/github-action-helper.sh collect_udev_logs_in_background + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -failfast -run CephObjectSuite github.com/rook/rook/tests/integration - - name: collect common logs - if: always() - run: | - export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" - export CLUSTER_NAMESPACE="object-ns" - export OPERATOR_NAMESPACE="object-ns-system" - tests/scripts/collect-logs.sh + - name: collect common logs + if: always() + run: | + export LOG_DIR="/home/runner/work/rook/rook/tests/integration/_output/tests/" + export CLUSTER_NAMESPACE="object-ns" + export OPERATOR_NAMESPACE="object-ns-system" + tests/scripts/collect-logs.sh - - name: Artifact - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ceph-object-suite-artifact-${{ matrix.kubernetes-versions }} - path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-object-suite-artifact-${{ matrix.kubernetes-versions }} + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ diff --git a/.github/workflows/mod-check.yml b/.github/workflows/mod-check.yml index 3a04ab328..46e1a571c 100644 --- a/.github/workflows/mod-check.yml +++ b/.github/workflows/mod-check.yml @@ -28,17 +28,17 @@ jobs: modcheck: runs-on: ubuntu-18.04 steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - uses: actions/setup-go@v2 - with: - go-version: 1.18 + - uses: actions/setup-go@v2 + with: + go-version: 1.18 - - name: run mod check - run: GOPATH=$(go env GOPATH) make -j $(nproc) mod.check + - name: run mod check + run: GOPATH=$(go env GOPATH) make -j $(nproc) mod.check - - name: validate modcheck - run: tests/scripts/validate_modified_files.sh modcheck + - name: validate modcheck + run: tests/scripts/validate_modified_files.sh modcheck diff --git a/.github/workflows/rbac-gen.yaml b/.github/workflows/rbac-gen.yaml index 64106fbdc..0391e539a 100644 --- a/.github/workflows/rbac-gen.yaml +++ b/.github/workflows/rbac-gen.yaml @@ -28,22 +28,22 @@ jobs: gen-rbac: runs-on: ubuntu-18.04 steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.18 + - uses: actions/setup-go@v2 + with: + go-version: 1.18 - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: copy working directory to GOPATH - run: sudo mkdir -p /home/runner/go/src/github.com && sudo cp -a /home/runner/work/rook /home/runner/go/src/github.com/ + - name: copy working directory to GOPATH + run: sudo mkdir -p /home/runner/go/src/github.com && sudo cp -a /home/runner/work/rook /home/runner/go/src/github.com/ - - name: run gen-rbac - working-directory: /home/runner/go/src/github.com/rook/rook - run: GOPATH=$(go env GOPATH) make gen-rbac + - name: run gen-rbac + working-directory: /home/runner/go/src/github.com/rook/rook + run: GOPATH=$(go env GOPATH) make gen-rbac - - name: validate gen-rbac - working-directory: /home/runner/go/src/github.com/rook/rook - run: tests/scripts/validate_modified_files.sh gen-rbac + - name: validate gen-rbac + working-directory: /home/runner/go/src/github.com/rook/rook + run: tests/scripts/validate_modified_files.sh gen-rbac diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index ce966377d..6888099d0 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -1,8 +1,8 @@ name: "Mark or close stale issues and PRs" on: schedule: - # Run the stalebot every day at 8pm UTC - - cron: "00 20 * * *" + # Run the stalebot every day at 8pm UTC + - cron: "00 20 * * *" permissions: contents: read @@ -10,33 +10,33 @@ permissions: jobs: stale: permissions: - issues: write # for actions/stale to close stale issues - pull-requests: write # for actions/stale to close stale PRs + issues: write # for actions/stale to close stale issues + pull-requests: write # for actions/stale to close stale PRs runs-on: ubuntu-18.04 if: github.repository == 'rook/rook' steps: - - uses: actions/stale@v4 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-issue-stale: 60 - days-before-pr-stale: 30 - days-before-close: 7 - days-before-pr-close: 14 - stale-issue-message: > - This issue has been automatically marked as stale because it has not had recent activity. - It will be closed in a week if no further activity occurs. - Thank you for your contributions. - stale-pr-message: > - This pull request has been automatically marked as stale because it has not had - recent activity. It will be closed in two weeks if no further activity occurs. - Thank you for your contributions. - close-issue-message: > - This issue has been automatically closed due to inactivity. - Please re-open if this still requires investigation. - close-pr-message: > - This pull request has been automatically closed due to inactivity. - Please re-open if these changes are still required. - stale-pr-label: "stale" - stale-issue-label: "wontfix" - exempt-issue-labels: "keepalive,security,reliability" - exempt-pr-labels: "keepalive,security,reliability" + - uses: actions/stale@v4 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-issue-stale: 60 + days-before-pr-stale: 30 + days-before-close: 7 + days-before-pr-close: 14 + stale-issue-message: > + This issue has been automatically marked as stale because it has not had recent activity. + It will be closed in a week if no further activity occurs. + Thank you for your contributions. + stale-pr-message: > + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed in two weeks if no further activity occurs. + Thank you for your contributions. + close-issue-message: > + This issue has been automatically closed due to inactivity. + Please re-open if this still requires investigation. + close-pr-message: > + This pull request has been automatically closed due to inactivity. + Please re-open if these changes are still required. + stale-pr-label: "stale" + stale-issue-label: "wontfix" + exempt-issue-labels: "keepalive,security,reliability" + exempt-pr-labels: "keepalive,security,reliability" diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 381af65ed..fc260044c 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -29,18 +29,18 @@ jobs: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - uses: actions/setup-go@v2 - with: - go-version: 1.18 + - uses: actions/setup-go@v2 + with: + go-version: 1.18 - - name: copy working directory to GOPATH - run: sudo mkdir -p /home/runner/go/src/github.com && sudo cp -a /home/runner/work/rook /home/runner/go/src/github.com/ + - name: copy working directory to GOPATH + run: sudo mkdir -p /home/runner/go/src/github.com && sudo cp -a /home/runner/work/rook /home/runner/go/src/github.com/ - - name: run unit tests - working-directory: /home/runner/go/src/github.com/rook/rook - run: GOPATH=$(go env GOPATH) make -j $(nproc) test + - name: run unit tests + working-directory: /home/runner/go/src/github.com/rook/rook + run: GOPATH=$(go env GOPATH) make -j $(nproc) test diff --git a/tests/scripts/create-bluestore-partitions.sh b/tests/scripts/create-bluestore-partitions.sh index b5c7adbd7..64a74a4d5 100755 --- a/tests/scripts/create-bluestore-partitions.sh +++ b/tests/scripts/create-bluestore-partitions.sh @@ -57,7 +57,7 @@ function create_block_partition { local osd_count=$1 if [ "$osd_count" -eq 1 ]; then sudo sgdisk --largest-new=0 --change-name=0:'block' --mbrtogpt -- "$DISK" - elif [ "$osd_count" -gt 1 ]; then + elif [ "$osd_count" -gt 1 ]; then SIZE=6144M for osd in $(seq 1 "$osd_count"); do echo "$osd" @@ -76,28 +76,29 @@ fi while [ "$1" != "" ]; do case $1 in - --disk) - shift - DISK="$1" + --disk) + shift + DISK="$1" ;; - --bluestore-type) - shift - BLUESTORE_TYPE="$1" + --bluestore-type) + shift + BLUESTORE_TYPE="$1" ;; - --osd-count) - shift - OSD_COUNT="$1" + --osd-count) + shift + OSD_COUNT="$1" ;; - --wipe-only) - WIPE_ONLY=1 + --wipe-only) + WIPE_ONLY=1 ;; - -h | --help) - usage - exit + -h | --help) + usage + exit + ;; + *) + usage + exit 1 ;; - *) - usage - exit 1 esac shift done @@ -112,16 +113,17 @@ fi if [ -z "$WIPE_ONLY" ]; then if [ -n "$BLUESTORE_TYPE" ]; then case "$BLUESTORE_TYPE" in - block.db) - create_partition block.db + block.db) + create_partition block.db ;; - block.wal) - create_partition block.db - create_partition block.wal + block.wal) + create_partition block.db + create_partition block.wal + ;; + *) + printf "invalid bluestore configuration %q" "$BLUESTORE_TYPE" >&2 + exit 1 ;; - *) - printf "invalid bluestore configuration %q" "$BLUESTORE_TYPE" >&2 - exit 1 esac fi From 5a274b71e3c5b8e69eb627dca0d6929444ec17f4 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Fri, 26 Aug 2022 08:45:56 +0530 Subject: [PATCH 2/5] docs: update vscode setting I have update vscode setting.json file according to the uses. Signed-off-by: subhamkrai --- .vscode/settings.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 39a4569e5..8dab85e93 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,12 @@ "go.buildOnSave": "package", "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, - "files.trimFinalNewlines": true + "files.trimFinalNewlines": true, + "go.lintTool": "golangci-lint", + "go.lintFlags": [ + "--fast" + ], + "python.formatting.provider": "black", + "python.linting.pylintEnabled": true, + "python.linting.enabled": true, } From aec9ac30601490a9a621228d0b7d5fe387aff469 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Fri, 26 Aug 2022 09:30:35 +0530 Subject: [PATCH 3/5] ci: ubuntu 18.04 is deprecated upgrade to ubuntu 22.04 Signed-off-by: subhamkrai --- .github/workflows/build.yml | 2 +- .github/workflows/canary-integration-test.yml | 20 +++++++++---------- .github/workflows/codegen.yml | 2 +- .github/workflows/codespell.yaml | 2 +- .github/workflows/commitlint.yml | 2 +- .github/workflows/crds-gen.yml | 2 +- .github/workflows/create-tag.yaml | 2 +- .github/workflows/daily-nightly-jobs.yml | 18 ++++++++--------- .github/workflows/docs-check.yml | 2 +- .github/workflows/golangci-lint.yaml | 2 +- .../integration-test-helm-suite.yaml | 2 +- .../workflows/integration-test-mgr-suite.yaml | 2 +- .../integration-test-multi-cluster-suite.yaml | 2 +- .../integration-test-object-suite.yaml | 2 +- .../integration-test-smoke-suite.yaml | 2 +- .../integration-test-upgrade-suite.yaml | 4 ++-- .../integration-tests-on-release.yaml | 12 +++++------ .github/workflows/mod-check.yml | 2 +- .github/workflows/push-build.yaml | 2 +- .github/workflows/rbac-gen.yaml | 2 +- .github/workflows/stale.yaml | 2 +- .github/workflows/unit-test.yml | 2 +- tests/scripts/create-bluestore-partitions.sh | 4 +++- 23 files changed, 48 insertions(+), 46 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 307a419ef..6775c3306 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,7 +90,7 @@ jobs: timeout-minutes: 60 linux-build-all: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" strategy: fail-fast: false diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index 54290b195..a5cd73915 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -23,7 +23,7 @@ concurrency: jobs: canary: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - name: checkout @@ -216,7 +216,7 @@ jobs: timeout-minutes: 60 raw-disk: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - name: checkout @@ -489,7 +489,7 @@ jobs: timeout-minutes: 60 pvc: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - name: checkout @@ -562,7 +562,7 @@ jobs: timeout-minutes: 60 pvc-db: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - name: checkout @@ -618,7 +618,7 @@ jobs: timeout-minutes: 60 pvc-db-wal: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - name: checkout @@ -1086,7 +1086,7 @@ jobs: timeout-minutes: 60 multi-cluster-mirroring: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - name: checkout @@ -1285,7 +1285,7 @@ jobs: timeout-minutes: 60 rgw-multisite-testing: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - name: checkout @@ -1320,7 +1320,7 @@ jobs: timeout-minutes: 60 encryption-pvc-kms-ibm-kp: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: @@ -1358,7 +1358,7 @@ jobs: timeout-minutes: 60 multus-cluster-network: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - name: checkout @@ -1420,7 +1420,7 @@ jobs: timeout-minutes: 60 csi-hostnetwork-disabled: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - name: checkout diff --git a/.github/workflows/codegen.yml b/.github/workflows/codegen.yml index 589f03874..0eace3ace 100644 --- a/.github/workflows/codegen.yml +++ b/.github/workflows/codegen.yml @@ -26,7 +26,7 @@ permissions: jobs: codegen: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - uses: actions/setup-go@v2 diff --git a/.github/workflows/codespell.yaml b/.github/workflows/codespell.yaml index 67b6bc6f3..cd7d747e9 100644 --- a/.github/workflows/codespell.yaml +++ b/.github/workflows/codespell.yaml @@ -22,7 +22,7 @@ permissions: jobs: codespell: name: codespell - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index bc3ab98ac..6b41ee490 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -18,7 +18,7 @@ concurrency: jobs: lint: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: diff --git a/.github/workflows/crds-gen.yml b/.github/workflows/crds-gen.yml index 62877659a..bb437fe84 100644 --- a/.github/workflows/crds-gen.yml +++ b/.github/workflows/crds-gen.yml @@ -26,7 +26,7 @@ permissions: jobs: crds-gen: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/setup-go@v2 with: diff --git a/.github/workflows/create-tag.yaml b/.github/workflows/create-tag.yaml index 2758fd465..707d15c73 100644 --- a/.github/workflows/create-tag.yaml +++ b/.github/workflows/create-tag.yaml @@ -13,7 +13,7 @@ defaults: jobs: Create-Tag: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: github.repository == 'rook/rook' && contains('travisn,leseb,BlaineEXE,jbw976,galexrt,satoru-takeuchi', github.actor) steps: - name: checkout diff --git a/.github/workflows/daily-nightly-jobs.yml b/.github/workflows/daily-nightly-jobs.yml index f3249779a..dd4cd1e09 100644 --- a/.github/workflows/daily-nightly-jobs.yml +++ b/.github/workflows/daily-nightly-jobs.yml @@ -91,7 +91,7 @@ jobs: smoke-suite-pacific-devel: if: github.repository == 'rook/rook' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: checkout uses: actions/checkout@v2 @@ -126,7 +126,7 @@ jobs: smoke-suite-quincy-devel: if: github.repository == 'rook/rook' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: checkout uses: actions/checkout@v2 @@ -161,7 +161,7 @@ jobs: smoke-suite-ceph-master: if: github.repository == 'rook/rook' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: checkout uses: actions/checkout@v2 @@ -196,7 +196,7 @@ jobs: object-suite-pacific-devel: if: github.repository == 'rook/rook' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: checkout uses: actions/checkout@v2 @@ -231,7 +231,7 @@ jobs: object-suite-master: if: github.repository == 'rook/rook' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: checkout uses: actions/checkout@v2 @@ -266,7 +266,7 @@ jobs: upgrade-from-pacific-stable-to-pacific-devel: if: github.repository == 'rook/rook' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: checkout uses: actions/checkout@v2 @@ -301,7 +301,7 @@ jobs: upgrade-from-quincy-stable-to-quincy-devel: if: github.repository == 'rook/rook' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: checkout uses: actions/checkout@v2 @@ -336,7 +336,7 @@ jobs: rgw-multisite-test-with-ceph-devel: if: github.repository == 'rook/rook' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: ceph-image-tag: @@ -362,7 +362,7 @@ jobs: encryption-pvc-kms-ibm-kp: if: github.repository == 'rook/rook' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index 4a07da25b..53fb2e688 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -19,7 +19,7 @@ concurrency: jobs: docs-check: name: docs-check - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index c5601c0a0..9be291700 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -22,7 +22,7 @@ permissions: jobs: golangci: name: golangci-lint - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/setup-go@v2 with: diff --git a/.github/workflows/integration-test-helm-suite.yaml b/.github/workflows/integration-test-helm-suite.yaml index ad8cef237..debf28f5b 100644 --- a/.github/workflows/integration-test-helm-suite.yaml +++ b/.github/workflows/integration-test-helm-suite.yaml @@ -18,7 +18,7 @@ concurrency: jobs: TestCephHelmSuite: if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/integration-test-mgr-suite.yaml b/.github/workflows/integration-test-mgr-suite.yaml index 13b4dd098..fffef8a76 100644 --- a/.github/workflows/integration-test-mgr-suite.yaml +++ b/.github/workflows/integration-test-mgr-suite.yaml @@ -16,7 +16,7 @@ concurrency: jobs: TestCephMgrSuite: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "contains(github.event.pull_request.labels.*.name, 'run-mgr-suite')" strategy: fail-fast: false diff --git a/.github/workflows/integration-test-multi-cluster-suite.yaml b/.github/workflows/integration-test-multi-cluster-suite.yaml index e926513b8..16515aa42 100644 --- a/.github/workflows/integration-test-multi-cluster-suite.yaml +++ b/.github/workflows/integration-test-multi-cluster-suite.yaml @@ -18,7 +18,7 @@ concurrency: jobs: TestCephMultiClusterDeploySuite: if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/integration-test-object-suite.yaml b/.github/workflows/integration-test-object-suite.yaml index 2c86cbb64..9091050fa 100644 --- a/.github/workflows/integration-test-object-suite.yaml +++ b/.github/workflows/integration-test-object-suite.yaml @@ -18,7 +18,7 @@ concurrency: jobs: TestCephObjectSuite: if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/integration-test-smoke-suite.yaml b/.github/workflows/integration-test-smoke-suite.yaml index 91f1c1e42..4863a9c8e 100644 --- a/.github/workflows/integration-test-smoke-suite.yaml +++ b/.github/workflows/integration-test-smoke-suite.yaml @@ -18,7 +18,7 @@ concurrency: jobs: TestCephSmokeSuite: if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/integration-test-upgrade-suite.yaml b/.github/workflows/integration-test-upgrade-suite.yaml index 63c0da283..76a66c65f 100644 --- a/.github/workflows/integration-test-upgrade-suite.yaml +++ b/.github/workflows/integration-test-upgrade-suite.yaml @@ -18,7 +18,7 @@ concurrency: jobs: TestCephUpgradeSuite: if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: @@ -63,7 +63,7 @@ jobs: TestHelmUpgradeSuite: if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/integration-tests-on-release.yaml b/.github/workflows/integration-tests-on-release.yaml index 3d230243e..acefd7c12 100644 --- a/.github/workflows/integration-tests-on-release.yaml +++ b/.github/workflows/integration-tests-on-release.yaml @@ -14,7 +14,7 @@ defaults: jobs: TestCephHelmSuite: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: @@ -55,7 +55,7 @@ jobs: path: /home/runner/work/rook/rook/tests/integration/_output/tests/ TestCephMultiClusterDeploySuite: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: @@ -95,7 +95,7 @@ jobs: path: /home/runner/work/rook/rook/tests/integration/_output/tests/ TestCephSmokeSuite: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: @@ -134,7 +134,7 @@ jobs: path: /home/runner/work/rook/rook/tests/integration/_output/tests/ TestCephUpgradeSuite: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: @@ -173,7 +173,7 @@ jobs: path: /home/runner/work/rook/rook/tests/integration/_output/tests/ TestHelmUpgradeSuite: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: @@ -216,7 +216,7 @@ jobs: TestCephObjectSuite: if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/mod-check.yml b/.github/workflows/mod-check.yml index 46e1a571c..004f68c25 100644 --- a/.github/workflows/mod-check.yml +++ b/.github/workflows/mod-check.yml @@ -26,7 +26,7 @@ permissions: jobs: modcheck: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: checkout uses: actions/checkout@v2 diff --git a/.github/workflows/push-build.yaml b/.github/workflows/push-build.yaml index dde7c9079..81de22fae 100644 --- a/.github/workflows/push-build.yaml +++ b/.github/workflows/push-build.yaml @@ -17,7 +17,7 @@ permissions: jobs: push-image-to-container-registry: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: github.repository == 'rook/rook' steps: - name: checkout diff --git a/.github/workflows/rbac-gen.yaml b/.github/workflows/rbac-gen.yaml index 0391e539a..ad9ba62aa 100644 --- a/.github/workflows/rbac-gen.yaml +++ b/.github/workflows/rbac-gen.yaml @@ -26,7 +26,7 @@ permissions: jobs: gen-rbac: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/setup-go@v2 with: diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 6888099d0..e2bf14d74 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -12,7 +12,7 @@ jobs: permissions: issues: write # for actions/stale to close stale issues pull-requests: write # for actions/stale to close stale PRs - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: github.repository == 'rook/rook' steps: - uses: actions/stale@v4 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index fc260044c..205bf2fb8 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -26,7 +26,7 @@ permissions: jobs: unittests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" steps: - name: checkout diff --git a/tests/scripts/create-bluestore-partitions.sh b/tests/scripts/create-bluestore-partitions.sh index 64a74a4d5..21796616a 100755 --- a/tests/scripts/create-bluestore-partitions.sh +++ b/tests/scripts/create-bluestore-partitions.sh @@ -43,8 +43,10 @@ function wipe_disk { sudo parted "$DISK" -s print || : return fi + set +e sudo parted -s "$DISK" mklabel gpt - sudo partprobe "$DISK" + set -e + sudo partprobe -d "$DISK" sudo udevadm settle sudo parted "$DISK" -s print } From e8251660758d829a1b93d0c4c1d2343ab358d088 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Fri, 26 Aug 2022 09:29:16 +0530 Subject: [PATCH 4/5] ci: update minikube setup action to 2.7.0 update minikube setup action to v2.7.0 for lastest k8s version and for older k8s version still use v2.6.1 Signed-off-by: subhamkrai --- .../workflows/canary-test-config/action.yaml | 2 +- .github/workflows/daily-nightly-jobs.yml | 14 +-- .../action.yaml | 2 +- .../action.yaml | 38 ++++++ .../integration-test-helm-suite.yaml | 22 +++- .../workflows/integration-test-mgr-suite.yaml | 2 +- .../integration-test-multi-cluster-suite.yaml | 2 +- .../integration-test-object-suite.yaml | 22 +++- .../integration-test-smoke-suite.yaml | 22 +++- .../integration-test-upgrade-suite.yaml | 24 +++- .../integration-tests-on-release.yaml | 119 ++++++++++++++++-- 11 files changed, 237 insertions(+), 32 deletions(-) rename .github/workflows/{integration-test-config => integration-test-config-latest-k8s}/action.yaml (96%) create mode 100644 .github/workflows/integration-test-config-older-k8s/action.yaml diff --git a/.github/workflows/canary-test-config/action.yaml b/.github/workflows/canary-test-config/action.yaml index 128576133..5af8dac05 100644 --- a/.github/workflows/canary-test-config/action.yaml +++ b/.github/workflows/canary-test-config/action.yaml @@ -14,7 +14,7 @@ runs: go-version: 1.18 - name: setup minikube - uses: manusa/actions-setup-minikube@v2.6.0 + uses: manusa/actions-setup-minikube@v2.7.0 with: minikube version: "v1.24.0" kubernetes version: "v1.23.0" diff --git a/.github/workflows/daily-nightly-jobs.yml b/.github/workflows/daily-nightly-jobs.yml index dd4cd1e09..8e5fdbf08 100644 --- a/.github/workflows/daily-nightly-jobs.yml +++ b/.github/workflows/daily-nightly-jobs.yml @@ -99,7 +99,7 @@ jobs: fetch-depth: 0 - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: "1.24.1" @@ -134,7 +134,7 @@ jobs: fetch-depth: 0 - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: "1.24.1" @@ -169,7 +169,7 @@ jobs: fetch-depth: 0 - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: "1.24.1" @@ -204,7 +204,7 @@ jobs: fetch-depth: 0 - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: "1.24.1" @@ -239,7 +239,7 @@ jobs: fetch-depth: 0 - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: "1.24.1" @@ -274,7 +274,7 @@ jobs: fetch-depth: 0 - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: "1.24.1" @@ -309,7 +309,7 @@ jobs: fetch-depth: 0 - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: "1.24.1" diff --git a/.github/workflows/integration-test-config/action.yaml b/.github/workflows/integration-test-config-latest-k8s/action.yaml similarity index 96% rename from .github/workflows/integration-test-config/action.yaml rename to .github/workflows/integration-test-config-latest-k8s/action.yaml index 906edb9dc..ccaa2fa37 100644 --- a/.github/workflows/integration-test-config/action.yaml +++ b/.github/workflows/integration-test-config-latest-k8s/action.yaml @@ -17,7 +17,7 @@ runs: go-version: 1.18 - name: setup minikube - uses: manusa/actions-setup-minikube@v2.6.0 + uses: manusa/actions-setup-minikube@v2.7.0 with: minikube version: "v1.26.0" kubernetes version: ${{ inputs.kubernetes-version }} diff --git a/.github/workflows/integration-test-config-older-k8s/action.yaml b/.github/workflows/integration-test-config-older-k8s/action.yaml new file mode 100644 index 000000000..27e060ccd --- /dev/null +++ b/.github/workflows/integration-test-config-older-k8s/action.yaml @@ -0,0 +1,38 @@ +name: Cluster Setup +description: Cluster setup for integration test +inputs: + kubernetes-version: + description: kubernetes version to use for the workflow + required: true + github-token: + description: GITHUB_TOKEN from the calling workflow + required: true + +runs: + using: "composite" + steps: + - name: setup golang + uses: actions/setup-go@v2 + with: + go-version: 1.18 + + - name: setup minikube + uses: manusa/actions-setup-minikube@v2.6.1 + with: + minikube version: "v1.26.0" + kubernetes version: ${{ inputs.kubernetes-version }} + start args: --memory 6g --cpus=2 --addons ingress + github token: ${{ inputs.github-token }} + + - name: print k8s cluster status + shell: bash --noprofile --norc -eo pipefail -x {0} + run: tests/scripts/github-action-helper.sh print_k8s_cluster_status + + # This step is required for all the integration tests except the canary tests + - name: use local disk + shell: bash --noprofile --norc -eo pipefail -x {0} + run: tests/scripts/github-action-helper.sh use_local_disk_for_integration_test + + - name: build rook + shell: bash --noprofile --norc -eo pipefail -x {0} + run: tests/scripts/github-action-helper.sh build_rook diff --git a/.github/workflows/integration-test-helm-suite.yaml b/.github/workflows/integration-test-helm-suite.yaml index debf28f5b..f743389f3 100644 --- a/.github/workflows/integration-test-helm-suite.yaml +++ b/.github/workflows/integration-test-helm-suite.yaml @@ -29,8 +29,26 @@ jobs: with: fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + - name: check matrix k8s version + run: | + echo USE_K8S=$(echo ${{ matrix.kubernetes-versions }}) + if [ $(echo ${{ matrix.kubernetes-versions }}) == "v1.17.17" ]; then + echo "OLDER_K8S=true" >> $GITHUB_ENV + else + echo "OLDER_K8S=false" >> $GITHUB_ENV + fi + echo env.OLDER_K8S + + - name: setup latest cluster resources + if: ${{ env.OLDER_K8S == 'false' }} + uses: ./.github/workflows/integration-test-config-latest-k8s + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} + + - name: setup older cluster resources + if: ${{ env.OLDER_K8S == 'true' }} + uses: ./.github/workflows/integration-test-config-older-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} diff --git a/.github/workflows/integration-test-mgr-suite.yaml b/.github/workflows/integration-test-mgr-suite.yaml index fffef8a76..bf8edc580 100644 --- a/.github/workflows/integration-test-mgr-suite.yaml +++ b/.github/workflows/integration-test-mgr-suite.yaml @@ -29,7 +29,7 @@ jobs: fetch-depth: 0 - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} diff --git a/.github/workflows/integration-test-multi-cluster-suite.yaml b/.github/workflows/integration-test-multi-cluster-suite.yaml index 16515aa42..229201e69 100644 --- a/.github/workflows/integration-test-multi-cluster-suite.yaml +++ b/.github/workflows/integration-test-multi-cluster-suite.yaml @@ -30,7 +30,7 @@ jobs: fetch-depth: 0 - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} diff --git a/.github/workflows/integration-test-object-suite.yaml b/.github/workflows/integration-test-object-suite.yaml index 9091050fa..cdb397119 100644 --- a/.github/workflows/integration-test-object-suite.yaml +++ b/.github/workflows/integration-test-object-suite.yaml @@ -29,8 +29,26 @@ jobs: with: fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + - name: check matrix k8s version + run: | + echo USE_K8S=$(echo ${{ matrix.kubernetes-versions }}) + if [ $(echo ${{ matrix.kubernetes-versions }}) == "v1.17.17" ]; then + echo "OLDER_K8S=true" >> $GITHUB_ENV + else + echo "OLDER_K8S=false" >> $GITHUB_ENV + fi + echo env.OLDER_K8S + + - name: setup latest cluster resources + if: ${{ env.OLDER_K8S == 'false' }} + uses: ./.github/workflows/integration-test-config-latest-k8s + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} + + - name: setup older cluster resources + if: ${{ env.OLDER_K8S == 'true' }} + uses: ./.github/workflows/integration-test-config-older-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} diff --git a/.github/workflows/integration-test-smoke-suite.yaml b/.github/workflows/integration-test-smoke-suite.yaml index 4863a9c8e..3a0ff853d 100644 --- a/.github/workflows/integration-test-smoke-suite.yaml +++ b/.github/workflows/integration-test-smoke-suite.yaml @@ -29,8 +29,26 @@ jobs: with: fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + - name: check matrix k8s version + run: | + echo USE_K8S=$(echo ${{ matrix.kubernetes-versions }}) + if [ $(echo ${{ matrix.kubernetes-versions }}) == "v1.17.17" ]; then + echo "OLDER_K8S=true" >> $GITHUB_ENV + else + echo "OLDER_K8S=false" >> $GITHUB_ENV + fi + echo env.OLDER_K8S + + - name: setup latest cluster resources + if: ${{ env.OLDER_K8S == 'false' }} + uses: ./.github/workflows/integration-test-config-latest-k8s + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} + + - name: setup older cluster resources + if: ${{ env.OLDER_K8S == 'true' }} + uses: ./.github/workflows/integration-test-config-older-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} diff --git a/.github/workflows/integration-test-upgrade-suite.yaml b/.github/workflows/integration-test-upgrade-suite.yaml index 76a66c65f..930c023e3 100644 --- a/.github/workflows/integration-test-upgrade-suite.yaml +++ b/.github/workflows/integration-test-upgrade-suite.yaml @@ -29,8 +29,26 @@ jobs: with: fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + - name: check matrix k8s version + run: | + echo USE_K8S=$(echo ${{ matrix.kubernetes-versions }}) + if [ $(echo ${{ matrix.kubernetes-versions }}) == "v1.17.17" ]; then + echo "OLDER_K8S=true" >> $GITHUB_ENV + else + echo "OLDER_K8S=false" >> $GITHUB_ENV + fi + echo env.OLDER_K8S + + - name: setup latest cluster resources + if: ${{ env.OLDER_K8S == 'false' }} + uses: ./.github/workflows/integration-test-config-latest-k8s + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} + + - name: setup older cluster resources + if: ${{ env.OLDER_K8S == 'true' }} + uses: ./.github/workflows/integration-test-config-older-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} @@ -75,7 +93,7 @@ jobs: fetch-depth: 0 - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} diff --git a/.github/workflows/integration-tests-on-release.yaml b/.github/workflows/integration-tests-on-release.yaml index acefd7c12..949b0f1b7 100644 --- a/.github/workflows/integration-tests-on-release.yaml +++ b/.github/workflows/integration-tests-on-release.yaml @@ -25,8 +25,26 @@ jobs: with: fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + - name: check matrix k8s version + run: | + echo USE_K8S=$(echo ${{ matrix.kubernetes-versions }}) + if [ $(echo ${{ matrix.kubernetes-versions }}) == "v1.17.17" ]; then + echo "OLDER_K8S=true" >> $GITHUB_ENV + else + echo "OLDER_K8S=false" >> $GITHUB_ENV + fi + echo env.OLDER_K8S + + - name: setup latest cluster resources + if: ${{ env.OLDER_K8S == 'false' }} + uses: ./.github/workflows/integration-test-config-latest-k8s + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} + + - name: setup older cluster resources + if: ${{ env.OLDER_K8S == 'true' }} + uses: ./.github/workflows/integration-test-config-older-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} @@ -66,8 +84,26 @@ jobs: with: fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + - name: check matrix k8s version + run: | + echo USE_K8S=$(echo ${{ matrix.kubernetes-versions }}) + if [ $(echo ${{ matrix.kubernetes-versions }}) == "v1.17.17" ]; then + echo "OLDER_K8S=true" >> $GITHUB_ENV + else + echo "OLDER_K8S=false" >> $GITHUB_ENV + fi + echo env.OLDER_K8S + + - name: setup latest cluster resources + if: ${{ env.OLDER_K8S == 'false' }} + uses: ./.github/workflows/integration-test-config-latest-k8s + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} + + - name: setup older cluster resources + if: ${{ env.OLDER_K8S == 'true' }} + uses: ./.github/workflows/integration-test-config-older-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} @@ -106,8 +142,26 @@ jobs: with: fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + - name: check matrix k8s version + run: | + echo USE_K8S=$(echo ${{ matrix.kubernetes-versions }}) + if [ $(echo ${{ matrix.kubernetes-versions }}) == "v1.17.17" ]; then + echo "OLDER_K8S=true" >> $GITHUB_ENV + else + echo "OLDER_K8S=false" >> $GITHUB_ENV + fi + echo env.OLDER_K8S + + - name: setup latest cluster resources + if: ${{ env.OLDER_K8S == 'false' }} + uses: ./.github/workflows/integration-test-config-latest-k8s + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} + + - name: setup older cluster resources + if: ${{ env.OLDER_K8S == 'true' }} + uses: ./.github/workflows/integration-test-config-older-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} @@ -145,8 +199,26 @@ jobs: with: fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + - name: check matrix k8s version + run: | + echo USE_K8S=$(echo ${{ matrix.kubernetes-versions }}) + if [ $(echo ${{ matrix.kubernetes-versions }}) == "v1.17.17" ]; then + echo "OLDER_K8S=true" >> $GITHUB_ENV + else + echo "OLDER_K8S=false" >> $GITHUB_ENV + fi + echo env.OLDER_K8S + + - name: setup latest cluster resources + if: ${{ env.OLDER_K8S == 'false' }} + uses: ./.github/workflows/integration-test-config-latest-k8s + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} + + - name: setup older cluster resources + if: ${{ env.OLDER_K8S == 'true' }} + uses: ./.github/workflows/integration-test-config-older-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} @@ -184,12 +256,17 @@ jobs: with: fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + - name: setup latest cluster resources + if: ${{ matrix.kubernetes-versions }} != "v1.24.1" + uses: ./.github/workflows/integration-test-config-latest-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} + - name: setup older cluster resources + if: ${{ matrix.kubernetes-versions }} == "v1.17.17" + uses: ./.github/workflows/integration-test-config-older-k8s + - name: TestHelmUpgradeSuite run: | tests/scripts/github-action-helper.sh create_helm_tag @@ -227,8 +304,26 @@ jobs: with: fetch-depth: 0 - - name: setup cluster resources - uses: ./.github/workflows/integration-test-config + - name: check matrix k8s version + run: | + echo USE_K8S=$(echo ${{ matrix.kubernetes-versions }}) + if [ $(echo ${{ matrix.kubernetes-versions }}) == "v1.17.17" ]; then + echo "OLDER_K8S=true" >> $GITHUB_ENV + else + echo "OLDER_K8S=false" >> $GITHUB_ENV + fi + echo env.OLDER_K8S + + - name: setup latest cluster resources + if: ${{ env.OLDER_K8S == 'false' }} + uses: ./.github/workflows/integration-test-config-latest-k8s + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kubernetes-version: ${{ matrix.kubernetes-versions }} + + - name: setup older cluster resources + if: ${{ env.OLDER_K8S == 'true' }} + uses: ./.github/workflows/integration-test-config-older-k8s with: github-token: ${{ secrets.GITHUB_TOKEN }} kubernetes-version: ${{ matrix.kubernetes-versions }} From 9f68afaeef23f1bcf2f2aa63b2a6f8c699f7ba63 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Fri, 26 Aug 2022 19:42:42 +0530 Subject: [PATCH 5/5] ci: update minikube version to 1.26.1 update minikube version to 1.26.1 for the latest k8s version and using 1.24.0 for older k8s version. Signed-off-by: subhamkrai --- .github/workflows/canary-test-config/action.yaml | 2 +- .../workflows/integration-test-config-latest-k8s/action.yaml | 2 +- .github/workflows/integration-test-config-older-k8s/action.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/canary-test-config/action.yaml b/.github/workflows/canary-test-config/action.yaml index 5af8dac05..bdce729cf 100644 --- a/.github/workflows/canary-test-config/action.yaml +++ b/.github/workflows/canary-test-config/action.yaml @@ -16,7 +16,7 @@ runs: - name: setup minikube uses: manusa/actions-setup-minikube@v2.7.0 with: - minikube version: "v1.24.0" + minikube version: "v1.26.1" kubernetes version: "v1.23.0" start args: --memory 6g --cpus=2 --addons ingress --cni=calico github token: ${{ inputs.github-token }} diff --git a/.github/workflows/integration-test-config-latest-k8s/action.yaml b/.github/workflows/integration-test-config-latest-k8s/action.yaml index ccaa2fa37..4f2cc98a1 100644 --- a/.github/workflows/integration-test-config-latest-k8s/action.yaml +++ b/.github/workflows/integration-test-config-latest-k8s/action.yaml @@ -19,7 +19,7 @@ runs: - name: setup minikube uses: manusa/actions-setup-minikube@v2.7.0 with: - minikube version: "v1.26.0" + minikube version: "v1.26.1" kubernetes version: ${{ inputs.kubernetes-version }} start args: --memory 6g --cpus=2 --addons ingress github token: ${{ inputs.github-token }} diff --git a/.github/workflows/integration-test-config-older-k8s/action.yaml b/.github/workflows/integration-test-config-older-k8s/action.yaml index 27e060ccd..e75518a47 100644 --- a/.github/workflows/integration-test-config-older-k8s/action.yaml +++ b/.github/workflows/integration-test-config-older-k8s/action.yaml @@ -19,7 +19,7 @@ runs: - name: setup minikube uses: manusa/actions-setup-minikube@v2.6.1 with: - minikube version: "v1.26.0" + minikube version: "v1.24.0" kubernetes version: ${{ inputs.kubernetes-version }} start args: --memory 6g --cpus=2 --addons ingress github token: ${{ inputs.github-token }}