igneum/tools/attack/f10-ladder/run-box.sh
2026-10-07 10:02:44 +00:00

20 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
# F10 box runner (igneum-build-1): one harness run under nohup, on the F10 cores, holding the box's measure file SHARED
# for the length of the run (every run is capped under 30 minutes by its own --secs), with a pid file and a log in the
# F10 scratch dir. Usage, on the box:
# run-box.sh <run name> <harness .mjs> [args...]
# The run's log is runs/<name>.log, its pid runs/<name>.pid, its summary copied to runs/<name>.json and its node logs to
# runs/<name>-n{0,1,2}.log when it ends. Never touches another lane's directory, port or network.
set -u
D=/srv/builds/igneum-wt-attack/attack-f10
NAME="$1"; shift
HARNESS="$1"; shift
mkdir -p "$D/runs"
export IGNEUM_ROOT=/srv/builds/igneum-wt-attack/
export IGNEUM_LADDER_TMP="/tmp/igneum-fast-time-attack-f10"
export IGNEUM_F10_BASE=29900 IGNEUM_F10_SUFFIX=990
# the inner command: the run, then the copies, then an END line keyed to this run's name (every wait keys on it)
INNER="cd $D && nice -n 10 taskset -c 38-39,86-87 node $D/$HARNESS $* ; rc=\$? ; cp $IGNEUM_LADDER_TMP/summary.json $D/runs/$NAME.json 2>/dev/null ; for i in 0 1 2; do cp $IGNEUM_LADDER_TMP/n\$i/node.log $D/runs/$NAME-n\$i.log 2>/dev/null; done ; for i in 0 1 2; do cp $IGNEUM_LADDER_TMP/cpu\$i.log $D/runs/$NAME-cpu\$i.log 2>/dev/null; done ; echo \"F10-END $NAME rc=\$rc \$(date -u +%FT%TZ)\""
nohup flock -s /srv/builds/_locks/measure -c "$INNER" > "$D/runs/$NAME.log" 2>&1 &
echo $! > "$D/runs/$NAME.pid"
echo "started $NAME pid $(cat "$D/runs/$NAME.pid") log $D/runs/$NAME.log"