Repository navigation
ci: log the build's disk use in the ubuntu-latest job - #486
Conversation
The ubuntu-latest job ran out of disk during cargo test --workspace on PR 484. There are about 170 test binaries, each linking all of terrio. Tests themselves use little disk. Keep file and line in backtraces, and log the build's disk use so the margin can be seen.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Check job disk reporting .github/workflows/ci.yml |
The check job adds an always-run step to report filesystem usage and the size of target. If du fails, the step prints no target directory. |
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Other
Suggested reviewers: rvalavi
Merge Risk: 
Low · up to 6ed2c
-
The logging-only change is mergeable with a small diagnostic caveat: a disk-usage measurement error can incorrectly report that target is missing.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title "ci: log the build's disk use in the ubuntu-latest job" matches the changeset. The raw summary says the check job adds an always() step that prints filesystem usage and reports the size of target. The PR objectives describe the same end-of-job logging of df -h . and the size of target, including when an earlier step fails. The title is specific and uses a conventional commit prefix. It names the main change and the job it affects. The summary also mentions a fallback message when target is absent, which the title does not need to cover.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the disk by moon,
And sees the target’s measured room.
If du cannot report the way,
“no target directory” it will say.
Then hops along beneath the stars.
Code reviewBugs
Security
Performance
Quality
CLAUDE.md
Checked: Change sizeCompared with the base branch (
|
- Drop CARGO_PROFILE_DEV_DEBUG: the dev profile already sets debug = 0, so line tables added to the build instead of saving disk. - Do not report a second error when target does not exist.
| if: always() | ||
| run: | | ||
| df -h . | ||
| du -sh target 2>/dev/null || echo "no target directory" |
There was a problem hiding this comment.
Confidence: medium. 2>/dev/null || echo "no target directory" treats every du failure as a missing directory. A permission error or a tree that disappears mid-walk would print the wrong message with no hint. Testing for the directory first keeps the two cases apart:
| du -sh target 2>/dev/null || echo "no target directory" | |
| if [ -d target ]; then du -sh target; else echo "no target directory"; fi |
There was a problem hiding this comment.
Leaving as is: this is a best-effort log line, and a permission error on the runner's own checkout is not a realistic case. Not worth another CI cycle; leaving this open for the maintainer.
| - run: cargo clippy -p terrio --features ndarray --lib --test ndarray --test float_reads -- -D warnings | ||
| - run: cargo test -p terrio --features ndarray --test ndarray --test float_reads | ||
| - name: Disk use of the build | ||
| if: always() |
There was a problem hiding this comment.
Confidence: low-medium. always() also runs when the job is cancelled. Pull requests have cancel-in-progress: true (line 10), so every superseded run would first spend time running du over a tree the PR says can reach 46 GB. The step's purpose is to record a failed build, so !cancelled() runs it on failure but not on cancellation:
| if: always() | |
| if: ${{ !cancelled() }} |
There was a problem hiding this comment.
Fair, but the cost is small: du over 22 GB is seconds, on a run being cancelled. Not worth another CI cycle; leaving this open for the maintainer.
Code reviewBugs
Security
Performance
Quality
CLAUDE.md (AGENTS.md)
Verified claims
Change sizeCompared: the whole PR against main (merge base 9f4ab10 to PR head 6ed2c4e).
|
The
ubuntu-latestjob now logsdf -h .and the size oftargetat its end, even when an earlier step fails. On #484 the runner died withNo space left on deviceduringcargo test --workspace, and the job's log was lost, so the cause could not be established. The rerun passed.Correction. This PR first set
CARGO_PROFILE_DEV_DEBUG=line-tables-only, on my mistaken claim that CI builds with full debug info.[profile.dev]already setsdebug = 0, so that setting added disk use, and it has been removed. No debug or build settings change here.Measured on this PR's
ubuntu-latestjob. The current build ends at 22 GB oftarget, with 81 GB used and 64 GB free out of 145 GB. With line tables it was 46 GB oftargetand 40 GB free.Limitations. This does not fix the failure, whose cause is still unknown. With 64 GB free at the end of a normal run, a build filling the disk 1m43s into the step is hard to explain, so it may have been specific to that runner. No test is implicated: a local run's largest temp file seen was 128 MB, sampled once a second. If the failure recurs, this log shows the margin.