Files
s3/seaweedfs-rdma-sidecar/Makefile
zooqueen dd74d3e6d6 Replace AGPL MinIO fork with Apache-2.0 SeaweedFS fork; rebrand CLI weed->s3
hanzoai/s3 was an AGPL-3.0 MinIO fork whose network-copyleft blocks embedding
and reselling as a managed service. Replace it wholesale with a fork of
SeaweedFS (github.com/seaweedfs/seaweedfs, Apache-2.0, Go) which ships a
built-in S3 gateway + Filer.

- License: AGPL-3.0 -> Apache-2.0 (upstream LICENSE kept verbatim, incl.
  "Copyright 2025 Chris Lu"); NOTICE added crediting SeaweedFS. No AGPL/BUSL/
  SSPL/GPL or enterprise ("ee") files remain.
- Module: go.mod path set to github.com/hanzoai/s3 with a self-replace
  (replace github.com/seaweedfs/seaweedfs => ./) so the ~1800 internal Go files
  keep their upstream import paths with zero churn. Internal identifiers and
  import paths are intentionally NOT renamed.
- CLI rebrand: the binary is built as `s3` (was `weed`); root usage, per-command
  help/usage/flag strings, shell autocomplete program name, and the product name
  in CLI output now read "Hanzo S3" / `s3`. Users never see `weed`.
  (e.g. `s3 server`, `s3 filer`, `s3 master`, `s3 volume`, `s3 s3`, `s3 mount`.)
- Build: `make` (or `go build -o s3 ./weed`) builds the `s3` binary green;
  `cmd/weed-db` and `cmd/weed-sql` also build; `go vet ./weed/command/` clean.
- README/LLM.md rewritten for Hanzo S3; AGENTS.md/CLAUDE.md symlinks preserved.
- Dropped a 33MB prebuilt Mach-O `stress` binary upstream had committed; `.gitignore`
  updated to ignore the `s3` build output.
2026-06-18 23:41:25 -07:00

206 lines
6.6 KiB
Makefile

# 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/"