Skip to content

Commit 1800d15

Browse files
authored
Always remove unecessary software from github runners for all jobs (fix intermittent out of space on runners) (#19122)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #19121 ## Rationale for this change - DataFusion requires a lot of diskspace (rust compilation, etc) - Github often adds significant overhead as well with pre-installed software - Some specific jobs remove unecessary pre-installed software, but it is not applied to all jobs (and so new jobs fail from time to time, such as #19121) ## What changes are included in this PR? 1. Let's apply the cleanup to all jobs Note I also looked into any other potential space savings, and I can't really find any (there is nothing else obvious to delete). Here is some `du` sleuthing from [this run](https://github.com/apache/datafusion/actions/runs/19971702815/job/57277837847?pr=19122): ``` info: installing component 'rustfmt' info: component 'rustfmt' for target 'x86_64-unknown-linux-gnu' is up to date Prepare all required actions Run ./.github/actions/setup-rust-runtime Run echo "RUST_BACKTRACE=1" >> $GITHUB_ENV Run git config --global --add safe.directory "$GITHUB_WORKSPACE" Run echo "Disk space before cleanup:" Disk space before cleanup: Filesystem Size Used Avail Use% Mounted on overlay 72G 56G 16G 79% / tmpfs 64M 0 64M 0% /dev shm 64M 0 64M 0% /dev/shm /dev/root 72G 56G 16G 79% /__w tmpfs 3.2G 1.2M 3.2G 1% /run/docker.sock tmpfs 7.9G 0 7.9G 0% /proc/acpi tmpfs 7.9G 0 7.9G 0% /proc/scsi tmpfs 7.9G 0 7.9G 0% /sys/firmware 605M /__e 5.8G /__t 59M /__w 0 /bin 4.0K /boot 0 /dev 2.1M /etc 4.0K /github 4.0K /home 0 /lib 0 /lib64 4.0K /media 4.0K /mnt 4.0K /opt du: cannot read directory '/proc/136/task/136/net': Invalid argument du: cannot read directory '/proc/136/net': Invalid argument du: cannot read directory '/proc/193/task/193/net': Invalid argument du: cannot read directory '/proc/193/net': Invalid argument du: cannot access '/proc/361/task/361/fd/4': No such file or directory du: cannot access '/proc/361/task/361/fdinfo/4': No such file or directory du: cannot access '/proc/361/fd/3': No such file or directory du: cannot access '/proc/361/fdinfo/3': No such file or directory 0 /proc 12K /root 8.0K /run 0 /sbin 4.0K /srv 0 /sys 4.0K /tmp 2.8G /usr 37M /var 114M /usr/bin 4.0K /usr/games 57M /usr/include 530M /usr/lib 4.0K /usr/lib64 101M /usr/libexec 1.8G /usr/local 5.0M /usr/sbin 233M /usr/share 4.0K /usr/src 4.0K /usr/local/bin 20M /usr/local/cargo 4.0K /usr/local/etc 4.0K /usr/local/games 4.0K /usr/local/include 12K /usr/local/lib 4.0K /usr/local/libexec 0 /usr/local/man 1.8G /usr/local/rustup 4.0K /usr/local/sbin 16K /usr/local/share 4.0K /usr/local/src 16K /__w/_PipelineMapping 2.2M /__w/_actions 88K /__w/_temp 57M /__w/datafusion Disk space after cleanup: Filesystem Size Used Avail Use% Mounted on overlay 72G 51G 22G 71% / tmpfs 64M 0 64M 0% /dev shm 64M 0 64M 0% /dev/shm /dev/root 72G 51G 22G 71% /__w tmpfs 3.2G 1.2M 3.2G 1% /run/docker.sock tmpfs 7.9G 0 7.9G 0% /proc/acpi tmpfs 7.9G 0 7.9G 0% /proc/scsi tmpfs 7.9G 0 7.9G 0% /sys/firmware ``` ## Are these changes tested? by CI ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
1 parent 2b05b09 commit 1800d15

File tree

2 files changed

+14
-25
lines changed

2 files changed

+14
-25
lines changed

.github/actions/setup-builder/action.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,17 @@ runs:
4646
# https://github.com/actions/checkout/issues/766
4747
shell: bash
4848
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
49+
- name: Remove unnecessary preinstalled software
50+
shell: bash
51+
run: |
52+
echo "Disk space before cleanup:"
53+
df -h
54+
apt-get clean
55+
# remove tool cache: about 8.5GB (github has host /opt/hostedtoolcache mounted as /__t)
56+
rm -rf /__t/* || true
57+
# remove Haskell runtime: about 6.3GB (host /usr/local/.ghcup)
58+
rm -rf /host/usr/local/.ghcup || true
59+
# remove Android library: about 7.8GB (host /usr/local/lib/android)
60+
rm -rf /host/usr/local/lib/android || true
61+
echo "Disk space after cleanup:"
62+
df -h

.github/workflows/rust.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -272,18 +272,6 @@ jobs:
272272
volumes:
273273
- /usr/local:/host/usr/local
274274
steps:
275-
- name: Remove unnecessary preinstalled software
276-
run: |
277-
echo "Disk space before cleanup:"
278-
df -h
279-
# remove tool cache: about 8.5GB (github has host /opt/hostedtoolcache mounted as /__t)
280-
rm -rf /__t/* || true
281-
# remove Haskell runtime: about 6.3GB (host /usr/local/.ghcup)
282-
rm -rf /host/usr/local/.ghcup || true
283-
# remove Android library: about 7.8GB (host /usr/local/lib/android)
284-
rm -rf /host/usr/local/lib/android || true
285-
echo "Disk space after cleanup:"
286-
df -h
287275
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
288276
with:
289277
submodules: true
@@ -374,19 +362,6 @@ jobs:
374362
with:
375363
save-if: ${{ github.ref_name == 'main' }}
376364
shared-key: "amd-ci-linux-test-example"
377-
- name: Remove unnecessary preinstalled software
378-
run: |
379-
echo "Disk space before cleanup:"
380-
df -h
381-
apt-get clean
382-
rm -rf /__t/CodeQL
383-
rm -rf /__t/PyPy
384-
rm -rf /__t/Java_Temurin-Hotspot_jdk
385-
rm -rf /__t/Python
386-
rm -rf /__t/go
387-
rm -rf /__t/Ruby
388-
echo "Disk space after cleanup:"
389-
df -h
390365
- name: Run examples
391366
run: |
392367
# test datafusion-sql examples

0 commit comments

Comments
 (0)