138 lines
3.7 KiB
YAML
138 lines
3.7 KiB
YAML
version: '3.8'
|
|
|
|
# Docker Compose configuration for RuVector Postgres Integration Tests
|
|
# Provides isolated environment for comprehensive test execution
|
|
|
|
services:
|
|
# PostgreSQL with RuVector extension
|
|
postgres:
|
|
build:
|
|
context: ../../..
|
|
dockerfile: crates/ruvector-postgres/docker/Dockerfile
|
|
args:
|
|
PG_VERSION: ${PG_VERSION:-17}
|
|
container_name: ruvector-postgres-integration
|
|
ports:
|
|
- "${POSTGRES_PORT:-5433}:5432"
|
|
environment:
|
|
POSTGRES_USER: ruvector
|
|
POSTGRES_PASSWORD: ruvector
|
|
POSTGRES_DB: ruvector_test
|
|
POSTGRES_INITDB_ARGS: "--data-checksums"
|
|
# Performance tuning for tests
|
|
POSTGRES_SHARED_BUFFERS: 256MB
|
|
POSTGRES_EFFECTIVE_CACHE_SIZE: 512MB
|
|
POSTGRES_WORK_MEM: 64MB
|
|
POSTGRES_MAINTENANCE_WORK_MEM: 128MB
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./init-integration.sql:/docker-entrypoint-initdb.d/01-init.sql
|
|
- ./test_sql:/test_sql:ro
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ruvector -d ruvector_test"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 30s
|
|
networks:
|
|
- integration-network
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 2G
|
|
reservations:
|
|
memory: 512M
|
|
|
|
# Test runner container with Rust toolchain
|
|
test-runner:
|
|
build:
|
|
context: ../../..
|
|
dockerfile: crates/ruvector-postgres/docker/Dockerfile.integration-test
|
|
container_name: ruvector-integration-runner
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
DATABASE_URL: postgres://ruvector:ruvector@postgres:5432/ruvector_test
|
|
RUST_LOG: ${RUST_LOG:-info}
|
|
RUST_BACKTRACE: 1
|
|
TEST_TIMEOUT: ${TEST_TIMEOUT:-600}
|
|
volumes:
|
|
- ../../..:/app:ro
|
|
- cargo_cache:/usr/local/cargo/registry
|
|
- target_cache:/app/target
|
|
- test_results:/app/test-results
|
|
networks:
|
|
- integration-network
|
|
working_dir: /app/crates/ruvector-postgres
|
|
command: >
|
|
cargo test
|
|
--release
|
|
--features pg${PG_VERSION:-17},graph-complete
|
|
--test integration
|
|
--
|
|
--test-threads=1
|
|
--nocapture
|
|
|
|
# Performance benchmark runner
|
|
benchmark:
|
|
build:
|
|
context: ../../..
|
|
dockerfile: crates/ruvector-postgres/docker/Dockerfile.integration-test
|
|
container_name: ruvector-benchmark-runner
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
DATABASE_URL: postgres://ruvector:ruvector@postgres:5432/ruvector_test
|
|
RUST_LOG: info
|
|
RUST_BACKTRACE: 1
|
|
volumes:
|
|
- ../../..:/app:ro
|
|
- cargo_cache:/usr/local/cargo/registry
|
|
- target_cache:/app/target
|
|
- test_results:/app/test-results
|
|
networks:
|
|
- integration-network
|
|
working_dir: /app/crates/ruvector-postgres
|
|
command: >
|
|
cargo bench
|
|
--features pg${PG_VERSION:-17},graph-complete
|
|
profiles:
|
|
- benchmark
|
|
|
|
# pgvector reference container for compatibility testing
|
|
pgvector-reference:
|
|
image: pgvector/pgvector:pg${PG_VERSION:-17}
|
|
container_name: pgvector-reference
|
|
ports:
|
|
- "5434:5432"
|
|
environment:
|
|
POSTGRES_USER: pgvector
|
|
POSTGRES_PASSWORD: pgvector
|
|
POSTGRES_DB: pgvector_test
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U pgvector -d pgvector_test"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- integration-network
|
|
profiles:
|
|
- compatibility
|
|
|
|
volumes:
|
|
postgres_data:
|
|
name: ruvector-integration-pg-data
|
|
cargo_cache:
|
|
name: ruvector-integration-cargo-cache
|
|
target_cache:
|
|
name: ruvector-integration-target-cache
|
|
test_results:
|
|
name: ruvector-integration-results
|
|
|
|
networks:
|
|
integration-network:
|
|
driver: bridge
|
|
name: ruvector-integration-network
|