60 lines
2.5 KiB
Makefile
60 lines
2.5 KiB
Makefile
# Container runtime: override with `make <target> COMMAND=podman`
|
|
COMMAND := docker
|
|
|
|
COMPOSE_FILE := compose/docker-compose.yml
|
|
ENV_FILE := compose/.env
|
|
API_URL := https://llm.sttlab.pc:8443
|
|
MCP_URL := https://mcp.sttlab.pc:8443
|
|
|
|
# ─── Docker Compose ───────────────────────────────────────────────────────────
|
|
|
|
docker-up: ## Start the stack (detached)
|
|
$(COMMAND) compose -f $(COMPOSE_FILE) --env-file $(ENV_FILE) up -d
|
|
|
|
docker-down: ## Stop and remove containers
|
|
$(COMMAND) compose -f $(COMPOSE_FILE) --env-file $(ENV_FILE) down
|
|
|
|
docker-restart: docker-down docker-up ## Full restart (re-reads env vars and config)
|
|
|
|
docker-logs: ## Tail logs
|
|
$(COMMAND) compose -f $(COMPOSE_FILE) logs -f
|
|
|
|
docker-ps: ## Show container status
|
|
$(COMMAND) compose -f $(COMPOSE_FILE) ps
|
|
|
|
docker-test: test-llm test-mcp ## Run all tests
|
|
|
|
test-llm: test-llm-claude-sonnet-4-6 ## Test all LLM endpoints
|
|
|
|
test-llm-claude-sonnet-4-6: ## Test claude-sonnet-4-6 via Anthropic
|
|
@echo "→ LLM: claude-sonnet-4-6"
|
|
@curl -sk $(API_URL)/claude-sonnet-4-6/v1/chat/completions \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"ping"}]}' \
|
|
| python3 -c "import sys,json; d=json.load(sys.stdin); print(d['choices'][0]['message']['content'])"
|
|
|
|
test-mcp-jira: ## Test MCP Jira endpoint via Traefik
|
|
@echo "→ MCP: /jira"
|
|
@curl -sk $(MCP_URL)/jira \
|
|
-X POST \
|
|
-H "Content-Type: application/json" \
|
|
-H "Accept: application/json, text/event-stream" \
|
|
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"make-test","version":"1.0"}}}' \
|
|
| grep -o '"name":"[^"]*"' | head -1
|
|
|
|
test-mcp: test-mcp-jira ## Test all MCP endpoints
|
|
|
|
docker-ui: ## Open the agentgateway UI in the browser
|
|
open http://localhost:15000/ui
|
|
|
|
# ─── Help ─────────────────────────────────────────────────────────────────────
|
|
|
|
.PHONY: docker-up docker-down docker-restart docker-logs docker-ps docker-test docker-ui help \
|
|
test-llm test-llm-claude-sonnet-4-6 test-mcp test-mcp-jira
|
|
|
|
help: ## Show this help
|
|
@grep -E '^[a-zA-Z_-]+:.*##' $(MAKEFILE_LIST) \
|
|
| awk 'BEGIN {FS = ":.*##"}; {printf " %-20s %s\n", $$1, $$2}'
|
|
|
|
.DEFAULT_GOAL := help
|