-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (54 loc) · 2.07 KB
/
Copy pathMakefile
File metadata and controls
67 lines (54 loc) · 2.07 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
.PHONY: setup dev prod logs stop clean migrate seed test cameras assign-cameras seed-all superset
# Start infrastructure (Postgres + Redis) and run migrations + seed
setup:
docker compose up -d postgres redis
@echo "Waiting for services to be healthy..."
@sleep 5
cd /home/netcom/Desktop/SwarmGuard && PYTHONPATH=. alembic upgrade head
cd /home/netcom/Desktop/SwarmGuard && PYTHONPATH=. python scripts/seed_segments.py
@echo "Setup complete. Database migrated and seeded."
# Development mode with hot reload
dev:
docker compose up -d postgres redis
@sleep 3
cd /home/netcom/Desktop/SwarmGuard && PYTHONPATH=. uvicorn backend.api.main:app --host 0.0.0.0 --port 8000 --reload &
@echo "API running at http://localhost:8000"
# Production mode via Docker Compose
prod:
docker compose up -d --build
@echo "All services running. Dashboard at http://localhost:3000, API at http://localhost:8000"
# Tail logs from all services
logs:
docker compose logs -f --tail=100
# Stop all services
stop:
docker compose down
# Clean everything including volumes
clean:
docker compose down -v --remove-orphans
@echo "All services stopped and volumes removed."
# Run database migrations only
migrate:
PYTHONPATH=. alembic upgrade head
# Seed road segments only
seed:
PYTHONPATH=. python scripts/seed_segments.py
# Start USB camera streaming service on port 8100
cameras:
cd /home/netcom/Desktop/SwarmGuard && PYTHONPATH=. python scripts/start_cameras.py
# Assign cameras to road segments in the database
assign-cameras:
cd /home/netcom/Desktop/SwarmGuard && PYTHONPATH=. python scripts/assign_cameras.py
# Seed all data (segments, NCRB, disaster resources, census, Redis)
seed-all:
cd /home/netcom/Desktop/SwarmGuard && PYTHONPATH=. python scripts/seed_all.py
# Start Apache Superset for strategic analytics
superset:
docker compose up -d superset
@echo "Waiting for Superset to start..."
@sleep 15
cd /home/netcom/Desktop/SwarmGuard && PYTHONPATH=. python scripts/setup_superset.py
@echo "Superset running at http://localhost:8088"
# Run tests
test:
PYTHONPATH=. python -m pytest tests/ -v --tb=short