Files
leleka/scripts/e2e/decode/baseline-install.sh
T

29 lines
2.3 KiB
Bash

#!/usr/bin/env bash
# Install the baseline-pair measurement inputs on rnr5090 (run on the server, from the directory that holds the scripts):
# bash baseline-install.sh
# Copies baseline-pair-ab.sh, baseline-sampler.py, ts-wrap.sh to /data/leleka-e2e/baseline-pair/tools (read-only afterwards) and writes MANIFEST.sha256 with the digest of every input a
# run depends on: these tools, the ours binaries, the harness, the upstream profile, the corpus manifest, the vanilla launcher and engine, the vanilla settings. The job refuses to start
# on a missing or changed input. Re-running replaces the tools and rewrites the manifest (a job already running keeps going; the next job start verifies the new manifest).
set -euo pipefail
BP=/data/leleka-e2e/baseline-pair
D=/data/leleka-e2e/decode/dt
SRC=$(cd "$(dirname "$0")" && pwd)
mkdir -p "$BP/tools"
chmod -R u+w "$BP/tools" 2>/dev/null || true
for f in baseline-pair-ab.sh baseline-sampler.py ts-wrap.sh cycle-hook.sh baseline-prefetch.py baseline-evict.py baseline-thpcheck.py; do install -m 0444 "$SRC/$f" "$BP/tools/$f"; done
chmod a-w "$BP/tools"
ENG=$(ls -d /home/para/.local/share/strata/components/engine/*/strata | head -1)
{
sha256sum "$BP"/tools/* \
"$D/bin-footprint3b/leleka-inference" "$D/bin-footprint3b/leleka-daemon" "$D/bin-footprint3b/leleka-cli" "$D/bin-footprint3b/strata-next" \
"$D/bin-cpuservice/leleka-inference" "$D/bin-cpuservice/leleka-daemon" "$D/bin-cpuservice/leleka-cli" "$D/bin-cpuservice/strata-next" \
$(ls "$D"/bin-main-*/leleka-inference "$D"/bin-main-*/leleka-daemon "$D"/bin-main-*/leleka-cli "$D"/bin-main-*/strata-next 2>/dev/null) \
"$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 \
"$HOME/work/vanilla-strata/control/bin/strata" "$ENG" "$HOME/.config/strata/settings.json"
} >"$BP/MANIFEST.sha256.new"
mv "$BP/MANIFEST.sha256.new" "$BP/MANIFEST.sha256"
cat "$D/bin-footprint3b/COMMIT.txt" "$D/bin-cpuservice/COMMIT.txt" >"$BP/PROVENANCE.txt"
{ echo "vanilla engine component: $ENG"; echo "vanilla launcher: $HOME/work/vanilla-strata/control/bin/strata (Strata 0.2.6 per docs/upstream.md)"; date -u +%FT%TZ; } >>"$BP/PROVENANCE.txt"
echo "installed; $(wc -l <"$BP/MANIFEST.sha256") inputs in $BP/MANIFEST.sha256"