-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
260 lines (247 loc) · 8.35 KB
/
docker-compose.yml
File metadata and controls
260 lines (247 loc) · 8.35 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# IRIS PostgreSQL Wire Protocol - Development Environment
# CRITICAL: PGWire server runs INSIDE IRIS using irispython (embedded deployment)
services:
# IRIS Database with Embedded PGWire Server
# Server runs via irispython command inside IRIS process (spec 014-irispython-deployment)
iris:
image: intersystemsdc/iris-community:latest
container_name: iris-pgwire-db
environment:
# IRIS configuration
- IRISNAMESPACE=USER
- ISC_DEFAULT_PASSWORD=SYS
# Embedded Python environment (required for irispython)
- IRISUSERNAME=_SYSTEM
- IRISPASSWORD=SYS
# PGWire server configuration
- PGWIRE_HOST=0.0.0.0
- PGWIRE_PORT=5432
- PGWIRE_SSL_ENABLED=false
- PGWIRE_DEBUG=false
ports:
- "2972:1972" # IRIS SQL port (mapped to 2972 to avoid conflicts)
- "52776:52773" # Management Portal (mapped to avoid conflicts)
- "5432:5432" # PostgreSQL wire protocol (served from INSIDE IRIS)
volumes:
# Mount source code for irispython execution
- ./src:/app/src
# Mount startup script for embedded PGWire server
- ./scripts/start-pgwire-embedded.sh:/app/start-pgwire.sh
# Mount merge.cpf for CallIn service (CRITICAL for embedded Python)
- ./docker/merge.cpf:/app/merge.cpf
# Mount vector licensing key (required for VECTOR operations)
- ./iris.key:/usr/irissys/mgr/iris.key
healthcheck:
test: ["CMD", "/usr/irissys/bin/iris", "session", "iris", "-U%SYS", "##class(%SYSTEM.Process).CurrentDirectory()"]
interval: 15s
timeout: 10s
retries: 5
start_period: 60s
# Start IRIS, apply merge.cpf (enables CallIn for embedded Python), then launch PGWire
# Note: Use ; instead of && so PGWire starts even if merge fails (e.g., "Namespace already exists")
command: >
--check-caps false
-a "iris merge IRIS /app/merge.cpf ; nohup /bin/bash /app/start-pgwire.sh > /tmp/pgwire.log 2>&1 &"
restart: unless-stopped
# Additional IRIS container for HNSW testing (latest preview build)
iris-latest:
image: containers.intersystems.com/intersystems/iris:latest-preview
container_name: iris-latest-test
environment:
- IRISNAMESPACE=USER
- ISC_DEFAULT_PASSWORD=SYS
- IRISUSERNAME=_SYSTEM
- IRISPASSWORD=SYS
ports:
- "2973:1972" # IRIS SQL port (different from main, avoid conflicts)
- "52777:52773" # Management Portal (different from main, avoid conflicts)
volumes:
- iris_latest_data:/usr/irissys/mgr
- ./iris.key:/usr/irissys/mgr/iris.key
- ./merge.cpf:/app/merge.cpf
healthcheck:
test: ["CMD", "/usr/irissys/bin/iris", "session", "iris", "-U%SYS", "##class(%SYSTEM.Process).CurrentDirectory()"]
interval: 15s
timeout: 10s
retries: 5
start_period: 60s
command: >
--check-caps false
-a "iris merge IRIS /app/merge.cpf"
restart: unless-stopped
profiles: ["hnsw-test"]
# Integration Test Runner - REQUIRED for Constitutional Principle II
# Runs pytest integration tests against real IRIS instance
pytest-integration:
build:
context: .
dockerfile: Dockerfile.test
container_name: iris-pgwire-integration-tests
depends_on:
iris:
condition: service_healthy
environment:
# IRIS connection for integration tests
- IRIS_HOSTNAME=iris
- IRIS_PORT=1972
- IRIS_NAMESPACE=USER
- IRIS_USERNAME=_SYSTEM
- IRIS_PASSWORD=SYS
# PGWire server connection
- PGWIRE_HOST=iris
- PGWIRE_PORT=5432
# Test configuration
- PYTHONPATH=/app/src
- PYTEST_ARGS=-v --tb=short
volumes:
- ./src:/app/src:ro
- ./tests:/app/tests:ro
- ./pyproject.toml:/app/pyproject.toml:ro
- ./LICENSE:/app/LICENSE:ro
- ./README.md:/app/README.md:ro
- ./ipm:/app/ipm:ro
- ./docker:/app/docker:ro
- ./test-results:/app/test-results
command: >
sh -c "
echo 'Installing test dependencies...' &&
pip install --quiet pytest>=7.0.0 pytest-asyncio>=0.21.0 pytest-timeout>=2.2.0 pytest-cov>=4.1.0 psycopg[binary]>=3.1.0 docker>=6.0.0 sqlparse>=0.4.0 intersystems-irispython>=5.1.2 &&
echo 'Waiting for IRIS to be ready...' &&
sleep 5 &&
echo 'Running ALL integration tests (no marker filter)...' &&
pytest tests/integration/ -v --tb=line --junitxml=test-results/integration-results.xml
"
profiles: ["test"]
# Contract Test Runner - Tests that don't require IRIS
pytest-contract:
build:
context: .
dockerfile: Dockerfile.test
container_name: iris-pgwire-contract-tests
environment:
- PYTHONPATH=/app/src
- PYTEST_ARGS=-v --tb=short
volumes:
- ./src:/app/src:ro
- ./tests:/app/tests:ro
- ./pyproject.toml:/app/pyproject.toml:ro
- ./test-results:/app/test-results
command: >
sh -c "
echo 'Running contract tests...' &&
pytest tests/contract/ -v --tb=short --junitxml=test-results/contract-results.xml
"
profiles: ["test"]
# Optional: PostgreSQL client tools for manual testing
# Note: PGWire server now runs inside iris container (embedded deployment)
pgclient:
image: postgres:15-alpine
container_name: postgres-client
depends_on:
iris:
condition: service_healthy
environment:
- PGHOST=iris # Changed from 'pgwire' to 'iris' (embedded deployment)
- PGPORT=5432
- PGUSER=test_user
- PGDATABASE=USER
command: ["sleep", "infinity"]
profiles: ["tools"]
# Optional: Monitoring with Prometheus
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./deployment/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
profiles: ["monitoring"]
# Optional: Grafana for dashboards
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana_data:/var/lib/grafana
- ./deployment/monitoring/grafana:/etc/grafana/provisioning
profiles: ["monitoring"]
# Optional: Apache Superset - Modern BI and data exploration platform
superset:
image: apache/superset:latest
container_name: superset-bi
depends_on:
iris:
condition: service_healthy
ports:
- "8088:8088"
environment:
- SUPERSET_SECRET_KEY=superset_secret_key_change_in_production
- SUPERSET_LOAD_EXAMPLES=yes
volumes:
- superset_home:/app/superset_home
- ./examples/superset:/app/docker/
command: >
sh -c "
superset db upgrade &&
superset fab create-admin --username admin --firstname Admin --lastname User --email admin@superset.com --password admin &&
superset init &&
superset run -h 0.0.0.0 -p 8088 --with-threads --reload --debugger
"
profiles: ["bi-tools"]
# Optional: Metabase - Simple, open-source BI tool
metabase:
image: metabase/metabase:latest
container_name: metabase-bi
depends_on:
iris:
condition: service_healthy
ports:
- "3001:3000"
environment:
- MB_DB_TYPE=postgres
- MB_DB_DBNAME=metabase
- MB_DB_PORT=5432
- MB_DB_USER=metabase
- MB_DB_PASS=metabase
- MB_DB_HOST=metabase-db
volumes:
- metabase_data:/metabase-data
profiles: ["bi-tools"]
# Metabase internal database
metabase-db:
image: postgres:15-alpine
container_name: metabase-postgres
environment:
- POSTGRES_DB=metabase
- POSTGRES_USER=metabase
- POSTGRES_PASSWORD=metabase
volumes:
- metabase_db:/var/lib/postgresql/data
profiles: ["bi-tools"]
volumes:
iris_data:
driver: local
iris_latest_data:
driver: local
grafana_data:
driver: local
superset_home:
driver: local
metabase_data:
driver: local
metabase_db:
driver: local
networks:
default:
name: iris-pgwire-network
iris-pgwire:
external: false
name: iris-pgwire-network
# Profile-based compose file includes
# Usage: docker-compose --profile superset-example up -d
# This will include services from examples/superset-iris-healthcare/docker-compose.superset.yml
# Note: You must manually specify the compose file:
# docker-compose -f docker-compose.yml -f examples/superset-iris-healthcare/docker-compose.superset.yml --profile superset-example up -d