Skip to content

Conversation

@timflannagan
Copy link
Member

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

NONE

Additional Notes

Copilot AI review requested due to automatic review settings December 16, 2025 02:04
@gateway-bot gateway-bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none labels Dec 16, 2025
Copy link
Contributor

Copilot AI left a 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]>
@timflannagan timflannagan added this pull request to the merge queue Dec 19, 2025
@howardjohn
Copy link
Contributor

This is much slower than the current cleanup, are we trying to be faster or delete more?

@timflannagan timflannagan removed this pull request from the merge queue due to a manual request Dec 19, 2025
@timflannagan
Copy link
Member Author

@howardjohn Where do you see that? Seeing <120s for this job

@chandler-solo
Copy link
Contributor

95s of the runtime is 'remove_packages'. We could land with it disabled and enable that later if we start running out of disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants