2026-02-25 00:46:22 +00:00
|
|
|
# ── Timmy Time — test stack ──────────────────────────────────────────────────
|
|
|
|
|
#
|
|
|
|
|
# Lightweight compose for functional tests. Runs the dashboard on port 18000
|
|
|
|
|
# and optional agent workers on the swarm-test-net network.
|
|
|
|
|
#
|
2026-02-25 02:44:36 +00:00
|
|
|
# Profiles:
|
|
|
|
|
# (default) dashboard only (Ollama on host via host.docker.internal)
|
|
|
|
|
# ollama adds a containerised Ollama instance + auto model pull
|
|
|
|
|
# agents adds scalable agent workers
|
|
|
|
|
#
|
2026-02-25 00:46:22 +00:00
|
|
|
# Usage:
|
2026-02-25 02:44:36 +00:00
|
|
|
# # Swarm tests (no LLM needed):
|
2026-02-25 00:46:22 +00:00
|
|
|
# FUNCTIONAL_DOCKER=1 pytest tests/functional/test_docker_swarm.py -v
|
|
|
|
|
#
|
2026-02-25 02:44:36 +00:00
|
|
|
# # Full-stack with Ollama (pulls qwen2.5:0.5b automatically):
|
|
|
|
|
# FUNCTIONAL_DOCKER=1 pytest tests/functional/test_ollama_chat.py -v
|
|
|
|
|
#
|
2026-02-25 00:46:22 +00:00
|
|
|
# Or manually:
|
|
|
|
|
# docker compose -f docker-compose.test.yml -p timmy-test up -d --build --wait
|
|
|
|
|
# curl http://localhost:18000/health
|
|
|
|
|
# docker compose -f docker-compose.test.yml -p timmy-test down -v
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
2026-02-25 02:44:36 +00:00
|
|
|
# ── Ollama — local LLM for functional tests ───────────────────────────────
|
|
|
|
|
# Activated with: --profile ollama
|
|
|
|
|
# Uses a tiny model (qwen2.5:0.5b, ~400 MB) so it runs on CPU-only CI.
|
|
|
|
|
ollama:
|
|
|
|
|
image: ollama/ollama:latest
|
|
|
|
|
container_name: timmy-test-ollama
|
|
|
|
|
profiles:
|
|
|
|
|
- ollama
|
|
|
|
|
networks:
|
|
|
|
|
- swarm-test-net
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 20
|
|
|
|
|
start_period: 10s
|
|
|
|
|
|
2026-02-25 00:46:22 +00:00
|
|
|
dashboard:
|
|
|
|
|
build: .
|
|
|
|
|
image: timmy-time:test
|
|
|
|
|
container_name: timmy-test-dashboard
|
|
|
|
|
ports:
|
|
|
|
|
- "18000:8000"
|
|
|
|
|
volumes:
|
|
|
|
|
- test-data:/app/data
|
|
|
|
|
- ./src:/app/src
|
|
|
|
|
- ./static:/app/static
|
|
|
|
|
environment:
|
|
|
|
|
DEBUG: "true"
|
|
|
|
|
TIMMY_TEST_MODE: "1"
|
2026-02-25 02:44:36 +00:00
|
|
|
OLLAMA_URL: "${OLLAMA_URL:-http://host.docker.internal:11434}"
|
|
|
|
|
OLLAMA_MODEL: "${OLLAMA_MODEL:-llama3.2}"
|
2026-02-25 00:46:22 +00:00
|
|
|
LIGHTNING_BACKEND: "mock"
|
|
|
|
|
extra_hosts:
|
|
|
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
|
networks:
|
|
|
|
|
- swarm-test-net
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 3s
|
|
|
|
|
retries: 10
|
|
|
|
|
start_period: 10s
|
|
|
|
|
|
|
|
|
|
agent:
|
|
|
|
|
build: .
|
|
|
|
|
image: timmy-time:test
|
|
|
|
|
profiles:
|
|
|
|
|
- agents
|
|
|
|
|
volumes:
|
|
|
|
|
- test-data:/app/data
|
|
|
|
|
- ./src:/app/src
|
|
|
|
|
environment:
|
|
|
|
|
COORDINATOR_URL: "http://dashboard:8000"
|
2026-02-25 02:44:36 +00:00
|
|
|
OLLAMA_URL: "${OLLAMA_URL:-http://host.docker.internal:11434}"
|
|
|
|
|
OLLAMA_MODEL: "${OLLAMA_MODEL:-llama3.2}"
|
2026-02-25 00:46:22 +00:00
|
|
|
AGENT_NAME: "${AGENT_NAME:-TestWorker}"
|
|
|
|
|
AGENT_CAPABILITIES: "${AGENT_CAPABILITIES:-general}"
|
|
|
|
|
TIMMY_TEST_MODE: "1"
|
|
|
|
|
extra_hosts:
|
|
|
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
|
command: ["sh", "-c", "python -m swarm.agent_runner --agent-id agent-$(hostname) --name $${AGENT_NAME:-TestWorker}"]
|
|
|
|
|
networks:
|
|
|
|
|
- swarm-test-net
|
|
|
|
|
depends_on:
|
|
|
|
|
dashboard:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
test-data:
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
swarm-test-net:
|
|
|
|
|
driver: bridge
|