deploy-remote: stat the frank-primary payload, do not wc it

wc -c falls back to reading the whole stream when its fstat shortcut does
not apply, and this gate runs over a 377 GiB GGUF: the 2026-09-26 cutover
deploy sat in wc for minutes (30 s of CPU, NVMe-bound) before it could
reach the cutover at all. stat -c %s is metadata-only and equally exact.
This commit is contained in:
Frank
2026-09-26 17:08:13 -07:00
parent 124175218f
commit de513ab080
+5 -2
View File
@@ -1345,8 +1345,11 @@ deploy_llm_primary() {
echo "frank-primary: podman build --build-arg LUCE_HIP_ARCHES=gfx1201 --build-arg ROCM_VERSION=7.14.1-full -t localhost/lucebox-rocm:gfx1201 -f Dockerfile.rocm . (see runbook)" >&2
missing=1
fi
local got_size
got_size="$(wc -c < "$model" 2>/dev/null || echo 0)"
# stat -c %s, never `wc -c < FILE`. wc falls back to reading the whole
# stream whenever its fstat shortcut does not apply, and this payload is
# 377 GiB: on 2026-09-26 a deploy sat in wc for minutes (30 s of CPU,
# NVMe-bound) before it could even reach the cutover.
got_size="$(stat -c %s "$model" 2>/dev/null || echo 0)"
if [[ "$got_size" != "$want_size" ]]; then
echo "ERROR: model absent or incomplete at $model (have $got_size, want $want_size)" >&2
missing=1