37 lines
3.1 KiB
Bash
37 lines
3.1 KiB
Bash
#!/usr/bin/env bash
|
|
# Sourced by the stubs of the route-tail-skip quality gate (plan stage 6f). EXPERIMENTAL, LOSSY, OFF in every shipped profile.
|
|
# Package: the owner-default release 83bdd85bb482 (release-s22). The mode is switched by the SHELL environment of the job, not by a profile key: the profile key
|
|
# allow-list (crates/deploy/src/profile/profile_limits.rs) has no LELEKA_ROUTE_ prefix, and the built-in profile only overrides the keys it holds, so
|
|
# LELEKA_ROUTE_TAIL_SKIP / ..._MAX_CACHED pass through to the engine (as in the earlier lever 7 gate, jobs spd-g1..g9). Proof = the engine log line
|
|
# "EXPERIMENTAL route tail skip is ON (LELEKA_ROUTE_TAIL_SKIP=7" after the warm-up request of the block (watcher below, plus the report job).
|
|
TAIL_SKIP_TOOLS=/data/leleka-e2e/prefill-latency/tools
|
|
TAIL_SKIP_RUN=/data/leleka-e2e/prefill-latency/runs/e2e-codex-ttt-and-crm-release-83bdd85bb482-route-tail-skip-7-experimental
|
|
TAIL_SKIP_TARBALL=/data/leleka-e2e/prefill-latency/release-s22/leleka-0.1.0-83bdd85bb482-linux-x86_64.tar.xz
|
|
TAIL_SKIP_TARBALL_SHA256=3837a32b3101b92f2c7da125290fc594e534536bc926b992202468de951ed51c
|
|
TAIL_SKIP_ENGINE_LOG=/data/leleka-e2e/codex-compare/ours-state-83bdd85bb482/logs/engine.log
|
|
|
|
# $1 repetition, $2 job pid, $3 engine log lines before the job: writes $TAIL_SKIP_RUN/tail-skip-proof-r$1.txt when the engine announced the mode after the
|
|
# warm-up request, ABORT-tail-skip-not-on-r$1.txt when it did not (no kill: a human decides).
|
|
tail_skip_watch_announcement() {
|
|
local rep=$1 job_pid=$2 base_lines=$3 smoke=$TAIL_SKIP_RUN/LEL/smoke-mini-r10$1/cell.json
|
|
until [ -f "$smoke" ]; do kill -0 "$job_pid" 2>/dev/null || return 0; sleep 20; done
|
|
if ! tail -n +$((base_lines + 1)) "$TAIL_SKIP_ENGINE_LOG" | grep -m1 "EXPERIMENTAL route tail skip is ON (LELEKA_ROUTE_TAIL_SKIP=7" >"$TAIL_SKIP_RUN/tail-skip-proof-r$rep.txt"; then
|
|
echo "engine did not announce the tail skip after the warm-up request of repetition $rep ($(date -u +%FT%TZ))" >"$TAIL_SKIP_RUN/ABORT-tail-skip-not-on-r$rep.txt"
|
|
fi
|
|
}
|
|
|
|
# $1 repetition: guards, environment, watcher, then the job (exec).
|
|
tail_skip_gate_run() {
|
|
unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG
|
|
local rep=$1 got
|
|
got=$(sha256sum "$TAIL_SKIP_TARBALL" | cut -d' ' -f1)
|
|
[ "$got" = "$TAIL_SKIP_TARBALL_SHA256" ] || { echo "tarball sha256 $got differs from $TAIL_SKIP_TARBALL_SHA256: stop"; exit 5; }
|
|
mkdir -p "$TAIL_SKIP_RUN"
|
|
for v in VAN VANL; do [ -e "$TAIL_SKIP_RUN/$v" ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v "$TAIL_SKIP_RUN/$v"; done
|
|
export CMP_ARM=ours CMP_TASKS="ttt nestng-crm" CMP_REPS="$rep" CMP_RUN=$TAIL_SKIP_RUN CMP_OURS_TAG=83bdd85bb482 CMP_TARBALL=$TAIL_SKIP_TARBALL
|
|
export LELEKA_ROUTE_TAIL_SKIP=7 LELEKA_ROUTE_TAIL_SKIP_MAX_CACHED=100
|
|
echo "tail skip gate rep $rep: tarball sha256 $got, LELEKA_ROUTE_TAIL_SKIP=7 LELEKA_ROUTE_TAIL_SKIP_MAX_CACHED=100" >>"$TAIL_SKIP_RUN/gate-start.txt"
|
|
( tail_skip_watch_announcement "$rep" "$$" "$(wc -l <"$TAIL_SKIP_ENGINE_LOG" 2>/dev/null || echo 0)" ) </dev/null >/dev/null 2>&1 &
|
|
exec bash "$TAIL_SKIP_TOOLS/cmp_codex_job_profile.sh"
|
|
}
|