ci(free-disk-space): remove more tools and fix warnings#155958
ci(free-disk-space): remove more tools and fix warnings#155958marcoieni wants to merge 1 commit intorust-lang:mainfrom
Conversation
| # Remove Docker images. | ||
| # Ubuntu 22 runners have docker images already installed. | ||
| # They aren't present in ubuntu 24 runners. | ||
| # Remove preinstalled Docker images. |
There was a problem hiding this comment.
Removed this comment because there are some docker images in ubuntu 24 as well.
5a7dd95 to
e5493ea
Compare
| ) | ||
|
|
||
| # Paths only present in x86 runners | ||
| local github_runner_x86_paths=( |
There was a problem hiding this comment.
I extracted these paths from the array above because they are not present in arm. Trying to remove them was emitting a warning.
| ) | ||
| local x86_only_packages=( | ||
| 'google-chrome-stable' | ||
| 'microsoft-edge-stable' |
There was a problem hiding this comment.
edge and the new packages from temurin to skopeo are new (they weren't removed before)
| # Microsoft Edge and powershell | ||
| "/opt/microsoft" | ||
|
|
||
| "/opt/pipx" | ||
| "/opt/pipx_bin" |
There was a problem hiding this comment.
These paths are new
| if [ -z "$images" ]; then | ||
| echo "=> No docker images to remove." | ||
| return | ||
| fi |
There was a problem hiding this comment.
Attempting to remove all docker images when there were none, produced a warning (because the measured saved space was less than zero)
| sufficientSpaceEarlyExit() { | ||
| local available_space_kb=$(df -k . --output=avail | tail -n 1) | ||
| local available_space_kb | ||
| available_space_kb=$(df -k . --output=avail | tail -n 1) |
There was a problem hiding this comment.
here and below I fixed a shellcheck lint that suggested to declare the variable before assigning it
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
The CI was successful, I'm reverting the commit 86529fb
|
86529fb to
e5493ea
Compare

With this PR I remove more space and improve the free-disk-space-linux script.
If you prefer me to split this PR into multiple ones, let me know.
Discussed in #t-infra > some jobs running out of disk space
Test
I tested this change in marcoieni/actions-test@196ce70. As you can see the workflows run without warnings, which ensures that we can remove all the space possible from the arm runners.
I also tested this change in this repository, by commenting out the mechanism to skip disk cleanup in case there is sufficient available disk space. ( see 86529fb )
If I don't comment out the code, it can happen that the CI skips the code I edited because there's enough disk space in the runners that this CI is running.
Here's the change of that commit:
Storage saved
In that temporary commit, I measured how much we are saving. It looks like this PR saves ~2GB:
Total saved: Saved 35GiBTotal saved: Saved 37GiB