igneum/tools/attack/adv-accept-2/run/run-box.sh
2026-10-07 18:49:26 +00:00

17 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
# adv-accept-2 runner. No SIGSTOP yield (build-server lane ruling, 7 Oct 2026 ~20:1x BST: a build slot is held nearly
# continuously, so the yield kept sweeps paused almost all the time). Every sweep runs at nice 10 on cores 8 to 95
# only (cores 0 to 7 are reserved for release builds, the seed and the observer). Logs and pid files live OUTSIDE the
# worktree mirror (/srv/builds/igneum-wt-adv-accept-2 is rsync-deleted by build-remote.sh): they go to
# /srv/builds/_adv-adv-accept-2/. The binary stays under the mirror's target dir.
# run-box.sh <name> <bin-args...>
set -euo pipefail
BIN="${ADV_BIN:-/srv/builds/igneum-wt-adv-accept-2/tools/attack/adv-accept-2/target/release/adv-accept-2}"
OUT=/srv/builds/_adv-adv-accept-2
mkdir -p "$OUT"
name="$1"; shift
log="$OUT/$name.log"; pidf="$OUT/$name.pid"
if [ -f "$pidf" ] && kill -0 "$(cat "$pidf")" 2>/dev/null; then echo "already running: $name (pid $(cat "$pidf"))"; exit 0; fi
nohup nice -n 10 taskset -c 8-95 "$BIN" "$@" > "$log" 2>&1 &
echo $! > "$pidf"
echo "started $name pid $(cat "$pidf") log $log"