mirror of
https://github.com/hanzoai/agents.git
synced 2026-10-30 18:48:36 +00:00
Transforms hanzoai/agents from a marketplace config repo into a full agent orchestration platform by merging the AgentField infrastructure: - Go control plane (K8s-like agent orchestration, service mesh, DAG workflows) - Python SDK (FastAPI-based agent framework, LiteLLM, memory, DID/VC) - TypeScript SDK (@hanzo/agents - Vercel AI SDK, MCP, workflows) - Go SDK (idiomatic agent builder + client) - React 19 embedded dashboard (XyFlow DAGs, Recharts, Radix UI) - Docker/K8s/Helm deployment configs - Examples: hello world, deep research, RAG, simulation, benchmarks - Functional test suite across Python/Go/TypeScript All references rebranded: AgentField → Hanzo Agents - Module: github.com/hanzoai/agents/control-plane - Python: hanzo_agents - TypeScript: @hanzo/agents - Go: github.com/hanzoai/agents/sdk/go - Env vars: HANZO_AGENTS_* - Config: hanzo-agents.yaml Previous marketplace configs moved to config/ directory.
110 lines
3.3 KiB
Docker
110 lines
3.3 KiB
Docker
FROM node:20-alpine AS ui-builder
|
|
WORKDIR /app/web
|
|
|
|
COPY control-plane/web/client/package*.json ./
|
|
RUN --mount=type=cache,target=/root/.npm npm ci
|
|
COPY control-plane/web/client/ .
|
|
RUN npm run build
|
|
|
|
FROM node:20-bookworm AS ts-sdk-builder
|
|
WORKDIR /build/ts-sdk
|
|
|
|
COPY sdk/typescript/package*.json ./
|
|
RUN --mount=type=cache,target=/root/.npm npm ci --ignore-scripts
|
|
COPY sdk/typescript .
|
|
RUN npm run build
|
|
# Package the SDK so it can be installed in the final test image
|
|
RUN PACK_FILE=$(npm pack | tail -n 1) && mv "$PACK_FILE" /tmp/ts-sdk.tgz
|
|
|
|
FROM golang:1.24-bookworm AS af-cli-builder
|
|
WORKDIR /build
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
pkg-config \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Pre-download Go modules for caching
|
|
COPY control-plane/go.mod control-plane/go.sum ./control-plane/
|
|
RUN cd control-plane && go mod download
|
|
|
|
# Build the Hanzo Agents CLI (af)
|
|
COPY control-plane ./control-plane
|
|
COPY --from=ui-builder /app/web/dist ./control-plane/web/client/dist
|
|
RUN mkdir -p /build/bin && \
|
|
cd control-plane && \
|
|
go build -tags "embedded sqlite_fts5" -o /build/bin/af ./cmd/af
|
|
|
|
# Build Go functional agent binaries
|
|
COPY sdk/go ./sdk/go
|
|
COPY tests/functional/go_agents ./tests/functional/go_agents
|
|
RUN cd tests/functional/go_agents && \
|
|
go mod tidy && \
|
|
for dir in cmd/*; do \
|
|
if [ -d "$dir" ]; then \
|
|
name=$(basename "$dir"); \
|
|
go build -o /build/bin/go-agent-$name "./cmd/$name"; \
|
|
fi; \
|
|
done
|
|
|
|
FROM python:3.11-slim
|
|
|
|
# Prevent Python from writing pyc files and buffering stdout/stderr
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_NO_CACHE_DIR=1 \
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
wget \
|
|
netcat-openbsd \
|
|
nodejs \
|
|
npm \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install the Hanzo Agents CLI built in the previous stage
|
|
COPY --from=af-cli-builder /build/bin/af /usr/local/bin/af
|
|
RUN ln -s /usr/local/bin/af /usr/local/bin/hanzo-agents
|
|
|
|
# Install the packaged TypeScript SDK globally for Node-based agents
|
|
COPY --from=ts-sdk-builder /tmp/ts-sdk.tgz /tmp/ts-sdk.tgz
|
|
RUN npm install -g /tmp/ts-sdk.tgz
|
|
ENV NODE_PATH=/usr/local/lib/node_modules
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy and install Hanzo Agents Python SDK
|
|
COPY sdk/python /tmp/hanzo-agents-sdk
|
|
RUN pip install --no-cache-dir /tmp/hanzo-agents-sdk && \
|
|
rm -rf /tmp/hanzo-agents-sdk
|
|
|
|
# Copy test requirements and install
|
|
COPY tests/functional/requirements.txt /tmp/requirements.txt
|
|
RUN pip install --no-cache-dir -r /tmp/requirements.txt && \
|
|
rm /tmp/requirements.txt
|
|
|
|
# Copy wait script
|
|
COPY tests/functional/docker/wait-for-services.sh /usr/local/bin/wait-for-services.sh
|
|
RUN chmod +x /usr/local/bin/wait-for-services.sh
|
|
|
|
# Copy Go agent binaries
|
|
COPY --from=af-cli-builder /build/bin/go-agent-* /usr/local/bin/
|
|
|
|
# Create non-root user for security
|
|
RUN groupadd -r testuser && useradd -r -g testuser testuser
|
|
|
|
# Create directories, install the TS SDK locally for tests, and fix ownership
|
|
RUN mkdir -p /reports /tests && \
|
|
npm install --prefix /tests /tmp/ts-sdk.tgz && \
|
|
chown -R testuser:testuser /reports /tests
|
|
|
|
# Switch to non-root user
|
|
USER testuser
|
|
|
|
WORKDIR /tests
|
|
|
|
# Default command (will be overridden by docker-compose)
|
|
CMD ["pytest", "-v"]
|