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

OLD https://github.com/rust-lang/rust/actions/runs/18821126435
NEW https://github.com/rust-lang/rust/actions/runs/18821542169

image

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.

# 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

Copy link
Member

Choose a reason for hiding this comment

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

sorry if I took so long reviewing this.

So if the mount fails, CI fails? Shouldn't we fallback to disk space cleanup?

Copy link
Member Author

Choose a reason for hiding this comment

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

hrrm maybe. Something going wrong here is kind of unexpected. It means the mountpoint does exist but the mount options are wrong, e.g. because it's not ext4.
I suppose microsoft could change their default filesystem choice for some reason...

I guess I'll just print a warning and then fallback.

Copy link
Member Author

Choose a reason for hiding this comment

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

changed it to warning + fallback

@the8472 the8472 requested a review from marcoieni October 27, 2025 23:00
@the8472
Copy link
Member Author

the8472 commented Nov 7, 2025

I was also thinking: it's possible to run this github action step in the background, right?
We would wait for it before the docker build start.

Kinda, but deleting currently takes many more minutes than it takes us to reach the docker step, so it doesn't save that much.
I tried running both directory enumeration and deleting in parallel fashion and it looked like it maybe it cut down times, but the variance from run to run is so high that I'm not sure.

We could even run it in parallel with the docker step too since docker doesn't need the space immediately, but that would risk failures when deleting is really slow, like the 30 minutes I linked at the top.

So switching to a different drive is much faster, as long as it is available.

@rustbot

This comment has been minimized.

@marcoieni
Copy link
Member

@bors try jobs=dist-x86_64-linux,x86_64-gnu-aux,dist-aarch64-linux,aarch64-gnu-llvm-20-1

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 1, 2025
CI: use alternative disks if available

try-job: dist-x86_64-linux
try-job: x86_64-gnu-aux
try-job: dist-aarch64-linux
try-job: aarch64-gnu-llvm-20-1
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Dec 1, 2025

💔 Test for 5c6810b failed: CI. Failed jobs:

@marcoieni
Copy link
Member

sorry if it took me a lot of time to get back on this. Apparently there are some issues.

the8472 and others added 3 commits December 1, 2025 22:27
cleaning up disk space takes a lot of time
we assume the disks are ext4, but GH doesn't guarantee that.
@rustbot
Copy link
Collaborator

rustbot commented Dec 1, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@the8472
Copy link
Member Author

the8472 commented Dec 1, 2025

@bors try jobs=dist-x86_64-linux

rust-bors bot added a commit that referenced this pull request Dec 1, 2025
CI: use alternative disks if available

try-job: dist-x86_64-linux
@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Dec 1, 2025

💔 Test for a9b4cb9 failed: CI. Failed jobs:

@the8472
Copy link
Member Author

the8472 commented Dec 1, 2025

Ah the codebuild runners are running inside a container, I assumed it would be the host. Doing filesystem shenanigans inside a container isn't a good idea.
Then I'll remove that section. Those boxes have enough disk space anyway, we can just skip cleanup.

@the8472 the8472 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 1, 2025
@the8472
Copy link
Member Author

the8472 commented Dec 1, 2025

Then I'll remove that section.

... but it did work on the aarch64 runners, so we need it after all.

@marcoieni
Copy link
Member

@bors try jobs=dist-x86_64-linux,x86_64-gnu-aux,dist-aarch64-linux,aarch64-gnu-llvm-20-1

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 6, 2025
CI: use alternative disks if available

try-job: dist-x86_64-linux
try-job: x86_64-gnu-aux
try-job: dist-aarch64-linux
try-job: aarch64-gnu-llvm-20-1
@rust-bors
Copy link

rust-bors bot commented Dec 6, 2025

💔 Test for bf5291a failed: CI. Failed jobs:

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-aux failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
/dev/sda1        74G  4.1G   66G   6% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001
================================================================================

/mnt is a mountpoint
Sufficient space available on /dev/sda1 mounted at /mnt
##[group]Run src/ci/scripts/setup-environment.sh
src/ci/scripts/setup-environment.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}

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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants