blob: 19aa90461680e4cf0790df7c3d8cfa005dfcdee2 (
plain)
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
# SeaweedFS RDMA Sidecar Makefile
.PHONY: help build test clean docker-build docker-test docker-clean integration-test
# Default target
help: ## Show this help message
@echo "SeaweedFS RDMA Sidecar - Available Commands:"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
@echo ""
@echo "Examples:"
@echo " make build # Build all components locally"
@echo " make docker-test # Run complete Docker integration tests"
@echo " make test # Run unit tests"
# Local Build Targets
build: build-go build-rust ## Build all components locally
build-go: ## Build Go components (sidecar, demo-server, test-rdma)
@echo "๐จ Building Go components..."
go build -o bin/sidecar ./cmd/sidecar
go build -o bin/demo-server ./cmd/demo-server
go build -o bin/test-rdma ./cmd/test-rdma
@echo "โ
Go build complete"
build-rust: ## Build Rust RDMA engine
@echo "๐ฆ Building Rust RDMA engine..."
cd rdma-engine && cargo build --release
@echo "โ
Rust build complete"
# Testing Targets
test: test-go test-rust ## Run all unit tests
test-go: ## Run Go tests
@echo "๐งช Running Go tests..."
go test ./...
@echo "โ
Go tests complete"
test-rust: ## Run Rust tests
@echo "๐งช Running Rust tests..."
cd rdma-engine && cargo test
@echo "โ
Rust tests complete"
integration-test: build ## Run local integration test
@echo "๐ Running local integration test..."
./scripts/demo-e2e.sh
@echo "โ
Local integration test complete"
# Docker Targets
docker-build: ## Build all Docker images
@echo "๐ณ Building Docker images..."
docker-compose build
@echo "โ
Docker images built"
docker-start: ## Start Docker services
@echo "๐ Starting Docker services..."
./tests/docker-test-helper.sh start
@echo "โ
Docker services started"
docker-test: ## Run Docker integration tests
@echo "๐งช Running Docker integration tests..."
./tests/docker-test-helper.sh test
@echo "โ
Docker integration tests complete"
docker-stop: ## Stop Docker services
@echo "๐ Stopping Docker services..."
./tests/docker-test-helper.sh stop
@echo "โ
Docker services stopped"
docker-clean: ## Clean Docker services and volumes
@echo "๐งน Cleaning Docker environment..."
./tests/docker-test-helper.sh clean
docker system prune -f
@echo "โ
Docker cleanup complete"
docker-logs: ## Show Docker logs
./tests/docker-test-helper.sh logs
docker-status: ## Show Docker service status
./tests/docker-test-helper.sh status
docker-shell: ## Open interactive shell in test container
./tests/docker-test-helper.sh shell
# RDMA Simulation Targets
rdma-sim-build: ## Build RDMA simulation environment
@echo "๐ Building RDMA simulation environment..."
docker-compose -f docker-compose.rdma-sim.yml build
@echo "โ
RDMA simulation images built"
rdma-sim-start: ## Start RDMA simulation environment
@echo "๐ Starting RDMA simulation environment..."
docker-compose -f docker-compose.rdma-sim.yml up -d
@echo "โ
RDMA simulation environment started"
rdma-sim-test: ## Run RDMA simulation tests
@echo "๐งช Running RDMA simulation tests..."
docker-compose -f docker-compose.rdma-sim.yml run --rm integration-tests-rdma
@echo "โ
RDMA simulation tests complete"
rdma-sim-stop: ## Stop RDMA simulation environment
@echo "๐ Stopping RDMA simulation environment..."
docker-compose -f docker-compose.rdma-sim.yml down
@echo "โ
RDMA simulation environment stopped"
rdma-sim-clean: ## Clean RDMA simulation environment
@echo "๐งน Cleaning RDMA simulation environment..."
docker-compose -f docker-compose.rdma-sim.yml down -v --remove-orphans
docker system prune -f
@echo "โ
RDMA simulation cleanup complete"
rdma-sim-status: ## Check RDMA simulation status
@echo "๐ RDMA simulation status:"
docker-compose -f docker-compose.rdma-sim.yml ps
@echo ""
@echo "๐ RDMA device status:"
docker-compose -f docker-compose.rdma-sim.yml exec rdma-simulation /opt/rdma-sim/test-rdma.sh || true
rdma-sim-shell: ## Open shell in RDMA simulation container
@echo "๐ Opening RDMA simulation shell..."
docker-compose -f docker-compose.rdma-sim.yml exec rdma-simulation /bin/bash
rdma-sim-logs: ## Show RDMA simulation logs
docker-compose -f docker-compose.rdma-sim.yml logs
rdma-sim-ucx: ## Show UCX information in simulation
@echo "๐ UCX information in simulation:"
docker-compose -f docker-compose.rdma-sim.yml exec rdma-simulation /opt/rdma-sim/ucx-info.sh
# Development Targets
dev-setup: ## Set up development environment
@echo "๐ ๏ธ Setting up development environment..."
go mod tidy
cd rdma-engine && cargo check
chmod +x scripts/*.sh tests/*.sh
@echo "โ
Development environment ready"
format: ## Format code
@echo "โจ Formatting code..."
go fmt ./...
cd rdma-engine && cargo fmt
@echo "โ
Code formatted"
lint: ## Run linters
@echo "๐ Running linters..."
go vet ./...
cd rdma-engine && cargo clippy -- -D warnings
@echo "โ
Linting complete"
# Cleanup Targets
clean: clean-go clean-rust ## Clean all build artifacts
clean-go: ## Clean Go build artifacts
@echo "๐งน Cleaning Go artifacts..."
rm -rf bin/
go clean -testcache
@echo "โ
Go artifacts cleaned"
clean-rust: ## Clean Rust build artifacts
@echo "๐งน Cleaning Rust artifacts..."
cd rdma-engine && cargo clean
@echo "โ
Rust artifacts cleaned"
# Full Workflow Targets
check: format lint test ## Format, lint, and test everything
ci: check integration-test docker-test ## Complete CI workflow
demo: build ## Run local demo
@echo "๐ฎ Starting local demo..."
./scripts/demo-e2e.sh
# Docker Development Workflow
docker-dev: docker-clean docker-build docker-test ## Complete Docker development cycle
# Quick targets
quick-test: build ## Quick local test
./bin/test-rdma --help
quick-docker: ## Quick Docker test
docker-compose up -d rdma-engine rdma-sidecar
sleep 5
curl -s http://localhost:8081/health | jq '.'
docker-compose down
# Help and Documentation
docs: ## Generate/update documentation
@echo "๐ Documentation ready:"
@echo " README.md - Main project documentation"
@echo " DOCKER-TESTING.md - Docker integration testing guide"
@echo " Use 'make help' for available commands"
# Environment Info
info: ## Show environment information
@echo "๐ Environment Information:"
@echo " Go Version: $$(go version)"
@echo " Rust Version: $$(cd rdma-engine && cargo --version)"
@echo " Docker Version: $$(docker --version)"
@echo " Docker Compose Version: $$(docker-compose --version)"
@echo ""
@echo "๐๏ธ Project Structure:"
@echo " Go Components: cmd/ pkg/"
@echo " Rust Engine: rdma-engine/"
@echo " Tests: tests/"
@echo " Scripts: scripts/"
|