|
1 | | -.PHONY: dev-edge-create dev-run-edge build test lint fix-lint codegen crds clean certs dev-setup run-dex run-hub run-hub-static run-hub-embedded run-hub-embedded-static run-hub-standalone run-hub-embedded-graphql run-kcp dev-login dev-login-static dev-create-workload dev dev-infra dev-run-kcp path boilerplate verify-boilerplate verify-codegen ldflags tools docker-build docker-build-hub docker-build-agent docker-build-dex docker-build-dev-agent load-dev-agent-image docker-push-dex verify help-dev dev-status dev-clean-hooks helm-build-local helm-push-local helm-clean build-quickstart-provider build-quickstart-provider-portal build-kuery-provider build-kuery-provider-portal run-provider-kuery kuery-db-up kuery-db-down install-provider-kuery init-provider-kuery uninstall-provider-kuery run-provider-quickstart install-provider-quickstart init-provider-quickstart uninstall-provider-quickstart build-infrastructure-provider build-infrastructure-provider-portal codegen-infrastructure-provider run-provider-infrastructure install-provider-infrastructure init-provider-infrastructure uninstall-provider-infrastructure build-app-studio-provider build-app-studio-provider-portal codegen-app-studio-provider app-studio-db-up app-studio-db-down run-provider-app-studio install-provider-app-studio init-provider-app-studio uninstall-provider-app-studio build-agents-provider build-agents-provider-portal codegen-agents-provider run-provider-agents install-provider-agents init-provider-agents uninstall-provider-agents build-code-provider build-code-provider-portal codegen-code-provider run-provider-code install-provider-code init-provider-code uninstall-provider-code build-databricks-provider build-databricks-provider-portal codegen-databricks-provider run-provider-databricks install-provider-databricks init-provider-databricks uninstall-provider-databricks dev-kro-up dev-kro-down dev-kro-seed dev-kro-register-self e2e-infrastructure portal-provider-symlinks build-mcp-provider-portal build-kubernetes-edges-provider-portal build-server-edges-provider-portal e2e-provider e2e-provider-flags e2e-provider-all |
| 1 | +.PHONY: dev-edge-create dev-run-edge build test lint fix-lint codegen crds clean certs dev-setup run-dex run-hub run-hub-static run-hub-embedded run-hub-embedded-static run-hub-standalone run-hub-embedded-graphql run-kcp dev-login dev-login-static dev-create-workload dev dev-infra dev-run-kcp path boilerplate verify-boilerplate verify-codegen ldflags tools docker-build docker-build-hub docker-build-agent docker-build-dex docker-build-dev-agent load-dev-agent-image docker-push-dex verify help-dev dev-status dev-clean-hooks helm-build-local helm-push-local helm-clean build-quickstart-provider build-quickstart-provider-portal build-kuery-provider build-kuery-provider-portal run-provider-kuery kuery-db-up kuery-db-down install-provider-kuery init-provider-kuery uninstall-provider-kuery run-provider-quickstart install-provider-quickstart init-provider-quickstart uninstall-provider-quickstart build-infrastructure-provider build-infrastructure-provider-portal codegen-infrastructure-provider run-provider-infrastructure install-provider-infrastructure init-provider-infrastructure uninstall-provider-infrastructure build-app-studio-provider build-app-studio-provider-portal codegen-app-studio-provider app-studio-db-up app-studio-db-down run-provider-app-studio install-provider-app-studio init-provider-app-studio uninstall-provider-app-studio build-agents-provider build-agents-provider-portal codegen-agents-provider agents-db-up agents-db-down run-provider-agents install-provider-agents init-provider-agents uninstall-provider-agents build-code-provider build-code-provider-portal codegen-code-provider run-provider-code install-provider-code init-provider-code uninstall-provider-code build-databricks-provider build-databricks-provider-portal codegen-databricks-provider run-provider-databricks install-provider-databricks init-provider-databricks uninstall-provider-databricks dev-kro-up dev-kro-down dev-kro-seed dev-kro-register-self e2e-infrastructure portal-provider-symlinks build-mcp-provider-portal build-kubernetes-edges-provider-portal build-server-edges-provider-portal e2e-provider e2e-provider-flags e2e-provider-all |
2 | 2 |
|
3 | 3 | BINDIR ?= bin |
4 | 4 | GOFLAGS ?= |
@@ -932,8 +932,14 @@ AGENTS_PROVIDER_KUBECONFIG ?= $(KCP_DATA_DIR)/agents-provider.kubeconfig |
932 | 932 | AGENTS_SCHEMAS_DIR ?= providers/agents/deploy/chart/files/schemas |
933 | 933 | AGENTS_MANIFEST ?= providers/agents/manifest.yaml |
934 | 934 | AGENTS_PROVIDER_MANIFEST ?= providers/agents/provider.yaml |
935 | | -# Postgres store backend is not wired yet; dev runs use the in-memory store. |
936 | | -AGENTS_IN_MEMORY_STORE ?= true |
| 935 | +# Durable store: dev runs use a local Postgres container by default (mirrors |
| 936 | +# app-studio). Set AGENTS_IN_MEMORY_STORE=true for a non-durable quick run. |
| 937 | +AGENTS_IN_MEMORY_STORE ?= |
| 938 | +AGENTS_DEV_DATABASE_URL ?= postgres://agents:agents@localhost:55434/agents?sslmode=disable |
| 939 | +AGENTS_POSTGRES_CONTAINER ?= kedge-agents-postgres |
| 940 | +AGENTS_POSTGRES_IMAGE ?= mirror.gcr.io/library/postgres:16-alpine |
| 941 | +AGENTS_POSTGRES_PORT ?= 55434 |
| 942 | +AGENTS_POSTGRES_DATA_DIR ?= $(KCP_DATA_DIR)/agents-postgres |
937 | 943 |
|
938 | 944 | ## Run the infrastructure provider binary locally. Heartbeats to the hub on |
939 | 945 | ## $(KROMC_HUB_URL); TLS verification skipped (dev cert is self-signed). |
@@ -1162,21 +1168,50 @@ uninstall-provider-app-studio: ## Delete App Studio CatalogEntry |
1162 | 1168 | --insecure-skip-tls-verify \ |
1163 | 1169 | delete -f $(APP_STUDIO_MANIFEST) -f $(APP_STUDIO_PROVIDER_MANIFEST) |
1164 | 1170 |
|
1165 | | -## --- agents provider dev targets (mirror app-studio; in-memory store) --- |
1166 | | - |
1167 | | -run-provider-agents: build-agents-provider ## Run the agents provider (requires: make run-hub-embedded-static + make install-provider-agents + make init-provider-agents) |
| 1171 | +## --- agents provider dev targets (mirror app-studio) --- |
| 1172 | + |
| 1173 | +## Start/reuse a local Postgres container for the agents durable store. Skips |
| 1174 | +## when AGENTS_IN_MEMORY_STORE=true or AGENTS_DATABASE_URL points elsewhere. |
| 1175 | +agents-db-up: |
| 1176 | + @set -a; [ -f providers/agents/.env ] && . ./providers/agents/.env || true; set +a; \ |
| 1177 | + if [ "$${AGENTS_IN_MEMORY_STORE:-$(AGENTS_IN_MEMORY_STORE)}" = "true" ]; then \ |
| 1178 | + echo "agents: in-memory store — skipping Postgres"; exit 0; fi; \ |
| 1179 | + if [ -n "$${AGENTS_DATABASE_URL:-}" ]; then \ |
| 1180 | + echo "agents: external AGENTS_DATABASE_URL set — skipping dev Postgres"; exit 0; fi; \ |
| 1181 | + if docker ps --format '{{.Names}}' | grep -q '^$(AGENTS_POSTGRES_CONTAINER)$$'; then \ |
| 1182 | + echo "agents postgres already running on :$(AGENTS_POSTGRES_PORT)"; exit 0; fi; \ |
| 1183 | + if docker ps -a --format '{{.Names}}' | grep -q '^$(AGENTS_POSTGRES_CONTAINER)$$'; then \ |
| 1184 | + docker start $(AGENTS_POSTGRES_CONTAINER); exit 0; fi; \ |
| 1185 | + mkdir -p $(AGENTS_POSTGRES_DATA_DIR); \ |
| 1186 | + docker run -d --name $(AGENTS_POSTGRES_CONTAINER) \ |
| 1187 | + -e POSTGRES_USER=agents -e POSTGRES_PASSWORD=agents -e POSTGRES_DB=agents \ |
| 1188 | + -p $(AGENTS_POSTGRES_PORT):5432 \ |
| 1189 | + -v $(AGENTS_POSTGRES_DATA_DIR):/var/lib/postgresql/data \ |
| 1190 | + $(AGENTS_POSTGRES_IMAGE) |
| 1191 | + |
| 1192 | +agents-db-down: ## Stop and remove the agents dev Postgres container |
| 1193 | + -docker rm -f $(AGENTS_POSTGRES_CONTAINER) |
| 1194 | + |
| 1195 | +run-provider-agents: build-agents-provider agents-db-up ## Run the agents provider (requires: make run-hub-embedded-static + make install-provider-agents + make init-provider-agents) |
1168 | 1196 | @echo "Starting agents provider on :$(AGENTS_PORT)" |
1169 | 1197 | @echo " hub: $(AGENTS_HUB_URL)" |
1170 | | - @echo " store: in-memory (non-durable; Postgres backend not wired yet)" |
1171 | 1198 | @# Auto-source providers/agents/.env (gitignored) for local overrides. |
1172 | 1199 | set -a; [ -f providers/agents/.env ] && . ./providers/agents/.env || true; set +a; \ |
| 1200 | + AGENTS_IN_MEMORY_STORE="$${AGENTS_IN_MEMORY_STORE:-$(AGENTS_IN_MEMORY_STORE)}"; \ |
| 1201 | + if [ "$$AGENTS_IN_MEMORY_STORE" = "true" ]; then \ |
| 1202 | + echo " store: in-memory (non-durable)"; AGENTS_DATABASE_URL=; \ |
| 1203 | + else \ |
| 1204 | + AGENTS_DATABASE_URL="$${AGENTS_DATABASE_URL:-$(AGENTS_DEV_DATABASE_URL)}"; \ |
| 1205 | + echo " store: $$AGENTS_DATABASE_URL"; \ |
| 1206 | + fi; \ |
1173 | 1207 | PORT=$(AGENTS_PORT) \ |
1174 | 1208 | KEDGE_HUB_URL=$(AGENTS_HUB_URL) \ |
1175 | 1209 | KEDGE_HUB_TOKEN=$(AGENTS_TOKEN) \ |
1176 | 1210 | KEDGE_HUB_INSECURE=true \ |
1177 | 1211 | KEDGE_PROVIDER_NAME=agents \ |
1178 | 1212 | KEDGE_PROVIDER_KUBECONFIG=$${KEDGE_PROVIDER_KUBECONFIG:-$$( for f in "$(AGENTS_PROVIDER_KUBECONFIG)" "$(AGENTS_KCP_KUBECONFIG)" "$(CURDIR)/tilt-frontproxy.kubeconfig"; do [ -f "$$f" ] && echo "$$f" && break; done )} \ |
1179 | | - AGENTS_IN_MEMORY_STORE=$(AGENTS_IN_MEMORY_STORE) \ |
| 1213 | + AGENTS_DATABASE_URL="$$AGENTS_DATABASE_URL" \ |
| 1214 | + AGENTS_IN_MEMORY_STORE="$$AGENTS_IN_MEMORY_STORE" \ |
1180 | 1215 | $(BINDIR)/agents-provider |
1181 | 1216 |
|
1182 | 1217 | install-provider-agents: ## Apply agents Provider + CatalogEntry into root:kedge:providers |
|
0 commit comments