Merge build-server 6150be8a into master on the box mirror: the site deploy checks (served links, the regrouped /miners count, the pipefail fixes)

This commit is contained in:
igneum-josh 2026-10-08 10:18:00 +01:00
commit d1b4ecb795
2 changed files with 18 additions and 6 deletions

View file

@ -71,6 +71,6 @@ every workflow job carries timeout-minutes (site 15, changes 10, pow 60, sims 45
a box or network check gets one retry before it is red (retry-once self-test)
gh's active account on the pushing Mac is the stored Igneum entry (self-test: another login refused and named; the hook and the merge tool run the check live)
CI state reader: a commit's newest run, master's last compiled run, a branch's last red (fake gh; the merge rule's reader)
the Intel rotate-fold rewrite: Intel gets the shift form, AMD and NVIDIA untouched (proto-opencl/test_intel_rotr.c)
known failure
known success
the Intel rotate-fold rewrite: Intel gets the shift form, AMD and NVIDIA untouched (proto-opencl/test_intel_rotr.c)

View file

@ -17,8 +17,14 @@ set -euo pipefail
LIVE_NETWORK="${LIVE_NETWORK:-igneum-devnet-3}"
INDEX_STRINGS=("At launch the strongest chip in our public model" "git.igneum.network/igneum-network/")
LEGAL_PAGE="${LEGAL_PAGE:-/litepaper}"; LEGAL_STRING="Not legal advice" # the legal line lives on the litepaper in master's tree (22:16 UK: no commit put it on the index)
MINERS_MIN_ROWS="${MINERS_MIN_ROWS:-30}"
MINERS_MIN_ROWS="${MINERS_MIN_ROWS:-20}" # the current-class table alone (the datacentre rows sit in their own table since 8 Oct 2026)
SITE="${SITE_URL:-https://igneum.network}"
# the /miners row count: the rows of the current-class table (table#bench-current, the regrouped bench of 8 Oct 2026; the datacentre
# and earlier tables sit under their own ids); known-failed: an empty table reads 0
miners_rows() { printf '%s' "$1" | python3 -c '
import sys,re
h=sys.stdin.read(); m=re.search(r"<table[^>]*id=\"bench-current\".*?</table>", h, re.S)
print(len(re.findall(r"<tr class=\"row\"", m.group(0))) if m else 0)'; }
post_checks() { # one pass: prints the first mismatch as "field: detail" and returns 1, or returns 0 silently
local j n idx m rows
local nc=(-H 'Cache-Control: no-cache' -H 'Pragma: no-cache')
@ -26,9 +32,13 @@ post_checks() { # one pass: prints the first mismatch as "field: detail" and ret
n=$(printf '%s' "$j" | python3 -c 'import sys,json; print(json.load(sys.stdin)["state"]["network"])' 2>/dev/null || echo "?")
[ "$n" = "$LIVE_NETWORK" ] || { echo "api/live network: $n (want $LIVE_NETWORK)"; return 1; }
idx=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/?x=$RANDOM" 2>/dev/null) || { echo "index: not reachable"; return 1; }
for m in "${INDEX_STRINGS[@]}"; do printf '%s' "$idx" | /usr/bin/grep -qF -- "$m" || { echo "index string missing: \"$m\""; return 1; }; done
curl -fsS "${nc[@]}" --max-time 20 "$SITE$LEGAL_PAGE?x=$RANDOM" 2>/dev/null | /usr/bin/grep -qiF -- "$LEGAL_STRING" || { echo "legal string missing on $LEGAL_PAGE: \"$LEGAL_STRING\""; return 1; }
rows=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/miners?x=$RANDOM" 2>/dev/null | /usr/bin/grep -c '<tr class="row"' || true)
for m in "${INDEX_STRINGS[@]}"; do printf '%s' "$idx" | /usr/bin/grep -cF -- "$m" >/dev/null || { echo "index string missing: \"$m\""; return 1; }; done
# the page is read into a variable first: `curl | grep -q` under pipefail reads false on a MATCH (grep closes the pipe, curl exits 56;
# three false DEPLOY REDs on 7 and 8 October 2026)
local legal; legal=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE$LEGAL_PAGE?x=$RANDOM" 2>/dev/null) || { echo "$LEGAL_PAGE: not reachable"; return 1; }
printf '%s' "$legal" | /usr/bin/grep -ciF -- "$LEGAL_STRING" >/dev/null || { echo "legal string missing on $LEGAL_PAGE: \"$LEGAL_STRING\""; return 1; }
local miners; miners=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/miners?x=$RANDOM" 2>/dev/null) || { echo "miners: not reachable"; return 1; }
rows=$(miners_rows "$miners")
[ "${rows:-0}" -ge "$MINERS_MIN_ROWS" ] || { echo "miners rows: ${rows:-0} (want at least $MINERS_MIN_ROWS)"; return 1; }
echo "ok: api/live $n, ${#INDEX_STRINGS[@]} index strings, the legal line on $LEGAL_PAGE, $rows miners rows"
}
@ -37,7 +47,9 @@ if [ "${1:-}" = --self-test-checks ]; then
LIVE_NETWORK="igneum-no-such-network" post_checks >/dev/null 2>&1 && { echo "post-deploy self-test: FAIL: a wrong network passed"; exit 1; }
out=$(LIVE_NETWORK="igneum-no-such-network" post_checks 2>&1 || true); case "$out" in "api/live network:"*) ;; *) echo "post-deploy self-test: FAIL: the wrong-network line was '$out'"; exit 1 ;; esac
INDEX_STRINGS=("no such string on any page 7f3a") LIVE_NETWORK="$(curl -fsS --max-time 20 "$SITE/api/live" | python3 -c 'import sys,json; print(json.load(sys.stdin)["state"]["network"])')" post_checks >/dev/null 2>&1 && { echo "post-deploy self-test: FAIL: a missing index string passed"; exit 1; }
echo "post-deploy self-test: a wrong network and a missing index string read RED with the field"
[ "$(miners_rows '<table id="bench-current"><tr class="hdr"></tr></table><table id="bench-earlier"><tr class="row"></tr></table>')" = 0 ] || { echo "post-deploy self-test: FAIL: an empty current table did not read 0 rows"; exit 1; }
[ "$(miners_rows '<table id="bench-current"><tr class="row"></tr><tr class="detail"></tr><tr class="row"></tr></table>')" = 2 ] || { echo "post-deploy self-test: FAIL: two rows did not read 2"; exit 1; }
echo "post-deploy self-test: a wrong network and a missing index string read RED with the field; an empty current table reads 0 rows, two rows read 2"
echo "live site now: $(post_checks 2>&1 || true)"
exit 0
fi