File size: 4,028 Bytes
ae122c6
3b9a6b5
186edf4
 
 
 
 
 
 
 
 
 
 
 
 
 
3b9a6b5
 
186edf4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3b9a6b5
 
186edf4
 
 
3b9a6b5
 
186edf4
 
 
 
 
3b9a6b5
 
186edf4
 
3b9a6b5
 
186edf4
 
3b9a6b5
 
186edf4
 
3b9a6b5
 
186edf4
 
 
3b9a6b5
 
186edf4
 
 
 
3b9a6b5
ae122c6
186edf4
ae122c6
 
f870b34
186edf4
f870b34
ae122c6
186edf4
ae122c6
 
186edf4
ae122c6
 
186edf4
ae122c6
3b9a6b5
186edf4
 
 
 
 
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
.PHONY: help venv install run test lint format clean setup-secrets check-creds deploy-k8s deploy-helm cleanup-k8s cleanup-helm

# Colors and formatting
BOLD := \033[1m
RED := \033[31m
GREEN := \033[32m
YELLOW := \033[33m
BLUE := \033[34m
MAGENTA := \033[35m
CYAN := \033[36m
RESET := \033[0m

PYTHON := python
PIP := pip
VENV := .venv
ACTIVATE := . $(VENV)/bin/activate

help:
	@printf "$(BOLD)πŸš€ Yuga Planner$(RESET)\n"
	@printf "$(CYAN)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━$(RESET)\n"
	@printf "\n"
	@printf "$(BOLD)πŸ“¦ Development Commands:$(RESET)\n"
	@printf "  $(GREEN)venv$(RESET)            🐍 Create Python virtual environment\n"
	@printf "  $(GREEN)install$(RESET)         πŸ“‹ Install all dependencies\n"
	@printf "  $(GREEN)run$(RESET)             πŸƒ Run the Gradio app locally\n"
	@printf "  $(GREEN)test$(RESET)            πŸ§ͺ Run tests with pytest\n"
	@printf "\n"
	@printf "$(BOLD)πŸ”§ Code Quality:$(RESET)\n"
	@printf "  $(BLUE)lint$(RESET)            ✨ Run pre-commit hooks (black, yaml, gitleaks)\n"
	@printf "  $(BLUE)format$(RESET)          🎨 Format code with black\n"
	@printf "\n"
	@printf "$(BOLD)πŸ” Credentials:$(RESET)\n"
	@printf "  $(YELLOW)setup-secrets$(RESET)   πŸ”‘ Setup credential template\n"
	@printf "  $(YELLOW)check-creds$(RESET)     πŸ” Validate all credentials\n"
	@printf "\n"
	@printf "$(BOLD)☸️  Deployment:$(RESET)\n"
	@printf "  $(MAGENTA)deploy-k8s$(RESET)      πŸš€ Deploy to Kubernetes\n"
	@printf "  $(MAGENTA)deploy-helm$(RESET)     ⎈  Deploy using Helm\n"
	@printf "\n"
	@printf "$(BOLD)🧹 Cleanup:$(RESET)\n"
	@printf "  $(RED)cleanup-k8s$(RESET)     πŸ—‘οΈ  Remove Kubernetes deployment\n"
	@printf "  $(RED)cleanup-helm$(RESET)    πŸ—‘οΈ  Remove Helm deployment\n"
	@printf "  $(RED)clean$(RESET)           🧽 Remove cache and virtual environment\n"
	@printf "\n"
	@printf "$(CYAN)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━$(RESET)\n"

venv:
	@printf "$(GREEN)🐍 Creating virtual environment...$(RESET)\n"
	@$(PYTHON) -m venv $(VENV)
	@printf "$(GREEN)βœ… Virtual environment created$(RESET)\n"

install: venv
	@printf "$(BLUE)πŸ“¦ Installing dependencies...$(RESET)\n"
	@$(ACTIVATE); $(PIP) install --upgrade pip
	@$(ACTIVATE); $(PIP) install -r requirements.txt
	@$(ACTIVATE); $(PIP) install pre-commit black
	@printf "$(GREEN)βœ… Dependencies installed$(RESET)\n"

run:
	@printf "$(CYAN)πŸƒ Starting Yuga Planner...$(RESET)\n"
	@$(ACTIVATE); $(PYTHON) src/app.py

test:
	@printf "$(YELLOW)πŸ§ͺ Running tests...$(RESET)\n"
	@$(ACTIVATE); pytest -v -s

lint:
	@printf "$(BLUE)✨ Running code quality checks...$(RESET)\n"
	@$(ACTIVATE); pre-commit run --all-files

format:
	@printf "$(MAGENTA)🎨 Formatting code...$(RESET)\n"
	@$(ACTIVATE); black src tests
	@printf "$(GREEN)βœ… Code formatted$(RESET)\n"

setup-secrets:
	@printf "$(YELLOW)πŸ”‘ Setting up credential template...$(RESET)\n"
	@cp -n tests/secrets/nebius_secrets.py.template tests/secrets/cred.py || true
	@printf "$(GREEN)βœ… Template created$(RESET)\n"
	@printf "$(CYAN)πŸ’‘ Edit tests/secrets/cred.py to add your API credentials$(RESET)\n"

check-creds:
	@printf "$(CYAN)πŸ” Validating credentials...$(RESET)\n"
	@./scripts/load-credentials.sh

deploy-k8s:
	@./scripts/deploy-k8s.sh

deploy-helm:
	@./scripts/deploy-helm.sh

cleanup-k8s:
	@./scripts/cleanup-k8s.sh

cleanup-helm:
	@./scripts/cleanup-helm.sh

clean:
	@printf "$(RED)🧽 Cleaning up...$(RESET)\n"
	@rm -rf $(VENV) __pycache__ */__pycache__ .pytest_cache .mypy_cache .coverage .hypothesis
	@find . -type f -name '*.pyc' -delete
	@find . -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true
	@printf "$(GREEN)βœ… Cleanup complete$(RESET)\n"