Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .github/actions/free-disk-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Free disk space
description: >
Reclaim disk space on GitHub-hosted Ubuntu runners by removing large
preinstalled toolchains the build does not use. Needed because the
`--features embeddings-all` build (candle / tokenizers / hf-hub / image /
reqwest) plus the restored Rust build cache can otherwise exhaust the
runner's root disk ("No space left on device"). See issue #775.

Linux-only: the caller gates this with `if: runner.os == 'Linux'`. The
removed paths are unused by the Rust / Python / Node toolchains these jobs
rely on, so they are safe to delete.

runs:
using: composite
steps:
- name: Free disk space
shell: bash
run: |
echo "Disk usage before cleanup:"
df -h /
# Remove large preinstalled toolchains the build never touches. Each
# `|| true` keeps the step succeeding even if a path is already absent
# (paths differ slightly between runner images).
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/local/.ghcup || true
sudo rm -rf /opt/hostedtoolcache/CodeQL || true
# Reclaim space held by cached Docker images (none of these jobs use Docker).
sudo docker image prune --all --force || true
echo "Disk usage after cleanup:"
df -h /
36 changes: 36 additions & 0 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -83,6 +87,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install toolchain
uses: dtolnay/rust-toolchain@v1
with:
Expand Down Expand Up @@ -126,6 +134,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -174,6 +186,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -222,6 +238,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -270,6 +290,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up Python
uses: actions/setup-python@v6
with:
Expand Down Expand Up @@ -323,6 +347,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up Node.js
uses: actions/setup-node@v6
with:
Expand Down Expand Up @@ -366,6 +394,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down Expand Up @@ -411,6 +443,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -224,6 +228,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install toolchain
uses: dtolnay/rust-toolchain@v1
with:
Expand Down Expand Up @@ -268,6 +276,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -317,6 +329,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -366,6 +382,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -415,6 +435,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up Python
uses: actions/setup-python@v6
with:
Expand Down Expand Up @@ -469,6 +493,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up Node.js
uses: actions/setup-node@v6
with:
Expand Down Expand Up @@ -542,6 +570,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down Expand Up @@ -589,6 +621,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -84,6 +88,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install toolchain
uses: dtolnay/rust-toolchain@v1
with:
Expand Down Expand Up @@ -127,6 +135,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -175,6 +187,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -223,6 +239,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Install protoc
uses: ./.github/actions/install-protoc
with:
Expand Down Expand Up @@ -271,6 +291,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up Python
uses: actions/setup-python@v6
with:
Expand Down Expand Up @@ -324,6 +348,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up Node.js
uses: actions/setup-node@v6
with:
Expand Down Expand Up @@ -367,6 +395,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down Expand Up @@ -413,6 +445,10 @@ jobs:
- name: Run checkout
uses: actions/checkout@v6

- name: Free disk space
if: runner.os == 'Linux'
uses: ./.github/actions/free-disk-space

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
Loading