-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (69 loc) · 2.96 KB
/
Copy pathMakefile
File metadata and controls
87 lines (69 loc) · 2.96 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
.PHONY: build build-docker up down reset demo logs clean test tmux node1 status help
# ─── Local build ────────────────────────────────────────────────────────────
## build: Compile all binaries locally (requires Go 1.26+)
build:
go build -o rainstorm .
go build -o rainstorm-cli cmd/cli/main.go
@for op in grep count transform identity echo output; do \
cd ops/$$op && go build -o $$op . && cd ../..; \
done
@echo "Build complete: rainstorm, rainstorm-cli, and all operators"
## clean: Remove compiled binaries
clean:
rm -f rainstorm rainstorm-cli
@for op in grep count transform identity echo output; do \
rm -f ops/$$op/$$op; \
done
@echo "Cleaned"
# ─── Docker cluster ──────────────────────────────────────────────────────────
## build-docker: Build the Docker image
build-docker:
docker compose build
## up: Start the 10-node cluster (detached)
up:
docker compose up -d
@echo ""
@echo "Cluster started. Wait ~5 seconds for SWIM membership to converge."
@echo " View logs: make logs"
@echo " Run demo: make demo"
@echo " Attach node1: docker attach node1"
@echo " Stop cluster: make down"
## down: Stop and remove all cluster containers (HyDFS volumes are kept)
down:
docker compose down
## reset: Stop the cluster and wipe HyDFS state, then start fresh
## (exactly-once state persists in volumes; reset before re-running a demo)
reset:
docker compose down -v
docker compose up -d
@echo ""
@echo "Cluster reset with clean HyDFS state. Wait ~5 seconds for membership to converge."
## logs: Tail logs from all nodes
logs:
docker compose logs -f
## restart: Rebuild image and restart cluster
restart: down build-docker up
# ─── Demo & testing ──────────────────────────────────────────────────────────
## demo: Run the end-to-end demo pipeline (filter + count)
demo:
@./scripts/local/run_demo.sh
## test: Run smoke test — verify cluster is up and all 10 nodes joined
test:
@echo "Checking cluster membership (via node1 client port)..."
@docker exec node1 sh -c 'echo "list_mem" | nc -w 3 localhost 8003'
@echo ""
@echo "Checking container status:"
@docker compose ps
# ─── Utilities ───────────────────────────────────────────────────────────────
## tmux: Open tmux session (node1 CLI + logs + shell)
tmux:
@./scripts/local/tmux_cluster.sh
## node1: Attach to node1's interactive CLI
node1:
docker attach node1
## status: Show running containers and their ports
status:
docker compose ps
## help: Show this help
help:
@grep -E '^## ' Makefile | sed 's/^## / /'