Seed v4 staging: no pipes after the build (the v4 igneumd --version exits 1), unpack stamp, resume mode

The first stage run built v4 on igneum-seed-1 in 60 min 49 s and then failed on `igneumd --version | head -1` under
pipefail, because the devnet-v4 igneumd prints its version and exits 1. The post-build steps now write to files and
test them; the tarball is unpacked once per src.stamp so a rerun is incremental; `stage-v4.sh <seed> resume` reruns
the build script on the tree already on the VM and then waits and installs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-04 02:53:50 +00:00
parent 674eb8d262
commit ff9caee488
2 changed files with 29 additions and 8 deletions

View file

@ -22,7 +22,14 @@ fi
. "$HOME/.cargo/env"
[ -f src.tar.gz ] || { log "no /root/v4/src.tar.gz"; exit 1; }
rm -rf src; tar -xzf src.tar.gz 2>/dev/null || tar -xzf src.tar.gz; log "unpacked src.tar.gz into /root/v4/src"
# Unpack once per tarball (src.stamp names what went in): a rerun after a failed post-build step, or stage-v4.sh
# `resume`, keeps the tree and cargo's cache, so the build is incremental. FORCE_UNPACK=1 starts clean.
stamp="$(cat src.stamp 2>/dev/null || echo none)"
if [ "${FORCE_UNPACK:-0}" = 1 ] || [ ! -d src/vendor/igneum-node ] || [ "$(cat src/.unpacked-stamp 2>/dev/null)" != "$stamp" ]; then
rm -rf src; tar -xzf src.tar.gz 2>/dev/null || tar -xzf src.tar.gz; printf '%s' "$stamp" > src/.unpacked-stamp; log "unpacked src.tar.gz into /root/v4/src"
else
log "src.tar.gz already unpacked for this src.stamp; keeping /root/v4/src and its target directory (incremental build)"
fi
[ -d src/vendor/igneum-node ] || { log "no src/vendor/igneum-node in the tarball"; exit 1; }
cd src/vendor/igneum-node
@ -37,10 +44,14 @@ log "build finished in $(( $(date +%s) - start )) s"
mkdir -p /root/v4/out
cp target/release/igneumd target/release/igneum-miner /root/v4/out/
strip /root/v4/out/igneumd /root/v4/out/igneum-miner 2>/dev/null || true
/root/v4/out/igneumd --version | head -1 | tee /root/v4/out/version.txt
[ -f /root/v4/src.stamp ] && cat /root/v4/src.stamp >> /root/v4/out/version.txt
# No pipes here: the devnet-v4 igneumd prints its version and then exits 1 (seen 4 Oct 2026), which pipefail would
# turn into a failed build after the binaries are already in place.
/root/v4/out/igneumd --version > /root/v4/out/version.txt 2>&1 || true
head -1 /root/v4/out/version.txt
if [ -f /root/v4/src.stamp ]; then cat /root/v4/src.stamp >> /root/v4/out/version.txt; fi
# the v4 miner's usage names --evm-address; a v3 miner does not
/root/v4/out/igneum-miner 2>&1 | grep -q -- '--evm-address' || { log "the built igneum-miner has no --evm-address: not the devnet-v4 source?"; exit 1; }
/root/v4/out/igneum-miner > /root/v4/usage.txt 2>&1 || true
grep -q -- '--evm-address' /root/v4/usage.txt || { log "the built igneum-miner has no --evm-address: not the devnet-v4 source?"; exit 1; }
ls -la /root/v4/out
touch /root/v4/DONE
log "DONE"

View file

@ -5,6 +5,8 @@
# for it, then install: /opt/igneum/v4/bin/{igneumd,igneum-miner,run-seed-v4.sh},
# /etc/igneum/seed-v4.env, /var/lib/igneum-v4 (fresh, empty), unit igneumd-v4
# installed and DISABLED (not started). The v3 unit keeps running the v3 chain.
# ./stage-v4.sh [seed-name] resume upload the build script again and rerun it on the tree already on the VM (incremental:
# a finished build is not repeated), then wait and install; for a failed post-build step
# ./stage-v4.sh [seed-name] wait only wait for a build already started and install when it is done
# ./stage-v4.sh [seed-name] status one line: build state, installed version, unit states
# The build runs under `systemd-run` with MemoryHigh 1600M, MemoryMax 2400M, nice 19, idle IO, 1 cargo job (the VM has
@ -14,7 +16,7 @@
# Switch with ./switch-v4.sh (not run by this script).
. "$(dirname "$0")/lib.sh"
name="${1:-$SEED_NAME}"; mode="${2:-start}"
case "$name" in start|wait|status) mode="$name"; name="$SEED_NAME" ;; esac
case "$name" in start|wait|status|resume) mode="$name"; name="$SEED_NAME" ;; esac
ip=$(seed_ip "$name"); [ -n "$ip" ] || die "$name not in seeds.tsv"
mkdir -p "$BUILD_DIR"
CD="$HERE/../cloud-devnet"
@ -27,7 +29,7 @@ remote_status() {
s="not started"; [ -f /root/v4/build.log ] && s="running"; [ -f /root/v4/DONE ] && s="done"; [ -f /root/v4/FAILED ] && s="failed"
systemctl is-active '"$BUILD_UNIT"' >/dev/null 2>&1 && s="running (unit active)"
last=""; [ -f /root/v4/build.log ] && last=$(grep -E "build running|build finished|FAILED|DONE|error\[" /root/v4/build.log | tail -1)
inst="not installed"; [ -x /opt/igneum/v4/bin/igneumd ] && inst="installed $(/opt/igneum/v4/bin/igneumd --version 2>/dev/null | head -1)"
inst="not installed"; [ -x /opt/igneum/v4/bin/igneumd ] && inst="installed $(head -1 /root/v4/out/version.txt 2>/dev/null)"
u4=$(systemctl is-enabled igneumd-v4 2>/dev/null || echo absent); a4=$(systemctl is-active igneumd-v4 2>/dev/null || true)
u3=$(systemctl is-enabled igneumd 2>/dev/null || echo absent); a3=$(systemctl is-active igneumd 2>/dev/null || true)
echo "build=$s | $last | v4: $inst, unit igneumd-v4 $u4/$a4 | v3: unit igneumd $u3/$a3"'
@ -47,7 +49,7 @@ install_v4() {
cp /root/v4/igneumd-v4.service /etc/systemd/system/igneumd-v4.service
systemctl daemon-reload
systemctl disable igneumd-v4 >/dev/null 2>&1 || true
echo "v4 binary: $(/opt/igneum/v4/bin/igneumd --version | head -1) at /opt/igneum/v4/bin (built from: $(sed -n 2p /root/v4/out/version.txt 2>/dev/null))"
echo "v4 binary: $(head -1 /root/v4/out/version.txt) at /opt/igneum/v4/bin (built from: $(sed -n 3p /root/v4/out/version.txt 2>/dev/null))"
echo "v4 data dir: /var/lib/igneum-v4 ($(ls -A /var/lib/igneum-v4 | wc -l) entries, fresh)"
echo "env: /etc/igneum/seed-v4.env"; sed "s/^/ /" /etc/igneum/seed-v4.env
echo "unit igneumd-v4: $(systemctl is-enabled igneumd-v4 2>/dev/null) / $(systemctl is-active igneumd-v4 2>/dev/null || true) (stays off until switch-v4.sh)"
@ -74,6 +76,14 @@ wait_build() {
case "$mode" in
status) remote_status ;;
wait) wait_build ;;
resume)
sssh "$ip" "test -f /root/v4/src.tar.gz" || die "nothing to resume on $name (no /root/v4/src.tar.gz; run start)"
if sssh "$ip" "systemctl is-active $BUILD_UNIT >/dev/null 2>&1"; then die "a v4 build is already running on $name (./stage-v4.sh $name wait)"; fi
sscp "$HERE/node/build-v4-on-seed.sh" "$SSH_USER@$ip:/root/v4/build-v4-on-seed.sh"
log "resuming the build on $name (same tree and cargo cache; the build script was uploaded again)"
sssh "$ip" "systemctl reset-failed $BUILD_UNIT >/dev/null 2>&1 || true; rm -f /root/v4/DONE /root/v4/FAILED; systemd-run --unit=$BUILD_UNIT --collect -p Nice=19 -p IOSchedulingClass=idle -p MemoryHigh=1600M -p MemoryMax=2400M -p OOMScoreAdjust=900 -E CARGO_BUILD_JOBS=1 -E HOME=/root bash -c 'bash /root/v4/build-v4-on-seed.sh > /root/v4/build.log 2>&1'" | tee -a "$LOG"
sleep 5
wait_build ;;
start)
for try in $(seq 1 10); do sssh "$ip" true >/dev/null 2>&1 && break; log "waiting for ssh ($try)"; sleep 10; done
sssh "$ip" true || die "ssh to $ip failed"
@ -92,5 +102,5 @@ case "$mode" in
sleep 5
sssh "$ip" "systemctl is-active $BUILD_UNIT; tail -3 /root/v4/build.log" | tee -a "$LOG"
wait_build ;;
*) die "usage: stage-v4.sh [seed-name] [start|wait|status]" ;;
*) die "usage: stage-v4.sh [seed-name] [start|resume|wait|status]" ;;
esac