Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(ci): Free disk space action #26318

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

Merged
nishithakbhaskaran merged 1 commit into prestodb:master from czentgr:cz_free_more_disk_space
Oct 16, 2025

Conversation

Copy link
Contributor

@czentgr czentgr commented Oct 15, 2025
edited
Loading

The previous github action used did not work.
The reason is that it was run inside the
(dependency) container where the commands
did not run (sudo not found) as well as the
files to be deleted were not present.

This fix mounts the host path that contains the
files to be deleted into the container and
we can run custom commands to clean up disk
space.

Description

Motivation and Context

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Oct 15, 2025
Copy link
Contributor

sourcery-ai bot commented Oct 15, 2025
edited
Loading

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Update the Linux build workflow to mount host directories into the CI container and replace the external disk-cleanup action with a custom inline script that calculates available space and removes specific host paths.

Flow diagram for custom disk cleanup script in CI

flowchart TD
 Start["Start CI job in container"] --> Mount["Mount /usr as /host_usr and /opt as /host_opt"]
 Mount --> Script["Run custom disk cleanup script"]
 Script --> CheckSpaceBefore["Check available disk space (before)"]
 CheckSpaceBefore --> RemoveDotNet["Remove /host_usr/share/dotnet"]
 RemoveDotNet --> RemoveAndroid["Remove /host_usr/local/lib/android"]
 RemoveAndroid --> RemoveCodeQL["Remove /host_opt/hostedtoolcache/CodeQL"]
 RemoveCodeQL --> CheckSpaceAfter["Check available disk space (after)"]
 CheckSpaceAfter --> End["Continue build steps"]
Loading

File-Level Changes

Change Details Files
Mount host directories into the CI container for cleanup access
  • Added volume mounts for /usr to /host_usr
  • Added volume mounts for /opt to /host_opt
.github/workflows/prestocpp-linux-build.yml
Replace external free-disk-space action with inline cleanup script
  • Removed uses of jlumbroso/free-disk-space action and its inputs
  • Introduced getAvailableSpace function to compute free space
  • Added echo statements to display disk space before and after cleanup
  • Added rm -rf commands to remove DotNet, Android, and CodeQL directories on host mounts
.github/workflows/prestocpp-linux-build.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@czentgr czentgr force-pushed the cz_free_more_disk_space branch 9 times, most recently from 76a0513 to 1d97474 Compare October 15, 2025 22:35
@czentgr czentgr changed the title (削除) fix(ci): Disk space not freed due to missing sudo (削除ここまで) (追記) fix(ci): Free disk space action (追記ここまで) Oct 15, 2025
The previous github action used did not work.
The reason is that it was run inside the
(dependency) container where the commands
did not run (sudo not found) as well as the
files to be deleted were not present.
This fix mounts the host path that contains the
files to be deleted into the container and
we can run custom commands to clean up disk
space.
The free-disk-space action uses sudo to remove packages
that are not needed. However, sudo is not found and as a result
does not clean up any disk space
@czentgr czentgr marked this pull request as ready for review October 15, 2025 22:56
@czentgr czentgr requested review from a team and unidevel as code owners October 15, 2025 22:56
@prestodb-ci prestodb-ci requested review from a team, ShahimSharafudeen and wanglinsong and removed request for a team October 15, 2025 22:56
Copy link
Contributor Author

czentgr commented Oct 15, 2025

@tdcmeehan FYI. This is fixing the disk space issues for this job.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.github/workflows/prestocpp-linux-build.yml:69-71` </location>
<code_context>
-  swap-storage: false
+  run: |
+  # Re-used from free-disk-space github action.
+  getAvailableSpace() { echo $(df -a 1ドル | awk 'NR > 1 {avail+=4ドル} END {print avail}'); }
+  # Show before
+  echo "Original available disk space: " $(getAvailableSpace)
+  # Remove DotNet.
+  rm -rf /host_usr/share/dotnet || true
</code_context>
<issue_to_address>
**suggestion (bug_risk):** The getAvailableSpace function does not specify a path argument, which may lead to ambiguous disk space reporting.
Calling getAvailableSpace without a path may report disk space for the root filesystem, which could be inaccurate if other mount points are affected. Specify the intended path when invoking the function.
Suggested implementation:
```
 # Show before
 echo "Original available disk space: " $(getAvailableSpace /host_usr)

```
```
 # Show after
 echo "New available disk space: " $(getAvailableSpace /host_usr)

```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

sourcery-ai[bot] reacted with thumbs up emoji sourcery-ai[bot] reacted with thumbs down emoji
Comment on lines +69 to +71
getAvailableSpace() { echo $(df -a 1ドル | awk 'NR > 1 {avail+=4ドル} END {print avail}'); }
# Show before
echo "Original available disk space: " $(getAvailableSpace)
Copy link
Contributor

@sourcery-ai sourcery-ai bot Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): The getAvailableSpace function does not specify a path argument, which may lead to ambiguous disk space reporting.

Calling getAvailableSpace without a path may report disk space for the root filesystem, which could be inaccurate if other mount points are affected. Specify the intended path when invoking the function.

Suggested implementation:

 # Show before
 echo "Original available disk space: " $(getAvailableSpace /host_usr)
 # Show after
 echo "New available disk space: " $(getAvailableSpace /host_usr)

sourcery-ai[bot] reacted with thumbs up emoji sourcery-ai[bot] reacted with thumbs down emoji
@czentgr czentgr force-pushed the cz_free_more_disk_space branch from 1d97474 to b061ce1 Compare October 15, 2025 22:57
Copy link
Contributor

@tdcmeehan tdcmeehan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @czentgr

Copy link
Contributor

Thanks for the fix @czentgr .

@nishithakbhaskaran nishithakbhaskaran merged commit 9108a9a into prestodb:master Oct 16, 2025
79 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sourcery-ai sourcery-ai[bot] sourcery-ai[bot] left review comments

@tdcmeehan tdcmeehan tdcmeehan approved these changes

@unidevel unidevel Awaiting requested review from unidevel unidevel is a code owner

@wanglinsong wanglinsong Awaiting requested review from wanglinsong wanglinsong was automatically assigned from prestodb/ibm-reviewers

@ShahimSharafudeen ShahimSharafudeen Awaiting requested review from ShahimSharafudeen ShahimSharafudeen was automatically assigned from prestodb/ibm-reviewers

Assignees

No one assigned

Labels

from:IBM PR from IBM

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /