igneum/tools/class-v5/kits-remote.sh

46 lines
3.4 KiB
Bash
Executable file

#!/usr/bin/env bash
# The class v5 kits for every platform, built and tested on igneum-build-1 (docs/design/class-v5-stored-state.md section 13,
# the kit rows; 7 October 2026). From THIS worktree's commit (HEAD through the bare mirror, as tools/build-remote.sh moves
# sources; nothing is built on the Mac): the pack loader test with the class v5 cases (proto-cuda/nvrtc/emu/packfile-test.c),
# the CPU emulation of the NVRTC worker running --check on the class v5 pack (the real kernel text on host threads, the
# dataset built from the pack's leaves and checked against the pack's cache FNV, dataset head, last word, 64 samples and
# three vector warps: the "exactly as igneum-pow's verifier" line without a GPU), the Linux and Windows builds of the two
# one-click workers (proto-cuda/nvrtc/worker.cpp through NVRTC, proto-opencl/host.c for AMD, Intel and Apple), then one kit
# zip at /srv/artefacts/packs/packs-ca3-v5-<stamp>.zip holding the three packs (v4-genesis, v5-genesis, v5-dn3-epoch0), the
# binaries, the sources, the bench scripts for the fleet and PC 1, and SHA256SUMS. Prints the zip's sha256 last.
#
# IGNEUM_AGENT=v5-kits tools/class-v5/kits-remote.sh [--box 1] [--skip-emu]
#
# Takes one of the box's build slots through infra/build-server/remote-run.sh (bs_remote_run), box 1 by default (the
# build-server lane's word of 7 October 2026, 19:4x BST: the kit builds on build-1 explicitly). The work itself is
# tools/class-v5/kits-on-box.sh, a script file run by path on the box (the inline-rm rule of 21:33 BST); when the
# build-server lane's lease tool is in place, the same file goes through `/srv/builds/_bin/lease pool <threads> -- bash
# tools/class-v5/kits-on-box.sh ...` with the label "v5 kit".
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BS_TOOL=class-v5-kits
# shellcheck source=../../infra/build-server/lib.sh
. "$HERE/../../infra/build-server/lib.sh"
BOX=1; SKIP_EMU=0
while [ $# -gt 0 ]; do
case "$1" in --box) BOX="$2"; shift 2 ;; --skip-emu) SKIP_EMU=1; shift ;; *) echo "unknown argument $1" >&2; exit 2 ;; esac
done
export IGNEUM_AGENT="${IGNEUM_AGENT:-v5-kits}"
bs_host "$BOX"
pushd "$HERE/../../igneum-pow" > /dev/null; bs_context; popd > /dev/null
WT="$BS_REMOTE_WT"
STAMP=$(date -u +%Y%m%dT%H%M%SZ)
ZIP="/srv/artefacts/packs/packs-ca3-v5-$STAMP.zip"
bs_toolchain_check
bs_sync_sources
bs_log "sources at $WT (commit $BS_SHA on $BS_BRANCH); building the class v5 kits on box $BOX"
# the body runs from a script FILE at the worktree's mirror checkout (tools/class-v5/kits-on-box.sh, carried by the commit), never
# an inline string: main's rule of 7 October 2026, 21:33 BST (no rm, find -delete or truncation inside a bash -c string)
CMD="cd '$WT' && bash tools/class-v5/kits-on-box.sh '$STAMP' '$SKIP_EMU'"
set +e
BR_KIND=build BR_COMMAND="class v5 kits (packfile-test, emu --check v5, Linux and Windows workers, kit zip)" BR_TARGET="x86_64-linux+windows" BR_ARTEFACTS="" \
bs_remote_run "$WT" "$BS_WT class-v5 kits" "$CMD" 2>&1 | tee "/tmp/v5-kits-$STAMP.log" | grep -E '^(STEP|FAIL|KIT|BIN|LOGS|check PASS|self-test|packfile-test|emu:| v5|build-remote: RESULT)'
rc=${PIPESTATUS[0]} # the remote runner's status, read before anything else runs (the first run read `true`'s and called a failed build built)
set -e
bs_wt_unlock
[ "$rc" = 0 ] && bs_log "class v5 kits built: $ZIP" || bs_die "class v5 kits FAILED (rc $rc); full log /tmp/v5-kits-$STAMP.log"