Skip to content

Commit 079d692

Browse files
authored
feat(docker): add docker-compose configuration for OpenSearch (#7510)
**What changed?** Added a new `docker-compose-opensearch.yml` file that provides a complete deployment configuration for running Cadence with OpenSearch as the advanced visibility store. This mirrors the existing Elasticsearch docker-compose setups but uses OpenSearch 2.13.0. The configuration includes: - Cassandra for persistence - OpenSearch 2.13.0 for advanced visibility (with security disabled for local dev) - OpenSearch Dashboards on port 5601 for visualization - Kafka for async workflow processing - Cadence server configured with `ES_VERSION=os2` - Cadence Web UI - Prometheus and Grafana for monitoring **Why?** OpenSearch is a popular open-source fork of Elasticsearch that many organizations are adopting. Cadence already supports OpenSearch through the `ES_VERSION=os2` configuration, but there was no ready-to-use docker-compose file for users who want to quickly deploy Cadence with OpenSearch for local development or testing. This addition: - Provides parity with existing Elasticsearch deployment options (es.yml, es-v7.yml) - Makes it easier for users to evaluate OpenSearch as an advanced visibility backend - Offers an alternative for users who prefer OpenSearch over Elasticsearch **How did you test it?** Tested locally using Docker Desktop: - Successfully deployed the full stack using `docker-compose -f docker/docker-compose-opensearch.yml up` - Verified all services started correctly: - Cassandra health check passed - OpenSearch accessible on port 9200 - OpenSearch Dashboards running on port 5601 - Kafka broker operational - Cadence server connected to OpenSearch - Cadence Web UI accessible on port 8088 - Prometheus and Grafana monitoring active **Potential risks** None. This is a new docker-compose configuration file that doesn't modify any existing code or configurations. Users must explicitly choose to use this file, so there's no impact on existing deployments or workflows. **Release notes** New Feature: Added `docker-compose-opensearch.yml` for deploying Cadence with OpenSearch 2.13.0 as the advanced visibility store. This provides users with an easy-to-use deployment option for testing and developing with OpenSearch. **Documentation Changes** May want to update the setup documentation at https://cadenceworkflow.io/docs/operation-guide/setup/ to mention the new OpenSearch docker-compose option alongside the existing Elasticsearch options. I can open a follow-up PR in the cadence-docs repo once this is merged. --------- Signed-off-by: “Kevin” <[email protected]>
1 parent 888f3e3 commit 079d692

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
services:
2+
cassandra:
3+
image: cassandra:4.1.1
4+
ports:
5+
- "9042:9042"
6+
environment:
7+
- "MAX_HEAP_SIZE=256M"
8+
- "HEAP_NEWSIZE=128M"
9+
healthcheck:
10+
test: ["CMD", "cqlsh", "-u cassandra", "-p cassandra" ,"-e describe keyspaces"]
11+
interval: 15s
12+
timeout: 30s
13+
retries: 10
14+
prometheus:
15+
image: prom/prometheus:latest
16+
volumes:
17+
- ./prometheus:/etc/prometheus
18+
command:
19+
- '--config.file=/etc/prometheus/prometheus.yml'
20+
ports:
21+
- '9090:9090'
22+
kafka:
23+
image: docker.io/bitnamilegacy/kafka:3.7
24+
hostname: kafka
25+
container_name: kafka
26+
ports:
27+
- "9092:9092"
28+
environment:
29+
# KRaft settings
30+
- "KAFKA_CFG_NODE_ID=0"
31+
- "KAFKA_CFG_PROCESS_ROLES=controller,broker"
32+
- "KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093"
33+
# Listeners
34+
- "KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093"
35+
- "KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092"
36+
- "KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT"
37+
- "KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER"
38+
- "KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT"
39+
# Topic settings
40+
- "KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true"
41+
opensearch:
42+
image: opensearchproject/opensearch:2.13.0
43+
ports:
44+
- "9200:9200"
45+
- "9600:9600"
46+
environment:
47+
- discovery.type=single-node
48+
- OPENSEARCH_SECURITY_SSL_HTTP_ENABLED=false
49+
- DISABLE_SECURITY_PLUGIN=true
50+
- cluster.name=opensearch-cluster
51+
- bootstrap.memory_lock=true
52+
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
53+
opensearch-dashboards:
54+
image: opensearchproject/opensearch-dashboards:2.13.0
55+
ports:
56+
- "5601:5601"
57+
environment:
58+
OPENSEARCH_HOSTS: '["http://opensearch:9200"]'
59+
DISABLE_SECURITY_DASHBOARDS_PLUGIN: "true"
60+
depends_on:
61+
- opensearch
62+
cadence:
63+
image: ubercadence/server:master-auto-setup
64+
ports:
65+
- "8000:8000"
66+
- "8001:8001"
67+
- "8002:8002"
68+
- "8003:8003"
69+
- "7933:7933"
70+
- "7934:7934"
71+
- "7935:7935"
72+
- "7939:7939"
73+
- "7833:7833"
74+
environment:
75+
- "CASSANDRA_SEEDS=cassandra"
76+
- "PROMETHEUS_ENDPOINT_0=0.0.0.0:8000"
77+
- "PROMETHEUS_ENDPOINT_1=0.0.0.0:8001"
78+
- "PROMETHEUS_ENDPOINT_2=0.0.0.0:8002"
79+
- "PROMETHEUS_ENDPOINT_3=0.0.0.0:8003"
80+
- "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development_es.yaml"
81+
- "ENABLE_ES=true"
82+
- "ES_SEEDS=opensearch"
83+
- "ES_VERSION=os2"
84+
- "KAFKA_SEEDS=kafka"
85+
depends_on:
86+
cassandra:
87+
condition: service_healthy
88+
prometheus:
89+
condition: service_started
90+
kafka:
91+
condition: service_started
92+
opensearch:
93+
condition: service_started
94+
cadence-web:
95+
image: ubercadence/web:latest
96+
environment:
97+
- "CADENCE_GRPC_PEERS=cadence:7833"
98+
ports:
99+
- "8088:8088"
100+
depends_on:
101+
- cadence
102+
grafana:
103+
image: grafana/grafana
104+
volumes:
105+
- ./grafana:/etc/grafana
106+
user: "1000"
107+
depends_on:
108+
- prometheus
109+
ports:
110+
- '3000:3000'
111+

0 commit comments

Comments
 (0)