-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.aimock.yml
More file actions
75 lines (73 loc) · 3.34 KB
/
Copy pathdocker-compose.aimock.yml
File metadata and controls
75 lines (73 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# SPDX-License-Identifier: Apache-2.0
# aimock fake-LLM HTTP server for deterministic CI smoke tests.
# Spec: specs/debug-infra-rebuild/RFC.md § P0
#
# This compose file is OPT-IN only. The default UMMAYA path (real FriendliAI)
# is unchanged. Start aimock ONLY when you need deterministic LLM responses
# for local development or CI smoke runs.
#
# Usage:
# docker compose -f docker-compose.aimock.yml up -d
# UMMAYA_FRIENDLI_BASE_URL=http://localhost:4010/v1 \
# UMMAYA_FRIENDLI_TOKEN=aimock-test \
# bun run tui
#
# Stop:
# docker compose -f docker-compose.aimock.yml down
#
# Reference: https://aimock.copilotkit.dev/
# Image: ghcr.io/copilotkit/aimock:latest (Apache-2.0, CopilotKit)
services:
# ---------------------------------------------------------------------------
# Default: ghcr.io/copilotkit/aimock (CopilotKit's official image).
# Uses AIMOCK_CONFIG to load fixtures. Will be the canonical service once
# Docker Desktop is available or the image is confirmed pullable.
# ---------------------------------------------------------------------------
aimock:
image: ghcr.io/copilotkit/aimock:latest
restart: unless-stopped
ports:
- "${UMMAYA_AIMOCK_PORT:-4010}:4010"
volumes:
# Mount the fixture directory so aimock can load scenario JSON files.
# Each *.json file in tests/fixtures/llm/ is a fixture bundle.
- ./tests/fixtures/llm:/fixtures:ro
environment:
# Tell aimock where the config file is inside the container.
AIMOCK_CONFIG: /fixtures/aimock.json
# Port to bind inside the container (must match the port mapping above).
PORT: "4010"
healthcheck:
# aimock exposes a /health endpoint (standard for CopilotKit services).
test: ["CMD-SHELL", "wget --spider -q http://localhost:4010/health || curl -sf http://localhost:4010/health"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
# profiles: ["docker"] — uncomment to gate this service on Docker availability
# ---------------------------------------------------------------------------
# Fallback: aimock-bun — hand-rolled Bun HTTP server (scripts/aimock-bun.ts).
# Used when Docker is unavailable (e.g., Docker.app not installed, CI runners
# without Docker daemon). Reads the same tests/fixtures/llm/*.json files.
#
# Tradeoffs vs ghcr.io/copilotkit/aimock:
# + No Docker required — runs with `bun scripts/aimock-bun.ts`
# + Zero image pull (native Bun, already required for TUI)
# + Health endpoint at /health and /v1/health
# - Not an official CopilotKit build; fixture format may drift
# - Uses a broader userMessageContains match (e.g., "부산" vs "부산 날씨")
#
# Usage (no Docker):
# bun scripts/aimock-bun.ts --port 4010
# UMMAYA_FRIENDLI_BASE_URL=http://localhost:4010/v1 \
# UMMAYA_FRIENDLI_TOKEN=aimock-test \
# bun run tui
#
# This service is defined here for documentation purposes; it cannot be
# started by docker compose (no image — it runs as a host process). It
# is kept in this file so fallback instructions are co-located with the
# primary service definition.
# ---------------------------------------------------------------------------
# aimock-bun:
# (no image — run as host process: bun scripts/aimock-bun.ts --port 4011)
# # Use UMMAYA_AIMOCK_PORT=4011 if running alongside the Docker service.