-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add csi-sanity action to PRs #30
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1c1a42b
sanity
alex-old-user f7f6295
sanity
alex-old-user e1b2ebe
sanity
alex-old-user 0b262b6
sanity
alex-old-user 15f0e18
sanity
alex-old-user 9ce0f34
sanity
alex-old-user aab3004
sanity
alex-old-user 2292c1c
sanity
alex-old-user 7e60e45
sanity
alex-old-user 0e13b57
sanity
alex-old-user 99c3d21
sanity
alex-old-user 4a9bf00
sanity
alex-old-user e3427d6
sanity
alex-old-user e93311a
sanity
alex-old-user File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: sanity | ||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
# through 1 to 9 | ||
PLUGIN_VERBOSITY: ${{ vars.PLUGIN_VERBOSITY }} | ||
# - ' ' | ||
# - '-ginkgo.v' | ||
# - '-ginkgo.vv' | ||
SANITY_VERBOSITY: ${{ vars.SANITY_VERBOSITY }} | ||
COMPOSE_DEFAULTS: '--exit-code-from=sanity --always-recreate-deps --force-recreate' | ||
|
||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: echo "${{ secrets.WEKAFS_API_SECRET_YAML }}" > tests/csi-sanity/wekafs-api-secret.yaml | ||
|
||
- uses: docker/setup-buildx-action@v2 | ||
- uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: tests/csi-sanity/ga-Dockerfile | ||
tags: sanity:latest | ||
load: true | ||
|
||
legacy_sanity: | ||
needs: build | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: docker-compose -f tests/csi-sanity/docker-compose-nosnapshotcaps.yaml up $COMPOSE_DEFAULTS | ||
env: | ||
SANITY_FUNCTION: legacy_sanity | ||
|
||
directory_volume_no_snapshots: | ||
if: success() || failure() # always() can't be canceled | ||
needs: legacy_sanity | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: docker-compose -f tests/csi-sanity/docker-compose-nosnapshotcaps.yaml up $COMPOSE_DEFAULTS | ||
env: | ||
SANITY_FUNCTION: directory_volume_no_snapshots | ||
|
||
fs_volume_no_snapshots: | ||
if: success() || failure() | ||
needs: directory_volume_no_snapshots | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: docker-compose -f tests/csi-sanity/docker-compose-nosnapshotcaps.yaml up $COMPOSE_DEFAULTS | ||
env: | ||
SANITY_FUNCTION: fs_volume_no_snapshots | ||
|
||
directory_volume_and_snapshots: | ||
if: success() || failure() | ||
needs: fs_volume_no_snapshots | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: docker-compose -f tests/csi-sanity/docker-compose-snapshotcaps.yaml up $COMPOSE_DEFAULTS | ||
env: | ||
SANITY_FUNCTION: directory_volume_and_snapshots | ||
|
||
snaphot_volumes_with_2nd_level_shapshots: | ||
if: success() || failure() | ||
needs: directory_volume_and_snapshots | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: docker-compose -f tests/csi-sanity/docker-compose-snapshotcaps.yaml up $COMPOSE_DEFAULTS | ||
env: | ||
SANITY_FUNCTION: snaphot_volumes_with_2nd_level_shapshots | ||
|
||
filesystem_volumes: | ||
if: success() || failure() | ||
needs: snaphot_volumes_with_2nd_level_shapshots | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: docker-compose -f tests/csi-sanity/docker-compose-snapshotcaps.yaml up $COMPOSE_DEFAULTS | ||
env: | ||
SANITY_FUNCTION: filesystem_volumes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
version: '3' | ||
|
||
services: | ||
plugin_controller_no_snaps: | ||
image: sanity | ||
command: wekafsplugin -nodeid 1 -v ${PLUGIN_VERBOSITY} --allowinsecurehttps --endpoint=unix://tmp/weka-csi-test/controller-no-snaps.sock --debugpath=/tmp/weka-csi-test/filesystems -metricsport=9091 --csimode=controller -enablemetrics -allowautofscreation -allowautofsexpansion -allowsnapshotsoflegacyvolumes -allowautoseedsnapshotcreation -suppresssnapshotcapability -suppressrvolumeclonecapability -alwaysallowsnapshotvolumes | ||
volumes: | ||
- test-volume:/tmp/weka-csi-test | ||
privileged: true | ||
network_mode: host | ||
plugin_node_no_snaps: | ||
image: sanity | ||
command: wekafsplugin -nodeid 1 -v ${PLUGIN_VERBOSITY} --allowinsecurehttps --endpoint=unix://tmp/weka-csi-test/node-no-snaps.sock --debugpath=/tmp/weka-csi-test/filesystems -metricsport=9092 --csimode=node -enablemetrics -allowautofscreation -allowautofsexpansion -allowsnapshotsoflegacyvolumes -allowautoseedsnapshotcreation -suppresssnapshotcapability -suppressrvolumeclonecapability -alwaysallowsnapshotvolumes | ||
volumes: | ||
- test-volume:/tmp/weka-csi-test | ||
privileged: true | ||
network_mode: host | ||
sanity: | ||
image: sanity | ||
command: run_sanity ${SANITY_FUNCTION} ${SANITY_VERBOSITY} | ||
network_mode: host | ||
volumes: | ||
- test-volume:/tmp/weka-csi-test | ||
healthcheck: | ||
test: test -f /tmp/weka-csi-test/controller-no-snaps.sock && test -f /tmp/weka-csi-test/node-no-snaps.sock | ||
start_period: 5s | ||
timeout: 1s | ||
retries: 5 | ||
interval: 3s | ||
volumes: | ||
test-volume: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
version: '3' | ||
|
||
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 -allowautoseedsnapshotcreation -alwaysallowsnapshotvolumes | ||
volumes: | ||
- test-volume:/tmp/weka-csi-test | ||
privileged: true | ||
network_mode: host | ||
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 -allowautoseedsnapshotcreation -alwaysallowsnapshotvolumes | ||
volumes: | ||
- test-volume:/tmp/weka-csi-test | ||
privileged: true | ||
network_mode: host | ||
sanity: | ||
image: sanity | ||
command: run_sanity ${SANITY_FUNCTION} ${SANITY_VERBOSITY} | ||
network_mode: host | ||
volumes: | ||
- test-volume:/tmp/weka-csi-test | ||
healthcheck: | ||
test: test -f /tmp/weka-csi-test/controller.sock && test -f /tmp/weka-csi-test/node.sock | ||
start_period: 5s | ||
timeout: 1s | ||
retries: 5 | ||
interval: 3s | ||
volumes: | ||
test-volume: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM golang:1.19-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
|
||
RUN go install -v github.com/kubernetes-csi/csi-test/v5/cmd/[email protected] | ||
|
||
COPY cmd cmd | ||
COPY pkg pkg | ||
|
||
RUN CGO_ENABLED=0 GOOS="linux" GOARCH="amd64" go build -a -ldflags '-X main.version='$VERSION' -extldflags "-static"' -o wekafsplugin ./cmd/wekafsplugin/main.go | ||
|
||
|
||
FROM golang:1.19-alpine | ||
|
||
ADD tests/csi-sanity/wekafs-dirv1.yaml /test/wekafs-dirv1.yaml | ||
ADD tests/csi-sanity/wekafs-fs.yaml /test/wekafs-fs.yaml | ||
ADD tests/csi-sanity/wekafs-snapvol.yaml /test/wekafs-snapvol.yaml | ||
ADD tests/csi-sanity/wekafs-api-secret.yaml /test/wekafs-api-secret.yaml | ||
ADD tests/csi-sanity/ga_docker_run_sanity.sh /usr/bin/run_sanity | ||
COPY --from=0 /go/bin/csi-sanity /usr/local/bin/csi-sanity | ||
COPY --from=0 /app/wekafsplugin /usr/local/bin/wekafsplugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/usr/bin/env sh | ||
|
||
mkdir -p /tmp/weka-csi-test/filesystems/default/test/my/path | ||
|
||
# ---------------------- LEGACY DIR VOLUME NO API BINDING (NO SNAPSHOT SUPPORT) ---------------------- | ||
legacy_sanity() { | ||
echo "LEGACY SANITY STARTED" | ||
|
||
csi-sanity -csi.stagingdir /tmp/csi-test-staging \ | ||
--csi.controllerendpoint /tmp/weka-csi-test/controller-no-snaps.sock \ | ||
--csi.endpoint /tmp/weka-csi-test/node-no-snaps.sock \ | ||
-csi.mountdir=/tmp/weka-csi-test/sanity-workspace/ \ | ||
-ginkgo.always-emit-ginkgo-writer \ | ||
-ginkgo.progress $1\ | ||
-ginkgo.seed 0 \ | ||
-csi.testvolumeparameters /test/wekafs-dirv1.yaml | ||
} | ||
|
||
# ---------------------- DIR VOLUME WITH API BINDING EXCLUDING SNAPSHOTS ---------------------- | ||
directory_volume_no_snapshots() { | ||
echo "DIRECTORY VOLUME NO SNAPSHOTS STARTED" | ||
|
||
csi-sanity -csi.stagingdir /tmp/csi-test-staging \ | ||
--csi.controllerendpoint /tmp/weka-csi-test/controller-no-snaps.sock \ | ||
--csi.endpoint /tmp/weka-csi-test/node-no-snaps.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 | ||
} | ||
|
||
# ---------------------- FS VOLUME WITH API BINDING EXCLUDING SNAPSHOTS ---------------------- | ||
fs_volume_no_snapshots() { | ||
echo "FS VOLUME NO SNAPSHOTS STARTED" | ||
|
||
csi-sanity -csi.stagingdir /tmp/csi-test-staging \ | ||
--csi.controllerendpoint /tmp/weka-csi-test/controller-no-snaps.sock \ | ||
--csi.endpoint /tmp/weka-csi-test/node-no-snaps.sock \ | ||
-csi.secrets /test/wekafs-api-secret.yaml \ | ||
-csi.mountdir=/tmp/weka-csi-test/sanity-workspace/ \ | ||
-csi.testvolumeparameters /test/wekafs-fs.yaml \ | ||
-ginkgo.seed 0 \ | ||
-ginkgo.progress $1 | ||
} | ||
|
||
# ---------------------- DIR VOLUME WITH API BINDING AND SNAPSHOTS ---------------------- | ||
directory_volume_and_snapshots() { | ||
echo "DIRECTORY VOLUME AND SNAPSHOTS 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" | ||
|
||
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-snapvol.yaml | ||
} | ||
|
||
# ---------------------- FILESYSTEM VOLUME WITH API BINDING AND SNAPSHOTS ---------------------- | ||
filesystem_volumes() { | ||
echo "FILESYSTEM VOLUMES 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-fs.yaml | ||
} | ||
|
||
"$@" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically the same as
always()
but can be canceled