-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (61 loc) · 2.11 KB
/
Copy pathMakefile
File metadata and controls
76 lines (61 loc) · 2.11 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
.PHONY: help setup install dev run clean build up down logs restart clean-all
.DEFAULT_GOAL := help
BLUE := \033[0;34m
GREEN := \033[0;32m
YELLOW := \033[0;33m
RED := \033[0;31m
NC := \033[0m
VENV := .venv
UV := uv
help: ## Show this help
@echo "$(BLUE)Vectorless RAG with Hierarchical Document Trees$(NC)"
@echo ""
@echo "$(GREEN)Usage:$(NC)"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " $(YELLOW)%-15s$(NC) %s\n", $$1, $$2}'
setup: ## Initial setup (create .env, install deps)
@if [ ! -f .env ]; then \
echo "$(BLUE)Creating .env file...$(NC)"; \
cp .env.example .env; \
echo "$(GREEN)✓ .env created$(NC)"; \
echo "$(YELLOW)⚠ Edit .env and add your OPENAI_API_KEY$(NC)"; \
else \
echo "$(YELLOW).env already exists$(NC)"; \
fi
@if ! command -v uv >/dev/null 2>&1; then \
echo "$(BLUE)Installing uv...$(NC)"; \
curl -LsSf https://astral.sh/uv/install.sh | sh; \
else \
echo "$(GREEN)✓ uv is installed$(NC)"; \
fi
@echo "$(BLUE)Setting up virtual environment...$(NC)"
@$(UV) sync
@echo "$(GREEN)✓ Environment ready$(NC)"
install: ## Install dependencies
@$(UV) sync
@echo "$(GREEN)✓ Dependencies installed$(NC)"
dev: setup run ## Setup and run (one command to start!)
run: ## Run the vectorless RAG pipeline
@echo "$(BLUE)Running vectorless RAG...$(NC)"
@$(UV) run python main.py
build: ## Build Docker image
docker compose build
@echo "$(GREEN)✓ Built$(NC)"
up: ## Start container
docker compose up -d
@echo "$(GREEN)✓ Running$(NC)"
down: ## Stop container
docker compose down
@echo "$(GREEN)✓ Stopped$(NC)"
logs: ## View container logs
docker compose logs -f
restart: down up ## Restart container
clean: ## Remove venv, cache, and generated results
@echo "$(BLUE)Cleaning...$(NC)"
rm -rf $(VENV) results/ retriever.log
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
@$(UV) cache clean 2>/dev/null || true
@echo "$(GREEN)✓ Cleaned$(NC)"
clean-all: clean down ## Clean everything including Docker
docker compose down -v
@echo "$(GREEN)✓ Everything cleaned$(NC)"