Skip to content

Commit 54e9feb

Browse files
authored
Add disk cleanup for Docker builds (#1442)
<!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [ ] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [ ] I have installed the hooks with `pre-commit install`. - [ ] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [ ] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. -->
1 parent fc88829 commit 54e9feb

File tree

1 file changed

+49
-6
lines changed

1 file changed

+49
-6
lines changed

.github/workflows/release-ci-docker.yml

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10+
- name: Free Disk Space
11+
uses: jlumbroso/free-disk-space@main
12+
with:
13+
tool-cache: false
14+
android: true
15+
dotnet: true
16+
haskell: true
17+
large-packages: true
18+
docker-images: true
19+
swap-storage: true
20+
1021
- uses: actions/checkout@v4
1122

1223
- name: Set up QEMU
@@ -21,15 +32,47 @@ jobs:
2132
username: flashinfer
2233
password: ${{ secrets.DOCKERHUB_TOKEN }}
2334

24-
- name: Build and push multi-arch image
35+
- name: Build and push AMD64 image
2536
uses: docker/build-push-action@v5
2637
with:
2738
context: docker
2839
file: docker/Dockerfile.ci_gpu
29-
platforms: linux/amd64,linux/arm64
40+
platforms: linux/amd64
3041
push: true
3142
tags: |
32-
flashinfer/flashinfer-ci:latest
33-
flashinfer/flashinfer-ci:${{ github.sha }}
34-
cache-from: type=registry,ref=flashinfer/flashinfer-ci:buildcache
35-
cache-to: type=registry,ref=flashinfer/flashinfer-ci:buildcache,mode=max
43+
flashinfer/flashinfer-ci:amd64
44+
cache-from: type=registry,ref=flashinfer/flashinfer-ci:buildcache-amd64
45+
cache-to: type=registry,ref=flashinfer/flashinfer-ci:buildcache-amd64,mode=max
46+
provenance: false
47+
sbom: false
48+
49+
- name: Clean up after AMD64 build
50+
run: |
51+
df -h /
52+
docker buildx prune -af
53+
docker system prune -af --volumes
54+
sudo rm -rf /tmp/* /var/tmp/* ~/.docker/buildx
55+
df -h /
56+
57+
- name: Re-setup Docker Buildx for ARM64
58+
uses: docker/setup-buildx-action@v3
59+
60+
- name: Build and push ARM64 image
61+
uses: docker/build-push-action@v5
62+
with:
63+
context: docker
64+
file: docker/Dockerfile.ci_gpu
65+
platforms: linux/arm64
66+
push: true
67+
tags: |
68+
flashinfer/flashinfer-ci:arm64
69+
cache-from: type=registry,ref=flashinfer/flashinfer-ci:buildcache-arm64
70+
cache-to: type=registry,ref=flashinfer/flashinfer-ci:buildcache-arm64,mode=max
71+
provenance: false
72+
sbom: false
73+
74+
- name: Create and push multi-arch manifest
75+
run: |
76+
docker buildx imagetools create -t flashinfer/flashinfer-ci:latest \
77+
flashinfer/flashinfer-ci:amd64 \
78+
flashinfer/flashinfer-ci:arm64

0 commit comments

Comments
 (0)