@@ -76,6 +76,9 @@ services:
7676 - FILE_STORE_BACKEND=${FILE_STORE_BACKEND:-s3}
7777 - POSTGRES_HOST=${POSTGRES_HOST:-relational_db}
7878 - VESPA_HOST=${VESPA_HOST:-index}
79+ - OPENSEARCH_HOST=${OPENSEARCH_HOST:-opensearch}
80+ - OPENSEARCH_ADMIN_PASSWORD=${OPENSEARCH_ADMIN_PASSWORD:-StrongPassword123!}
81+ - ENABLE_OPENSEARCH_INDEXING_FOR_ONYX=${OPENSEARCH_FOR_ONYX_ENABLED:-false}
7982 - REDIS_HOST=${REDIS_HOST:-cache}
8083 - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server}
8184 - S3_ENDPOINT_URL=${S3_ENDPOINT_URL:-http://minio:9000}
@@ -147,6 +150,9 @@ services:
147150 - FILE_STORE_BACKEND=${FILE_STORE_BACKEND:-s3}
148151 - POSTGRES_HOST=${POSTGRES_HOST:-relational_db}
149152 - VESPA_HOST=${VESPA_HOST:-index}
153+ - OPENSEARCH_HOST=${OPENSEARCH_HOST:-opensearch}
154+ - OPENSEARCH_ADMIN_PASSWORD=${OPENSEARCH_ADMIN_PASSWORD:-StrongPassword123!}
155+ - ENABLE_OPENSEARCH_INDEXING_FOR_ONYX=${OPENSEARCH_FOR_ONYX_ENABLED:-false}
150156 - REDIS_HOST=${REDIS_HOST:-cache}
151157 - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server}
152158 - INDEXING_MODEL_SERVER_HOST=${INDEXING_MODEL_SERVER_HOST:-indexing_model_server}
@@ -395,6 +401,45 @@ services:
395401 max-size : " 50m"
396402 max-file : " 6"
397403
404+ opensearch :
405+ image : opensearchproject/opensearch:3.4.0
406+ restart : unless-stopped
407+ # Controls whether this service runs. In order to enable it, add
408+ # opensearch-enabled to COMPOSE_PROFILES in the environment for this
409+ # docker-compose.
410+ profiles : ["opensearch-enabled"]
411+ environment :
412+ # We need discovery.type=single-node so that OpenSearch doesn't try
413+ # forming a cluster and waiting for other nodes to become live.
414+ - discovery.type=single-node
415+ - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_ADMIN_PASSWORD:-StrongPassword123!}
416+ # This and the JVM config below come from the example in https://docs.opensearch.org/latest/install-and-configure/install-opensearch/docker/
417+ # We do this to avoid unstable performance from page swaps.
418+ - bootstrap.memory_lock=true # Disable JVM heap memory swapping.
419+ # Java heap should be ~50% of memory limit. For now we assume a limit of
420+ # 2g although in practice the container can request more than this.
421+ # See https://opster.com/guides/opensearch/opensearch-basics/opensearch-heap-size-usage-and-jvm-garbage-collection/
422+ # Xms is the starting size, Xmx is the maximum size. These should be the
423+ # same.
424+ - " OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g"
425+ volumes :
426+ - opensearch-data:/usr/share/opensearch/data
427+ # These come from the example in https://docs.opensearch.org/latest/install-and-configure/install-opensearch/docker/
428+ ulimits :
429+ # Similarly to bootstrap.memory_lock, we don't want to impose limits on
430+ # how much memory a process can lock from being swapped.
431+ memlock :
432+ soft : -1 # Set memlock to unlimited (no soft or hard limit).
433+ hard : -1
434+ nofile :
435+ soft : 65536 # Maximum number of open files for the opensearch user - set to at least 65536.
436+ hard : 65536
437+ logging :
438+ driver : json-file
439+ options :
440+ max-size : " 50m"
441+ max-file : " 6"
442+
398443 nginx :
399444 image : nginx:1.25.5-alpine
400445 restart : unless-stopped
@@ -535,3 +580,5 @@ volumes:
535580 indexing_model_server_logs :
536581 # Shared volume for persistent document storage (Craft file-system mode)
537582 file-system :
583+ # Persistent data for OpenSearch.
584+ opensearch-data :
0 commit comments