diff --git a/README.md b/README.md index 1a58e4b55..6e49cb058 100644 --- a/README.md +++ b/README.md @@ -54,35 +54,38 @@ For contribution guidelines, see [Code contribution guide](https://docs.spryker. ## Supported services -| Service | Engine | Version(s) | ARM support | Note | -|-----------------|--------------|--------------|-------------|------------------------------------| -| database | postgres | 9.6* | ✓ | | -| | | 10 | ✓ | | -| | | 11 | ✓ | | -| | | 12 | ✓ | | -| | mysql | 5.7 | | | -| | | mariadb-10.2 | ✓ | | -| | | mariadb-10.3 | ✓ | | -| | | mariadb-10.4 | ✓ | | -| | | mariadb-10.5 | ✓ | | -| broker | rabbitmq | 3.7 | | | -| | | 3.8 | ✓ | | -| | | 3.9 | ✓ | | -| session | redis | 5.0 | ✓ | | -| key_value_store | redis | 5.0 | ✓ | | -| search | elastic | 5.6* | ✓ | https://www.elastic.co/support/eol | -| | | 6.8 | ✓ | https://www.elastic.co/support/eol | -| | | 7.6 | ✓ | | -| | | 7.10 | ✓ | | -| scheduler | jenkins | 2.176 | | | -| | | 2.305 | ✓ | | -| | | 2.324 | ✓ | | -| webdriver | phantomjs | latest* | | | -| | chromedriver | latest | ✓ | | -| mail_catcher | mailhog | 1.0 | ✓ | | -| swagger | swagger-ui | v3.24 | ✓ | | -| kibana | kibana | 5.6* | ✓ | https://www.elastic.co/support/eol | -| | | 6.8 | ✓ | https://www.elastic.co/support/eol | -| | | 7.6 | ✓ | | -| | | 7.10 | ✓ | | -| blackfire | blackfire | latest | ✓ | | +| Service | Engine | Version(s) | ARM support | Note | +|-----------------|--------------|---------------|-------------|------------------------------------| +| database | postgres | 9.6* | ✓ | | +| | | 10 | ✓ | | +| | | 11 | ✓ | | +| | | 12 | ✓ | | +| | mysql | 5.7 | | | +| | | mariadb-10.2 | ✓ | | +| | | mariadb-10.3 | ✓ | | +| | | mariadb-10.4 | ✓ | | +| | | mariadb-10.5 | ✓ | | +| | | mariadb-10.6 | ✓ | | +| | | mariadb-10.11 | ✓ | | +| broker | rabbitmq | 3.7 | | | +| | | 3.8 | ✓ | | +| | | 3.9 | ✓ | | +| session | redis | 5.0 | ✓ | | +| key_value_store | redis | 5.0 | ✓ | | +| search | elastic | 5.6* | ✓ | https://www.elastic.co/support/eol | +| | | 6.8 | ✓ | https://www.elastic.co/support/eol | +| | | 7.6 | ✓ | | +| | | 7.10 | ✓ | | +| | opensearch | 1.3 | ✓ | | +| scheduler | jenkins | 2.176 | | | +| | | 2.305 | ✓ | | +| | | 2.324 | ✓ | | +| webdriver | phantomjs | latest* | | | +| | chromedriver | latest | ✓ | | +| mail_catcher | mailhog | 1.0 | ✓ | | +| swagger | swagger-ui | v3.24 | ✓ | | +| kibana | kibana | 5.6* | ✓ | https://www.elastic.co/support/eol | +| | | 6.8 | ✓ | https://www.elastic.co/support/eol | +| | | 7.6 | ✓ | | +| | | 7.10 | ✓ | | +| blackfire | blackfire | latest | ✓ | | diff --git a/context/opensearch/opensearch.yml b/context/opensearch/opensearch.yml new file mode 100644 index 000000000..412ce182c --- /dev/null +++ b/context/opensearch/opensearch.yml @@ -0,0 +1,18 @@ +# Cluster ################################ +cluster.name: "docker-cluster" + +bootstrap.memory_lock: "true" # along with the memlock settings below, disables swapping + +# Threshold ################################ +cluster.routing.allocation.disk.threshold_enabled: true +cluster.routing.allocation.disk.watermark.low: 90% +cluster.routing.allocation.disk.watermark.high: 95% + +# Security ################################# +plugins.security.disabled: true + +# Network ################################### +http.host: 0.0.0.0 + +# Http ################################### +http.max_content_length: 10mb diff --git a/docs/06-configuring-services.md b/docs/06-configuring-services.md index c50a18fb6..89f25ea90 100644 --- a/docs/06-configuring-services.md +++ b/docs/06-configuring-services.md @@ -153,6 +153,27 @@ services: docker/sdk up ``` +## OpenSearch + +[OpenSearch](https://opensearch.org/docs/1.3/) is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. + +### Configuration + +1. Adjust `deploy.*.yml` in the `services:` section to open the port used for accessing OpenSearch: +```yaml +services: + search: + engine: opensearch + endpoints: + localhost:9200 + protocol: tcp + +2. Bootstrap the docker setup and rebuild the application: +```bash +docker/sdk boot deploy.*.yml &&\ +docker/sdk up +``` + ## Kibana UI [Kibana](https://www.elastic.co/kibana) is an open source analytics and visualization platform designed to work with Elasticsearch. You use Kibana to search, view, and interact with data stored in Elasticsearch indices. You can easily perform advanced data analysis and visualize your data in a variety of charts, tables, and maps. diff --git a/generator/src/templates/env/search/opensearch.env.twig b/generator/src/templates/env/search/opensearch.env.twig new file mode 100644 index 000000000..cb7dbf0a1 --- /dev/null +++ b/generator/src/templates/env/search/opensearch.env.twig @@ -0,0 +1,6 @@ +SPRYKER_SEARCH_ENGINE=OS +SPRYKER_SEARCH_HOST={{ serviceName }} +SPRYKER_SEARCH_PORT={{ serviceData['port'] | default(9200) }} +SPRYKER_SEARCH_INDEX_PREFIX={{ searchIndexPrefix }} +# STORE-SPECIFIC +#SPRYKER_SEARCH_NAMESPACE= diff --git a/generator/src/templates/nginx/tcp/opensearch.server.conf.twig b/generator/src/templates/nginx/tcp/opensearch.server.conf.twig new file mode 100644 index 000000000..66b923e9e --- /dev/null +++ b/generator/src/templates/nginx/tcp/opensearch.server.conf.twig @@ -0,0 +1,3 @@ +{% extends "nginx/tcp/server.conf.twig" %} +{% block port %}{{ port | default(9200) }}{% endblock port %} +{% block upstream %}{{ upstream }}:9200{% endblock upstream %} diff --git a/generator/src/templates/service/mysql/mariadb-10.11/mysql.yml.twig b/generator/src/templates/service/mysql/mariadb-10.11/mysql.yml.twig new file mode 100644 index 000000000..67dcb36cc --- /dev/null +++ b/generator/src/templates/service/mysql/mariadb-10.11/mysql.yml.twig @@ -0,0 +1,19 @@ + {{ serviceName }}: + image: mariadb:10.11 + networks: + - private + labels: + 'spryker.app.name': database + 'spryker.app.type': services + 'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG} + healthcheck: + test: ["CMD", "mysqladmin", "ping", "--silent"] + interval: 10s + timeout: 10s + retries: 5 + environment: + MYSQL_ROOT_PASSWORD: "{{ serviceData['root']['password'] }}" + LANG: C.UTF-8 + volumes: + - {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/lib/mysql:rw + - ./${DEPLOYMENT_PATH}/context/mysql/my.cnf:/etc/mysql/mariadb.conf.d/my.cnf:ro diff --git a/generator/src/templates/service/mysql/mariadb-10.6/mysql.yml.twig b/generator/src/templates/service/mysql/mariadb-10.6/mysql.yml.twig new file mode 100644 index 000000000..240bf1923 --- /dev/null +++ b/generator/src/templates/service/mysql/mariadb-10.6/mysql.yml.twig @@ -0,0 +1,19 @@ + {{ serviceName }}: + image: mariadb:10.6 + networks: + - private + labels: + 'spryker.app.name': database + 'spryker.app.type': services + 'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG} + healthcheck: + test: ["CMD", "mysqladmin", "ping", "--silent"] + interval: 10s + timeout: 10s + retries: 5 + environment: + MYSQL_ROOT_PASSWORD: "{{ serviceData['root']['password'] }}" + LANG: C.UTF-8 + volumes: + - {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/lib/mysql:rw + - ./${DEPLOYMENT_PATH}/context/mysql/my.cnf:/etc/mysql/mariadb.conf.d/my.cnf:ro diff --git a/generator/src/templates/service/opensearch/1.3/opensearch.yml.twig b/generator/src/templates/service/opensearch/1.3/opensearch.yml.twig new file mode 100644 index 000000000..7ae649fb1 --- /dev/null +++ b/generator/src/templates/service/opensearch/1.3/opensearch.yml.twig @@ -0,0 +1,25 @@ + {{ serviceName }}: + image: opensearchproject/opensearch:1.3 + networks: + - private + labels: + 'spryker.app.name': search + 'spryker.app.type': services + 'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG} + healthcheck: + test: ["CMD", "curl", "-f", "localhost:9200/_cat/health"] + interval: 10s + timeout: 5s + retries: 5 + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65536 + hard: 65536 + environment: + ES_JAVA_OPTS: "-Xms512m -Xmx512m" + volumes: + - {{ serviceName }}-{{ serviceData['engine'] }}-data:/usr/share/opensearch/data:rw + - ./${DEPLOYMENT_PATH}/context/opensearch/opensearch.yml:/usr/share/opensearch/config/opensearch.yml:ro diff --git a/generator/src/templates/service/opensearch/default/opensearch.yml.twig b/generator/src/templates/service/opensearch/default/opensearch.yml.twig new file mode 100644 index 000000000..01b3615db --- /dev/null +++ b/generator/src/templates/service/opensearch/default/opensearch.yml.twig @@ -0,0 +1 @@ +{% include "service/#{engine}/1.3/#{engine}.yml.twig" with _context only %} diff --git a/generator/src/templates/terraform/search/opensearch.tf.twig b/generator/src/templates/terraform/search/opensearch.tf.twig new file mode 100644 index 000000000..c08915124 --- /dev/null +++ b/generator/src/templates/terraform/search/opensearch.tf.twig @@ -0,0 +1,2 @@ + SPRYKER_SEARCH_ENGINE = "OS" + SPRYKER_SEARCH_INDEX_PREFIX = "{{ searchIndexPrefix }}"