#!/usr/bin/env bash # Install the window-policy A/B inputs on rnr5090 (run on the server from the directory that holds the scripts): # bash windowpolicy-install.sh [bin dir under dt/ ...] # Copies the A/B tools to /data/leleka-e2e/window-policy/tools and the repository's scripts/e2e (run-e2e.sh and its client files) to /data/leleka-e2e/window-policy/scripts/e2e # (read-only afterwards) and writes MANIFEST.sha256 with the digest of every input a run depends on: the tools, the e2e scripts, the draft-round harness helper, # the binaries named on the command line, the long-session client, the upstream profile and the corpus manifest. windowpolicy-ab.sh refuses to start on a mismatch. set -euo pipefail WP=/data/leleka-e2e/window-policy DRT=/data/leleka-e2e/draft-round/tools D=/data/leleka-e2e/decode/dt SRC=$(cd "$(dirname "$0")" && pwd) E2E=$(cd "${1:?usage: windowpolicy-install.sh [bin ...]}" && pwd) shift chmod -R u+w "$WP/tools" "$WP/scripts" 2>/dev/null || true mkdir -p "$WP/tools" for f in windowpolicy-ab.sh windowpolicy-analyze.py windowpolicy-replay.sh windowpolicy-replay-summary.py windowpolicy-id.sh windowpolicy-install.sh; do if [ -e "$SRC/$f" ]; then install -m 0555 "$SRC/$f" "$WP/tools/$f"; fi done rm -rf "$WP/scripts" mkdir -p "$WP/scripts/e2e" for f in "$E2E"/*.sh "$E2E"/*.py; do if [ -f "$f" ]; then install -m 0555 "$f" "$WP/scripts/e2e/$(basename "$f")"; fi done chmod a-w "$WP/tools" "$WP/scripts/e2e" "$WP/scripts" { sha256sum "$WP"/tools/* "$WP"/scripts/e2e/* "$DRT"/ts-wrap.sh for b in "$@"; do for x in leleka-inference leleka-daemon leleka-cli strata-next; do sha256sum "$D/$b/$x" done done sha256sum "$D/tools/long-session.py" /data/leleka-e2e/decode/assets/expert-profile-upstream.bin /data/leleka-e2e/decode/corpus/MANIFEST.txt } >"$WP/MANIFEST.sha256.new" mv "$WP/MANIFEST.sha256.new" "$WP/MANIFEST.sha256" echo "installed; $(wc -l <"$WP/MANIFEST.sha256") inputs in $WP/MANIFEST.sha256"