Add pinned borrowed-eight-hour campaign bootstrap
Browse files- START_BORROWED_8H.sh +46 -0
START_BORROWED_8H.sh
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
SIMCT_BASE=/workspace/storage-shared/nlp/tungks
|
| 4 |
+
SIMCT_HOST=tungdd11-sparse-vllm-core-0-0
|
| 5 |
+
[[ "$(hostname)" == "$SIMCT_HOST" ]] || { echo 'WRONG_HOST: run only on the newly borrowed node'; exit 2; }
|
| 6 |
+
SIMCT_POINTER="$SIMCT_BASE/borrow8-$SIMCT_HOST.launch"
|
| 7 |
+
if [[ -e "$SIMCT_POINTER" ]]; then
|
| 8 |
+
echo 'ALLOCATION_ALREADY_RECORDED: inspect/recover this allocation; do not reset its clock'
|
| 9 |
+
cat "$SIMCT_POINTER"
|
| 10 |
+
exit 2
|
| 11 |
+
fi
|
| 12 |
+
SIMCT_STARTED="${SIMCT_BORROW_STARTED:-$(date +%s)}"
|
| 13 |
+
[[ "$SIMCT_STARTED" =~ ^[0-9]+$ ]] || { echo 'START must be Unix integer seconds'; exit 2; }
|
| 14 |
+
SIMCT_TASK="$(mktemp -d "$SIMCT_BASE/borrow8-XXXXXXXX")"
|
| 15 |
+
(set -o noclobber; printf '%s\n%s\n' "$SIMCT_TASK" "$SIMCT_STARTED" > "$SIMCT_POINTER")
|
| 16 |
+
printf 'ALLOCATION_ROOT=%s\nSTARTED=%s\n' "$SIMCT_TASK" "$SIMCT_STARTED"
|
| 17 |
+
test -x /usr/bin/python3.12 || { echo 'MISSING_RUNTIME: /usr/bin/python3.12; keep the recorded allocation clock'; exit 2; }
|
| 18 |
+
test -x /opt/venvs/simct-b200/bin/python || { echo 'MISSING_RUNTIME: /opt/venvs/simct-b200/bin/python; keep the recorded allocation clock'; exit 2; }
|
| 19 |
+
SIMCT_REV=d849970059510104e763209685b80645af5f88d9
|
| 20 |
+
SIMCT_URL="https://huggingface.co/codemaivanngu/simct/resolve/$SIMCT_REV"
|
| 21 |
+
for SIMCT_FILE in simct-b200-portable.bundle job-manager-source.tar; do
|
| 22 |
+
curl --fail --location --silent --show-error --retry 3 --connect-timeout 20 \
|
| 23 |
+
--proxy http://10.30.154.118:80 --noproxy "" \
|
| 24 |
+
"$SIMCT_URL/$SIMCT_FILE" -o "$SIMCT_TASK/$SIMCT_FILE"
|
| 25 |
+
done
|
| 26 |
+
(
|
| 27 |
+
cd "$SIMCT_TASK"
|
| 28 |
+
printf '%s %s\n' \
|
| 29 |
+
885f2fb7d994720f2a06e1a151493bb2b8c3ff23c8aaff1002202b02102df6a3 simct-b200-portable.bundle \
|
| 30 |
+
cdbda29a2d35fef8c3315a81ba4bf6d1cb7402b762cf8609379d0e60773c4914 job-manager-source.tar \
|
| 31 |
+
| sha256sum --check -
|
| 32 |
+
)
|
| 33 |
+
git clone --branch vdt/ops/b200-portable "$SIMCT_TASK/simct-b200-portable.bundle" "$SIMCT_TASK/source"
|
| 34 |
+
[[ "$(git -C "$SIMCT_TASK/source" rev-parse HEAD)" == 6b9442ad463dc3781436c7cc94bb4e49d49c81d8 ]] || { echo 'SOURCE_MISMATCH'; exit 2; }
|
| 35 |
+
/usr/bin/python3.12 - "$SIMCT_TASK" <<'PY'
|
| 36 |
+
import sys,tarfile
|
| 37 |
+
from pathlib import Path
|
| 38 |
+
root=Path(sys.argv[1])
|
| 39 |
+
with tarfile.open(root/'job-manager-source.tar') as archive:
|
| 40 |
+
for member in archive.getmembers():
|
| 41 |
+
if member.name!='job-manager' and not member.name.startswith('job-manager/'):
|
| 42 |
+
raise ValueError('Unexpected archive member')
|
| 43 |
+
archive.extractall(root,filter='data')
|
| 44 |
+
PY
|
| 45 |
+
bash "$SIMCT_TASK/source/experiments/runai/start_borrowed_campaign.sh" \
|
| 46 |
+
"$SIMCT_TASK/work" "$SIMCT_TASK/job-manager" "$SIMCT_STARTED" "$SIMCT_HOST"
|