-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
134 lines (111 loc) · 6.81 KB
/
Copy pathjustfile
File metadata and controls
134 lines (111 loc) · 6.81 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
# AuditFlow — Root justfile
#
# Prerequisites: just, docker, docker compose, curl, jq (optional, for pretty output)
#
# Quick start:
# just up → start stack (default)
# just up otel → start stack + observability
# just test → run all tests
# just down → stop everything
# just clean → stop + remove volumes (full reset)
# ─────────────────────────────────────────────────────────────────────────────
# List available recipes
# ─────────────────────────────────────────────────────────────────────────────
default:
@just --list
# ─────────────────────────────────────────────────────────────────────────────
# Private helpers
# ─────────────────────────────────────────────────────────────────────────────
# Print all service URLs
_urls:
@echo ""
@echo " Backend API: http://localhost:8080"
@echo " Backend Health: http://localhost:8080/actuator/health"
@echo " Backend Swagger UI: http://localhost:8080/swagger-ui.html"
@echo " Transformer API: http://localhost:8081/docs"
@echo " Sink API: http://localhost:8082/docs"
@echo " RabbitMQ UI: http://localhost:15673 (guest/guest)"
@echo " OTel Collector: localhost:4317 (gRPC) / localhost:4318 (HTTP)"
@echo " Grafana: http://localhost:3000 (admin/admin)"
@echo " Prometheus: http://localhost:9090"
@echo " Tempo: http://localhost:3200"
@echo " Loki: http://localhost:3100"
# Stop all known stacks to free ports
_stop-all:
@docker compose -f docker-compose.yml -f docker-compose-observability.yml --profile full down 2>/dev/null || true
# ─────────────────────────────────────────────────────────────────────────────
# Stack
# ─────────────────────────────────────────────────────────────────────────────
# Build JAR, images, start stack.
# Enable observability with: otel, yes, true, or 1
up otel="": build-be
@just _stop-all
@docker compose \
-f docker-compose.yml \
{{ if otel == "otel" {
"-f docker-compose-observability.yml"
} else if otel == "yes" {
"-f docker-compose-observability.yml"
} else if otel == "true" {
"-f docker-compose-observability.yml"
} else if otel == "1" {
"-f docker-compose-observability.yml"
} else {
""
} }} \
up --build -d
@just _urls
# Stop and remove all containers (keeps images)
down:
@just _stop-all
# Stop and remove containers AND volumes (full clean)
clean:
@docker compose -f docker-compose.yml -f docker-compose-observability.yml --profile full down -v --remove-orphans 2>/dev/null || true
# Show current container status
status:
docker compose ps
# Tail logs from all services (Ctrl+C to stop)
logs:
docker compose logs -f
# Tail logs from a specific service: just log backend | transformer | sink | rabbitmq
log service:
docker compose logs -f {{service}}
# ─────────────────────────────────────────────────────────────────────────────
# Build
# ─────────────────────────────────────────────────────────────────────────────
# Build and install the API client (required before building the backend Docker image)
build-api:
mvn -B clean install -DskipTests --file auditflow-api/pom.xml
# Build the Spring Boot JAR (required before building the backend Docker image)
build-be: build-api
mvn -B clean package -DskipTests --file auditflow-be/pom.xml
# ─────────────────────────────────────────────────────────────────────────────
# Testing
# ─────────────────────────────────────────────────────────────────────────────
# Run all tests across all three services
test: test-api test-be test-transformer test-sink
# Run Java backend unit tests
test-api:
mvn -B verify --file auditflow-api/pom.xml
# Run Java backend unit tests
test-be:
mvn -B verify --file auditflow-be/pom.xml
# Run Python transformer tests
test-transformer:
python3 -m pip install -r auditflow-transformer/requirements-dev.txt -q --break-system-packages 2>/dev/null || python3 -m pip install -r auditflow-transformer/requirements-dev.txt -q
cd auditflow-transformer && python3 -m pytest -v --tb=short
# Run Python sink tests
test-sink:
python3 -m pip install -r auditflow-sink/requirements-dev.txt -q --break-system-packages 2>/dev/null || python3 -m pip install -r auditflow-sink/requirements-dev.txt -q
cd auditflow-sink && python3 -m pytest -v --tb=short
# ─────────────────────────────────────────────────────────────────────────────
# Example notebooks
# ─────────────────────────────────────────────────────────────────────────────
# Open the getting-started notebook (requires: pip install jupyter requests)
notebook-getting-started:
@echo "Prerequisites: pip install jupyter requests && just up"
jupyter lab examples/getting-started.ipynb
# Open the load-testing notebook (requires: pip install jupyter requests)
notebook-load-test:
@echo "Prerequisites: pip install jupyter requests && just up"
jupyter lab examples/load-tests.ipynb