Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
183 lines (179 loc) · 8.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
183 lines (179 loc) · 8.5 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
services:
# MLflow Tracking Server for observability
mlflow:
image: ghcr.io/mlflow/mlflow:v3.15.0
container_name: cascade_mlflow
network_mode: host # Use host network for localhost access
user: "${UID:-1000}:${GID:-1000}" # Run as current user to match permissions
environment:
- MLFLOW_HOST=127.0.0.1
volumes:
# Mount local mlruns directory for persistence across rebuilds
- ./conversational_system/mlruns:/mlruns
# Use file-based backend (same as non-Docker mlflow ui) for consistent trace display
command: mlflow server --host 127.0.0.1 --port 5001 --backend-store-uri file:///mlruns --default-artifact-root file:///mlruns
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5001/')"]
interval: 10s
timeout: 10s
retries: 5
start_period: 10s
restart: unless-stopped
# CASCADE Conversational System
# NOTE: Neo4j is NOT included - uses your local Neo4j instance for data sharing
cascade:
build:
context: .
dockerfile: docker/Dockerfile
container_name: cascade_app
image: cascade-app:latest
network_mode: host # Use host network for localhost access to Neo4j
user: "${UID:-1000}:${GID:-1000}" # Run as current user to match permissions
environment:
# Home directory for user-writable cache (crawl4ai, etc.)
- HOME=/app/.home
# Playwright browsers are installed in cascade_user's home during build
- PLAYWRIGHT_BROWSERS_PATH=/home/cascade_user/.cache/ms-playwright
# API Keys
- OPENAI_API_KEY=${OPENAI_API_KEY}
- TAVILY_API_KEY=${TAVILY_API_KEY}
- MP_API_KEY=${MP_API_KEY}
# Supabase
- SUPABASE_URL=${SUPABASE_URL}
- SUPABASE_SERVICE_KEY=${SUPABASE_SERVICE_KEY}
- SUPABASE_DATABASE_URL=${SUPABASE_DATABASE_URL}
# Neo4j
- NEO4J_URI=${NEO4J_URI:-bolt://localhost:7687}
- NEO4J_USER=${NEO4J_USER:-neo4j}
- NEO4J_PASSWORD=${NEO4J_PASSWORD}
# Memory configuration
- MEM0_USE_LLM=${MEM0_USE_LLM:-true}
- MEM0_LLM_MODEL=${MEM0_LLM_MODEL:-gpt-4o-mini}
- ENABLE_GRAPH_MEMORY=${ENABLE_GRAPH_MEMORY:-true}
# Knowledge graph for code parsing (requires Neo4j)
- USE_KNOWLEDGE_GRAPH=${USE_KNOWLEDGE_GRAPH:-true}
# Generate AI summaries for extracted code (increases API usage)
- GENERATE_CODE_SUMMARY=${GENERATE_CODE_SUMMARY:-false}
# Agent model configuration
- AGENT_MODEL_NAME=${AGENT_MODEL_NAME:-o3}
- OPENAI_BASE_URL=${OPENAI_BASE_URL:-https://api.openai.com/v1}
- USE_ADAPTIVE_AGENTS=${USE_ADAPTIVE_AGENTS:-false}
- REQUIRE_OPENAI_API_KEY=${REQUIRE_OPENAI_API_KEY:-true}
# Application paths
- PROJECT_ROOT=${PROJECT_ROOT:-/app}
- CODE_STORAGE_DIR=${CODE_STORAGE_DIR:-/app/temp_code}
- SAVED_FILES_DIR=${SAVED_FILES_DIR:-/app/saved_code}
# MLflow tracking
- MLFLOW_TRACKING_URI=${MLFLOW_TRACKING_URI:-http://localhost:5001}
# Streamlit settings
- STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
# Database path (mounted in /app/data for write access)
- CONVERSATIONS_DB_PATH=/app/data/conversations.db
volumes:
# Mount local directories for persistence across rebuilds
# (conversations.db is created inside data/ on first use)
- ./conversational_system/data:/app/data
- ./conversational_system/saved_code:/app/saved_code
- ./conversational_system/mlruns:/mlruns # Same path as MLflow server for trace data
# To hand your own files to the agent, mount a host directory and refer
# to it by path in the chat (e.g. "analyze /app/user_data/structure.cif"):
# - ./user_data:/app/user_data:ro
depends_on:
mlflow:
condition: service_healthy
restart: unless-stopped
# Execution sandbox for benchmark evaluation (see
# deep_solver_benchmark/DEVELOPMENT.md, Section 6.8). Agent-generated code
# and shell commands run inside this container:
# the repository is visible at the same absolute path as on the host, EXCEPT
# benchmark_tasks_and_results, which is masked by an empty volume, so the
# answers and recorded results do not exist inside the sandbox. Figshare (the
# host serving the benchmark archives) is blackholed at the hosts level.
benchmark:
build:
context: .
dockerfile: docker/Dockerfile.benchmark
image: cascade-benchmark:latest
container_name: cascade_benchmark
# the entrypoint (root) installs the egress firewall and starts the
# filtering proxy; sandboxed code runs as SANDBOX_UID:SANDBOX_GID (docker
# exec), which should be the host user owning the checkout (id -u, id -g)
cap_add:
- NET_ADMIN
init: true
profiles: ["benchmark"]
environment:
- HOME=/app/.home
# checked by the entrypoint (compose cannot require it here: a required
# variable would be enforced for the application services too)
- REPO_ABS_PATH=${REPO_ABS_PATH:-}
- MP_API_KEY=${MP_API_KEY}
# where the MongoDB used by the pymatgen-db tasks is reachable
- MONGODB_FORWARD_HOST=${MONGODB_FORWARD_HOST:-host.docker.internal}
- MONGODB_FORWARD_PORT=${MONGODB_FORWARD_PORT:-27017}
# sandboxed code must use the filtering proxy for any external request
- HTTP_PROXY=http://127.0.0.1:18080
- HTTPS_PROXY=http://127.0.0.1:18080
- http_proxy=http://127.0.0.1:18080
- https_proxy=http://127.0.0.1:18080
- NO_PROXY=127.0.0.1,localhost
- no_proxy=127.0.0.1,localhost
# trust the sandbox proxy's CA on the intercepted hosts
- SSL_CERT_FILE=/etc/cascade-egress/ca-bundle.crt
- REQUESTS_CA_BUNDLE=/etc/cascade-egress/ca-bundle.crt
- CURL_CA_BUNDLE=/etc/cascade-egress/ca-bundle.crt
- GIT_SSL_CAINFO=/etc/cascade-egress/ca-bundle.crt
- NODE_EXTRA_CA_CERTS=/etc/cascade-egress/ca.crt
extra_hosts:
# benchmark archives live on figshare; the sandbox cannot reach it
- "figshare.com:127.0.0.1"
- "ndownloader.figshare.com:127.0.0.1"
- "api.figshare.com:127.0.0.1"
- "host.docker.internal:host-gateway"
volumes:
# the repository is read-only; agent code writes only to the code dirs
- ${REPO_ABS_PATH:-.}:${REPO_ABS_PATH:-/workspace}:ro
- ${REPO_ABS_PATH:-.}/deep_solver_benchmark/temp_code:${REPO_ABS_PATH:-/workspace}/deep_solver_benchmark/temp_code
- ${REPO_ABS_PATH:-.}/deep_solver_benchmark/saved_code:${REPO_ABS_PATH:-/workspace}/deep_solver_benchmark/saved_code
# credentials stay outside the sandbox (the tasks get MP_API_KEY only)
- /dev/null:${REPO_ABS_PATH:-/workspace}/.env:ro
- benchmark_bank_mask:${REPO_ABS_PATH:-/workspace}/benchmark_tasks_and_results
# git history holds earlier versions of the repository's documentation
- benchmark_git_mask:${REPO_ABS_PATH:-/workspace}/.git
# MLflow traces of earlier runs contain their final answers, so they are
# masked as well: repetitions stay independent
- benchmark_mlruns_mask_a:${REPO_ABS_PATH:-/workspace}/conversational_system/mlruns
- benchmark_mlruns_mask_b:${REPO_ABS_PATH:-/workspace}/deep_solver_benchmark/mlruns
# Claude Code baseline outputs (results carry reference answers)
- benchmark_cc_mask_a:${REPO_ABS_PATH:-/workspace}/deep_solver_benchmark/baselines/claude_code/test_results
- benchmark_cc_mask_b:${REPO_ABS_PATH:-/workspace}/deep_solver_benchmark/baselines/claude_code/agent_logs
- benchmark_cc_mask_c:${REPO_ABS_PATH:-/workspace}/deep_solver_benchmark/baselines/claude_code/test_tracing
- benchmark_cc_mask_d:${REPO_ABS_PATH:-/workspace}/deep_solver_benchmark/baselines/claude_code/test_log
# the proxy CA is shared with the baseline containers (claude_code, codex)
- egress_ca:/etc/cascade-egress
# ORCA is license-restricted; mount your own installation to enable the
# ORCA benchmarks inside the sandbox:
# - /path/to/orca_6_1_0:/opt/orca:ro
networks:
- default
- egress
restart: unless-stopped
networks:
# Internal network for the baseline containers (claude_code, codex): it has
# no route to the outside, so their only path to the internet is the
# filtering proxy on the benchmark container, which blocks the benchmark
# archive host and this project's repository.
egress:
name: cascade-egress
internal: true
volumes:
benchmark_bank_mask:
benchmark_git_mask:
benchmark_mlruns_mask_a:
benchmark_mlruns_mask_b:
benchmark_cc_mask_a:
benchmark_cc_mask_b:
benchmark_cc_mask_c:
benchmark_cc_mask_d:
egress_ca:
name: cascade-egress-ca