fix: move docker data dir to /mnt to address e2e test low disk space for clean backport #5142
Workflow file for this run
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release-* | |
| workflow_dispatch: {} | |
| pull_request: | |
| branches: | |
| - main | |
| - release-* | |
| paths-ignore: [docs/**, "**.md", "**.mdx", "**.png", "**.jpg"] | |
| env: | |
| GO_VERSION: '1.24.9' | |
| jobs: | |
| detect-noop: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| noop: ${{ steps.noop.outputs.should_skip }} | |
| steps: | |
| - name: Detect No-op Changes | |
| id: noop | |
| uses: fkirc/skip-duplicate-actions@v5.3.1 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| do_not_skip: '["workflow_dispatch", "schedule", "push"]' | |
| concurrent_skipping: false | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| needs: detect-noop | |
| if: needs.detect-noop.outputs.noop != 'true' | |
| steps: | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@v5 | |
| - name: Set up Ginkgo CLI | |
| run: | | |
| go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1 | |
| - name: Run unit tests & Generate coverage | |
| run: make test | |
| - name: Upload Codecov report | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| ## Repository upload token - get it from codecov.io. Required only for private repositories | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| ## Comma-separated list of files to upload | |
| files: ./it-coverage.xml;./ut-coverage.xml | |
| e2e-tests: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| customized-settings: [default, resourceplacement, joinleave, custom] | |
| include: | |
| - customized-settings: default | |
| # to shorten the test duration, set the resource snapshot creation interval to 0 | |
| resource-snapshot-creation-minimum-interval: 0m | |
| resource-changes-collection-duration: 0m | |
| - customized-settings: resourceplacement | |
| # to shorten the test duration, set the resource snapshot creation interval to 0 | |
| resource-snapshot-creation-minimum-interval: 0m | |
| resource-changes-collection-duration: 0m | |
| - customized-settings: joinleave | |
| # to shorten the test duration, set the resource snapshot creation interval to 0 | |
| resource-snapshot-creation-minimum-interval: 0m | |
| resource-changes-collection-duration: 0m | |
| - customized-settings: custom | |
| resource-snapshot-creation-minimum-interval: 30s | |
| resource-changes-collection-duration: 15s | |
| runs-on: ubuntu-latest | |
| needs: [ | |
| detect-noop, | |
| ] | |
| if: needs.detect-noop.outputs.noop != 'true' | |
| steps: | |
| - name: Remove unnecessary files | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf "/usr/local/share/boost" | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@v5 | |
| - name: Move Docker data directory to /mnt | |
| # The default storage device on GitHub-hosted runners is running low during e2e tests. | |
| # Moving Docker data directory to /mnt which has more space and is backed by a larger | |
| # storage device. | |
| # Upstream kubefleet repo has a much bigger default storage device and no secondary | |
| # storage device to use. | |
| run: | | |
| echo "=== Moving Docker to /mnt for more disk space ===" | |
| df -h | |
| sudo systemctl stop docker | |
| echo '{"data-root": "/mnt/docker"}' | sudo tee /etc/docker/daemon.json | |
| sudo mkdir -p /mnt/docker | |
| if [ -d "/var/lib/docker" ]; then | |
| sudo mv /var/lib/docker/* /mnt/docker/ || true | |
| fi | |
| sudo systemctl start docker | |
| echo "=== Docker moved to /mnt, verifying ===" | |
| docker info | grep "Docker Root Dir" || true | |
| - name: Install Ginkgo CLI | |
| run: | | |
| go install github.com/onsi/ginkgo/v2/ginkgo@v2.23.4 | |
| - name: Install Kind | |
| # Before updating the kind version to use, verify that the current kind image | |
| # is still supported by the version. | |
| run: | | |
| go install sigs.k8s.io/kind@v0.30.0 | |
| - name: Run e2e tests | |
| run: | | |
| if [ "${{ matrix.customized-settings }}" = "default" ]; then | |
| make e2e-tests LABEL_FILTER="!custom && !joinleave && !resourceplacement" | |
| elif [ "${{ matrix.customized-settings }}" = "resourceplacement" ]; then | |
| make e2e-tests LABEL_FILTER="!custom && resourceplacement" | |
| elif [ "${{ matrix.customized-settings }}" = "joinleave" ]; then | |
| make e2e-tests LABEL_FILTER="!custom && joinleave" | |
| else | |
| make e2e-tests-custom | |
| fi | |
| env: | |
| KUBECONFIG: '/home/runner/.kube/config' | |
| HUB_SERVER_URL: 'https://172.19.0.2:6443' | |
| # Temporarily enable the AKS property provider for the E2E tests, in order | |
| # to verify the property-based scheduling experience. | |
| # | |
| # TO-DO (chenyu1): to ensure a vendor-neutral experience, switch to a dummy | |
| # property provider once the AKS one is split out. | |
| PROPERTY_PROVIDER: 'azure' | |
| RESOURCE_SNAPSHOT_CREATION_MINIMUM_INTERVAL: ${{ matrix.resource-snapshot-creation-minimum-interval }} | |
| RESOURCE_CHANGES_COLLECTION_DURATION: ${{ matrix.resource-changes-collection-duration }} | |
| - name: Collect logs | |
| if: always() | |
| run: | | |
| make collect-e2e-logs | |
| env: | |
| KUBECONFIG: '/home/runner/.kube/config' | |
| LOG_DIR: 'logs-${{ matrix.customized-settings }}' | |
| - name: Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-logs-${{ matrix.customized-settings }} | |
| path: test/e2e/logs-${{ matrix.customized-settings }}/ | |
| retention-days: 3 |