Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
137 lines (120 loc) · 4.23 KB
/
Copy pathMakefile
File metadata and controls
137 lines (120 loc) · 4.23 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
.PHONY: help build up down logs test lint clean restart status \
monitoring-up gateway-up full-up test-coverage test-integration showcase eval
help:
@echo ""
@echo " plainpatch - Development Commands"
@echo " ────────────────────────────────────────"
@echo ""
@echo " Core:"
@echo " make build Build Docker images"
@echo " make up Start core services"
@echo " make down Stop all services"
@echo " make restart Restart all services"
@echo " make logs Follow service logs"
@echo " make status Show service status"
@echo ""
@echo " Profiles:"
@echo " make monitoring-up Start with Prometheus + Grafana"
@echo " make gateway-up Start with Nginx API gateway"
@echo " make full-up Start all services + monitoring + gateway"
@echo ""
@echo " Quality:"
@echo " make test Run all unit tests"
@echo " make test-coverage Run tests with coverage report"
@echo " make test-integration Run integration test suite"
@echo " make eval Score the bot on labeled requests against a real Ollama"
@echo " make lint Run code linting (ruff)"
@echo " make showcase Run feature showcase"
@echo ""
@echo " Cleanup:"
@echo " make clean Remove containers, images, and caches"
@echo ""
build:
docker compose build
up:
docker compose up -d
@echo "Services starting..."
@sleep 5
@$(MAKE) status
down:
docker compose --profile monitoring --profile gateway down
restart:
docker compose restart
logs:
docker compose logs -f
status:
@docker compose ps --format "table {{.Name}}\t{{.Status}}\t{{.Ports}}"
monitoring-up:
docker compose --profile monitoring up -d
@echo ""
@echo " Prometheus: http://localhost:9090"
@echo " Grafana: http://localhost:3000 (admin/admin)"
@echo ""
gateway-up:
docker compose --profile gateway up -d
@echo ""
@echo " API Gateway: http://localhost:80"
@echo ""
full-up:
docker compose --profile monitoring --profile gateway up -d
@echo ""
@echo " Services: http://localhost:7000"
@echo " API Gateway: http://localhost:80"
@echo " Prometheus: http://localhost:9090"
@echo " Grafana: http://localhost:3000 (admin/admin)"
@echo ""
test:
@echo "Running schema-server tests..."
@cd schema-server && python3 -m pytest tests/ -v
@echo ""
@echo "Running values-server tests..."
@cd values-server && python3 -m pytest tests/ -v
@echo ""
@echo "Running bot-server tests..."
@cd bot-server && python3 -m pytest tests/ -v
@echo ""
@echo "Running cli tests..."
@cd cli && python3 -m pytest tests/ -v
@echo ""
@echo "All tests passed!"
test-coverage:
@echo "Running tests with coverage..."
@cd schema-server && python3 -m pytest tests/ -v --cov=. --cov-report=term-missing --junitxml=test-results.xml
@echo ""
@cd values-server && python3 -m pytest tests/ -v --cov=. --cov-report=term-missing --junitxml=test-results.xml
@echo ""
@cd bot-server && python3 -m pytest tests/ -v --cov=. --cov-report=term-missing --junitxml=test-results.xml
@echo ""
@cd cli && python3 -m pytest tests/ -v --cov=. --cov-report=term-missing --junitxml=test-results.xml
test-integration:
@bash test_integration.sh
eval:
@python3 evals/run.py --set all
showcase:
@bash showcase.sh
lint:
@echo "Linting schema-server..."
@ruff check schema-server/
@echo ""
@echo "Linting values-server..."
@ruff check values-server/
@echo ""
@echo "Linting bot-server..."
@ruff check bot-server/
@echo ""
@echo "Linting cli..."
@ruff check cli/
@echo "Linting evals..."
@ruff check evals/
@echo ""
@echo "All lint checks passed!"
clean:
docker compose --profile monitoring --profile gateway down -v --rmi local
@find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name ".venv" -exec rm -rf {} + 2>/dev/null || true
@find . -name ".coverage" -delete 2>/dev/null || true
@find . -name "test-results.xml" -delete 2>/dev/null || true
@find . -name "coverage.xml" -delete 2>/dev/null || true
@echo "Cleanup complete"