STRA-338 S3: arch-install.sh can replace only the candidate binaries without disturbing a running job
This commit is contained in:
@@ -23,19 +23,34 @@ place() { # $1 source, $2 destination (file), mode 0555 for programs and 0444 fo
|
||||
install -D -m "${3:-0444}" "$1" "$2"
|
||||
}
|
||||
|
||||
chmod -R u+w "$HX" 2>/dev/null || true
|
||||
mkdir -p "$HX/tools" "$HX/dt/tools" "$HX/dt/scripts/e2e"
|
||||
for f in draftround-id.sh draftround-ab.sh draftround-idcmp.py; do place "$SRC/decode/$f" "$HX/tools/$f" 0555; done
|
||||
place "$DRO/tools/ts-wrap.sh" "$HX/tools/ts-wrap.sh" 0555
|
||||
for f in q_pair.py q_tail_gate.py q_lib.py long-session.py memsample.sh; do place "$OLD/tools/$f" "$HX/dt/tools/$f" 0555; done
|
||||
for f in run-e2e.sh sample_env.sh e2e_client.py status_writer.sh long_session.py cupti_trigger.sh; do
|
||||
place "$OLD/scripts/e2e/$f" "$HX/dt/scripts/e2e/$f" 0555
|
||||
done
|
||||
for kind in main cand; do
|
||||
dir=$([ $kind = main ] && echo "$BASE" || echo "$CAND"); rt=$([ $kind = main ] && echo "$BASE_RT" || echo "$CAND_RT")
|
||||
install_tools() { # the shared helpers and scripts, installed once
|
||||
mkdir -p "$HX/tools" "$HX/dt/tools" "$HX/dt/scripts/e2e"
|
||||
for f in draftround-id.sh draftround-ab.sh draftround-idcmp.py; do place "$SRC/decode/$f" "$HX/tools/$f" 0555; done
|
||||
place "$DRO/tools/ts-wrap.sh" "$HX/tools/ts-wrap.sh" 0555
|
||||
for f in q_pair.py q_tail_gate.py q_lib.py long-session.py memsample.sh; do place "$OLD/tools/$f" "$HX/dt/tools/$f" 0555; done
|
||||
for f in run-e2e.sh sample_env.sh e2e_client.py status_writer.sh long_session.py cupti_trigger.sh; do
|
||||
place "$OLD/scripts/e2e/$f" "$HX/dt/scripts/e2e/$f" 0555
|
||||
done
|
||||
}
|
||||
|
||||
install_binaries() { # $1 = main or cand
|
||||
local kind=$1 dir rt x
|
||||
dir=$([ "$kind" = main ] && echo "$BASE" || echo "$CAND"); rt=$([ "$kind" = main ] && echo "$BASE_RT" || echo "$CAND_RT")
|
||||
for x in leleka-inference leleka-daemon leleka-cli strata-next; do place "$dir/$x" "$HX/dt/bin-$kind/$x" 0555; done
|
||||
place "$rt" "$HX/dt/rt-$kind" 0555
|
||||
done
|
||||
}
|
||||
|
||||
# ONLY_CAND=1 replaces the candidate binaries only (the reference and the helpers stay byte for byte, so a running job is not disturbed)
|
||||
if [[ "${ONLY_CAND:-0}" == 1 ]]; then
|
||||
chmod u+w "$HX/dt" "$HX/dt/bin-cand" 2>/dev/null || true
|
||||
chmod u+w "$HX/dt"/bin-cand/* "$HX/dt/rt-cand" 2>/dev/null || true
|
||||
install_binaries cand
|
||||
else
|
||||
chmod -R u+w "$HX" 2>/dev/null || true
|
||||
install_tools
|
||||
install_binaries main
|
||||
install_binaries cand
|
||||
fi
|
||||
{
|
||||
find "$HX/tools" "$HX/dt" -type f ! -name '*.pyc' | sort | xargs sha256sum
|
||||
sha256sum /data/leleka-e2e/decode/assets/expert-profile-upstream.bin /data/leleka-e2e/decode/corpus/MANIFEST.txt
|
||||
|
||||
Reference in New Issue
Block a user