|
| 1 | +# QP Conduit - Makefile |
| 2 | +# Internal infrastructure for on-premises AI deployments. |
| 3 | +# https://github.com/quantumpipes/conduit |
| 4 | +# |
| 5 | +# Override CONDUIT_APP_NAME to rebrand for your project. |
| 6 | +# Include this Makefile in your own: include path/to/conduit/Makefile |
| 7 | + |
| 8 | +SHELL := /bin/bash |
| 9 | +.DEFAULT_GOAL := help |
| 10 | + |
| 11 | +CONDUIT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) |
| 12 | +UI_DIR := $(CONDUIT_DIR)/ui |
| 13 | + |
| 14 | +# --------------------------------------------------------------------------- |
| 15 | +# Help |
| 16 | +# --------------------------------------------------------------------------- |
| 17 | +.PHONY: help |
| 18 | +help: ## Show this help |
| 19 | + @echo "" |
| 20 | + @echo " QP Conduit - On-Premises Infrastructure" |
| 21 | + @echo " ========================================" |
| 22 | + @echo "" |
| 23 | + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ |
| 24 | + awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-26s\033[0m %s\n", $$1, $$2}' |
| 25 | + @echo "" |
| 26 | + |
| 27 | +# --------------------------------------------------------------------------- |
| 28 | +# Setup |
| 29 | +# --------------------------------------------------------------------------- |
| 30 | +.PHONY: conduit-setup |
| 31 | +conduit-setup: ## Initialize Conduit (dnsmasq, Caddy, internal CA) |
| 32 | + @bash $(CONDUIT_DIR)/conduit-setup.sh |
| 33 | + |
| 34 | +# --------------------------------------------------------------------------- |
| 35 | +# Service Management |
| 36 | +# --------------------------------------------------------------------------- |
| 37 | +.PHONY: conduit-register |
| 38 | +conduit-register: ## Register a service (NAME=grafana HOST=10.0.1.50:3000) |
| 39 | + @bash $(CONDUIT_DIR)/conduit-register.sh --name $(NAME) --host $(HOST) \ |
| 40 | + $(if $(HEALTH),--health $(HEALTH),) \ |
| 41 | + $(if $(NO_TLS),--no-tls,) |
| 42 | + |
| 43 | +.PHONY: conduit-deregister |
| 44 | +conduit-deregister: ## Remove a service (NAME=grafana) |
| 45 | + @bash $(CONDUIT_DIR)/conduit-deregister.sh --name $(NAME) |
| 46 | + |
| 47 | +.PHONY: conduit-status |
| 48 | +conduit-status: ## Show all services with health, TLS, and DNS status |
| 49 | + @bash $(CONDUIT_DIR)/conduit-status.sh |
| 50 | + |
| 51 | +# --------------------------------------------------------------------------- |
| 52 | +# Monitoring |
| 53 | +# --------------------------------------------------------------------------- |
| 54 | +.PHONY: conduit-monitor |
| 55 | +conduit-monitor: ## Show hardware stats (GPU, CPU, memory, disk) |
| 56 | + @bash $(CONDUIT_DIR)/conduit-monitor.sh $(if $(SERVER),--server $(SERVER),) |
| 57 | + |
| 58 | +.PHONY: conduit-monitor-containers |
| 59 | +conduit-monitor-containers: ## Show Docker container health |
| 60 | + @bash $(CONDUIT_DIR)/conduit-monitor.sh --containers |
| 61 | + |
| 62 | +# --------------------------------------------------------------------------- |
| 63 | +# Certificates |
| 64 | +# --------------------------------------------------------------------------- |
| 65 | +.PHONY: conduit-certs |
| 66 | +conduit-certs: ## List all TLS certificates with expiry dates |
| 67 | + @bash $(CONDUIT_DIR)/conduit-certs.sh |
| 68 | + |
| 69 | +.PHONY: conduit-certs-rotate |
| 70 | +conduit-certs-rotate: ## Rotate a certificate (NAME=grafana) |
| 71 | + @bash $(CONDUIT_DIR)/conduit-certs.sh --rotate $(NAME) |
| 72 | + |
| 73 | +.PHONY: conduit-certs-inspect |
| 74 | +conduit-certs-inspect: ## Inspect a certificate (NAME=grafana) |
| 75 | + @bash $(CONDUIT_DIR)/conduit-certs.sh --inspect $(NAME) |
| 76 | + |
| 77 | +.PHONY: conduit-certs-trust |
| 78 | +conduit-certs-trust: ## Install internal CA in system trust store |
| 79 | + @bash $(CONDUIT_DIR)/conduit-certs.sh --trust |
| 80 | + |
| 81 | +# --------------------------------------------------------------------------- |
| 82 | +# DNS |
| 83 | +# --------------------------------------------------------------------------- |
| 84 | +.PHONY: conduit-dns |
| 85 | +conduit-dns: ## List all DNS entries |
| 86 | + @bash $(CONDUIT_DIR)/conduit-dns.sh |
| 87 | + |
| 88 | +.PHONY: conduit-dns-flush |
| 89 | +conduit-dns-flush: ## Flush DNS cache |
| 90 | + @bash $(CONDUIT_DIR)/conduit-dns.sh --flush |
| 91 | + |
| 92 | +.PHONY: conduit-dns-resolve |
| 93 | +conduit-dns-resolve: ## Test DNS resolution (DOMAIN=grafana.internal) |
| 94 | + @bash $(CONDUIT_DIR)/conduit-dns.sh --resolve $(DOMAIN) |
| 95 | + |
| 96 | +# --------------------------------------------------------------------------- |
| 97 | +# Audit |
| 98 | +# --------------------------------------------------------------------------- |
| 99 | +.PHONY: conduit-verify |
| 100 | +conduit-verify: ## Verify Capsule audit chain integrity |
| 101 | + @bash -c 'source $(CONDUIT_DIR)/conduit-preflight.sh && qp-capsule verify' |
| 102 | + |
| 103 | +# --------------------------------------------------------------------------- |
| 104 | +# Admin UI |
| 105 | +# --------------------------------------------------------------------------- |
| 106 | +.PHONY: ui |
| 107 | +ui: ## Start the admin dashboard (dev mode, port 5173) |
| 108 | + @cd $(UI_DIR) && npm run dev |
| 109 | + |
| 110 | +.PHONY: ui-build |
| 111 | +ui-build: ## Build the admin dashboard for production |
| 112 | + @cd $(UI_DIR) && npm run build |
| 113 | + |
| 114 | +.PHONY: ui-install |
| 115 | +ui-install: ## Install admin dashboard dependencies |
| 116 | + @cd $(UI_DIR) && npm install |
| 117 | + |
| 118 | +.PHONY: ui-typecheck |
| 119 | +ui-typecheck: ## Type-check the admin dashboard |
| 120 | + @cd $(UI_DIR) && npm run typecheck |
| 121 | + |
| 122 | +# --------------------------------------------------------------------------- |
| 123 | +# Testing |
| 124 | +# --------------------------------------------------------------------------- |
| 125 | +.PHONY: test |
| 126 | +test: ## Run all tests (requires bats-core) |
| 127 | + @bats $(CONDUIT_DIR)/tests/unit/ $(CONDUIT_DIR)/tests/integration/ |
| 128 | + |
| 129 | +.PHONY: test-unit |
| 130 | +test-unit: ## Run unit tests only |
| 131 | + @bats $(CONDUIT_DIR)/tests/unit/ |
| 132 | + |
| 133 | +.PHONY: test-integration |
| 134 | +test-integration: ## Run integration tests only |
| 135 | + @bats $(CONDUIT_DIR)/tests/integration/ |
| 136 | + |
| 137 | +.PHONY: test-smoke |
| 138 | +test-smoke: ## Run smoke tests |
| 139 | + @bash $(CONDUIT_DIR)/tests/smoke/test_standalone.sh |
| 140 | + |
| 141 | +.PHONY: test-ui |
| 142 | +test-ui: ## Run admin dashboard tests |
| 143 | + @cd $(UI_DIR) && npm test |
| 144 | + |
| 145 | +.PHONY: check |
| 146 | +check: test ui-typecheck ## Run all tests + type-check UI |
0 commit comments