Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.git
.github
.venv
**/.venv
**/__pycache__
**/.pytest_cache
**/.mypy_cache
**/.ruff_cache
**/.coverage
**/htmlcov
**/build
**/dist
**/*.egg-info
**/node_modules
.DS_Store
.idea
.vscode
coverage.xml
node_modules
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,33 @@ pip install -e "packages/agent-lightning[dev]"
pytest
```

### Docker Quickstart

If you prefer a containerized development environment, use the root Docker
configuration. The image includes Python 3.11, Node.js 22, the core editable
Python packages in this monorepo, and the TypeScript SDK dependencies.

```bash
# Build and start the development container
docker compose up --build dev

# Open a shell in the running container
docker compose exec dev bash

# Run the full test suite
docker compose run --rm test
```

The repository is bind-mounted into `/workspace`, so Python source changes are
available immediately without rebuilding the image. If you update package
metadata or dependency definitions, rebuild with `docker compose build`.

To launch the optional Agent Hypervisor dashboard:

```bash
docker compose --profile dashboard up --build dashboard
```

### Package Structure

This is a mono-repo with seven packages:
Expand Down
52 changes: 52 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# syntax=docker/dockerfile:1.7

ARG PYTHON_VERSION=3.11

FROM python:${PYTHON_VERSION}-slim AS base

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ENV DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
NODE_MAJOR=22

WORKDIR /workspace

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
build-essential \
ca-certificates \
curl \
git \
&& curl -fsSL "https://deb.nodesource.com/setup_${NODE_MAJOR}.x" | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& python -m pip install --upgrade pip setuptools wheel \
&& rm -rf /var/lib/apt/lists/*

FROM base AS dev

COPY . /workspace

RUN python -m pip install --no-cache-dir \
-e "packages/agent-os[full,dev]" \
-e "packages/agent-mesh[agent-os,dev,server]" \
-e "packages/agent-hypervisor[api,dev,nexus]" \
-e "packages/agent-runtime" \
-e "packages/agent-sre[api,dev]" \
-e "packages/agent-compliance" \
-e "packages/agent-marketplace[cli,dev]" \
-e "packages/agent-lightning[agent-os,dev]" \
&& python -m pip install --no-cache-dir \
-r packages/agent-hypervisor/examples/dashboard/requirements.txt \
&& cd /workspace/packages/agent-mesh/sdks/typescript \
&& npm ci

ENTRYPOINT ["bash", "/workspace/scripts/docker/dev-entrypoint.sh"]
CMD ["sleep", "infinity"]

FROM dev AS test

CMD ["pytest"]
47 changes: 47 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
services:
dev:
build:
context: .
target: dev
command: ["sleep", "infinity"]
init: true
stdin_open: true
tty: true
working_dir: /workspace
volumes:
- .:/workspace
- typescript_node_modules:/workspace/packages/agent-mesh/sdks/typescript/node_modules

test:
build:
context: .
target: test
command: ["bash", "/workspace/scripts/docker/run-tests.sh"]
init: true
user: "1000:1000"
working_dir: /workspace
volumes:
- .:/workspace
- typescript_node_modules:/workspace/packages/agent-mesh/sdks/typescript/node_modules

dashboard:
profiles: ["dashboard"]
build:
context: .
target: dev
command:
- streamlit
- run
- packages/agent-hypervisor/examples/dashboard/app.py
- --server.address=0.0.0.0
- --server.port=8501
init: true
ports:
- "8501:8501"
working_dir: /workspace
volumes:
- .:/workspace
- typescript_node_modules:/workspace/packages/agent-mesh/sdks/typescript/node_modules

volumes:
typescript_node_modules:
13 changes: 13 additions & 0 deletions scripts/docker/dev-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail

sdk_dir="/workspace/packages/agent-mesh/sdks/typescript"

if [[ -f "${sdk_dir}/package.json" && ! -d "${sdk_dir}/node_modules" ]]; then
echo "Installing TypeScript SDK dependencies..."
cd "${sdk_dir}"
npm ci
cd /workspace
fi

exec "$@"
17 changes: 17 additions & 0 deletions scripts/docker/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail

packages=(
"packages/agent-os"
"packages/agent-mesh"
"packages/agent-hypervisor"
"packages/agent-sre"
"packages/agent-compliance"
)

for package_dir in "${packages[@]}"; do
echo
echo "==> Testing ${package_dir}"
cd "/workspace/${package_dir}"
pytest tests/ -q --tb=short
done
Loading