-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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: master
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 |
| # The availability of the disks we're probing isn't guaranteed, | ||
| # so this is opportunistic. | ||
| checkAlternative() { | ||
| local mountpoint="/mnt" |
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.
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 |
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.
should we reuse the variable instead of hardcoding /mnt?
| 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 🙌 |
cleaning up disk space takes a lot of time
Co-authored-by: Marco Ieni <11428655+marcoieni@users.noreply.github.com>
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
| printDF "BEFORE CLEAN-UP:" | ||
| echo "" | ||
|
|
||
| checkAlternative |
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.
and moved this down a bit so we always print the disk space before, useful for later reference in case it was not sufficient.

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