Skip to content

Commit d422dc6

Browse files
dustymabejbtrystram
authored andcommitted
runvm-osbuild: log disk usage during run
At least temporarily let's output some logging about how much of the filesystem under cache/ we are using so we can see if we're getting close to limits and also maybe see which stages are taking up the most space.
1 parent 0e589f1 commit d422dc6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/runvm-osbuild

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ getconfig_def() {
3232
jq -re .\""$k"\"//\""${default}"\" < "${config}"
3333
}
3434

35+
log_disk_usage(){
36+
# spawn off a subshell in the background to log disk usage every
37+
# 10 seconds.
38+
yellow="\033[33m"; default="\033[39m"
39+
(while true; do
40+
echo -e "$yellow"; df -kh ./cache; echo -e "$default";
41+
sleep 10;
42+
pgrep --exact osbuild >/dev/null || break;
43+
done) &
44+
}
45+
3546
while [ $# -gt 0 ];
3647
do
3748
flag="${1}"; shift;
@@ -112,6 +123,8 @@ set -x; osbuild-mpp \
112123
"${mppyaml}" "${processed_json}"
113124
set +x
114125

126+
log_disk_usage
127+
115128
# Build the image
116129
set -x
117130
# shellcheck disable=SC2068

0 commit comments

Comments
 (0)