#!/usr/bin/env bash # Chain the Qwen3-4B-Base arm behind the instruct arm. # # ⚠ Gated on the instruct run having actually produced an adapter. If that run died, # this must not quietly start and consume the box: a chain that fires on failure turns # one lost run into two. set -uo pipefail PREV=/home/infra-ops/r49-runs/yarros-4b-instruct-1ep CHAINLOG=/home/infra-ops/r49-runs/chain-yarros-4b-base.log exec >> "$CHAINLOG" 2>&1 echo "=== $(date -Is) chain armed, waiting on $PREV" while [ -f "$PREV/run.pid" ] && kill -0 "$(cat "$PREV/run.pid")" 2>/dev/null; do sleep 60; done echo "=== $(date -Is) instruct run finished" if [ ! -f "$PREV/adapter/adapter_model.safetensors" ]; then echo "=== REFUSING to chain: $PREV produced no adapter -- the instruct run did not succeed" exit 1 fi exec /home/infra-ops/r49-prep/launch-yarros-4b-base.sh