-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
167 lines (135 loc) · 6.84 KB
/
Makefile
File metadata and controls
167 lines (135 loc) · 6.84 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# ═══════════════════════════════════════════════════════════════════════
# Makefile — Autonomous Multi-Agent AI Organization
# Cross-platform shortcuts for common operations
# Usage: make <target>
# ═══════════════════════════════════════════════════════════════════════
.PHONY: help start stop restart logs test build clean status shell demo
# Default target
help:
@echo ""
@echo " 🏢 Autonomous Multi-Agent AI Organization"
@echo " ══════════════════════════════════════════"
@echo ""
@echo " make start Start all services (detached)"
@echo " make stop Stop all services"
@echo " make restart Restart all services"
@echo " make logs Tail logs (all services)"
@echo " make status Show running containers + health"
@echo ""
@echo " make test Run unit tests"
@echo " make lint Run ruff + black check"
@echo " make security Run bandit security scan"
@echo ""
@echo " make build Rebuild all Docker images"
@echo " make clean Remove containers + volumes (fresh start)"
@echo " make shell Open shell in orchestrator container"
@echo " make demo Run the AI demo pipeline"
@echo ""
@echo " make setup First-time setup (copy .env, build images)"
@echo " make grafana Open Grafana dashboard in browser"
@echo " make kafka-ui Open Kafka UI in browser"
@echo " make jaeger Open Jaeger tracing UI in browser"
@echo ""
# ── Setup ────────────────────────────────────────────────────────────
setup:
@echo "📋 Setting up AI Organization..."
@test -f .env || (cp .env.example .env && echo "✅ .env created from .env.example — please fill in your API keys")
@mkdir -p output monitoring/grafana/provisioning/datasources monitoring/grafana/dashboards
@docker compose build
@echo "✅ Setup complete. Run: make start"
# ── Core Operations ──────────────────────────────────────────────────
start:
@echo "🚀 Starting AI Organization..."
@docker compose up -d
@echo ""
@echo " ✅ Dashboard: http://localhost:3000"
@echo " ✅ API: http://localhost:8080"
@echo " ✅ Kafka UI: http://localhost:8888"
@echo " ✅ Grafana: http://localhost:3002 (admin / ai-org-admin)"
@echo " ✅ Prometheus: http://localhost:9090"
@echo " ✅ Jaeger: http://localhost:16686"
@echo ""
stop:
@echo "🛑 Stopping AI Organization..."
@docker compose down
@echo "✅ Stopped."
restart:
@docker compose down
@docker compose up -d
logs:
@docker compose logs -f --tail=100
logs-orchestrator:
@docker compose logs -f orchestrator --tail=100
logs-agents:
@docker compose logs -f ceo-agent cto-agent engineer-backend engineer-frontend qa-agent devops-agent finance-agent --tail=100
logs-services:
@docker compose logs -f mcp-server proxy metrics-svc tenant-svc health-monitor ws-hub --tail=100
status:
@echo "📊 Service Status:"
@docker compose ps
# ── Development ──────────────────────────────────────────────────────
build:
@echo "🐳 Building Docker images..."
@docker compose build --parallel
@echo "✅ Build complete."
build-no-cache:
@docker compose build --no-cache --parallel
shell:
@docker compose exec orchestrator bash
shell-agent:
@docker compose exec ceo-agent bash
# ── Testing ──────────────────────────────────────────────────────────
test:
@echo "🧪 Running tests..."
@docker compose exec orchestrator python -m pytest tests/ -v --tb=short 2>/dev/null || \
(source venv/bin/activate 2>/dev/null || true; python -m pytest tests/ -v --tb=short)
test-local:
@source venv/bin/activate && python -m pytest tests/unit/ -v --tb=short
test-coverage:
@source venv/bin/activate && python -m pytest tests/ --cov=. --cov-report=html
@echo "📊 Coverage report: htmlcov/index.html"
lint:
@echo "🔍 Linting..."
@source venv/bin/activate && ruff check . && black --check .
@echo "✅ Lint passed."
lint-fix:
@source venv/bin/activate && ruff check . --fix && black .
security:
@echo "🔒 Security scan..."
@source venv/bin/activate && bandit -r agents/ orchestrator/ api/ moe/ messaging/ tools/ -ll
@echo "✅ Security scan complete."
# ── Demo ─────────────────────────────────────────────────────────────
demo:
@echo "🎬 Running AI Organization demo pipeline..."
@source venv/bin/activate && python run_demo.py
demo-docker:
@docker compose exec orchestrator python run_demo.py
# ── Data Management ───────────────────────────────────────────────────
clean:
@echo "⚠️ This will delete ALL data (volumes). Press Ctrl+C to cancel..."
@sleep 3
@docker compose down -v
@echo "✅ Cleaned. Fresh start."
clean-output:
@rm -rf output/*
@echo "✅ Output directory cleaned."
# ── UI Shortcuts (open browser) ────────────────────────────────────────
grafana:
@open http://localhost:3002 2>/dev/null || xdg-open http://localhost:3002 2>/dev/null || echo "Open: http://localhost:3002"
kafka-ui:
@open http://localhost:8888 2>/dev/null || xdg-open http://localhost:8888 2>/dev/null || echo "Open: http://localhost:8888"
jaeger:
@open http://localhost:16686 2>/dev/null || xdg-open http://localhost:16686 2>/dev/null || echo "Open: http://localhost:16686"
dashboard:
@open http://localhost:3000 2>/dev/null || xdg-open http://localhost:3000 2>/dev/null || echo "Open: http://localhost:3000"
# ── Git Workflow ─────────────────────────────────────────────────────
branch-feature:
@read -p "Feature name (e.g. nextjs-dashboard): " name; \
git checkout master && git checkout -b feature/$$name
branch-bugfix:
@read -p "Bug name: " name; \
git checkout master && git checkout -b bugfix/$$name
branch-status:
@echo "Current branch: $$(git branch --show-current)"
@echo "All branches:"
@git branch -a