ci: Import bootc setup action, use in a few jobs#5504
Conversation
This cleans up disk space, which we're now hitting. However to really be consistent we need to stop using `container:` in all jobs and switch to having this action run first step, and then spawn podman (or docker) inside jobs.
There was a problem hiding this comment.
Code Review
This pull request introduces a new composite GitHub Action, bootc-ubuntu-setup, designed to prepare an Ubuntu runner for bootc-related tasks. The action updates podman, frees up disk space by removing unneeded packages and data, configures KVM access, and sets an architecture environment variable. My review focuses on improving the efficiency and debuggability of the disk space cleanup script. I've suggested combining multiple apt-get calls into one for better performance and removing output redirection to /dev/null to aid in debugging potential failures.
| for x in ${unwanted[@]}; do | ||
| sudo apt-get remove -y $x > /dev/null | ||
| done |
There was a problem hiding this comment.
This loop can be replaced by a single, more efficient apt-get remove command that processes all packages at once. This avoids invoking apt-get multiple times.
Additionally, I've removed the redirection to /dev/null in the suggestion. While it keeps the logs clean on success, it hides valuable error messages if a command fails, making debugging more difficult. GitHub Actions UI collapses logs for successful steps by default, so the extra output won't create much noise but will be invaluable in case of failure.
sudo apt-get remove -y "${unwanted[@]}"| sudo apt-get remove -y $x > /dev/null | ||
| done | ||
| # Start other removal operations in parallel | ||
| sudo docker image prune --all --force > /dev/null & |
There was a problem hiding this comment.
Consider removing the redirection to /dev/null. While it keeps the logs clean on success, it hides valuable error messages if the command fails, making debugging more difficult. Since this command runs in the background, its output will be critical for diagnostics if it fails and causes the wait command to exit with an error.
sudo docker image prune --all --force &
This cleans up disk space, which we're now hitting.
However to really be consistent we need to stop using
container:in all jobs and switch to having this action run first step, and then spawn podman (or docker) inside jobs.