-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
199 lines (192 loc) · 5.4 KB
/
docker-compose.yml
File metadata and controls
199 lines (192 loc) · 5.4 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# docker-compose.yml — Required for local MOA development.
# Production uses managed Postgres / Neon, not this compose stack.
services:
postgres:
build:
context: .
dockerfile: docker/postgres/Dockerfile
args:
AGE_REF: release/PG17/1.7.0
PGVECTOR_REF: v0.8.2
image: moa-postgres-age:pg17-age1.7.0
container_name: moa-postgres
restart: unless-stopped
environment:
POSTGRES_DB: moa
POSTGRES_USER: moa_owner
POSTGRES_PASSWORD: dev
command:
- postgres
- -c
- shared_preload_libraries=age,pgaudit
- -c
- session_preload_libraries=age
- -c
- wal_level=logical
- -c
- max_replication_slots=10
- -c
- max_wal_senders=10
- -c
- logging_collector=on
- -c
- log_destination=stderr,csvlog
- -c
- log_directory=/var/log/postgresql
- -c
- log_rotation_age=60min
- -c
- log_rotation_size=0
- -c
- pgaudit.log=write,ddl,role
- -c
- pgaudit.log_relation=on
- -c
- pgaudit.log_parameter=off
- -c
- pgaudit.log_parameter_max_size=0
- -c
- pgaudit.log_catalog=off
- -c
- pgaudit.log_statement_once=on
ports:
- "25432:5432"
volumes:
- moa-pg-data:/var/lib/postgresql/data
- moa-pg-audit:/var/log/postgresql
- ./docker/postgres/init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U moa_owner -d moa"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
restate:
image: docker.restate.dev/restatedev/restate:1.6.2
container_name: moa-restate
restart: unless-stopped
command: ["--node-name=restate-dev"]
environment:
RESTATE_LOG_FILTER: "warn,restate=info"
RESTATE_ROCKSDB_TOTAL_MEMORY_SIZE: "1 GiB"
RESTATE_ADMIN__QUERY_ENGINE__MEMORY_SIZE: "256 MiB"
RESTATE_BIFROST__RECORD_CACHE_MEMORY_SIZE: "128 MiB"
DO_NOT_TRACK: "1"
ports:
- "18080:8080"
- "9070:9070"
- "5122:5122"
volumes:
- moa-restate-data:/restate-data
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:9070/health >/dev/null 2>&1 || exit 1"]
interval: 5s
timeout: 3s
retries: 20
start_period: 5s
moa-orchestrator:
build:
context: .
dockerfile: Dockerfile
image: moa/orchestrator:dev
container_name: moa-orchestrator
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
restate:
condition: service_healthy
environment:
POSTGRES_URL: postgres://moa_owner:dev@postgres:5432/moa
RESTATE_ADMIN_URL: http://restate:9070
MOA_LINEAGE_SINK: postgres
MOA_PROVIDERS_OVERRIDE: ${MOA_PROVIDERS_OVERRIDE:-}
MOA_REQUIRE_RESTATE_REGISTRATION_FOR_READINESS: "false"
MOA_DEREGISTER_ON_SHUTDOWN: "false"
RUST_LOG: "info,moa_orchestrator=debug"
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
ports:
- "9080:9080"
- "9081:9081"
volumes:
- ./crates/moa-loadtest/scripts:/loadtest-scripts:ro
restate-register:
image: docker.restate.dev/restatedev/restate-cli:1.6.2
container_name: moa-restate-register
restart: "no"
depends_on:
restate:
condition: service_healthy
moa-orchestrator:
condition: service_started
environment:
RESTATE_ADMIN_URL: http://restate:9070
entrypoint: ["/bin/sh", "-c"]
command:
- |
set -eu
echo "registering moa-orchestrator with Restate admin..."
attempt=1
while [ "$$attempt" -le 30 ]; do
if restate \
--connect-timeout 10000 \
--request-timeout 30000 \
deployments register --force http://moa-orchestrator:9080 --yes; then
echo "registration complete"
exit 0
fi
echo "registration attempt $${attempt} failed; retrying..."
attempt=$$((attempt + 1))
sleep 2
done
echo "registration failed"
exit 1
moa-pii-service:
build:
context: .
dockerfile: services/pii-service/Dockerfile
image: moa/pii-service:0.1
container_name: moa-pii-service
restart: unless-stopped
environment:
MODEL: openai/privacy-filter
DEVICE: cpu
HF_HUB_DISABLE_XET: "1"
ports:
- "8080:8080"
volumes:
- moa-pii-hf-cache:/root/.cache/huggingface
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/healthz', timeout=2)\""]
interval: 10s
timeout: 3s
retries: 10
start_period: 60s
moa-audit-shipper:
build:
context: .
dockerfile: services/audit-shipper/Dockerfile
image: moa/audit-shipper:0.1
container_name: moa-audit-shipper
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
AWS_REGION: us-east-1
BUCKET: moa-audit-dev
OBJECT_LOCK_DAYS: "2190"
LOG_DIR: /var/log/postgresql
LOG_GLOB: "*.log,*.csv"
STATE_DIR: /var/lib/moa-audit-shipper
POLL_INTERVAL_SECONDS: "60"
volumes:
- moa-pg-audit:/var/log/postgresql:ro
- moa-audit-shipper-state:/var/lib/moa-audit-shipper
volumes:
moa-pg-data:
moa-pg-audit:
moa-audit-shipper-state:
moa-pii-hf-cache:
moa-restate-data: