Skip to content

Commit 078ebce

Browse files
authored
[UNOMI-828] Support for OpenSearch persistence (#715)
* Minor Quickstart refactoring * Merge changes from master branch * Additional remove commands for actions, conditions, sessions, rules to be able to fix problems with deployments * Initial working OpenSearch implementation. Basic functionality is working, work on automated tests is still in progress. * Merges from master * Bump all versions to 2.7 * Fix interface in blueprint descriptor * Fix interface in blueprint descriptor * Fix interface in blueprint descriptor * - Fix issues with integration tests, ES tests now work 100% - Changed Unomi startup to use features instead of bundles - Added new build script that integrates all the functionality of the other build scripts - Fix IPv6 address parsing - Merge latest changes from master branch - * - Remove old build scripts - Add option to new build script to be able to use opensearch with integration tests * - Add new conditions bundle for ElasticSearch-specific conditions - Replace hardcoded past event ES query builder in pasteventconditionbuilder to use a generic interface - Replace GeoDistance and DistanceUnit used directly from ElasticSearch with clean-room implementation that are validated through unit tests. Also added unit tests on the ElasticSearch implementation to be able to test any differences - Also added clean-room implementation of the DateMathParser so that it can be used with ElasticSearch or OpenSearch - Modified Unomi startup mechanism to use features instead of bundles. Unfortunately due to complex interdependencies between bundles the features could not be split as wanted, so there is some duplication in the list of bundles. - Removed last of inter-dependencies in the base plugin and the persistence-spi to try to resolve bundle inter-dependencies but that wasn't enough. - ElasticSearch integration tests are now execute without any errors ! * Work on making integration tests work with OpenSearch: - Removed elasticsearch-core from bundle watch requirements - Fix issues with date parsing due to case sensitivity - Improved test units for date parsing and date math handling - Modified HealthChecks to provide an OpenSearch check provider (not yet fully working) - Deactivate 1.x to 2.x migration integration test for OpenSearch (No OpenSearch users will be coming from 1.x) - Update OpenSearch past event query builder to latest changes done in ElasticSearch past event query builder - Various fixes in the integration tests to make them compatible with OpenSearch (removed hardcoded elasticsearch configuration and references) - Added new shell script in itests directory to make it easier to handle the dynamically generated Pax Exam Karaf test container directory. Documentation is also included in the README file inside the itests directory. * Work on making integration tests work with OpenSearch: - Removed elasticsearch-core from bundle watch requirements - Fix issues with date parsing due to case sensitivity - Improved test units for date parsing and date math handling - Modified HealthChecks to provide an OpenSearch check provider (not yet fully working) - Deactivate 1.x to 2.x migration integration test for OpenSearch (No OpenSearch users will be coming from 1.x) - Update OpenSearch past event query builder to latest changes done in ElasticSearch past event query builder - Various fixes in the integration tests to make them compatible with OpenSearch (removed hardcoded elasticsearch configuration and references) - Added new shell script in itests directory to make it easier to handle the dynamically generated Pax Exam Karaf test container directory. Documentation is also included in the README file inside the itests directory. * Add missing ASL header * - Introduce new ProgressListener system to indicate the current progress status in the integration tests - Make sure the Unomi Management Service is started in IT tests before starting the unomi:start command - Add support for minimal cluster state to allow to start an OpenSearch cluster with yellow status in IT tests - Fix OpenSearch configuration prefix - Modify HealthCheck providers to only be available depending on the availability of the persistence implementation. - Fix integration tests to work properly with OpenSearch. - Fix OpenSearch persistence initial startup - Restructure startFeatures configuration to use arrays instead of complex parsing - Modify OpenSearch custom object mapping to serialize map entries that have null values (which is the default for the ElasticSearch implementation). - * - Introduce new ProgressListener system to indicate the current progress status in the integration tests - Make sure the Unomi Management Service is started in IT tests before starting the unomi:start command - Add support for minimal cluster state to allow to start an OpenSearch cluster with yellow status in IT tests - Fix OpenSearch configuration prefix - Modify HealthCheck providers to only be available depending on the availability of the persistence implementation. - Fix integration tests to work properly with OpenSearch. - Fix OpenSearch persistence initial startup - Restructure startFeatures configuration to use arrays instead of complex parsing - Modify OpenSearch custom object mapping to serialize map entries that have null values (which is the default for the ElasticSearch implementation). - Make sure the OpenSearch docker container used for the IT tests is replaced when tests are restarted. - Fix the handling of the OffsetDateTime in the OpenSearch Property condition query builder - Fix the rule service IT to generate rules with proper conditions and actions * - Small cosmetic changes to the progress listener's top 10 slowest tests output to be CSV compatible - Added a known issue in the itests README to reference the log issue on OpenSearch 2.18. * - Add auto-start and no-karaf options to build script * - Fix NO_COLOR handling * - Add support for OpenSearch in docker images - Add docker compose support for OpenSearch - Fix startup issues with updates to UnomiManagementService - Documentation updates to add OpenSearch information (still to be completed) * - Improve plugin documentation to explain how to implement plugins for both OpenSearch and ElasticSearch - Update Health check README to explain how it now works with both ElasticSearch and OpenSearch engines * - Add support for OpenSearch in docker images - Add docker compose support for OpenSearch - Fix startup issues with updates to UnomiManagementService - Documentation updates to add OpenSearch information (still to be completed) * Change max parallel stragegy to 1 to avoid port conflicts * - Make the search port configurable so that we can avoid conflicts between the ElasticSearch and OpenSearch integration tests - Add documentation on how to migrate from ElasticSearch to OpenSearch (not tested yet) * Update persistence-opensearch/conditions/src/main/java/org/apache/unomi/persistence/opensearch/conditions/PropertyConditionOSQueryBuilder.java * Update persistence-opensearch/conditions/src/main/java/org/apache/unomi/persistence/opensearch/conditions/PropertyConditionOSQueryBuilder.java * Update persistence-opensearch/conditions/src/main/java/org/apache/unomi/persistence/opensearch/conditions/PropertyConditionOSQueryBuilder.java * Update persistence-opensearch/core/src/main/java/org/apache/unomi/persistence/opensearch/OpenSearchPersistenceServiceImpl.java * - Remove Claude config file - Update documentation to indicate support for OpenSearch 3 instead of 2 * Fix some minor dependencies * Make sure all OpenSearch documentation points to v3 * Fix Unomi version in documentation * Refactor entrypoint.sh to build node URLs array for both OpenSearch and Elasticsearch configurations * Added a maximum number of retries to address issued raised during code review. * To address issue in code review, made sure we output to both the logger and the System.out systematically * Enhance ProgressListener with detailed JUnit test run reporting features. Added visual elements, timing information, motivational quotes, and CSV output for performance data. Improved ANSI color support and structured documentation for better usability. * Enhance ProgressSuite with detailed documentation and improved test method counting. Added support for nested test classes, real-time progress reporting, and thread-safe tracking of completed tests. Updated class structure to facilitate better integration with ProgressListener. * Update RuleServiceIT to clarify default condition and action settings in rule creation * Update healthcheck configuration to correct HTTP client settings for OpenSearch and Elasticsearch, including trust certificate options and minimal cluster state defaults. * Update Unomi version in quickstart and migration documentation from 2.0.0 to 3.0.0 * Clarify integration test impact of Maven profile selection for OpenSearch in configuration documentation * Update setenv.sh to modify KARAF_OPTS for OpenSearch integration and remove auto-start option * Refactor PropertyConditionEvaluator to use foldToASCII for string comparison, aligning with analyzer configuration behavior * Revert IPv6 fix * Refactor monthly index properties to rollover properties in configuration files and update related test cases. Rename test method for clarity and adjust logging messages to reflect changes in index template creation. * Quick fix on description * Refactor error handling in HealthCheckIT and OpenSearchPersistenceServiceImpl to use logging instead of printStackTrace. Update exception messages in IdsConditionESQueryBuilder and IdsConditionOSQueryBuilder to include maximum IDs query count for better clarity. Other general naming cleanup. * Revert test unit runner to default one, will introduce new ProgressListener in a separate PR * - Rename all query builder IDs to no longer use a reference to ElasticSearch - Remove hover event query builder that is replaced with a condition definition with a parent condition - Add a JSON schema for the hover event type - Add missing JavaDocs * Add detailed Javadoc comments to aggregation and condition interfaces for improved documentation * - Removed non OpenSearch specific changes - Added missing Javadoc comments - Minor whitespace cleanups * Update CI workflow to use actions/setup-java@v4 and improve OpenSearch integration test instructions in documentation * Implement legacy query builder ID mapping for backward compatibility in Elasticsearch and OpenSearch. Add integration tests for legacy query builder functionality, including new condition definitions and JSON files for legacy conditions. Update documentation to reflect changes in query builder ID conventions and migration steps from previous versions. * Refactor ConditionESQueryBuilderDispatcher and ConditionOSQueryBuilderDispatcher to utilize ConditionQueryBuilderDispatcherSupport for legacy ID resolution and contextualization. Remove hardcoded legacy ID mappings and improve documentation regarding legacy query builder handling. * Run the build serially to avoid parallel interference * Update new poms to version 3.1.0 * Refactor condition query builder dispatchers to extend a new base class. Update legacy query builder references to use the new centralized mapping and logging mechanism. This change enhances code maintainability and prepares for future improvements.
1 parent b617d5c commit 078ebce

File tree

173 files changed

+9957
-835
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+9957
-835
lines changed

.github/workflows/unomi-ci-build-tests.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,56 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222
- name: Set up JDK 17
23-
uses: actions/setup-java@v1
23+
uses: actions/setup-java@v4
2424
with:
25-
java-version: 17
26-
cache: maven
25+
distribution: 'temurin'
26+
java-version: '17'
27+
cache: 'maven'
2728
- name: Build and Unit tests
2829
run: mvn -U -ntp -e clean install
2930

3031
integration-tests:
3132
name: Execute integration tests
33+
needs: unit-tests
3234
runs-on: ubuntu-latest
35+
strategy:
36+
max-parallel: 1
37+
matrix:
38+
include:
39+
- search-engine: elasticsearch
40+
port: 9400
41+
- search-engine: opensearch
42+
port: 9401
43+
fail-fast: false
3344
steps:
3445
- uses: actions/checkout@v4
3546
- name: Set up JDK 17
36-
uses: actions/setup-java@v1
47+
uses: actions/setup-java@v4
3748
with:
38-
java-version: 17
39-
cache: maven
49+
distribution: 'temurin'
50+
java-version: '17'
51+
cache: 'maven'
4052
- name: Integration tests
41-
run: mvn -ntp clean install -Pintegration-tests
53+
run: |
54+
FLAGS="-Pintegration-tests"
55+
if [ "${{ matrix.search-engine }}" = "opensearch" ]; then
56+
# Trigger OpenSearch profile activation via property; do not pass any -P profile toggles
57+
FLAGS="$FLAGS -Duse.opensearch=true"
58+
fi
59+
mvn -ntp clean install $FLAGS \
60+
-Dopensearch.port=${{ matrix.port }} \
61+
-Delasticsearch.port=${{ matrix.port }}
4262
- name: Archive code coverage logs
4363
uses: actions/upload-artifact@v4
4464
if: false # UNOMI-746 Reactivate if necessary
4565
with:
46-
name: unomi-code-coverage-jdk17-${{ github.run_number }}
66+
name: unomi-code-coverage-jdk17-${{ matrix.search-engine }}-${{ github.run_number }}
4767
path: itests/target/site/jacoco
4868
- name: Archive unomi logs
4969
uses: actions/upload-artifact@v4
5070
if: failure()
5171
with:
52-
name: unomi-log-jdk17-${{ github.run_number }}
72+
name: unomi-log-jdk17-${{ matrix.search-engine }}-${{ github.run_number }}
5373
path: |
5474
itests/target/exam/**/data/log
5575
itests/target/elasticsearch0/data

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/NOTICE-generated
22
.settings
3+
.vscode
34
target
45
.classpath
56
.project
@@ -16,4 +17,5 @@ rest/.miredot-offline.json
1617
/extensions/salesforce-connector/test.properties
1718
**/*.versionsBackup
1819
itests/src/main
19-
.mvn/.develocity/develocity-workspace-id
20+
dependency_tree.txt
21+
.mvn/.develocity/develocity-workspace-id

docker/README.md

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ required Unomi tarball.
3030

3131
## Launching docker-compose using Maven project
3232

33-
Unomi requires ElasticSearch so it is recommended to run Unomi and ElasticSearch using docker-compose:
33+
Unomi requires a search engine (ElasticSearch or OpenSearch) so it is recommended to run Unomi and the search engine using docker-compose:
3434

3535
```
3636
mvn docker:start
3737
```
3838

39-
You will need to wait while Docker builds the containers and they boot up (ES will take a minute or two). Once they are
39+
You will need to wait while Docker builds the containers and they boot up (the search engine will take a minute or two). Once they are
4040
up you can check that the Unomi services are available by visiting http://localhost:8181 in a web browser.
4141

42-
## Manually launching ElasticSearch & Unomi docker images
42+
## Manually launching Search Engine & Unomi docker images
4343

4444
If you want to run it without docker-compose you should then make sure you setup the following environments properly.
4545

@@ -48,21 +48,66 @@ For ElasticSearch:
4848
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.4.2
4949
docker network create unomi
5050
docker run --name elasticsearch --net unomi -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e cluster.name=contextElasticSearch docker.elastic.co/elasticsearch/elasticsearch:7.4.2
51+
52+
For OpenSearch:
53+
54+
docker pull opensearchproject/opensearch:3.0.0
55+
docker network create unomi
56+
export OPENSEARCH_ADMIN_PASSWORD=enter_your_custom_admin_password_here
57+
docker run --name opensearch --net unomi -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_ADMIN_PASSWORD} opensearchproject/opensearch:3.0.0
5158

52-
For Unomi:
59+
For Unomi (with ElasticSearch):
60+
61+
docker pull apache/unomi:3.0.0-SNAPSHOT
62+
docker run --name unomi --net unomi -p 8181:8181 -p 9443:9443 -p 8102:8102 \
63+
-e UNOMI_ELASTICSEARCH_ADDRESSES=elasticsearch:9200 \
64+
apache/unomi:3.0.0-SNAPSHOT
5365

54-
docker pull apache/unomi:2.0.0-SNAPSHOT
55-
docker run --name unomi --net unomi -p 8181:8181 -p 9443:9443 -p 8102:8102 -e UNOMI_ELASTICSEARCH_ADDRESSES=elasticsearch:9200 apache/unomi:2.0.0-SNAPSHOT
66+
For Unomi (with OpenSearch):
5667

57-
## Using a host OS ElasticSearch installation (only supported on macOS & Windows)
68+
docker pull apache/unomi:3.0.0-SNAPSHOT
69+
docker run --name unomi --net unomi -p 8181:8181 -p 9443:9443 -p 8102:8102 \
70+
-e UNOMI_AUTO_START=opensearch \
71+
-e UNOMI_OPENSEARCH_ADDRESSES=opensearch:9200 \
72+
-e UNOMI_OPENSEARCH_PASSWORD=${OPENSEARCH_ADMIN_PASSWORD} \
73+
apache/unomi:3.0.0-SNAPSHOT
74+
75+
## Using a host OS Search Engine installation (only supported on macOS & Windows)
76+
77+
For ElasticSearch:
5878

59-
docker run --name unomi -p 8181:8181 -p 9443:9443 -p 8102:8102 -e UNOMI_ELASTICSEARCH_ADDRESSES=host.docker.internal:9200 apache/unomi:2.0.0-SNAPSHOT
79+
docker run --name unomi -p 8181:8181 -p 9443:9443 -p 8102:8102 \
80+
-e UNOMI_ELASTICSEARCH_ADDRESSES=host.docker.internal:9200 \
81+
apache/unomi:3.0.0-SNAPSHOT
82+
83+
For OpenSearch:
84+
85+
docker run --name unomi -p 8181:8181 -p 9443:9443 -p 8102:8102 \
86+
-e UNOMI_AUTO_START=opensearch \
87+
-e UNOMI_OPENSEARCH_ADDRESSES=host.docker.internal:9200 \
88+
-e UNOMI_OPENSEARCH_PASSWORD=${OPENSEARCH_ADMIN_PASSWORD} \
89+
apache/unomi:3.0.0-SNAPSHOT
6090

6191
Note: Linux doesn't support the host.docker.internal DNS lookup method yet, it should be available in an upcoming version of Docker. See https://github.com/docker/for-linux/issues/264
6292

93+
## Environment Variables
94+
95+
### Common Variables
96+
- `UNOMI_AUTO_START`: Specifies the search engine type (`elasticsearch` or `opensearch`, defaults to `elasticsearch`)
97+
98+
### ElasticSearch-specific Variables
99+
- `UNOMI_ELASTICSEARCH_ADDRESSES`: ElasticSearch host:port (default: localhost:9200)
100+
- `UNOMI_ELASTICSEARCH_USERNAME`: Optional username for ElasticSearch
101+
- `UNOMI_ELASTICSEARCH_PASSWORD`: Optional password for ElasticSearch
102+
- `UNOMI_ELASTICSEARCH_SSL_ENABLE`: Enable SSL for ElasticSearch connection (default: false)
103+
104+
### OpenSearch-specific Variables
105+
- `UNOMI_OPENSEARCH_ADDRESSES`: OpenSearch host:port (default: localhost:9200)
106+
- `UNOMI_OPENSEARCH_PASSWORD`: Required admin password for OpenSearch (SSL and authentication are mandatory)
107+
63108
# Using docker build tools
64109

65110
If you want to rebuild the images or use docker compose directly, you must still first use `mvn clean install` to generate
66111
the filtered project in `target/filtered-docker`.
67112

68-
You can then use `docker-compose up` to start the project
113+
You can then use `docker compose -f docker-compose-es.yml up` to start the project with ElasticSearch or `docker compose -f docker-compose-os.yml up` to start the project with OpenSearch.

docker/pom.xml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,21 @@
9494
<directory>${project.basedir}/src/main/docker</directory>
9595
<filtering>true</filtering>
9696
<includes>
97-
<include>docker-compose.yml</include>
98-
<include>docker-compose-build.yml</include>
97+
<include>docker-compose-es.yml</include>
98+
<include>docker-compose-build-es.yml</include>
99+
<include>docker-compose-os.yml</include>
100+
<include>docker-compose-build-os.yml</include>
99101
</includes>
100102
</resource>
101103
<!-- # Unfiltered Resources -->
102104
<resource>
103105
<directory>${project.basedir}/src/main/docker</directory>
104106
<filtering>false</filtering>
105107
<excludes>
106-
<exclude>docker-compose.yml</exclude>
107-
<include>docker-compose-build.yml</include>
108+
<exclude>docker-compose-es.yml</exclude>
109+
<exclude>docker-compose-build-es.yml</exclude>
110+
<exclude>docker-compose-os.yml</exclude>
111+
<exclude>docker-compose-build-os.yml</exclude>
108112
</excludes>
109113
</resource>
110114
</resources>
@@ -133,7 +137,7 @@
133137
<external>
134138
<type>compose</type>
135139
<basedir>${project.build.directory}/filtered-docker</basedir>
136-
<composeFile>${project.build.directory}/filtered-docker/docker-compose-build.yml</composeFile>
140+
<composeFile>${project.build.directory}/filtered-docker/docker-compose-build-es.yml</composeFile>
137141
</external>
138142
</image>
139143
</images>
@@ -161,10 +165,17 @@
161165
<artifacts>
162166
<artifact>
163167
<file>
164-
${project.build.directory}/filtered-docker/docker-compose.yml
168+
${project.build.directory}/filtered-docker/docker-compose-es.yml
165169
</file>
166170
<type>yml</type>
167-
<classifier>docker-compose</classifier>
171+
<classifier>docker-compose-es</classifier>
172+
</artifact>
173+
<artifact>
174+
<file>
175+
${project.build.directory}/filtered-docker/docker-compose-os.yml
176+
</file>
177+
<type>yml</type>
178+
<classifier>docker-compose-os</classifier>
168179
</artifact>
169180
</artifacts>
170181
</configuration>

docker/src/main/docker/Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@ FROM library/eclipse-temurin:17
2020
# Unomi environment variables
2121
ENV UNOMI_HOME=/opt/apache-unomi
2222
ENV PATH=$PATH:$UNOMI_HOME/bin
23-
ENV KARAF_OPTS="-Dunomi.autoStart=true"
23+
24+
ENV UNOMI_AUTO_START=true
25+
26+
# Debug configuration (disabled by default)
27+
ENV KARAF_DEBUG=false
28+
ENV KARAF_DEBUG_PORT=5005
29+
ENV KARAF_DEBUG_SUSPEND=n
30+
2431
ENV UNOMI_ELASTICSEARCH_ADDRESSES=localhost:9200
32+
ENV UNOMI_OPENSEARCH_ADDRESSES=localhost:9200
2533

2634
WORKDIR $UNOMI_HOME
2735

@@ -34,8 +42,11 @@ RUN mv unomi-*/* . \
3442

3543
COPY entrypoint.sh ./entrypoint.sh
3644

45+
# Expose standard ports
3746
EXPOSE 9443
3847
EXPOSE 8181
3948
EXPOSE 8102
49+
# Expose debug port
50+
EXPOSE 5005
4051

4152
CMD ["/bin/bash", "./entrypoint.sh"]

docker/src/main/docker/docker-compose-build.yml renamed to docker/src/main/docker/docker-compose-build-es.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ services:
3535
build: .
3636
image: apache/unomi:${project.version}
3737
environment:
38+
- UNOMI_AUTO_START=elasticsearch
3839
- UNOMI_ELASTICSEARCH_ADDRESSES=elasticsearch:9200
40+
# Debug settings
41+
- KARAF_DEBUG=${DEBUG:-false}
42+
- KARAF_DEBUG_PORT=${DEBUG_PORT:-5005}
43+
- KARAF_DEBUG_SUSPEND=${DEBUG_SUSPEND:-n}
3944
ports:
4045
- 8181:8181
4146
- 9443:9443
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
################################################################################
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
################################################################################
17+
version: '2.4'
18+
19+
# Define networks first
20+
networks:
21+
unomi-net:
22+
driver: bridge
23+
24+
services:
25+
opensearch-node1:
26+
image: opensearchproject/opensearch:3.0.0
27+
container_name: opensearch-node1
28+
environment:
29+
- cluster.name=opensearch-cluster
30+
- node.name=opensearch-node1
31+
- discovery.seed_hosts=opensearch-node1,opensearch-node2
32+
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
33+
- bootstrap.memory_lock=true
34+
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
35+
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}
36+
ulimits:
37+
memlock:
38+
soft: -1
39+
hard: -1
40+
nofile:
41+
soft: 65536
42+
hard: 65536
43+
volumes:
44+
- opensearch-data1:/usr/share/opensearch/data
45+
ports:
46+
- 9200:9200
47+
- 9600:9600
48+
networks:
49+
unomi-net:
50+
aliases:
51+
- opensearch-node1
52+
53+
opensearch-node2:
54+
image: opensearchproject/opensearch:3.0.0
55+
container_name: opensearch-node2
56+
environment:
57+
- cluster.name=opensearch-cluster
58+
- node.name=opensearch-node2
59+
- discovery.seed_hosts=opensearch-node1,opensearch-node2
60+
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
61+
- bootstrap.memory_lock=true
62+
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
63+
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}
64+
ulimits:
65+
memlock:
66+
soft: -1
67+
hard: -1
68+
nofile:
69+
soft: 65536
70+
hard: 65536
71+
volumes:
72+
- opensearch-data2:/usr/share/opensearch/data
73+
networks:
74+
unomi-net:
75+
aliases:
76+
- opensearch-node2
77+
78+
opensearch-dashboards:
79+
image: opensearchproject/opensearch-dashboards:3.0.0
80+
container_name: opensearch-dashboards
81+
ports:
82+
- 5601:5601
83+
environment:
84+
OPENSEARCH_HOSTS: '["https://opensearch-node1:9200","https://opensearch-node2:9200"]'
85+
networks:
86+
unomi-net:
87+
aliases:
88+
- opensearch-dashboards
89+
depends_on:
90+
- opensearch-node1
91+
- opensearch-node2
92+
93+
unomi:
94+
build: .
95+
image: apache/unomi:${project.version}
96+
container_name: unomi
97+
environment:
98+
- UNOMI_AUTO_START=opensearch
99+
- UNOMI_OPENSEARCH_ADDRESSES=opensearch-node1:9200
100+
- UNOMI_OPENSEARCH_USERNAME=admin
101+
- UNOMI_OPENSEARCH_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}
102+
# Debug settings
103+
- KARAF_DEBUG=${DEBUG:-false}
104+
- KARAF_DEBUG_PORT=${DEBUG_PORT:-5005}
105+
- KARAF_DEBUG_SUSPEND=${DEBUG_SUSPEND:-n}
106+
ports:
107+
- 8181:8181
108+
- 9443:9443
109+
- 8102:8102
110+
# Debug port
111+
- "${DEBUG_PORT:-5005}:5005"
112+
depends_on:
113+
- opensearch-node1
114+
- opensearch-node2
115+
networks:
116+
unomi-net:
117+
aliases:
118+
- unomi
119+
120+
volumes:
121+
opensearch-data1:
122+
opensearch-data2:

0 commit comments

Comments
 (0)