Skip to content

Conversation

@the8472
Copy link
Member

@the8472 the8472 commented Oct 26, 2025

cleaning up disk space takes a lot of time, sometimes 30 minutes

@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Oct 26, 2025
@the8472 the8472 force-pushed the ci-use-extra-disk branch 2 times, most recently from b040885 to 4848df3 Compare October 26, 2025 17:02
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@the8472 the8472 marked this pull request as ready for review October 26, 2025 19:04
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 26, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 26, 2025

r? @marcoieni

rustbot has assigned @marcoieni.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@the8472
Copy link
Member Author

the8472 commented Oct 26, 2025

# The availability of the disks we're probing isn't guaranteed,
# so this is opportunistic.
checkAlternative() {
local mountpoint="/mnt"
Copy link
Member

Choose a reason for hiding this comment

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

I find confusing naming the variable as the mountpoint command

local mntopts="defaults,discard,journal_async_commit,barrier=0,noauto_da_alloc,lazytime,data=writeback"

# GHA has a 2nd disk mounted at /mnt that is almost empty
if mountpoint /mnt && [ "$available_space_kb" -ge "$space_target_kb" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

should we reuse the variable instead of hardcoding /mnt?

Comment on lines 265 to 272
local blkdev=$(df -k "$mountpoint" --output=source | tail -n 1)
echo "Sufficient space available on $blkdev mounted at $mountpoint"
sudo swapoff -a || true
mkdir ./obj
# remount with O_EATMYDATA while we're at it
sudo umount /mnt
sudo mount $blkdev ./obj -o $mntopts || sudo dmesg | tail -n 20
sudo chown -R "$USER":"$USER" ./obj
Copy link
Member

Choose a reason for hiding this comment

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

can you add more comments explaining what you are doing here? 🙏

@marcoieni
Copy link
Member

I have no objections if this works as it seems faster than freeing up disk space 🙌
Let's make sure to try this on many jobs to prevent the auto build to fail.
I would definitely mark this as rollup never.

the8472 and others added 2 commits October 27, 2025 23:58
cleaning up disk space takes a lot of time
Co-authored-by: Marco Ieni <11428655+marcoieni@users.noreply.github.com>
# remount under the obj dir which is used by docker scripts to write most
# of our build output. And apply optimized mount options while we're at it.
mkdir ./obj
sudo mount $blkdev ./obj -o $mntopts || (sudo dmesg | tail -n 20 ; exit 1)
Copy link
Member Author

Choose a reason for hiding this comment

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

added an exit 1 here

printDF "BEFORE CLEAN-UP:"
echo ""

checkAlternative
Copy link
Member Author

Choose a reason for hiding this comment

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

and moved this down a bit so we always print the disk space before, useful for later reference in case it was not sufficient.

@the8472 the8472 requested a review from marcoieni October 27, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants