Skip to content

Commit 0307f34

Browse files
authored
feat: use disk space cleanup in all nvidia builds (#705)
1 parent 4f8dcc7 commit 0307f34

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,21 @@ jobs:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- uses: actions/checkout@v3
39+
- run: ./hack/free-disk-space.sh
3940
- run: docker build --file test/images/nvidia/Dockerfile .
4041
build-image-nvidia-training:
4142
runs-on: ubuntu-latest
4243
steps:
4344
- uses: actions/checkout@v3
45+
- run: ./hack/free-disk-space.sh
4446
- run: |
4547
docker build --file test/images/nvidia-training/Dockerfile test/images/nvidia-training \
4648
--build-arg PYTORCH_BUILD_ENV="MAX_JOBS=$(($(nproc) - 2)) USE_MKLDNN=0 USE_DISTRIBUTED=0 USE_CUDA=0 USE_ROCM=0 USE_CAFFE2=0 USE_QNNPACK=0 USE_NNPACK=0 USE_XNNPACK=0 USE_MPS=0 BUILD_SHARED_LIBS=OFF USE_FLASH_ATTENTION=0 USE_MEM_EFF_ATTENTION=0 BUILD_TEST=0"
4749
build-image-nvidia-inference:
4850
runs-on: ubuntu-latest
4951
steps:
5052
- uses: actions/checkout@v3
51-
# hack to free up disk space for build
52-
# ref: https://github.com/easimon/maximize-build-space/blob/master/action.yml
53-
- run: |
54-
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
55-
docker image prune --all --force
56-
docker builder prune -a
53+
- run: ./hack/free-disk-space.sh
5754
- run: |
5855
docker build --file test/images/nvidia-inference/Dockerfile test/images/nvidia-inference \
5956
--build-arg PYTORCH_BUILD_ENV="MAX_JOBS=$(($(nproc) - 2)) USE_MKLDNN=0 USE_DISTRIBUTED=0 USE_CUDA=0 USE_ROCM=0 USE_CAFFE2=0 USE_QNNPACK=0 USE_NNPACK=0 USE_XNNPACK=0 USE_MPS=0 BUILD_SHARED_LIBS=OFF USE_FLASH_ATTENTION=0 USE_MEM_EFF_ATTENTION=0 BUILD_TEST=0"

hack/free-disk-space.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
set -o nounset
4+
set -o errexit
5+
set -o pipefail
6+
7+
# hack to free up disk space for build
8+
# ref: https://github.com/easimon/maximize-build-space/blob/master/action.yml
9+
10+
# storage before
11+
sudo df -h
12+
13+
sudo rm -rf \
14+
/usr/share/dotnet \
15+
/usr/local/lib/android \
16+
/opt/ghc \
17+
/opt/hostedtoolcache/CodeQL
18+
19+
docker image prune --all --force
20+
docker builder prune -a
21+
22+
# storage after
23+
sudo df -h

0 commit comments

Comments
 (0)