Best effort attempt to clean /mnt partition before the builds#98
Best effort attempt to clean /mnt partition before the builds#98ggiguash merged 2 commits intomicroshift-io:mainfrom
Conversation
WalkthroughUpdated the GitHub Actions prebuild workflow to prevent CI disk space failures by cleaning up leftover /mnt content, creating designated mount directories, and redirecting system paths (/var/tmp, /var/lib/containers) to /mnt for better resource isolation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/actions/prebuild/action.yaml (1)
28-28: Unsafemvof /var/lib/containers could break the script on fresh runners.With
set -eenabled, if/var/lib/containersdoesn't exist after podman installation, themvfails and halts the workflow. Fresh runners or clean podman installations may not have this directory.Make the move conditional or create the directory first:
- sudo mv /var/lib/containers /mnt/containers + [[ -d /var/lib/containers ]] && sudo mv /var/lib/containers /mnt/containers || true + sudo mkdir -p /mnt/containers
🧹 Nitpick comments (1)
.github/actions/prebuild/action.yaml (1)
13-16: Cleanup approach is sound, but consider being explicit about excluded paths.The best-effort
rm -rvf /mnt/* || trueworks well for this use case. However, if you later need to preserve certain paths (e.g., persistent build caches), consider explicitly listing targets instead of using a glob.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/actions/prebuild/action.yaml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: quick-start-and-clean
- GitHub Check: isolated-network-kindnet
- GitHub Check: isolated-network-ovnk
- GitHub Check: ubuntu-rpm2deb
- GitHub Check: centos10-bootc
- GitHub Check: centos9-bootc
- GitHub Check: fedora-bootc
🔇 Additional comments (1)
.github/actions/prebuild/action.yaml (1)
27-30: Symlink ordering and targets look correct.The moves happen before symlinks are created, and the symlink targets (
/mnt/tmpand/mnt/containers) are guaranteed to exist by lines 19 and 28. This sequence is sound.
|
@coderabbitai |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 965 🏁 Script executed: Length of output: 51 @ggiguash I've updated the PR description with a comprehensive summary that includes:
The updated description provides better context for reviewers and maintainers while preserving your original example output and the CodeRabbit auto-generated summary. |
Problem
Resolves #93
GitHub Actions runners provisioning the /mnt partition sometimes leave files from previous jobs, causing intermittent "no space left on device" CI failures. Previous runs have shown leftover files like disk0.img (65G), swapfile (4.0G), and other artifacts consuming the available space.
Solution
This PR implements a best-effort cleanup of the /mnt partition before builds by:
Technical Changes
.github/actions/prebuild/action.yamlsudo rm -rvffor known leftover filesExample Cleanup Output
Note: Some files like swapfile may fail to delete due to permissions, but the cleanup proceeds with other files.
Summary by CodeRabbit