Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Free disk space
if: steps.guard.outputs.hit != 'true'
run: scripts/free-disk-space.sh
run: scripts/free-disk-space.sh > /tmp/free-disk-space.log 2>&1 &

- name: Run build
if: steps.guard.outputs.hit != 'true'
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

- name: Free disk space
if: steps.guard.outputs.hit != 'true'
run: scripts/free-disk-space.sh
run: scripts/free-disk-space.sh > /tmp/free-disk-space.log 2>&1 &

- name: Run feature unification check
if: steps.guard.outputs.hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Free disk space
if: steps.guard.outputs.hit != 'true' && runner.environment != 'self-hosted'
run: scripts/free-disk-space.sh
run: scripts/free-disk-space.sh > /tmp/free-disk-space.log 2>&1 &

- name: Log in to GHCR (for remote cache)
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 #v4.4.0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ jobs:

- name: Free disk space
if: steps.guard.outputs.hit != 'true' && runner.environment != 'self-hosted'
run: scripts/free-disk-space.sh
run: scripts/free-disk-space.sh > /tmp/free-disk-space.log 2>&1 &

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wait for disk cleanup before starting the build

On GitHub-hosted runners this step now returns immediately, but the next step in this job is the Earthly build (Run pallet fixture tests) that was previously run only after removeUnusedFilesAndDirs had finished reclaiming /opt/hostedtoolcache and other large directories. If the hosted runner is near the disk limit, Earthly can begin pulling/building before that space has actually been freed and fail with ENOSPC; the same backgrounded cleanup pattern was added in the other CI jobs that immediately start disk-heavy builds. Keep the cleanup in the foreground, or explicitly wait for it before the build phase that depends on the reclaimed space.

Useful? React with 👍 / 👎.


- name: Run pallet fixture tests
if: steps.guard.outputs.hit != 'true'
Expand Down Expand Up @@ -596,7 +596,7 @@ jobs:

- name: Free disk space
if: steps.guard.outputs.hit != 'true' && runner.environment != 'self-hosted'
run: scripts/free-disk-space.sh
run: scripts/free-disk-space.sh > /tmp/free-disk-space.log 2>&1 &

# Self-hosted-runner-specific: earthly's managed buildkitd defaults to TLS
# but no certs are provisioned on the runner. Append tls_enabled: false
Expand Down Expand Up @@ -1038,7 +1038,7 @@ jobs:

- name: Free disk space
if: steps.image_meta.outputs.skip_build != 'true' && runner.environment != 'self-hosted'
run: scripts/free-disk-space.sh
run: scripts/free-disk-space.sh > /tmp/free-disk-space.log 2>&1 &

- name: Install just
if: steps.image_meta.outputs.skip_build != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
run: |
git fetch origin "$GITHUB_REF" --depth=1
git checkout FETCH_HEAD -- "scripts/free-disk-space.sh"
./scripts/free-disk-space.sh
./scripts/free-disk-space.sh > /tmp/free-disk-space.log 2>&1 &

- name: Run build
if: steps.check-images.outputs.images_exist != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: cat ./Cargo.toml

- name: Free disk space
run: scripts/free-disk-space.sh
run: scripts/free-disk-space.sh > /tmp/free-disk-space.log 2>&1 &

- name: Run check
run: |
Expand Down
15 changes: 4 additions & 11 deletions scripts/free-disk-space.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,6 @@ cleanPackages() {
|| echo "::warning::The command [sudo apt-get clean] failed"
}

# Remove Docker images, containers, volumes, and build cache.
# Ubuntu 22 runners have docker images already installed.
cleanDocker() {
echo "=> Removing the following docker images:"
sudo docker image ls
echo "=> Removing docker images, containers, volumes, and build cache..."
sudo docker system prune -af || true
sudo docker builder prune -af || true
}

# Remove Swap storage
cleanSwap() {
sudo swapoff -a || true
Expand All @@ -185,7 +175,10 @@ cleanSwap() {
echo "Initial disk space:"
df -h /
# cleanPackages - slow and doesn't free much.
cleanDocker
# cleanDocker removed: ubuntu-24.04 runners ship ~no preinstalled docker images
# (actions/runner-images#12625), and pruning raced the build now that this
# script runs backgrounded. Log usage so we can verify that stays true.
sudo docker system df || true
cleanSwap
removeUnusedFilesAndDirs
echo "Final disk space:"
Expand Down
Loading