-
Notifications
You must be signed in to change notification settings - Fork 0
Speed up Ubuntu 24.04 valgrind with pytest-split (2h -> 40min) #4
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -34,7 +34,6 @@ jobs: | |||
| - "fedora-44-amd64" | ||||
| - "gentoo" | ||||
| - "ubuntu-24.04-noble-amd64" | ||||
| - "ubuntu-24.04-noble-amd64-valgrind" | ||||
| - "ubuntu-26.04-resolute-amd64" | ||||
| # has a dependency on the test image | ||||
| - "manylinux_2_28-wheel-build" | ||||
|
|
@@ -118,8 +117,130 @@ jobs: | |||
| if: always() | ||||
| run: sudo chown -R "$(id -u)" "$(pwd)" | ||||
|
|
||||
| # The valgrind suite is slow, so build its image once, test it across | ||||
| # parallel split jobs, and push only after every split has passed. | ||||
| build-valgrind: | ||||
| name: ubuntu-24.04-noble-amd64-valgrind build | ||||
| runs-on: ubuntu-latest | ||||
| steps: | ||||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||||
| with: | ||||
| persist-credentials: false | ||||
| submodules: true | ||||
|
|
||||
| - name: Prepare build | ||||
| run: | | ||||
| git submodule update --remote Pillow | ||||
| (cd Pillow && git checkout main) | ||||
|
|
||||
| - name: Build image | ||||
| run: | | ||||
| cd ubuntu-24.04-noble-amd64-valgrind && make update | ||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why doesn't this have docker-images/.github/workflows/build.yml Line 88 in e3ecdef
?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That other job had already run |
||||
| if [[ -n "$DOCKER_USERNAME" ]]; then | ||||
| echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | ||||
| fi | ||||
| make build BRANCH=main | ||||
| env: | ||||
| DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||||
| DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||||
|
|
||||
| - name: Save image | ||||
| run: make -C ubuntu-24.04-noble-amd64-valgrind save BRANCH=main | ||||
|
|
||||
| - name: Upload image | ||||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||||
| with: | ||||
| name: ubuntu-24.04-noble-amd64-valgrind | ||||
| path: ubuntu-24.04-noble-amd64-valgrind/image.tar | ||||
| retention-days: 1 | ||||
|
|
||||
| test-valgrind: | ||||
| name: ubuntu-24.04-noble-amd64-valgrind ${{ matrix.split }} | ||||
| needs: build-valgrind | ||||
| runs-on: ubuntu-latest | ||||
| env: | ||||
| SPLIT_COUNT: ${{ strategy.job-total }} | ||||
| strategy: | ||||
| fail-fast: false | ||||
| matrix: | ||||
| split: [1, 2, 3, 4] | ||||
| steps: | ||||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||||
| with: | ||||
| persist-credentials: false | ||||
| submodules: true | ||||
|
|
||||
| - name: Download image | ||||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||||
| with: | ||||
| name: ubuntu-24.04-noble-amd64-valgrind | ||||
|
|
||||
| - name: Prepare test | ||||
| run: | | ||||
| git submodule update --remote Pillow | ||||
| (cd Pillow && git checkout main) | ||||
| sudo chown -R 1001 "$(pwd)" | ||||
|
|
||||
| - name: Load image | ||||
| run: | | ||||
| if [[ -n "$DOCKER_USERNAME" ]]; then | ||||
| echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | ||||
| fi | ||||
| docker load -i image.tar | ||||
| env: | ||||
| DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||||
| DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||||
|
|
||||
| - name: Test image | ||||
| run: | | ||||
| cd ubuntu-24.04-noble-amd64-valgrind | ||||
| make test BRANCH=main | ||||
| env: | ||||
| SPLIT_INDEX: ${{ matrix.split }} | ||||
|
|
||||
| - name: Post test | ||||
| if: always() | ||||
| run: sudo chown -R "$(id -u)" "$(pwd)" | ||||
|
|
||||
| push-valgrind: | ||||
| name: Push ubuntu-24.04-noble-amd64-valgrind | ||||
| needs: test-valgrind | ||||
| runs-on: ubuntu-latest | ||||
| steps: | ||||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||||
| with: | ||||
| persist-credentials: false | ||||
|
|
||||
| - name: Download image | ||||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||||
| with: | ||||
| name: ubuntu-24.04-noble-amd64-valgrind | ||||
|
|
||||
| - name: Load image | ||||
| id: build | ||||
| run: | | ||||
| if [[ -n "$DOCKER_USERNAME" ]]; then | ||||
| echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin && echo "logged_in=true" >> "$GITHUB_OUTPUT" | ||||
| fi | ||||
| docker load -i image.tar | ||||
| env: | ||||
| DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||||
| DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||||
|
|
||||
| - name: Log image size | ||||
| run: | | ||||
| docker images | ||||
|
|
||||
| - name: Push image | ||||
| if: "steps.build.outputs.logged_in == 'true' | ||||
| && github.event_name == 'push' | ||||
| && github.ref == 'refs/heads/main'" | ||||
| run: make push-ubuntu-24.04-noble-amd64-valgrind BRANCH=main | ||||
| env: | ||||
| DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||||
|
|
||||
| success: | ||||
| needs: build | ||||
| needs: [build, push-valgrind] | ||||
| runs-on: ubuntu-latest | ||||
| name: Build successful | ||||
| steps: | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.