Files
leleka/scripts/e2e/decode/draftround-install.sh

24 lines
1.7 KiB
Bash

#!/usr/bin/env bash
# Install the draft-round measurement inputs on rnr5090 (run on the server from the directory that holds the scripts):
# bash draftround-install.sh [extra bin dir under dt/ ...]
# Copies the tools to /data/leleka-e2e/draft-round/tools (read-only afterwards) and writes MANIFEST.sha256 with the digest of every input a run depends on: the tools, the CUPTI
# tracer, the ours binaries named on the command line (bin-main-ffd9322 is always included), the harness, the upstream profile and the corpus manifest. Jobs refuse to start on a mismatch.
set -euo pipefail
DR=/data/leleka-e2e/draft-round
D=/data/leleka-e2e/decode/dt
SRC=$(cd "$(dirname "$0")" && pwd)
mkdir -p "$DR/tools"
chmod -R u+w "$DR/tools" 2>/dev/null || true
for f in draftround-ab.sh draftround-id.sh draftround-idcmp.py draftround-kernels.py draftround-timeline.py draftround-width.py draftround-install.sh ts-wrap.sh draftround-analyze.py; do [ -e "$SRC/$f" ] && install -m 0444 "$SRC/$f" "$DR/tools/$f"; done
[ -e "$DR/tools/libleleka_cupti_trace.so" ] || install -m 0444 "$HOME/work/cupti-trace/libleleka_cupti_trace.so" "$DR/tools/libleleka_cupti_trace.so"
chmod a-w "$DR/tools"
BINS="bin-main-ffd9322 $*"
{
sha256sum "$DR"/tools/* "$DR"/cupti/lib/libcupti.so.2026.1.2
for b in $BINS; do for x in leleka-inference leleka-daemon leleka-cli leleka-api; do echo "$(sha256sum "$D/$b/$x" | cut -d' ' -f1) $D/$b/$x"; done; done
sha256sum "$D/tools/long-session.py" "$D/scripts/e2e/run-e2e.sh" "$D/scripts/e2e/sample_env.sh" \
/data/leleka-e2e/decode/assets/expert-profile-upstream.bin /data/leleka-e2e/decode/corpus/MANIFEST.txt
} >"$DR/MANIFEST.sha256.new"
mv "$DR/MANIFEST.sha256.new" "$DR/MANIFEST.sha256"
echo "installed; $(wc -l <"$DR/MANIFEST.sha256") inputs in $DR/MANIFEST.sha256"