-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (52 loc) · 2.48 KB
/
Copy pathMakefile
File metadata and controls
69 lines (52 loc) · 2.48 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
.PHONY: help install 01-tcp-echo 02-resp-parser 03-get-set 04-expiry 05-aof-persistence 06-rdb-snapshots 07-pubsub 08-replication 09-event-loop 10-capstone test clean
help: ## Show this help message
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install: ## Install dependencies using uv
@echo "Installing dependencies..."
@uv sync
run: 01-tcp-echo ## Run the first module — start here!
# =============================================================================
# Workshop Modules
# =============================================================================
01-tcp-echo: ## 01 TCP echo — blocking socket server that mirrors input
@echo "Running 01: TCP echo..."
@uv run python 01-tcp-echo/server.py
02-resp-parser: ## 02 RESP parser — the Redis wire format from scratch
@echo "Running 02: RESP parser..."
@uv run python 02-resp-parser/server.py
03-get-set: ## 03 GET/SET — in-memory key-value store with command dispatch
@echo "Running 03: GET/SET..."
@uv run python 03-get-set/server.py
04-expiry: ## 04 Expiry — EXPIRE, TTL, lazy deletion
@echo "Running 04: Expiry..."
@uv run python 04-expiry/server.py
05-aof-persistence: ## 05 AOF — append-only file persistence + replay
@echo "Running 05: AOF..."
@uv run python 05-aof-persistence/server.py
06-rdb-snapshots: ## 06 RDB — point-in-time snapshots
@echo "Running 06: RDB snapshots..."
@uv run python 06-rdb-snapshots/server.py
07-pubsub: ## 07 Pub/Sub — fan-out + subscriber registry
@echo "Running 07: Pub/Sub..."
@uv run python 07-pubsub/server.py
08-replication: ## 08 Replication — master/replica log shipping
@echo "Running 08: Replication..."
@uv run python 08-replication/server.py
09-event-loop: ## 09 Event loop — selectors-based non-blocking IO
@echo "Running 09: Event loop..."
@uv run python 09-event-loop/server.py
10-capstone: ## 10 Capstone — benchmark vs real Redis
@echo "Running 10: Capstone..."
@uv run python 10-capstone/bench.py
# =============================================================================
# Utilities
# =============================================================================
test: ## Run automated tests to verify all modules
@echo "Running workshop tests..."
@uv run python tests.py
clean: ## Clean up artifacts
@echo "Cleaning up..."
@rm -rf .venv
@find . -type d -name "__pycache__" -exec rm -rf {} +
@find . -name "*.aof" -delete
@find . -name "*.rdb" -delete