-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
115 lines (88 loc) · 2.65 KB
/
Copy pathMakefile
File metadata and controls
115 lines (88 loc) · 2.65 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
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
.PHONY: help build run test clean docker-build docker-run docker-stop lint fmt check release install dev
# Default target
help:
@echo "FastEmbed Service - Available Commands"
@echo "======================================="
@echo ""
@echo "Development:"
@echo " make dev - Run in development mode with hot reload info"
@echo " make build - Build debug version"
@echo " make run - Run the service locally"
@echo " make test - Run tests"
@echo " make lint - Run clippy linter"
@echo " make fmt - Format code"
@echo " make check - Run all checks (fmt, lint, test)"
@echo ""
@echo "Production:"
@echo " make release - Build optimized release version"
@echo " make install - Install to system (requires sudo)"
@echo ""
@echo "Docker:"
@echo " make docker-build - Build Docker image"
@echo " make docker-run - Run with Docker Compose"
@echo " make docker-stop - Stop Docker containers"
@echo " make docker-logs - View Docker logs"
@echo " make docker-clean - Remove Docker images and volumes"
@echo ""
@echo "Maintenance:"
@echo " make clean - Remove build artifacts"
@echo " make clean-cache - Remove model cache"
# ============================================
# Development
# ============================================
dev:
RUST_LOG=debug cargo run
build:
cargo build
run:
cargo run --release
test:
cargo test
lint:
cargo clippy -- -D warnings
fmt:
cargo fmt
fmt-check:
cargo fmt -- --check
check: fmt-check lint test
@echo "All checks passed!"
# ============================================
# Production
# ============================================
release:
cargo build --release
@echo "Binary available at: target/release/embedding_service"
install: release
sudo cp target/release/embedding_service /usr/local/bin/
@echo "Installed to /usr/local/bin/embedding_service"
# ============================================
# Docker
# ============================================
docker-build:
docker build -t embedding_service:latest .
docker-run:
docker compose up -d
docker-stop:
docker compose down
docker-logs:
docker compose logs -f
docker-clean:
docker compose down -v --rmi local
docker-shell:
docker compose exec embedding_service /bin/sh
# ============================================
# Maintenance
# ============================================
clean:
cargo clean
clean-cache:
rm -rf .fastembed_cache
clean-all: clean clean-cache
# ============================================
# CI/CD Helpers
# ============================================
ci: check
@echo "CI checks completed successfully"
# Version info
version:
@cargo pkgid | cut -d# -f2