-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_enterprise.sh
More file actions
executable file
·56 lines (43 loc) · 2.21 KB
/
run_enterprise.sh
File metadata and controls
executable file
·56 lines (43 loc) · 2.21 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# run_enterprise.sh — Run enterprise cost-center benchmarks
# Usage: bash run_enterprise.sh (from project root)
# Topology: star only (hrm may still be building; add it later)
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] Starting enterprise benchmark suite..."
# ---------------------------------------------------------------------------
# 1. Wait for benchmark_v2/__init__.py to be importable (retry 5x, 10s sleep)
# ---------------------------------------------------------------------------
MAX_RETRIES=5
RETRY_DELAY=10
ATTEMPT=0
until python3 -c "import benchmark_v2" 2>/dev/null; do
ATTEMPT=$((ATTEMPT + 1))
if [ "$ATTEMPT" -ge "$MAX_RETRIES" ]; then
echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] ERROR: benchmark_v2 not importable after ${MAX_RETRIES} attempts. Aborting."
exit 1
fi
echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] benchmark_v2 not importable yet (attempt ${ATTEMPT}/${MAX_RETRIES}). Retrying in ${RETRY_DELAY}s..."
sleep "$RETRY_DELAY"
done
echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] benchmark_v2 is importable. Proceeding..."
# ---------------------------------------------------------------------------
# 2. Create output directory
# ---------------------------------------------------------------------------
OUTPUT_DIR="benchmark_v2/results/enterprise"
mkdir -p "$OUTPUT_DIR"
# ---------------------------------------------------------------------------
# 3. Run the enterprise benchmark suite
# run_suite.py lives inside benchmark_v2/ and adds parent to sys.path,
# so invoke it as a module from the project root.
# ---------------------------------------------------------------------------
python3 benchmark_v2/run_suite.py \
--tasks contract_review code_review_protocol support_triage_system \
--topologies star \
--iterations 3 \
--output "$OUTPUT_DIR"
# ---------------------------------------------------------------------------
# 4. Echo completion with timestamp
# ---------------------------------------------------------------------------
echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] Enterprise benchmark suite complete. Results in: $OUTPUT_DIR"