Skip to content
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

osbuild: use sparse for GCP tarball; log disk usage #3986

Merged
merged 4 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/osbuild-manifests/platform.gcp.ipp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pipelines:
filename: disk.tar
format: oldgnu
root-node: omit
sparse: true
# Set these to false so GCP image upload/create will succeed
acls: false
selinux: false
Expand Down
22 changes: 18 additions & 4 deletions src/runvm-osbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -eux -o pipefail
set -euo pipefail

usage() {
cat <<EOC
Expand Down Expand Up @@ -32,6 +32,17 @@ getconfig_def() {
jq -re .\""$k"\"//\""${default}"\" < "${config}"
}

log_disk_usage(){
# spawn off a subshell in the background to log disk usage every
# 10 seconds.
yellow="\033[33m"; default="\033[39m"
(while true; do
echo -e "$yellow"; df -kh ./cache; echo -e "$default";
sleep 10;
pgrep --exact osbuild >/dev/null || break;
done) &
}

while [ $# -gt 0 ];
do
flag="${1}"; shift;
Expand Down Expand Up @@ -95,7 +106,7 @@ podman images > /dev/null

# Run through the preprocessor
# Note: don't quote the size arguements since they are numbers, not strings
osbuild-mpp \
set -x; osbuild-mpp \
-D arch=\""$(arch)"\" \
-D artifact_name_prefix=\""${artifact_name_prefix}"\" \
-D ostree_ref=\""${ostree_ref}"\" \
Expand All @@ -110,8 +121,12 @@ osbuild-mpp \
-D cloud_image_size_mb="${cloud_image_size_mb}" \
-D rootfs_size_mb="${rootfs_size_mb}" \
"${mppyaml}" "${processed_json}"
set +x

log_disk_usage

# Build the image
set -x
# shellcheck disable=SC2068
osbuild \
--out "$outdir" \
Expand All @@ -124,8 +139,7 @@ osbuild \
--checkpoint metal4k \
${platforms[@]/#/--export=} \
"${processed_json}"

# --break org.osbuild.coreos.live-artifacts.mono \
set +x

mv "${outdir}"/* "${orig_outdir}/"
rm -f "${processed_json}"
Loading