-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (85 loc) · 2.99 KB
/
Copy pathMakefile
File metadata and controls
100 lines (85 loc) · 2.99 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
# --------------------------------------------------------------------
# Agentic AI Assistant – Makefile
# --------------------------------------------------------------------
# Usage examples:
# make test # run pytest + coverage
# make lint # ruff + mypy
# make dev # hot-reload FastAPI (local)
# make build # build Docker image
# make helm-up # upgrade Helm release (local Kube context)
# make tf-plan # terraform plan (infra/terraform)
# make tf-apply # terraform apply (infra/terraform)
# make cpp-build # compile C++ cosine-similarity library
# make java-build # compile Java planner JAR via Maven
# make build-native # compile both C++ and Java artifacts
# --------------------------------------------------------------------
PYTHON ?= python
POETRY ?= poetry
IMAGE_TAG ?= agentic-ai:latest
HELM_NAME ?= agentic-ai
HELM_CHART ?= infra/helm/agentic-ai-assistant
KUBE_NS ?= default
TERRAFORM_DIR = infra/terraform
# --------------------------------------------------------------------
# Python targets
# --------------------------------------------------------------------
.PHONY: test
test:
coverage run -m pytest
coverage report -m
.PHONY: lint
lint:
$(PYTHON) -m pip install --quiet ruff mypy
ruff agent api src tests
mypy agent api src --ignore-missing-imports
.PHONY: dev
dev:
uvicorn api.main:app --reload --port 8000
# --------------------------------------------------------------------
# Native build targets
# --------------------------------------------------------------------
.PHONY: cpp-build
cpp-build:
g++ -O3 -shared -std=c++17 -fPIC agent/cpp/vector.cpp -o agent/cpp/libvector.so
@echo "✓ agent/cpp/libvector.so built"
.PHONY: java-build
java-build:
cd java && mvn package -q
@echo "✓ agent/java/planner.jar built"
.PHONY: build-native
build-native: cpp-build java-build
@echo "✓ All native artifacts built"
# --------------------------------------------------------------------
# Docker targets
# --------------------------------------------------------------------
.PHONY: build
build:
docker build -t $(IMAGE_TAG) .
.PHONY: run
run:
docker run -p 8000:8000 $(IMAGE_TAG)
# --------------------------------------------------------------------
# Helm targets
# --------------------------------------------------------------------
.PHONY: helm-up
helm-up:
helm upgrade --install $(HELM_NAME) $(HELM_CHART) \
--namespace $(KUBE_NS) --create-namespace
.PHONY: helm-uninstall
helm-uninstall:
helm uninstall $(HELM_NAME) --namespace $(KUBE_NS)
# --------------------------------------------------------------------
# Terraform targets
# --------------------------------------------------------------------
.PHONY: tf-init
tf-init:
cd $(TERRAFORM_DIR) && terraform init
.PHONY: tf-plan
tf-plan:
cd $(TERRAFORM_DIR) && terraform plan
.PHONY: tf-apply
tf-apply:
cd $(TERRAFORM_DIR) && terraform apply
.PHONY: tf-destroy
tf-destroy:
cd $(TERRAFORM_DIR) && terraform destroy