mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add disk usage monitoring to BuildKite script.
If disk usage of any filesystem approaches or reaches 100%, the agent will log its disk usage to the console, and then reboot. PiperOrigin-RevId: 555334222
This commit is contained in:
committed by
gVisor bot
parent
821459c942
commit
582bf0d72d
@@ -1,5 +1,13 @@
|
||||
set -euo pipefail
|
||||
|
||||
if POSIXLY_CORRECT=true df --local --output=pcent,ipcent,target | grep -vE '/snap/' | grep -qE '9[4-9]%|100%'; then
|
||||
echo "Disk usage has reached critical level, node is bad." >&2
|
||||
sudo df -h --local | sed -r 's/^/[df] /' >&2
|
||||
sleep 3
|
||||
sudo poweroff
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${BUILDKITE_PIPELINE_NAME:-}" == "Pipeline" ]]; then
|
||||
# Check that the target branch exists.
|
||||
git fetch origin "${BUILDKITE_BRANCH}" || {
|
||||
|
||||
Reference in New Issue
Block a user