Skip to content

Commit 1f8b680

Browse files
fix: add additional cleanup in docker publish workflow, running out of runner space (#535)
Same code applied to the CI workflow in a previous PR but it's required on the docker publish workflow as well due to the limited github runner disk space https://github.com/Unstructured-IO/unstructured-api/blob/main/.github/workflows/ci.yml#L120-L140 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Introduces proactive disk cleanup to prevent runner out-of-space failures during image builds. > > - Adds `Free up disk space` step in `docker-publish.yml` that removes large preinstalled toolchains (e.g., `dotnet`, `ghc`, `boost`, Android, CodeQL, `ghcup`, Swift) and runs `docker system prune -af --volumes`, logging `df -h` before/after > - Keeps the existing image build logic intact, now executed in a subsequent `Build image` step > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 20d2aef. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent fa49907 commit 1f8b680

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,28 @@ jobs:
6666
registry: quay.io
6767
username: ${{ secrets.QUAY_IO_ROBOT_USERNAME }}
6868
password: ${{ secrets.QUAY_IO_ROBOT_TOKEN }}
69-
- name: Build image
69+
- name: Free up disk space
7070
run: |
7171
# Clear some space (https://github.com/actions/runner-images/issues/2840)
72-
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost
72+
echo "Disk usage before cleanup:"
73+
df -h
74+
75+
# Remove unnecessary pre-installed software
76+
sudo rm -rf /usr/share/dotnet
77+
sudo rm -rf /opt/ghc
78+
sudo rm -rf /usr/local/share/boost
79+
sudo rm -rf /usr/local/lib/android
80+
sudo rm -rf /opt/hostedtoolcache/CodeQL
81+
sudo rm -rf /usr/local/.ghcup
82+
sudo rm -rf /usr/share/swift
83+
84+
# Clean up docker to ensure we start fresh
85+
docker system prune -af --volumes
7386
87+
echo "Disk usage after cleanup:"
88+
df -h
89+
- name: Build image
90+
run: |
7491
DOCKER_BUILDKIT=1 docker buildx build --load -f Dockerfile \
7592
--platform=$DOCKER_PLATFORM \
7693
--build-arg PIP_VERSION=$PIP_VERSION \

0 commit comments

Comments
 (0)