Skip to content

Commit 24053d0

Browse files
authored
Merge pull request rook#17017 from parth-gr/test-mirror-ec
ci: add ec pool mirroring in our ci
2 parents 4baca28 + 50f5eec commit 24053d0

2 files changed

Lines changed: 34 additions & 6 deletions

File tree

.github/workflows/canary-integration-test.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,7 @@ jobs:
16161616
run: |
16171617
tests/scripts/github-action-helper.sh use_local_disk
16181618
export BLOCK="/dev/$(tests/scripts/github-action-helper.sh find_extra_block_dev)"
1619-
tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --osd-count 2
1619+
tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --osd-count 6
16201620
sudo lsblk
16211621
16221622
- name: deploy first cluster rook
@@ -1639,7 +1639,7 @@ jobs:
16391639
- name: wait for ceph cluster 1 to be ready
16401640
run: |
16411641
mkdir -p test
1642-
tests/scripts/validate_cluster.sh osd 1
1642+
tests/scripts/validate_cluster.sh osd 3
16431643
kubectl -n rook-ceph get pods
16441644
16451645
- name: create replicated mirrored pool on cluster 1
@@ -1650,6 +1650,14 @@ jobs:
16501650
kubectl create -f pool-test.yaml
16511651
timeout 180 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 be created on cluster 1" && sleep 1; done'
16521652
1653+
- name: create ec pool on cluster 1
1654+
run: |
1655+
cd deploy/examples/
1656+
yq w -i pool-ec.yaml spec.failureDomain osd
1657+
yq w -i pool-ec.yaml metadata.name ecpool
1658+
kubectl create -f pool-ec.yaml
1659+
timeout 180 sh -c 'until [ "$(kubectl -n rook-ceph get cephblockpool ecpool -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for pool ecpool to be created on cluster 1" && sleep 1; done'
1660+
16531661
- name: create replicated mirrored pool 2 on cluster 1
16541662
run: |
16551663
cd deploy/examples/
@@ -1665,6 +1673,13 @@ jobs:
16651673
kubectl create -f pool-test.yaml
16661674
timeout 180 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 be created on cluster 2" && sleep 1; done'
16671675
1676+
- name: create ec-pool pool on cluster 2
1677+
run: |
1678+
cd deploy/examples/
1679+
yq w -i pool-ec.yaml metadata.namespace rook-ceph-secondary
1680+
kubectl create -f pool-ec.yaml
1681+
timeout 180 sh -c 'until [ "$(kubectl -n rook-ceph-secondary get cephblockpool ecpool -o jsonpath='{.status.phase}'|grep -c "Ready")" -eq 1 ]; do echo "waiting for pool ecpool to be created on cluster 2" && sleep 1; done'
1682+
16681683
- name: create replicated mirrored pool 2 on cluster 2
16691684
run: |
16701685
cd deploy/examples/
@@ -1677,6 +1692,9 @@ jobs:
16771692
kubectl exec -n rook-ceph deploy/rook-ceph-tools -ti -- rbd -p replicapool create test -s 1G
16781693
kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd mirror image enable replicapool/test snapshot
16791694
kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool info test
1695+
kubectl exec -n rook-ceph deploy/rook-ceph-tools -ti -- rbd -p replicapool --data-pool ecpool create ec-test-image -s 1G
1696+
kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd mirror image enable replicapool/ec-test-image snapshot
1697+
kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool info ec-test-image
16801698
kubectl exec -n rook-ceph deploy/rook-ceph-tools -ti -- rbd -p replicapool2 create test -s 1G
16811699
kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd mirror image enable replicapool2/test snapshot
16821700
kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool2 info test
@@ -1708,7 +1726,12 @@ jobs:
17081726
- name: verify image has been mirrored for replicapool
17091727
run: |
17101728
# let's wait a bit for the image to be present
1711-
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'
1729+
timeout 120 sh -c 'until [ "$(kubectl exec -n rook-ceph-secondary deploy/rook-ceph-tools -t -- rbd -p replicapool ls|grep -c test)" -ge 1 ]; do echo "waiting for image to be mirrored in pool replicapool" && sleep 1; done'
1730+
1731+
- name: verify image has been mirrored for ec
1732+
run: |
1733+
# let's wait a bit for the image to be present
1734+
timeout 120 sh -c 'until [ "$(kubectl exec -n rook-ceph-secondary deploy/rook-ceph-tools -t -- rbd -p replicapool ls|grep -c ec-test-image)" -eq 1 ]; do echo "waiting for image to be mirrored in ecpool replicapool" && sleep 1; done'
17121735
17131736
- name: verify image has been mirrored for replicapool2
17141737
run: |
@@ -1721,6 +1744,7 @@ jobs:
17211744
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'
17221745
kubectl -n rook-ceph-secondary get cephblockpool replicapool -o yaml
17231746
kubectl -n rook-ceph-secondary get cephblockpool replicapool2 -o yaml
1747+
kubectl -n rook-ceph-secondary get cephblockpool ecpool -o yaml
17241748
kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool info test
17251749
kubectl exec -n rook-ceph deploy/rook-ceph-tools -t -- rbd -p replicapool2 info test
17261750
@@ -1889,7 +1913,7 @@ jobs:
18891913
run: |
18901914
export BLOCK="/dev/$(tests/scripts/github-action-helper.sh find_extra_block_dev)"
18911915
tests/scripts/github-action-helper.sh use_local_disk
1892-
tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --osd-count 2
1916+
tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --osd-count 6
18931917
sudo lsblk
18941918
18951919
- name: deploy first cluster rook

tests/scripts/github-action-helper.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,17 +530,21 @@ function deploy_first_rook_cluster() {
530530
deploy_manifest_with_local_build csi-operator.yaml
531531
yq w -i -d0 cluster-test.yaml spec.dashboard.enabled false
532532
yq w -i -d0 cluster-test.yaml spec.storage.useAllDevices false
533-
yq w -i -d0 cluster-test.yaml spec.storage.deviceFilter "${DEVICE_NAME}"1
533+
yq w -i -d0 cluster-test.yaml spec.storage.deviceFilter "${DEVICE_NAME}"[1-3]
534+
534535
kubectl create -f cluster-test.yaml
535536
deploy_toolbox
536537
}
537538

539+
# deploy_second_rook_cluster will only work if there are 6 disk or partitions available
540+
# as we are picking "${DEVICE_NAME}"[4-6]
538541
function deploy_second_rook_cluster() {
539542
DEVICE_NAME="$(tests/scripts/github-action-helper.sh find_extra_block_dev)"
540543
cd "${REPO_DIR}/deploy/examples"
541544
NAMESPACE=rook-ceph-secondary envsubst <common-second-cluster.yaml | kubectl create -f -
542545
sed -i 's/namespace: rook-ceph/namespace: rook-ceph-secondary/g' cluster-test.yaml
543-
yq w -i -d0 cluster-test.yaml spec.storage.deviceFilter "${DEVICE_NAME}"2
546+
yq w -i -d0 cluster-test.yaml spec.storage.deviceFilter "${DEVICE_NAME}"[4-6]
547+
544548
yq w -i -d0 cluster-test.yaml spec.dataDirHostPath "/var/lib/rook-external"
545549
kubectl create -f cluster-test.yaml
546550
yq w -i toolbox.yaml metadata.namespace rook-ceph-secondary

0 commit comments

Comments
 (0)