|
| 1 | +name: Compatibility E2E Test(API v2 - Rust Client) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, release-*] |
| 6 | + paths-ignore: ["**.md", "**.png", "**.jpg", "**.svg", "**/docs/**"] |
| 7 | + pull_request: |
| 8 | + branches: [main, release-*] |
| 9 | + paths-ignore: ["**.md", "**.png", "**.jpg", "**.svg", "**/docs/**"] |
| 10 | + schedule: |
| 11 | + - cron: '0 4 * * *' |
| 12 | + |
| 13 | +env: |
| 14 | + KIND_VERSION: v0.12.0 |
| 15 | + CONTAINERD_VERSION: v1.5.2 |
| 16 | + KIND_CONFIG_PATH: test/testdata/kind/config-v2.yaml |
| 17 | + DRAGONFLY_CHARTS_CONFIG_PATH: test/testdata/charts/config-v2.yaml |
| 18 | + DRAGONFLY_CHARTS_PATH: deploy/helm-charts/charts/dragonfly |
| 19 | + DRAGONFLY_FILE_SERVER_PATH: test/testdata/k8s/file-server.yaml |
| 20 | + |
| 21 | +jobs: |
| 22 | + compatibility_e2e_tests: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + timeout-minutes: 60 |
| 25 | + strategy: |
| 26 | + matrix: |
| 27 | + module: ["manager", "scheduler", "client", "seed-client"] |
| 28 | + include: |
| 29 | + - module: manager |
| 30 | + image: manager |
| 31 | + image-tag: v2.1.42 |
| 32 | + chart-name: manager |
| 33 | + - module: scheduler |
| 34 | + image: scheduler |
| 35 | + image-tag: v2.1.42 |
| 36 | + chart-name: scheduler |
| 37 | + - module: client |
| 38 | + image: client |
| 39 | + image-tag: v0.1.35 |
| 40 | + chart-name: client |
| 41 | + - module: seed-client |
| 42 | + image: client |
| 43 | + image-tag: v0.1.35 |
| 44 | + chart-name: seed-client |
| 45 | + |
| 46 | + steps: |
| 47 | + - name: Free Disk Space (Ubuntu) |
| 48 | + uses: jlumbroso/free-disk-space@main |
| 49 | + with: |
| 50 | + tool-cache: false |
| 51 | + android: true |
| 52 | + dotnet: true |
| 53 | + haskell: true |
| 54 | + large-packages: true |
| 55 | + docker-images: true |
| 56 | + swap-storage: true |
| 57 | + |
| 58 | + - name: Checkout code |
| 59 | + uses: actions/checkout@v4 |
| 60 | + with: |
| 61 | + submodules: recursive |
| 62 | + fetch-depth: 0 |
| 63 | + |
| 64 | + - name: Install Go |
| 65 | + uses: actions/setup-go@v5 |
| 66 | + with: |
| 67 | + go-version-file: go.mod |
| 68 | + |
| 69 | + - name: Get dependencies |
| 70 | + run: | |
| 71 | + go install github.com/onsi/ginkgo/v2/[email protected] |
| 72 | + mkdir -p /tmp/artifact |
| 73 | +
|
| 74 | + - name: Setup buildx |
| 75 | + uses: docker/setup-buildx-action@v3 |
| 76 | + id: buildx |
| 77 | + with: |
| 78 | + install: true |
| 79 | + |
| 80 | + - name: Cache Docker layers |
| 81 | + uses: actions/cache@v4 |
| 82 | + with: |
| 83 | + path: /tmp/.buildx-cache |
| 84 | + key: ${{ runner.os }}-buildx-${{ github.sha }} |
| 85 | + restore-keys: | |
| 86 | + ${{ runner.os }}-buildx- |
| 87 | +
|
| 88 | + - name: Pull Rust Client Image |
| 89 | + run: | |
| 90 | + cd client-rs |
| 91 | + CLIENT_TAG=$(git describe --tags $(git rev-parse HEAD)) |
| 92 | + docker pull dragonflyoss/client:$CLIENT_TAG |
| 93 | + docker tag dragonflyoss/client:$CLIENT_TAG dragonflyoss/client:latest |
| 94 | + docker pull dragonflyoss/dfinit:$CLIENT_TAG |
| 95 | + docker tag dragonflyoss/dfinit:$CLIENT_TAG dragonflyoss/dfinit:latest |
| 96 | +
|
| 97 | + - name: Build Scheduler Image |
| 98 | + uses: docker/build-push-action@v5 |
| 99 | + with: |
| 100 | + context: . |
| 101 | + file: build/images/scheduler/Dockerfile |
| 102 | + push: false |
| 103 | + load: true |
| 104 | + tags: dragonflyoss/scheduler:latest |
| 105 | + cache-from: type=local,src=/tmp/.buildx-cache |
| 106 | + cache-to: type=local,dest=/tmp/.buildx-cache-new |
| 107 | + |
| 108 | + - name: Build Manager Image |
| 109 | + uses: docker/build-push-action@v5 |
| 110 | + with: |
| 111 | + context: . |
| 112 | + file: build/images/manager/Dockerfile |
| 113 | + push: false |
| 114 | + load: true |
| 115 | + tags: dragonflyoss/manager:latest |
| 116 | + cache-from: type=local,src=/tmp/.buildx-cache |
| 117 | + cache-to: type=local,dest=/tmp/.buildx-cache-new |
| 118 | + |
| 119 | + - name: Setup Kind |
| 120 | + |
| 121 | + with: |
| 122 | + version: ${{ env.KIND_VERSION }} |
| 123 | + config: ${{ env.KIND_CONFIG_PATH }} |
| 124 | + cluster_name: kind |
| 125 | + |
| 126 | + - name: Kind load images |
| 127 | + run: | |
| 128 | + kind load docker-image dragonflyoss/manager:latest |
| 129 | + kind load docker-image dragonflyoss/scheduler:latest |
| 130 | + kind load docker-image dragonflyoss/client:latest |
| 131 | + kind load docker-image dragonflyoss/dfinit:latest |
| 132 | +
|
| 133 | + - name: Setup dragonfly |
| 134 | + run: | |
| 135 | + helm install --wait --timeout 10m --dependency-update --create-namespace --namespace dragonfly-system --set ${{ matrix.chart-name }}.image.tag=${{ matrix.image-tag }} --set ${{ matrix.chart-name }}.image.repository=dragonflyoss/${{ matrix.image }} -f ${{ env.DRAGONFLY_CHARTS_CONFIG_PATH }} dragonfly ${{ env.DRAGONFLY_CHARTS_PATH }} |
| 136 | + kubectl apply -f ${{ env.DRAGONFLY_FILE_SERVER_PATH }} |
| 137 | + kubectl wait po file-server-0 --namespace dragonfly-e2e --for=condition=ready --timeout=10m |
| 138 | + kubectl get po -n dragonfly-system |
| 139 | +
|
| 140 | + - name: Run E2E test |
| 141 | + run: | |
| 142 | + ginkgo -v -r --race --fail-fast --cover --trace --show-node-events --skip=${{ matrix.skip }} test/e2e/v2 |
| 143 | + cat coverprofile.out >> coverage.txt |
| 144 | +
|
| 145 | + - name: Move cache |
| 146 | + run: | |
| 147 | + rm -rf /tmp/.buildx-cache |
| 148 | + mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
| 149 | +
|
| 150 | + - name: Upload coverage to Codecov |
| 151 | + uses: codecov/codecov-action@v4 |
| 152 | + with: |
| 153 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 154 | + files: ./coverage.txt |
| 155 | + flags: e2etests |
| 156 | + |
| 157 | + - name: Upload Logs |
| 158 | + uses: actions/upload-artifact@v4 |
| 159 | + if: always() |
| 160 | + with: |
| 161 | + name: ${{ matrix.module }}-e2e-tests-logs |
| 162 | + path: | |
| 163 | + /tmp/artifact/** |
0 commit comments