Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
35 lines
2.2 KiB
Bash
35 lines
2.2 KiB
Bash
#!/usr/bin/env bash
|
|
# Runs inside run-e2e.sh (as E2E_RUN_CMD, so inside a holder job, with the engine loaded and the current strata-next on :8081):
|
|
# starts the BASELINE strata-next (commit dbf487b logic) on :8082 against the same engine and replays one synthesized Codex session
|
|
# (scripts/cp/synth_session.py) alternately through the two, then joins the client's timings with the servers' stage logs.
|
|
# Test tooling only; no credential is printed (keys are read from files).
|
|
set -uo pipefail
|
|
HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
BINS=${CP_BINS:-$HOME/work/leleka-cp/bin}
|
|
OUT=${E2E_OUT_DIR:?run through run-e2e.sh}
|
|
STATE=$HOME/work/leleka-e2e/state
|
|
SESSION=${CP_SESSION:-$HOME/work/leleka-cp/data/s945.json}
|
|
TOK=$STATE/tokenizer-assets/tokenizer
|
|
SIZE=${CP_SIZE:-100000}
|
|
TURNS=${CP_TURNS:-20}
|
|
MAXOUT=${CP_MAX_OUT:-64}
|
|
sed 's/127.0.0.1:8081/127.0.0.1:8082/' "$STATE/strata.json" >"$STATE/strata-base.json"
|
|
[ "$(grep -c 8082 "$STATE/strata-base.json")" = 1 ] || { echo "could not derive the baseline config"; exit 3; }
|
|
STRATA_STAGE_TRACE=log "$BINS/strata-next-base" serve --config "$STATE/strata-base.json" >"$OUT/strata-base.log" 2>&1 &
|
|
PID_BASE=$!
|
|
if ! "$BINS/strata-next-base" wait-ready --url http://127.0.0.1:8082 --model qwen-iq3 --key-file "$STATE/api-key" --timeout-s 180 >"$OUT/wait-ready-base.log" 2>&1; then
|
|
echo "baseline strata-next never became ready"; tail -20 "$OUT/wait-ready-base.log" "$OUT/strata-base.log"; kill -INT $PID_BASE 2>/dev/null; exit 6
|
|
fi
|
|
echo "both servers ready: $(date -u +%T)"
|
|
sha256sum "$BINS"/strata-next-base "$BINS"/strata-next-new "$BINS"/leleka-inference "$BINS"/cp_replay | cut -c1-16,65-
|
|
"$BINS/cp_replay" "$TOK" "$SESSION" --live http://127.0.0.1:8081,http://127.0.0.1:8082 --names new,base --key-file "$STATE/api-key" \
|
|
--size "$SIZE" --turns "$TURNS" --max-output-tokens "$MAXOUT" >"$OUT/live.txt" 2>"$OUT/live.err"
|
|
RC=$?
|
|
cat "$OUT/live.err" | tail -5
|
|
kill -INT $PID_BASE 2>/dev/null
|
|
for _ in $(seq 1 20); do kill -0 $PID_BASE 2>/dev/null || break; sleep 1; done
|
|
kill -KILL $PID_BASE 2>/dev/null
|
|
python3 -I "$HERE/live_report.py" "$OUT/live.txt" new="$OUT/strata-next.log" base="$OUT/strata-base.log" | tee "$OUT/live-report.txt"
|
|
echo "cp_replay exit status $RC"
|
|
exit $RC
|