Files
hanzoai_agent/control-plane/Makefile
zeekay c536f93fd5 feat(cmd/agentd): rename binary, thin entrypoint via pkg/agents.Embed
RENAMED: cmd/hanzo-agents-server/ → cmd/agentd/

Per ~/work/hanzo/HANZO_BINARY.md the canonical name is <svc>d:
tasksd, iamd, kmsd, agentd. Same binary shape across the fleet
so the future fused 'hanzo' binary wires every service through a
single import.

main.go is now ~170 LOC: parse flags+env, agents.Embed(...),
signal handler. Config-loading via cobra/viper has gone — the
canonical contract is EmbedConfig + BootstrapFunc. Bootstrap
plugs in the legacy internal/server/server.NewHanzoAgentsServer
until that lifts into pkg/agents.

ALSO: stripped pre-existing dead references in internal/server:
  - removed unused 'github.com/luxfi/zap' import (no zap symbols
    used; the package was a stub)
  - removed undefined zapAdmin field + startZAPAdminNode call
    (never had a definition; the code was a half-landing)
  - removed undefined registerAdminRESTRoutes call (same)
  - dropped unused 'encoding/json' and pkg/types imports

Net effect: the tree builds cleanly again. 'go build ./...' is
green. The agentd binary builds via 'go build ./cmd/agentd'.

Updated:
  Dockerfile, Makefile, .air.toml, scripts/test-mcp-endpoints.sh,
  tools/perf/README.md — all point at cmd/agentd / 'agentd' now.
2026-04-27 18:51:03 -07:00

73 lines
1.9 KiB
Makefile

# Hanzo Agents Control Plane — build, push, deploy
IMAGE := ghcr.io/hanzoai/agents-control-plane
TAG := $(shell git rev-parse --short HEAD 2>/dev/null || echo "dev")
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "0.0.0-dev")
COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo "none")
DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
NAMESPACE := hanzo
.PHONY: dev build push deploy apply status logs clean
## Local development
dev:
cd web/client && npm run dev
dev-collab:
cd web/client && npm run dev:collab
## Build frontend only
frontend:
cd web/client && npm ci && npx vite build
## Build Go binary locally (with embedded UI)
binary: frontend
CGO_ENABLED=0 go build -tags embedded \
-ldflags "-s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE)" \
-o bin/agentd ./cmd/agentd
## Build Docker image
build:
docker build \
--build-arg VERSION=$(VERSION) \
--build-arg COMMIT=$(COMMIT) \
--build-arg DATE=$(DATE) \
-t $(IMAGE):$(TAG) \
-t $(IMAGE):latest \
.
## Push Docker image to ghcr.io
push: build
docker push $(IMAGE):$(TAG)
docker push $(IMAGE):latest
## Apply K8s manifests
apply:
kubectl apply -f ../../../devops/k8s/services/bot-site/deployment.yaml
## Rolling restart of agents deployment
deploy: push apply
kubectl rollout restart deployment/agents -n $(NAMESPACE)
kubectl rollout status deployment/agents -n $(NAMESPACE) --timeout=120s
## Check status
status:
@echo "=== Deployment ==="
kubectl get deployment agents -n $(NAMESPACE) -o wide
@echo ""
@echo "=== Pods ==="
kubectl get pods -n $(NAMESPACE) -l app=agents -o wide
@echo ""
@echo "=== Service ==="
kubectl get svc agents -n $(NAMESPACE)
@echo ""
@echo "=== Ingress ==="
kubectl get ingress hanzo-agents-ui -n $(NAMESPACE)
## Tail logs
logs:
kubectl logs -n $(NAMESPACE) -l app=agents --tail=100 -f
## Clean build artifacts
clean:
rm -rf bin/ web/client/dist/