diff --git a/.github/workflows/sanity.yaml b/.github/workflows/sanity.yaml index 047098140..7e58ca922 100644 --- a/.github/workflows/sanity.yaml +++ b/.github/workflows/sanity.yaml @@ -23,6 +23,8 @@ 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 - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: @@ -54,12 +56,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 diff --git a/tests/csi-sanity/docker-compose-nfs-snapshotcaps.yaml b/tests/csi-sanity/docker-compose-nfs-snapshotcaps.yaml new file mode 100644 index 000000000..6aea2e00d --- /dev/null +++ b/tests/csi-sanity/docker-compose-nfs-snapshotcaps.yaml @@ -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: diff --git a/tests/csi-sanity/docker-compose.yaml b/tests/csi-sanity/docker-compose.yaml index 34893cb18..7c5f8d101 100644 --- a/tests/csi-sanity/docker-compose.yaml +++ b/tests/csi-sanity/docker-compose.yaml @@ -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 diff --git a/tests/csi-sanity/ga_docker_run_sanity.sh b/tests/csi-sanity/ga_docker_run_sanity.sh index f0779e444..ce7f438d3 100755 --- a/tests/csi-sanity/ga_docker_run_sanity.sh +++ b/tests/csi-sanity/ga_docker_run_sanity.sh @@ -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"