-
Notifications
You must be signed in to change notification settings - Fork 635
.github/actions: Optimize job for freeing disk space #13144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR optimizes the disk space cleanup process in GitHub Actions by replacing a lengthy inline bash script (42 lines) with a new composite action that uses a Rust-based disk space freeing tool. The change introduces intelligent conditional execution that skips the cleanup on larger runners (4+ CPUs) to save time, while using the faster rmz tool on smaller runners where disk space is more constrained.
Key Changes
- Replaced inline bash script with modular composite action reference
- Added CPU detection to conditionally skip disk cleanup on larger runners
- Integrated external Rust-based action (
endersonmenezes/free-disk-space) for faster file deletion
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/actions/prep-go-runner/action.yaml |
Replaced 42-line inline bash script with a single line calling the new free-disk-space action |
.github/actions/free-disk-space/action.yaml |
New composite action that detects CPU count and conditionally executes disk cleanup using a Rust-based tool with customized settings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Optimize the current GHA job that's responsible for freeing up disk space for several runners. Use a custom, rust-based GHA action that does this work instead of an inline bash script. This effectively ports over a commit that Chandler made to a repository outside of this org, but has significant performance improvements. Signed-off-by: timflannagan <[email protected]> Co-authored-by: David L. Chandler <[email protected]> Signed-off-by: timflannagan <[email protected]>
d0aba4d to
a5a9bc4
Compare
|
This is much slower than the current cleanup, are we trying to be faster or delete more? |
|
@howardjohn Where do you see that? Seeing <120s for this job |
|
95s of the runtime is 'remove_packages'. We could land with it disabled and enable that later if we start running out of disk. |
Description
Optimize the current GHA job that's responsible for freeing up disk space for several runners. Use a custom, rust-based GHA action that does this work instead of an inline bash script. This effectively ports over a commit that Chandler made to a repository outside of this org, but has significant performance improvements.
Change Type
/kind cleanup
Changelog
Additional Notes