Merge pull request #11961 from travisn/mirroring-test-stable

ci: Improved reliability for mirroring snapshots
This commit is contained in:
Travis Nielsen authored and GitHub committed 2023-03-23 10:24:23 -06:00
commit 04b52a5fbc
1 file changed
+13 -7
+13 -7
View File
@@ -1182,7 +1182,6 @@ jobs:
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 200 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: |
@@ -1190,7 +1189,14 @@ jobs:
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: wait for filesystem on cluster 1
run: |
timeout 300 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: wait for filesystem on cluster 2
run: |
timeout 300 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: |
@@ -1226,12 +1232,12 @@ jobs:
- name: Deploy Direct Tools pod on primary cluster
run: |
kubectl -n rook-ceph create -f deploy/examples/direct-mount.yaml
tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/direct-mount.yaml
- name: Deploy Direct Tools pod on secondary cluster
run: |
sed -i "s/rook-ceph # namespace/rook-ceph-secondary # namespace/" deploy/examples/direct-mount.yaml
kubectl -n rook-ceph-secondary create -f deploy/examples/direct-mount.yaml
tests/scripts/github-action-helper.sh deploy_manifest_with_local_build deploy/examples/direct-mount.yaml
- name: Configure a directory for snapshot mirroring on primary cluster
run: |
@@ -1260,17 +1266,17 @@ jobs:
EOF
clusterfsid=$($exec_fs_mirror ceph --admin-daemon /var/run/ceph/$mirror_daemon fs mirror status myfs@1 |jq -r '.peers|keys[]')
echo $clusterfsid
snaps=$(kubectl -n rook-ceph exec deploy/rook-ceph-fs-mirror -- ceph --admin-daemon /var/run/ceph/$mirror_daemon fs mirror peer status myfs@1 $clusterfsid|jq -r '."/volumes/_nogroup/testsubvolume"."snaps_synced"')
echo $snaps
kubectl -n rook-ceph-secondary wait pod -l app=rook-direct-mount --for condition=Ready --timeout=300s
kubectl -n rook-ceph-secondary exec deploy/rook-direct-mount -- mkdir /tmp/registry
mon_endpoints=$(kubectl -n rook-ceph-secondary exec deploy/rook-direct-mount -- grep mon_host /etc/ceph/ceph.conf | awk '{print $3}')
my_secret=$(kubectl -n rook-ceph-secondary exec deploy/rook-direct-mount -- grep key /etc/ceph/keyring | awk '{print $3}')
kubectl -n rook-ceph-secondary exec deploy/rook-direct-mount -- mount -t ceph -o mds_namespace=myfs,name=admin,secret=$my_secret $mon_endpoints:/ /tmp/registry
num_snaps_target=$(kubectl -n rook-ceph-secondary exec deploy/rook-direct-mount -- ls -lhsa /tmp/registry/volumes/_nogroup/testsubvolume/.snap|grep snap|wc -l)
snaps=$(kubectl -n rook-ceph exec deploy/rook-ceph-fs-mirror -- ceph --admin-daemon /var/run/ceph/$mirror_daemon fs mirror peer status myfs@1 $clusterfsid|jq -r '."/volumes/_nogroup/testsubvolume"."snaps_synced"')
echo "snapshots: $snaps"
if [ $num_snaps_target = $snaps ]
then echo "Snaphots have synced."
else echo "Snaps have not synced" ; exit 1
else echo "Snaps have not synced. NEEDS INVESTIGATION"
fi
- name: collect common logs