igneum/tools/attack/adv-cache-3/run-box.sh
igneum-labs ff8afa731f adv-cache-3 run-box.sh: through the ranked lease, no -c string (main's inline-rm rule of 21:33 BST)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 20:36:51 +00:00

19 lines
1.3 KiB
Bash
Executable file

#!/usr/bin/env bash
# Start one adv-cache-3 sweep on a build box (run ON the box). Internal adversarial pass, not an independent review.
# run-box.sh <tag> <args...> (THREADS=N caps the pool ask; default 32, the ceiling an adv holder keeps)
# The binary is /srv/builds/_adv-cache-3/bin/adv-cache-3 (copied there after tools/build-remote.sh). The log and pid file
# live under /srv/builds/_adv-cache-3/logs/<tag>.log{,.pid}, outside the worktree mirror, which build-remote.sh's source
# sync would wipe. Every sweep starts through the build-server lane's ranked lease (main, 7 October 2026, 20:1x and 20:40
# BST: `lease pool`, class adv, holders above 32 threads are pre-empted), pinned by the lease to the cores it took, at
# nice 10, never on cores 0 to 7; "{cores}" in the arguments becomes the count taken. No `-c` string, no inline rm
# (main, 21:33 BST). Kill by pid file only: kill $(cat <pid>).
set -euo pipefail
tag="$1"; shift
BIN=/srv/builds/_adv-cache-3/bin/adv-cache-3
DIR=/srv/builds/_adv-cache-3/logs
T="${THREADS:-32}"
mkdir -p "$DIR"
log="$DIR/$tag.log"
nohup /srv/builds/_bin/lease pool "$T" --min 16 --label "adv-cache-3 $tag" --owner adv-cache-3 -- "$BIN" "$@" >> "$log" 2>&1 &
echo $! > "$log.pid"
echo "started $tag pid $(cat "$log.pid") log $log (waits in the lease queue while fewer than 16 pool cores are free)"