-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-first100.sh
More file actions
executable file
·103 lines (81 loc) · 2.57 KB
/
start-first100.sh
File metadata and controls
executable file
·103 lines (81 loc) · 2.57 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
# =============================================================================
# FIRST-100 REGIME — Initialize and Run
# =============================================================================
set -e
echo "=============================================="
echo " FIRST-100 REGIME STARTUP"
echo "=============================================="
echo ""
# Check Docker
if ! command -v docker &> /dev/null; then
echo "ERROR: Docker not found"
exit 1
fi
if ! command -v docker-compose &> /dev/null && ! docker compose version &> /dev/null; then
echo "ERROR: Docker Compose not found"
exit 1
fi
# Use docker compose v2 or docker-compose v1
COMPOSE_CMD="docker compose"
if ! docker compose version &> /dev/null 2>&1; then
COMPOSE_CMD="docker-compose"
fi
echo "1. Building containers..."
$COMPOSE_CMD -f docker-compose.first100.yml build
echo ""
echo "2. Starting infrastructure (Redis, MongoDB)..."
$COMPOSE_CMD -f docker-compose.first100.yml up -d redis mongo
echo " Waiting for databases..."
sleep 5
echo ""
echo "3. Starting intelligence layer (LAM, Governor)..."
$COMPOSE_CMD -f docker-compose.first100.yml up -d lam-inference governor drift-monitor
echo " Waiting for services..."
sleep 3
echo ""
echo "4. Starting router..."
$COMPOSE_CMD -f docker-compose.first100.yml up -d router
echo " Waiting for router..."
sleep 2
echo ""
echo "5. Starting page variants..."
$COMPOSE_CMD -f docker-compose.first100.yml up -d page-a page-b
echo ""
echo "6. Starting monitoring..."
$COMPOSE_CMD -f docker-compose.first100.yml up -d prometheus grafana
echo ""
echo "7. Initializing Thompson Sampling priors..."
sleep 2
docker exec redis-state redis-cli <<EOF
# Arm: Baseline (Control)
HSET bandit:arms:site_001:baseline alpha 1 beta 1 samples 0
# Arm: Challenger (LLM-Generated)
HSET bandit:arms:site_001:challenger alpha 1 beta 1 samples 0
# Initialize LoA to Shadow
SET loa:level:default 1
# Initialize drift
SET drift:smoothed:global 0.0
# Circuit breaker
SET circuit:status CLOSED
ECHO "Thompson priors initialized"
EOF
echo ""
echo "=============================================="
echo " FIRST-100 REGIME ACTIVE"
echo "=============================================="
echo ""
echo "Endpoints:"
echo " Router: http://localhost:8024"
echo " Grafana: http://localhost:3000 (admin/admin)"
echo " Prometheus: http://localhost:9090"
echo ""
echo "Test routing:"
echo " curl -v http://localhost:8024/route/site_001"
echo ""
echo "View stats:"
echo " curl http://localhost:8024/stats/site_001"
echo ""
echo "Monitor with:"
echo " docker logs -f router-api"
echo ""