-
Notifications
You must be signed in to change notification settings - Fork 762
[ci] Upload disk and snapcraft diagnostics #4520
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
Co-authored-by: ricab <6698114+ricab@users.noreply.github.com>
.github/workflows/linux.yml
Outdated
| echo "==== df -i ====" >> "$OUT" | ||
| df -i >> "$OUT" || true | ||
| echo "" >> "$OUT" |
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.
Please remove these lines.
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.
Done in 1fc922a - removed empty echo lines.
.github/workflows/linux.yml
Outdated
| du -ahx / 2>/dev/null | sort -rh | head -n 50 >> "$OUT" || true | ||
| echo "" >> "$OUT" | ||
| echo "==== find files >50M ====" >> "$OUT" | ||
| find / -xdev -type f -size +50M -exec ls -lh {} \; 2>/dev/null | sort -k5 -h | tail -n 50 >> "$OUT" || true |
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.
Would sort know to sort sizes with M/G suffixes? Probably not, so remove h from ls -lh please.
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.
Fixed in 1fc922a - changed to ls -l and sort -k5 -n for proper numerical sorting.
.github/workflows/linux.yml
Outdated
| # capture snapcraft log if present (log path seen in failing job) | ||
| if ls /home/runner/.local/state/snapcraft/log/snapcraft-*.log 1> /dev/null 2>&1; then | ||
| echo "" >> "$OUT" | ||
| echo "==== snapcraft log tail ====" >> "$OUT" | ||
| tail -n 400 /home/runner/.local/state/snapcraft/log/snapcraft-*.log >> "$OUT" || true | ||
| fi |
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.
This wouldn't exist at this point, so remove these lines please.
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.
Removed in 1fc922a - snapcraft log capture removed from the "before build" step.
.github/workflows/linux.yml
Outdated
| - name: Upload runner disk diagnostics (before build) | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: runner-disk-diagnostics-before-build-${{ matrix.build-type }} | ||
| path: runner-disk-diagnostics-before-build.txt |
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.
Better do this only once at the end (together with the diagnostics from after the build).
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.
Consolidated in 1fc922a - single upload step at the end now captures all diagnostic files using wildcard pattern.
.github/workflows/linux.yml
Outdated
| - name: Dump runner disk diagnostics (before build) | ||
| if: always() | ||
| run: | | ||
| set -euxo pipefail |
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.
Please remove -x, we shouldn't need all the noise. We can always add it back.
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.
Removed in 1fc922a - changed from set -euxo pipefail to set -euo pipefail.
.github/workflows/linux.yml
Outdated
| - name: Dump runner disk diagnostics (before snap build) | ||
| if: always() | ||
| run: | | ||
| set -euxo pipefail |
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.
Please remove -x, we shouldn't need all the noise. We can always add it back.
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.
Removed in 1fc922a - changed from set -euxo pipefail to set -euo pipefail.
.github/workflows/linux.yml
Outdated
| echo "==== df -i ====" >> "$OUT" | ||
| df -i >> "$OUT" || true | ||
| echo "" >> "$OUT" |
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.
Remove please
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.
Done in 1fc922a - removed empty echo lines.
.github/workflows/linux.yml
Outdated
| du -ahx / 2>/dev/null | sort -rh | head -n 50 >> "$OUT" || true | ||
| echo "" >> "$OUT" | ||
| echo "==== find files >50M ====" >> "$OUT" | ||
| find / -xdev -type f -size +50M -exec ls -lh {} \; 2>/dev/null | sort -k5 -h | tail -n 50 >> "$OUT" || true |
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.
Remove -h, same as above.
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.
Fixed in 1fc922a - changed to ls -l and sort -k5 -n for proper numerical sorting.
.github/workflows/linux.yml
Outdated
| FREE_KB=$(df --output=avail -k / | tail -n1 | tr -d ' ') | ||
| if [ -n "$FREE_KB" ] && [ "$FREE_KB" -lt $((2*1024*1024)) ]; then | ||
| echo "##[warning] Less than 2GB available on / ($(($FREE_KB/1024)) MB)" >> "$OUT" | ||
| fi |
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.
Please remove these lines. No point after the build.
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.
Removed in 1fc922a - disk space warning removed from the "before snap build" step.
| if ls /home/runner/.local/state/snapcraft/log/snapcraft-*.log 1> /dev/null 2>&1; then | ||
| echo "" >> "$OUT" | ||
| echo "==== snapcraft log tail ====" >> "$OUT" | ||
| tail -n 400 /home/runner/.local/state/snapcraft/log/snapcraft-*.log >> "$OUT" || true | ||
| fi |
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.
Please update the full snapcraft log file instead, together with the other files, in the next step.
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.
Updated in 1fc922a - changed to capture full snapcraft log with cat instead of tail, and consolidated upload at the end.
|
@copilot please address the review above. |
Co-authored-by: ricab <6698114+ricab@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4520 +/- ##
=======================================
Coverage 89.47% 89.47%
=======================================
Files 243 243
Lines 13877 13877
=======================================
Hits 12416 12416
Misses 1461 1461 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
We don't seem to be nearing space limits today. Keeping this around for later. |
Add disk usage diagnostics to capture disk space information before heavy build steps:
Summary
Added comprehensive disk usage diagnostics to
.github/workflows/linux.ymlto help diagnose the failing job https://github.com/canonical/multipass/actions/runs/19534052585/job/55935120817 which may be caused by disk space exhaustion.Changes Made
Two diagnostic checkpoints added:
Each checkpoint captures:
df -h- disk usage in human-readable formatdf -i- inode usageduon top directories (/root, /home, /tmp, /var, /usr, runner temp/workspace)Implementation details:
if: always()to ensure diagnostics run even on job failurecontinue-on-error: trueto prevent diagnostic failures from failing the jobrunner-disk-diagnostics-${{ matrix.build-type }}actions/upload-artifact@v4with wildcard pattern-xflag fromset -euo pipefailto reduce noisels -lhtols -land sort by size numerically for proper sortingSecurity
|| trueto prevent failuresOriginal prompt
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.