-
Notifications
You must be signed in to change notification settings - Fork 14k
CI: use alternative disks if available #148146
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
b040885 to
4848df3
Compare
This comment has been minimized.
This comment has been minimized.
4848df3 to
357f10f
Compare
This comment has been minimized.
This comment has been minimized.
357f10f to
d288956
Compare
This comment has been minimized.
This comment has been minimized.
d288956 to
014c722
Compare
This comment has been minimized.
This comment has been minimized.
014c722 to
53b6d43
Compare
|
r? @marcoieni rustbot has assigned @marcoieni. Use |
| 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 |
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.
can you add more comments explaining what you are doing here? 🙏
|
I have no objections if this works as it seems faster than freeing up disk space 🙌 |
4457feb to
1d7b3f2
Compare
| # 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) |
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.
added an exit 1 here
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.
sorry if I took so long reviewing this.
So if the mount fails, CI fails? Shouldn't we fallback to disk space cleanup?
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.
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.
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.
changed it to warning + fallback
|
I was also thinking: it's possible to run this github action step in the background, right? Just in case in the future we want to cleanup the disk space in the background 👍 |
Kinda, but deleting currently takes many more minutes than it takes us to reach the docker step, so it doesn't save that much. 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. |
cleaning up disk space takes a lot of time
Co-authored-by: Marco Ieni <11428655+marcoieni@users.noreply.github.com>
we assume the disks are ext4, but GH doesn't guarantee that.
1d7b3f2 to
32902a9
Compare
|
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. |

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