-
Notifications
You must be signed in to change notification settings - Fork 213
Expand file tree
/
Copy pathrun_benchmark_docker.sh
More file actions
executable file
·70 lines (56 loc) · 1.54 KB
/
run_benchmark_docker.sh
File metadata and controls
executable file
·70 lines (56 loc) · 1.54 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
# Docker-based MRR Benchmark Runner
# Ensures consistent, reproducible benchmark execution
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Default values
MODEL=${1:-claude_4_opus}
SCENARIOS=${2:-5000}
SEED=${3:-42}
echo -e "${GREEN}MRR Benchmark Docker Runner${NC}"
echo "=============================="
echo "Model: $MODEL"
echo "Scenarios: $SCENARIOS"
echo "Seed: $SEED"
echo ""
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo -e "${RED}Error: Docker is not installed${NC}"
exit 1
fi
# Check if docker-compose is installed
if ! command -v docker-compose &> /dev/null; then
echo -e "${RED}Error: docker-compose is not installed${NC}"
exit 1
fi
# Create results directory
mkdir -p results
# Export environment variables
export BENCHMARK_MODEL=$MODEL
export BENCHMARK_SCENARIOS=$SCENARIOS
export BENCHMARK_SEED=$SEED
# Build Docker image
echo -e "${YELLOW}Building Docker image...${NC}"
docker-compose build
# Run benchmark
echo -e "${YELLOW}Running MRR benchmark...${NC}"
docker-compose up mrr-benchmark
# Run validation
echo -e "${YELLOW}Validating results...${NC}"
docker-compose up mrr-validator
# Analyze results
echo -e "${YELLOW}Analyzing results...${NC}"
docker-compose up mrr-analyzer
# Show results summary
echo -e "${GREEN}Benchmark complete!${NC}"
echo "Results saved in: ./results/"
# Optional: Clean up containers
read -p "Clean up Docker containers? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
docker-compose down
fi