File size: 1,612 Bytes
2955ecc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #!/usr/bin/env bash
# Assemble the deployable study bundle: trace-study/ plus the passive
# collector from collector/, into dist/trace-study-<date>.tar.gz.
#
# scripts/make_study_tar.sh small tar; nodes pip-install torch
# scripts/make_study_tar.sh <wheeldir> offline tar with bundled wheels
# (fill <wheeldir> with: pip download torch --dest <wheeldir> \
# --platform manylinux_2_28_x86_64 --python-version 3.14 \
# --implementation cp --abi cp314 --only-binary=:all:
# matching the nodes' python3 --version and uname -m)
set -euo pipefail
REPO="$(cd "$(dirname "$0")/.." && pwd)"
STAGE="$(mktemp -d)/trace-study"
mkdir -p "$STAGE/collector" "$REPO/dist"
cp "$REPO"/trace-study/README.txt \
"$REPO"/trace-study/setup.sh \
"$REPO"/trace-study/preflight.sh \
"$REPO"/trace-study/run_study.sh \
"$REPO"/trace-study/nodes.conf.example \
"$REPO"/trace-study/orchestrator.py \
"$REPO"/trace-study/workloads.py \
"$REPO"/trace-study/schedule_3node.json \
"$REPO"/trace-study/schedule_5node.json \
"$REPO"/trace-study/schedule_1node_4gpu.json \
"$REPO"/trace-study/schedule_test.json \
"$STAGE/"
cp "$REPO"/collector/collect.py "$REPO"/collector/trace.sh "$STAGE/collector/"
chmod +x "$STAGE"/*.sh "$STAGE"/collector/trace.sh
SUFFIX=""
if [[ -n "${1:-}" ]]; then
mkdir -p "$STAGE/wheels"
cp "$1"/*.whl "$STAGE/wheels/"
SUFFIX="-offline"
fi
TAR="$REPO/dist/trace-study-$(date -u +%Y%m%d)$SUFFIX.tar.gz"
tar -czf "$TAR" -C "$(dirname "$STAGE")" trace-study
rm -rf "$(dirname "$STAGE")"
echo "built: $TAR"
tar -tzf "$TAR" | sed 's/^/ /'
|