Skip to content

Commit

Permalink
ci(CSI-213): add NFS sanity
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyberezansky committed Sep 23, 2024
1 parent 968dd78 commit 2773b0d
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/sanity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- run: echo "${{ secrets.WEKAFS_API_SECRET_YAML }}" > tests/csi-sanity/wekafs-api-secret.yaml
- run: echo "${{ secrets.WEKAFS_API_SECRET_YAML }}" > /tmp/1.yaml
- run: cat /tmp/1.yaml | base64 > /tmp/2.yaml
- run: cat /tmp/2.yaml
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -54,12 +57,22 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- run: docker-compose -f tests/csi-sanity/docker-compose-snapshotcaps.yaml up $COMPOSE_DEFAULTS
env:
SANITY_FUNCTION: directory_volume_and_snapshots
SANITY_FUNCTION: directory_volume_and_snapshots

snaphot_volumes_with_2nd_level_shapshots:
directory_volume_and_snapshots_nfs:
if: success() || failure()
needs: directory_volume_and_snapshots
runs-on: self-hosted
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- run: docker-compose -f tests/csi-sanity/docker-compose-nfs-snapshotcaps.yaml up $COMPOSE_DEFAULTS
env:
SANITY_FUNCTION: directory_volume_and_snapshots_nfs

snaphot_volumes_with_2nd_level_shapshots:
if: success() || failure()
needs: directory_volume_and_snapshots_nfs
runs-on: self-hosted
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- run: docker-compose -f tests/csi-sanity/docker-compose-snapshotcaps.yaml up $COMPOSE_DEFAULTS
Expand Down
40 changes: 40 additions & 0 deletions tests/csi-sanity/docker-compose-nfs-snapshotcaps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: '3.8'

services:
plugin_controller:
image: sanity
command: wekafsplugin -nodeid 1 -v ${PLUGIN_VERBOSITY} --allowinsecurehttps --endpoint=unix://tmp/weka-csi-test/controller.sock --debugpath=/tmp/weka-csi-test/filesystems -metricsport=9091 --csimode=controller -enablemetrics -allowautofscreation -allowautofsexpansion -allowsnapshotsoflegacyvolumes -alwaysallowsnapshotvolumes -usenfs
volumes:
- test-volume:/tmp/weka-csi-test
privileged: true
network_mode: host
healthcheck:
test: test -f /tmp/weka-csi-test/controller.sock
start_period: 1s
timeout: 1s
retries: 10
interval: 3s
plugin_node:
image: sanity
command: wekafsplugin -nodeid 1 -v ${PLUGIN_VERBOSITY} --allowinsecurehttps --endpoint=unix://tmp/weka-csi-test/node.sock --debugpath=/tmp/weka-csi-test/filesystems -metricsport=9092 --csimode=node -enablemetrics -allowautofscreation -allowautofsexpansion -allowsnapshotsoflegacyvolumes -alwaysallowsnapshotvolumes -usenfs
volumes:
- test-volume:/tmp/weka-csi-test
privileged: true
network_mode: host
healthcheck:
test: test -f /tmp/weka-csi-test/node.sock
start_period: 1s
timeout: 1s
retries: 10
interval: 3s
sanity:
image: sanity
command: run_sanity ${SANITY_FUNCTION} ${SANITY_VERBOSITY}
network_mode: host
volumes:
- test-volume:/tmp/weka-csi-test
depends_on:
- plugin_controller
- plugin_node
volumes:
test-volume:
16 changes: 16 additions & 0 deletions tests/csi-sanity/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ services:
privileged: true
ports:
- "9004:9090"
plugin_controller_nfs:
build: .
command: wekafsplugin -nodeid 1 -v 9 --allowinsecurehttps --endpoint=unix://tmp/weka-csi-test/controller-nfs.sock --debugpath=/tmp/weka-csi-test/filesystems --csimode=controller -enablemetrics -allowautofscreation -allowautofsexpansion -allowsnapshotsoflegacyvolumes -alwaysallowsnapshotvolumes -usenfs
volumes:
- test-volume:/tmp/weka-csi-test
privileged: true
ports:
- "9005:9090"
plugin_node_nfs:
build: .
command: wekafsplugin -nodeid 1 -v 9 --allowinsecurehttps --endpoint=unix://tmp/weka-csi-test/node.sock --debugpath=/tmp/weka-csi-test/filesystems --csimode=node -enablemetrics -allowautofscreation -allowautofsexpansion -allowsnapshotsoflegacyvolumes -alwaysallowsnapshotvolumes -usenfs
volumes:
- test-volume:/tmp/weka-csi-test
privileged: true
ports:
- "9006:9090"
sanity:
build: .
command: run_sanity
Expand Down
12 changes: 12 additions & 0 deletions tests/csi-sanity/ga_docker_run_sanity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ csi-sanity -csi.stagingdir /tmp/csi-test-staging \
-csi.testvolumeparameters /test/wekafs-dirv1.yaml
}

directory_volume_and_snapshots_nfs() {
echo "DIRECTORY VOLUME AND SNAPSHOTS NFS STARTED"
csi-sanity -csi.stagingdir /tmp/csi-test-staging \
--csi.controllerendpoint /tmp/weka-csi-test/controller.sock \
--csi.endpoint /tmp/weka-csi-test/node.sock \
-csi.secrets /test/wekafs-api-secret.yaml \
-csi.mountdir=/tmp/weka-csi-test/sanity-workspace/ \
-ginkgo.seed 0 \
-ginkgo.progress $1\
-csi.testvolumeparameters /test/wekafs-dirv1.yaml
}

# ---------------------- SNAPSHOT VOLUME WITH API BINDING AND SNAPSHOTS ----------------------
snaphot_volumes_with_2nd_level_shapshots() {
echo "SNAPSHOT VOLUMES WITH 2nd LEVEL SNAPSHOTS STARTED"
Expand Down

0 comments on commit 2773b0d

Please sign in to comment.