igneum/tools/attack/adv-accept-3/chunks3.sh
2026-10-07 20:36:58 +00:00

18 lines
1.4 KiB
Bash
Executable file

#!/usr/bin/env bash
# adv-accept-3 chunked sweep driver, yield rule v3 (coordinator, 7 Oct 2026 20:3x BST): every chunk is its own
# `lease pool 32 --min 16` call; before each chunk the driver sleeps while `lease status` shows a WAITER whose owner is
# class-v5, or whose owner is attack-pass with "v5" in its label; a waiter whose owner starts with adv- never outranks it.
# chunks3.sh <name> <from> <to> <step> <cmd> [fixed args...] log /srv/builds/_adv-accept-3/<name>.lease.log
set -u
name=$1; from=$2; to=$3; step=$4; shift 4
B=/srv/builds/_adv-accept-3/bin/adv3-928272e0; D=/srv/builds/_adv-accept-3; LOG=$D/$name.lease.log
yield_due() { /srv/builds/_bin/lease status 2>/dev/null | sed -n '/^waiting:/,$p' | grep -qiE 'owner=class-v5|v5.*owner=attack-pass'; }
echo "driver3 start $(date -u +%FT%TZ) $name $from..$to step $step: $*" >> "$LOG.driver"
for ((f=from; f<to; f+=step)); do
n=$step; [ $((f+n)) -gt "$to" ] && n=$((to-f))
while yield_due; do echo "$(date -u +%T) yield: a class-v5 or attack-pass v5 waiter is in the pool" >> "$LOG.driver"; sleep 30; done
echo "$(date -u +%T) chunk $f +$n" >> "$LOG.driver"
/srv/builds/_bin/lease pool 32 --min 16 --label "adv-accept-3 $name $f" --owner adv-accept-3 -- "$B" "$@" --from "$f" --count "$n" --threads '{cores}' >> "$LOG" 2>&1
echo "$(date -u +%T) chunk $f done rc $?" >> "$LOG.driver"
done
echo "driver3 end $(date -u +%FT%TZ)" >> "$LOG.driver"