-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (65 loc) · 2.66 KB
/
Copy pathMakefile
File metadata and controls
80 lines (65 loc) · 2.66 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
# S3-Lite WAL engine (Lane A) — local workflow via podman.
MINIO_CONTAINER := s3lite-minio
MINIO_IMAGE := docker.io/minio/minio:latest
MINIO_ENDPOINT ?= http://127.0.0.1:9000
IMAGE ?= s3lite-wal-demo:latest
# Full ECR repo URI, e.g. 123456789012.dkr.ecr.us-east-1.amazonaws.com/s3lite-wal-demo
ECR_REPO ?=
.PHONY: build test minio-up minio-down e2e demo e2e-aws demo-aws \
image image-run image-push clean
## Compile and package (unit tests only)
build:
mvn -q package -DskipTests
## Unit tests — no MinIO required
test:
mvn test
## Start MinIO under podman (idempotent) and wait until it is healthy
minio-up:
@podman container exists $(MINIO_CONTAINER) 2>/dev/null \
&& podman start $(MINIO_CONTAINER) >/dev/null \
|| podman run -d --name $(MINIO_CONTAINER) \
-p 9000:9000 -p 9001:9001 \
$(MINIO_IMAGE) server /data --console-address ":9001" >/dev/null
@echo "waiting for MinIO at $(MINIO_ENDPOINT) ..."
@for i in $$(seq 1 30); do \
curl -sf $(MINIO_ENDPOINT)/minio/health/live >/dev/null && break; \
sleep 1; \
done
@curl -sf $(MINIO_ENDPOINT)/minio/health/live >/dev/null \
|| { echo "MinIO did not become healthy"; exit 1; }
@echo "MinIO ready (console: http://127.0.0.1:9001, minioadmin/minioadmin)"
## Stop and remove the MinIO container (objects are discarded)
minio-down:
-podman rm -f $(MINIO_CONTAINER) >/dev/null 2>&1
@echo "MinIO removed"
## Full end-to-end: unit tests + integration tests against real MinIO
e2e: minio-up
MINIO_ENDPOINT=$(MINIO_ENDPOINT) mvn verify
## The cost-story demo: batched produce, hot-tail consume, coalesced scan
demo: minio-up
MINIO_ENDPOINT=$(MINIO_ENDPOINT) mvn -q compile exec:java
## Same, against real AWS S3. Needs AWS credentials (env/profile/role),
## AWS_REGION, and S3_BUCKET set to a bucket name you own.
e2e-aws:
S3_MODE=aws mvn verify
demo-aws:
S3_MODE=aws mvn -q compile exec:java
## Build the demo container image (multi-stage; no local Maven needed)
image:
podman build -t $(IMAGE) .
## Smoke-test the image locally against MinIO. host.containers.internal is
## how a podman container reaches ports published on the Mac. Scaled down so
## it fits comfortably inside the podman VM's memory.
image-run: minio-up
podman run --rm \
-e MINIO_ENDPOINT=http://host.containers.internal:9000 \
-e DEMO_MESSAGES=100000 \
$(IMAGE)
## Push to ECR. First: aws ecr get-login-password --region <region> \
## | podman login --username AWS --password-stdin <acct>.dkr.ecr.<region>.amazonaws.com
image-push:
@test -n "$(ECR_REPO)" || { echo "set ECR_REPO=<acct>.dkr.ecr.<region>.amazonaws.com/<repo>"; exit 1; }
podman tag $(IMAGE) $(ECR_REPO):latest
podman push $(ECR_REPO):latest
clean:
mvn -q clean