Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
31 lines
2.6 KiB
Bash
31 lines
2.6 KiB
Bash
#!/usr/bin/env bash
|
|
# Install the KAR on / off tools on the server (run ON the server): kar_off_install.sh LELEKA_BINARY SCRIPTS_DIR [LELEKA_INFERENCE_BINARY]
|
|
# LELEKA_BINARY the `leleka` built from the kar_source=none commit (Linux x86_64) SCRIPTS_DIR scripts/e2e/kar-off copied to the server
|
|
# LELEKA_INFERENCE_BINARY the engine built from the same commit (the GGUF-PLE opt-in LELEKA_ORIGINAL_SERVE_GGUF_PLE); both arms then run this engine
|
|
# Creates /data/leleka-e2e/kar-off-ab/{tools,pkg,inputs.sha256,INSTALL.sha256,pkg.sha256}. The package is the release 17e3729 binaries (hard links, no copy) with `leleka` replaced; nothing under
|
|
# codex-compare/ or spd-gap/ is changed. Frozen measurement inputs (tools + the recorded requests of the two cells) are listed with their sha256.
|
|
set -euo pipefail
|
|
BIN=${1:?leleka binary}; SRC=${2:?scripts dir}; ENG=${3:-}
|
|
K=/data/leleka-e2e/kar-off-ab; CMP=/data/leleka-e2e/codex-compare
|
|
mkdir -p "$K/tools" "$K/pkg/bin" "$K/runs"
|
|
chmod u+w "$K"/tools/* "$K"/pkg/bin/leleka "$K"/*.sha256 2>/dev/null || true
|
|
for f in "$SRC"/*.sh "$SRC"/*.py; do [ -f "$f" ] && install -m 0555 "$f" "$K/tools/$(basename "$f")"; done
|
|
install -m 0555 /data/leleka-e2e/spd-gap/tools/replay_fwd.py "$K/tools/replay_fwd.py"
|
|
OURS=$CMP/ours-pkg
|
|
for b in leleka-cli leleka-daemon leleka-inference leleka-seal-exec strata-next; do [ "$b" = leleka-inference ] && [ -z "$ENG" ] && [ -e "$K/pkg/bin/$b" ] && continue; ln -f "$OURS/bin/$b" "$K/pkg/bin/$b" 2>/dev/null || cp -p "$OURS/bin/$b" "$K/pkg/bin/$b"; done
|
|
install -m 0555 "$BIN" "$K/pkg/bin/leleka"
|
|
[ -n "$ENG" ] && install -m 0555 "$ENG" "$K/pkg/bin/leleka-inference"
|
|
python3 -I - "$OURS/MANIFEST.json" "$K/pkg/MANIFEST.json" "$K/pkg/bin" <<'PY'
|
|
import hashlib, json, sys
|
|
m = json.load(open(sys.argv[1]))
|
|
for b in ("leleka", "leleka-inference"):
|
|
m["binaries"][b] = hashlib.sha256(open(sys.argv[3] + "/" + b, "rb").read()).hexdigest()
|
|
m["kar_off_ab_note"] = "`leleka` and `leleka-inference` rebuilt from the kar_source=none commits (docs/experiments/kar-off-ab-5090.md); the other binaries are the release 17e3729 ones"
|
|
json.dump(m, open(sys.argv[2], "w"), indent=2)
|
|
PY
|
|
( cd "$K/pkg" && sha256sum bin/* MANIFEST.json > ../pkg.sha256 )
|
|
( cd "$K" && sha256sum tools/* > INSTALL.sha256 )
|
|
{ for cell in $CMP/runs/main/VANL/nestng-crm-r2 $CMP/runs/main/VANL/ttt-r3; do ls "$cell"/proxy/rounds/*.fwd.json.gz | xargs sha256sum; done; sha256sum "$K/tools/replay_fwd.py"; } > "$K/inputs.sha256"
|
|
chmod a-w "$K/inputs.sha256" "$K/INSTALL.sha256" "$K/pkg.sha256"
|
|
echo "installed: $(wc -l < "$K/inputs.sha256") input digests, $(wc -l < "$K/INSTALL.sha256") tools"
|