diff --git a/Makefile b/Makefile index 134947b..c2e5c36 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,13 @@ .DEFAULT_GOAL := help -.PHONY: help agent demo-ui demo-down demo-logs smoke-two-worker docs docs-serve +.PHONY: help agent coordinator demo-ui demo-down demo-logs smoke-two-worker docs docs-serve help: @printf '%s\n' \ 'SciMesh developer commands:' \ ' make agent Build the Go worker agent (coordinator/bin/worker-agent).' \ + ' make coordinator Build the coordinator server as a static binary' \ + ' (coordinator/bin/coordinator).' \ ' make demo-ui Start the local UI pipeline demo with 2 Go worker agents.' \ ' make demo-ui WORKERS=3 Start the demo with 3 workers.' \ ' make demo-logs Follow coordinator logs for the demo.' \ @@ -22,6 +24,9 @@ help: agent: $(MAKE) -C coordinator agent +coordinator: + $(MAKE) -C coordinator coordinator + demo-ui: $(MAKE) -C coordinator demo-ui diff --git a/coordinator/Makefile b/coordinator/Makefile index 7bcfc2b..186b0e0 100644 --- a/coordinator/Makefile +++ b/coordinator/Makefile @@ -1,6 +1,6 @@ .DEFAULT_GOAL := help -.PHONY: help build run test test-integration vet lint tidy check migrate-up migrate-down up down down-clean logs ps rebuild psql smoke agent workloads-export demo-ui demo-down demo-reset demo-logs +.PHONY: help build run test test-integration vet lint tidy check migrate-up migrate-down up down down-clean logs ps rebuild psql smoke agent coordinator workloads-export demo-ui demo-down demo-reset demo-logs # `check` deliberately uses its own Compose project and host ports. This keeps # it from connecting to or replacing a developer's local PostgreSQL instance. @@ -32,12 +32,20 @@ DEMO_DIR ?= .demo WORKLOADS_JSON := internal/transport/http/workloads.json # The Go worker agent: a static coordinator client that executes SDK -# workloads in a Python subprocess per claimed task. The Python worker remains -# the reference implementation. +# workloads in a Python subprocess per claimed task. agent: CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o bin/worker-agent ./cmd/worker-agent @printf '%s\n' 'Built bin/worker-agent. Configure via environment:' ' COORDINATOR_URL, WORKER_AUTH_TOKEN, WORK_DIR, CPU_COUNT, MEMORY_MB,' ' POLL_INTERVAL, REQUEST_TIMEOUT, HEARTBEAT_INTERVAL, CAPABILITIES,' ' TASK_RUNNER, MAX_TASKS, EXIT_WHEN_IDLE, WORKER_NAME, WORKER_ID' +# The coordinator server as a static binary, the same way the Docker image +# builds it (CGO_ENABLED=0, trimmed). Requires PostgreSQL at runtime. +coordinator: + CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o bin/coordinator ./cmd/coordinator + @printf '%s\n' \ + 'Built bin/coordinator. Configure via environment:' \ + ' DATABASE_URL, COORDINATOR_ADDR, COORDINATOR_TOKEN, UI_AUTH_TOKEN,' \ + ' COORDINATOR_STORAGE_DIR, SCIMESH_DOCS_DIR, JWT_SECRET, USERSERVICE_URL' + workloads-export: cd .. && .venv/bin/scimesh workload export -o coordinator/$(WORKLOADS_JSON)