ci: upload only what the run wrote, and a failed upload is a warning (#184)
scripts/nightly.sh run-logs gathers the logs and DoE CSVs newer than the run's start, and the stages' output, into build/nightly/run-logs/; acceptance, nightly and release upload that, not every log in the tree, with continue-on-error (Captain Bob: "A warning only"). scripts/test_nightly_run_logs.sh: 5 of 8 failed first; its own error (nightly.sh works from the repository root) corrected with NIGHTLY_TREE; 8 pass. To see: CI's next acceptance uploads a handful. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
+18
-1
@@ -19,6 +19,10 @@
|
||||
# found, and one value (#172 -- it was one distinct value, which two of the three could make).
|
||||
# scripts/nightly.sh test-32
|
||||
# make -C v4 test-32: v4 with 32-bit cells, every test (the acceptance's last part).
|
||||
# scripts/nightly.sh run-logs
|
||||
# What this run wrote, gathered for CI to upload (#184): the files under logs/ and
|
||||
# experiments/bare_metal/runs/ newer than the run's start ($OUT/.started), and the stages' own
|
||||
# output ($OUT/*.txt), copied with their paths into $OUT/run-logs/. Not every log in the tree.
|
||||
# scripts/nightly.sh capsule-trust
|
||||
# A signed build with one capsule's signature taken out (v4:centre.4th), booted on amd64: the kernel
|
||||
# must refuse it and stop (#139; plan 2026-11-20-capsule-trust.md, ruling 4, "Left to CI"). Needs
|
||||
@@ -94,7 +98,7 @@ DOCS=build/nightly-docs
|
||||
LITHOS=$(sed -n 's/^LITHOS_VERSION *?= *//p' kernel/Makefile)
|
||||
VERSION=${NIGHTLY_VERSION:-$LITHOS-SNAPSHOT}
|
||||
usage() {
|
||||
echo "Usage: scripts/nightly.sh accept <amd64|aarch64|riscv64|stick-high> | test-32 | capsule-trust | v4-checks | proofs | images" >&2
|
||||
echo "Usage: scripts/nightly.sh accept <amd64|aarch64|riscv64|stick-high> | test-32 | capsule-trust | run-logs | v4-checks | proofs | images" >&2
|
||||
echo " | publish <URL> | docs | publish-docs <URL> | gitea-release <tag>" >&2
|
||||
echo " | protocol [<stage>...] | protocol-report | dict-hash | post-count" >&2
|
||||
echo " | diagnose [<stage that failed>]" >&2
|
||||
@@ -196,6 +200,19 @@ dict-hash)
|
||||
echo "nightly: the three architectures do not agree on dict_hash -- $(tr '\n' ' ' <<<"$distinct")" >&2; exit 1
|
||||
fi
|
||||
;;
|
||||
run-logs)
|
||||
need "$OUT/.started"
|
||||
rm -rf "$OUT/run-logs"; mkdir -p "$OUT/run-logs"
|
||||
out_abs=$(cd "$OUT" && pwd)
|
||||
(cd "${NIGHTLY_TREE:-.}" && # NIGHTLY_TREE: the tests' scratch tree (scripts/test_nightly_run_logs.sh)
|
||||
find logs experiments/bare_metal/runs -type f -newer "$out_abs/.started" -print0 2>/dev/null \
|
||||
| while IFS= read -r -d '' f; do mkdir -p "$out_abs/run-logs/$(dirname "$f")"; cp -p "$f" "$out_abs/run-logs/$f"; done)
|
||||
for f in "$OUT"/*.txt; do
|
||||
[ -f "$f" ] || continue
|
||||
mkdir -p "$OUT/run-logs/$(basename "$OUT")"; cp -p "$f" "$OUT/run-logs/$(basename "$OUT")/"
|
||||
done
|
||||
echo "=== nightly: run-logs: $(find "$OUT/run-logs" -type f | wc -l) files, this run's, in $OUT/run-logs"
|
||||
;;
|
||||
capsule-trust)
|
||||
git checkout -q -- disk/zuse-scratch
|
||||
python3 scripts/qemu_session.py unsigned_capsule amd64 --label nightly-capsule-trust --make "QEMU_DISPLAY=none"
|
||||
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: LicenseRef-Starship-1.0
|
||||
# Copyright (c) 2023-2026 Robert A. James
|
||||
# test_nightly_run_logs.sh -- the tests of `scripts/nightly.sh run-logs` (#184): what CI uploads is
|
||||
# only what this run wrote -- the files under logs/ and experiments/bare_metal/runs/ newer than the
|
||||
# run's start ($OUT/.started), and the stages' own output in $OUT -- not every log in the tree.
|
||||
# No QEMU: a scratch tree with old and new files.
|
||||
#
|
||||
# Prints PASS:/FAIL: per check and RESULT:; exits 0 only if every check passes.
|
||||
set -uo pipefail
|
||||
NIGHTLY="$(cd "$(dirname "$0")" && pwd)/nightly.sh"
|
||||
T=$(mktemp -d)
|
||||
trap 'rm -rf "$T"' EXIT
|
||||
ok=1
|
||||
check() { if eval "$2"; then echo "PASS: $1"; else echo "FAIL: $1"; ok=0; fi; }
|
||||
|
||||
cd "$T"
|
||||
mkdir -p logs/old/amd64 experiments/bare_metal/runs out
|
||||
echo old > logs/old/amd64/qemu-amd64-old.log
|
||||
echo old > experiments/bare_metal/runs/doe-old.csv
|
||||
touch -d '2026-01-01' logs/old/amd64/qemu-amd64-old.log experiments/bare_metal/runs/doe-old.csv
|
||||
touch out/.started
|
||||
sleep 1
|
||||
mkdir -p logs/new/amd64
|
||||
echo new > logs/new/amd64/qemu-amd64-new.log
|
||||
echo new > experiments/bare_metal/runs/doe-new.csv
|
||||
echo stage > out/accept-amd64.txt
|
||||
|
||||
NIGHTLY_TREE="$T" NIGHTLY_OUT="$T/out" bash "$NIGHTLY" run-logs > run.txt 2>&1; rc=$?
|
||||
check "the stage succeeds" '[ $rc -eq 0 ]'
|
||||
check "this run's serial log is kept" '[ -f out/run-logs/logs/new/amd64/qemu-amd64-new.log ]'
|
||||
check "this run's DoE CSV is kept" '[ -f out/run-logs/experiments/bare_metal/runs/doe-new.csv ]'
|
||||
check "the stages' own output is kept" '[ -f out/run-logs/out/accept-amd64.txt ]'
|
||||
check "an older log is not" '[ ! -e out/run-logs/logs/old ]'
|
||||
check "an older CSV is not" '[ ! -e out/run-logs/experiments/bare_metal/runs/doe-old.csv ]'
|
||||
check "it says how many files" 'grep -q "run-logs: 3 files" run.txt'
|
||||
rm -rf out/run-logs; rm out/.started
|
||||
NIGHTLY_TREE="$T" NIGHTLY_OUT="$T/out" bash "$NIGHTLY" run-logs > run2.txt 2>&1; rc=$?
|
||||
check "with no run started, it refuses" '[ $rc -ne 0 ]'
|
||||
|
||||
echo "RESULT: $([ $ok = 1 ] && echo PASS || echo FAIL)"
|
||||
[ $ok = 1 ]
|
||||
Reference in New Issue
Block a user