diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index efaa650a3bdaf..b4a57682d3394 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -30,8 +30,8 @@ on: env: # Workaround testsuite locale issue LANG: en_US.UTF-8 - NATIVE_TEST_MAVEN_OPTS: "-B --settings .github/mvn-settings.xml --fail-at-end -Dquarkus.native.container-build=true -Dtest-postgresql -Dtest-elasticsearch -Dtest-keycloak -Dtest-amazon-services -Dtest-db2 -Dtest-mysql -Dtest-mariadb -Dmariadb.base_url='jdbc:mariadb://localhost:3308' -Dmariadb.url='jdbc:mariadb://localhost:3308/hibernate_orm_test' -Dtest-mssql -Dtest-vault -Dtest-neo4j -Dtest-kafka -Dtest-redis -Dnative-image.xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install" - JVM_TEST_MAVEN_OPTS: "-e -B --settings .github/mvn-settings.xml -Dtest-postgresql -Dtest-elasticsearch -Dtest-db2 -Dtest-mysql -Dtest-mariadb -Dmariadb.base_url='jdbc:mariadb://localhost:3308' -Dmariadb.url='jdbc:mariadb://localhost:3308/hibernate_orm_test' -Dtest-mssql -Dtest-amazon-services -Dtest-vault -Dtest-neo4j -Dtest-kafka -Dtest-keycloak -Dtest-redis -Dformat.skip" + NATIVE_TEST_MAVEN_OPTS: "-B --settings .github/mvn-settings.xml --fail-at-end -Dquarkus.native.container-build=true -Dtest-postgresql -Dtest-elasticsearch -Delasticsearch.hosts='localhost:9200' -Dtest-keycloak -Dtest-amazon-services -Dtest-db2 -Dtest-mysql -Dtest-mariadb -Dmariadb.base_url='jdbc:mariadb://localhost:3308' -Dmariadb.url='jdbc:mariadb://localhost:3308/hibernate_orm_test' -Dtest-mssql -Dtest-vault -Dtest-neo4j -Dtest-kafka -Dtest-redis -Dnative-image.xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install" + JVM_TEST_MAVEN_OPTS: "-e -B --settings .github/mvn-settings.xml -Dtest-postgresql -Dtest-elasticsearch -Delasticsearch.hosts='localhost:9200' -Dtest-db2 -Dtest-mysql -Dtest-mariadb -Dmariadb.base_url='jdbc:mariadb://localhost:3308' -Dmariadb.url='jdbc:mariadb://localhost:3308/hibernate_orm_test' -Dtest-mssql -Dtest-amazon-services -Dtest-vault -Dtest-neo4j -Dtest-kafka -Dtest-keycloak -Dtest-redis -Dformat.skip" DB_USER: hibernate_orm_test DB_PASSWORD: hibernate_orm_test DB_NAME: hibernate_orm_test @@ -181,6 +181,12 @@ jobs: image: redis:5.0.8-alpine ports: - 127.0.0.1:6379:6379 + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.8.0 + env: + discovery.type: single-node + ports: + - 127.0.0.1:9200:9200 steps: - name: Start mysql shell: bash @@ -444,6 +450,7 @@ jobs: hibernate-reactive-postgresql - category: Data6 postgres: "true" + elasticsearch: "true" timeout: 40 test-modules: > elasticsearch-rest-client @@ -609,6 +616,12 @@ jobs: -Dkeycloak.profile.feature.upload_scripts=enabled" \ -d quay.io/keycloak/keycloak:11.0.1 if: matrix.keycloak + - name: Elasticsearch Service + run: | + docker run --rm --publish 9200:9200 --name build-elasticsearch \ + -e discovery.type=single-node \ + -d docker.elastic.co/elasticsearch/elasticsearch-oss:7.8.0 + if: matrix.elasticsearch - uses: actions/checkout@v2 - name: Set up JDK 11 # Uses sha for added security since tags can be updated diff --git a/build-parent/pom.xml b/build-parent/pom.xml index 2373c36cff231..f0afdd9cc439f 100644 --- a/build-parent/pom.xml +++ b/build-parent/pom.xml @@ -16,8 +16,6 @@ - 6.15 - 7.8.0 4.1.1 @@ -75,6 +73,11 @@ 4.7.2 + + 7.8.0 + docker.elastic.co/elasticsearch/elasticsearch-oss:${elasticsearch-server.version} + http + 3.0.2 1.11.3 @@ -484,14 +487,6 @@ true - - com.github.alexcojocaru - elasticsearch-maven-plugin - ${elasticsearch-maven-plugin.version} - - ${elasticsearch-server.version} - - org.antlr antlr4-maven-plugin diff --git a/integration-tests/elasticsearch-rest-client/pom.xml b/integration-tests/elasticsearch-rest-client/pom.xml index 5b38225180a5a..1aacb088c49c7 100644 --- a/integration-tests/elasticsearch-rest-client/pom.xml +++ b/integration-tests/elasticsearch-rest-client/pom.xml @@ -41,6 +41,12 @@ + + + src/main/resources + true + + io.quarkus @@ -91,25 +97,67 @@ false + + + + + + docker-elasticsearch + + + docker + + + + localhost:9200 + http + + + - com.github.alexcojocaru - elasticsearch-maven-plugin + io.fabric8 + docker-maven-plugin - 90 - ${project.build.directory}/test-classes/elasticsearch-maven-plugin/configuration/ - true + + + ${elasticsearch.image} + elasticsearch + + + single-node + + + 9200:9200 + + + Elasticsearch: + default + cyan + + + + http://localhost:9200 + GET + 200 + + + + + + + true - - start-elasticsearch + docker-start process-test-classes - runforked + stop + start - stop-elasticsearch + docker-stop post-integration-test stop @@ -117,9 +165,26 @@ + + org.codehaus.mojo + exec-maven-plugin + + + docker-prune + generate-resources + + exec + + + ${basedir}/../../.github/docker-prune.sh + + + + + native diff --git a/integration-tests/elasticsearch-rest-client/src/main/resources/application.properties b/integration-tests/elasticsearch-rest-client/src/main/resources/application.properties index 8395e78244c4d..3c4d6d3f852d5 100644 --- a/integration-tests/elasticsearch-rest-client/src/main/resources/application.properties +++ b/integration-tests/elasticsearch-rest-client/src/main/resources/application.properties @@ -1,4 +1,5 @@ -quarkus.elasticsearch.hosts=localhost:9200 +quarkus.elasticsearch.hosts=${elasticsearch.hosts} +quarkus.elasticsearch.protocol=${elasticsearch.protocol} quarkus.elasticsearch.socket-timeout=10S quarkus.elasticsearch.discovery.enabled=true quarkus.elasticsearch.discovery.refresh-interval=1M \ No newline at end of file diff --git a/integration-tests/elasticsearch-rest-client/src/test/resources/elasticsearch-maven-plugin/configuration/elasticsearch.yml b/integration-tests/elasticsearch-rest-client/src/test/resources/elasticsearch-maven-plugin/configuration/elasticsearch.yml deleted file mode 100644 index e15abadf05b9d..0000000000000 --- a/integration-tests/elasticsearch-rest-client/src/test/resources/elasticsearch-maven-plugin/configuration/elasticsearch.yml +++ /dev/null @@ -1,92 +0,0 @@ -# ======================== Elasticsearch Configuration ========================= -# -# NOTE: Elasticsearch comes with reasonable defaults for most settings. -# Before you set out to tweak and tune the configuration, make sure you -# understand what are you trying to accomplish and the consequences. -# -# The primary way of configuring a node is via this file. This template lists -# the most important settings you may want to configure for a production cluster. -# -# Please consult the documentation for further information on configuration options: -# https://www.elastic.co/guide/en/elasticsearch/reference/index.html -# -# ---------------------------------- Cluster ----------------------------------- -# -# Use a descriptive name for your cluster: -# -#cluster.name: my-application -# -# ------------------------------------ Node ------------------------------------ -# -# Use a descriptive name for the node: -# -#node.name: node-1 -# -# Add custom attributes to the node: -# -#node.attr.rack: r1 -# -# ----------------------------------- Paths ------------------------------------ -# -# Path to directory where to store the data (separate multiple locations by comma): -# -#path.data: /path/to/data -# -# Path to log files: -# -#path.logs: /path/to/logs -# -# ----------------------------------- Memory ----------------------------------- -# -# Lock the memory on startup: -# -bootstrap.memory_lock: true -# -# Make sure that the heap size is set to about half the memory available -# on the system and that the owner of the process is allowed to use this -# limit. -# -# Elasticsearch performs poorly when the system is swapping the memory. -# -# ---------------------------------- Network ----------------------------------- -# -# Set the bind address to a specific IP (IPv4 or IPv6): -# -network.host: _local_ -# -# Set a custom port for HTTP: -# -http.port: 9200 -# -# For more information, consult the network module documentation. -# -# --------------------------------- Discovery ---------------------------------- -# -# Pass an initial list of hosts to perform discovery when this node is started: -# The default list of hosts is ["127.0.0.1", "[::1]"] -# -#discovery.seed_hosts: ["host1", "host2"] -# -# Bootstrap the cluster using an initial set of master-eligible nodes: -# -#cluster.initial_master_nodes: ["node-1", "node-2"] -# -# For more information, consult the discovery and cluster formation module documentation. -# -# ---------------------------------- Gateway ----------------------------------- -# -# Block initial recovery after a full cluster restart until N nodes are started: -# -#gateway.recover_after_nodes: 3 -# -# For more information, consult the gateway module documentation. -# -# ---------------------------------- Various ----------------------------------- -# -# Require explicit names when deleting indices: -# -#action.destructive_requires_name: true -# -# Disable starting multiple nodes on a single system: -# -node.max_local_storage_nodes: 1 diff --git a/integration-tests/elasticsearch-rest-client/src/test/resources/elasticsearch-maven-plugin/configuration/jvm.options b/integration-tests/elasticsearch-rest-client/src/test/resources/elasticsearch-maven-plugin/configuration/jvm.options deleted file mode 100644 index 91f3f0ee7dd56..0000000000000 --- a/integration-tests/elasticsearch-rest-client/src/test/resources/elasticsearch-maven-plugin/configuration/jvm.options +++ /dev/null @@ -1,125 +0,0 @@ -## JVM configuration - -################################################################ -## IMPORTANT: JVM heap size -################################################################ -## -## You should always set the min and max JVM heap -## size to the same value. For example, to set -## the heap to 4 GB, set: -## -## -Xms4g -## -Xmx4g -## -## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html -## for more information -## -################################################################ - -# Xms represents the initial size of total heap space -# Xmx represents the maximum size of total heap space - -# For Hibernate Search, we don't need as much as the default 2g -# Let's keep it low, so that we'll be able to run tests -# on memory-constrained CI slaves --Xms256m --Xmx256m - -################################################################ -## Expert settings -################################################################ -## -## All settings below this section are considered -## expert settings. Don't tamper with them unless -## you understand what you are doing -## -################################################################ - -## GC configuration --XX:+UseConcMarkSweepGC --XX:CMSInitiatingOccupancyFraction=75 --XX:+UseCMSInitiatingOccupancyOnly - -## G1GC Configuration -# NOTE: G1GC is only supported on JDK version 10 or later. -# To use G1GC uncomment the lines below. -# 10-:-XX:-UseConcMarkSweepGC -# 10-:-XX:-UseCMSInitiatingOccupancyOnly -# 10-:-XX:+UseG1GC -# 10-:-XX:InitiatingHeapOccupancyPercent=75 - -## DNS cache policy -# cache ttl in seconds for positive DNS lookups noting that this overrides the -# JDK security property networkaddress.cache.ttl; set to -1 to cache forever --Des.networkaddress.cache.ttl=60 -# cache ttl in seconds for negative DNS lookups noting that this overrides the -# JDK security property networkaddress.cache.negative ttl; set to -1 to cache -# forever --Des.networkaddress.cache.negative.ttl=10 - -## optimizations - -# pre-touch memory pages used by the JVM during initialization --XX:+AlwaysPreTouch - -## basic - -# explicitly set the stack size --Xss1m - -# set to headless, just in case --Djava.awt.headless=true - -# ensure UTF-8 encoding by default (e.g. filenames) --Dfile.encoding=UTF-8 - -# use our provided JNA always versus the system one --Djna.nosys=true - -# turn off a JDK optimization that throws away stack traces for common -# exceptions because stack traces are important for debugging --XX:-OmitStackTraceInFastThrow - -# flags to configure Netty --Dio.netty.noUnsafe=true --Dio.netty.noKeySetOptimization=true --Dio.netty.recycler.maxCapacityPerThread=0 - -# log4j 2 --Dlog4j.shutdownHookEnabled=false --Dlog4j2.disable.jmx=true - --Djava.io.tmpdir=${ES_TMPDIR} - -## heap dumps - -# generate a heap dump when an allocation from the Java heap fails -# heap dumps are created in the working directory of the JVM --XX:+HeapDumpOnOutOfMemoryError - -# specify an alternative path for heap dumps; ensure the directory exists and -# has sufficient space --XX:HeapDumpPath=data - -# specify an alternative path for JVM fatal error logs --XX:ErrorFile=logs/hs_err_pid%p.log - -## JDK 8 GC logging - -8:-XX:+PrintGCDetails -8:-XX:+PrintGCDateStamps -8:-XX:+PrintTenuringDistribution -8:-XX:+PrintGCApplicationStoppedTime -8:-Xloggc:logs/gc.log -8:-XX:+UseGCLogFileRotation -8:-XX:NumberOfGCLogFiles=32 -8:-XX:GCLogFileSize=64m - -# JDK 9+ GC logging -9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m -# due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise -# time/date parsing will break in an incompatible way for some date patterns and locals -9-:-Djava.locale.providers=COMPAT - -# temporary workaround for C2 bug with JDK 10 on hardware with AVX-512 -10-:-XX:UseAVX=2 \ No newline at end of file diff --git a/integration-tests/elasticsearch-rest-client/src/test/resources/elasticsearch-maven-plugin/configuration/log4j2.properties b/integration-tests/elasticsearch-rest-client/src/test/resources/elasticsearch-maven-plugin/configuration/log4j2.properties deleted file mode 100644 index e4789c251b25a..0000000000000 --- a/integration-tests/elasticsearch-rest-client/src/test/resources/elasticsearch-maven-plugin/configuration/log4j2.properties +++ /dev/null @@ -1,36 +0,0 @@ -status = error -appenders = console -loggers = action, metadata, cluster, settings, deprecation, slow_search, slow_indexing - -# log action execution errors for easier debugging -logger.action.name = org.elasticsearch.action -logger.action.level = info - -# do not log metadata too much as we generate a log of noise -logger.metadata.name = org.elasticsearch.cluster.metadata -logger.metadata.level = warn - -logger.cluster.name = org.elasticsearch.cluster.routing.allocation -logger.cluster.level = warn - -logger.settings.name = org.elasticsearch.common.settings -logger.settings.level = warn - -logger.deprecation.name = org.elasticsearch.deprecation -logger.deprecation.level = warn - -# Warn us about using inefficient Search operations -logger.slow_search.name = index.search.slowlog -logger.slow_search.level = trace - -# Warn us about using inefficient indexing actions -logger.slow_indexing.name = index.indexing.slowlog -logger.slow_indexing.level = trace - -appender.console.type = Console -appender.console.name = console -appender.console.layout.type = PatternLayout -appender.console.layout.pattern = %d{ABSOLUTE} (%t) %5p %c{1}:%L - %m%n - -rootLogger.level = info -rootLogger.appenderRef.console.ref = console diff --git a/integration-tests/elasticsearch-rest-high-level-client/pom.xml b/integration-tests/elasticsearch-rest-high-level-client/pom.xml index 20f4b06c6f9ba..f058d0c785b71 100644 --- a/integration-tests/elasticsearch-rest-high-level-client/pom.xml +++ b/integration-tests/elasticsearch-rest-high-level-client/pom.xml @@ -42,6 +42,12 @@ + + + src/main/resources + true + + io.quarkus @@ -92,25 +98,67 @@ false + + + + + + docker-elasticsearch + + + docker + + + + localhost:9200 + http + + + - com.github.alexcojocaru - elasticsearch-maven-plugin + io.fabric8 + docker-maven-plugin - 90 - ${project.build.directory}/test-classes/elasticsearch-maven-plugin/configuration/ - true + + + ${elasticsearch.image} + elasticsearch + + + single-node + + + 9200:9200 + + + Elasticsearch: + default + cyan + + + + http://localhost:9200 + GET + 200 + + + + + + + true - - start-elasticsearch + docker-start process-test-classes - runforked + stop + start - stop-elasticsearch + docker-stop post-integration-test stop @@ -118,9 +166,26 @@ + + org.codehaus.mojo + exec-maven-plugin + + + docker-prune + generate-resources + + exec + + + ${basedir}/../../.github/docker-prune.sh + + + + + native diff --git a/integration-tests/elasticsearch-rest-high-level-client/src/main/resources/application.properties b/integration-tests/elasticsearch-rest-high-level-client/src/main/resources/application.properties new file mode 100644 index 0000000000000..3c4d6d3f852d5 --- /dev/null +++ b/integration-tests/elasticsearch-rest-high-level-client/src/main/resources/application.properties @@ -0,0 +1,5 @@ +quarkus.elasticsearch.hosts=${elasticsearch.hosts} +quarkus.elasticsearch.protocol=${elasticsearch.protocol} +quarkus.elasticsearch.socket-timeout=10S +quarkus.elasticsearch.discovery.enabled=true +quarkus.elasticsearch.discovery.refresh-interval=1M \ No newline at end of file diff --git a/integration-tests/elasticsearch-rest-high-level-client/src/test/resources/elasticsearch-maven-plugin/configuration/elasticsearch.yml b/integration-tests/elasticsearch-rest-high-level-client/src/test/resources/elasticsearch-maven-plugin/configuration/elasticsearch.yml deleted file mode 100644 index e15abadf05b9d..0000000000000 --- a/integration-tests/elasticsearch-rest-high-level-client/src/test/resources/elasticsearch-maven-plugin/configuration/elasticsearch.yml +++ /dev/null @@ -1,92 +0,0 @@ -# ======================== Elasticsearch Configuration ========================= -# -# NOTE: Elasticsearch comes with reasonable defaults for most settings. -# Before you set out to tweak and tune the configuration, make sure you -# understand what are you trying to accomplish and the consequences. -# -# The primary way of configuring a node is via this file. This template lists -# the most important settings you may want to configure for a production cluster. -# -# Please consult the documentation for further information on configuration options: -# https://www.elastic.co/guide/en/elasticsearch/reference/index.html -# -# ---------------------------------- Cluster ----------------------------------- -# -# Use a descriptive name for your cluster: -# -#cluster.name: my-application -# -# ------------------------------------ Node ------------------------------------ -# -# Use a descriptive name for the node: -# -#node.name: node-1 -# -# Add custom attributes to the node: -# -#node.attr.rack: r1 -# -# ----------------------------------- Paths ------------------------------------ -# -# Path to directory where to store the data (separate multiple locations by comma): -# -#path.data: /path/to/data -# -# Path to log files: -# -#path.logs: /path/to/logs -# -# ----------------------------------- Memory ----------------------------------- -# -# Lock the memory on startup: -# -bootstrap.memory_lock: true -# -# Make sure that the heap size is set to about half the memory available -# on the system and that the owner of the process is allowed to use this -# limit. -# -# Elasticsearch performs poorly when the system is swapping the memory. -# -# ---------------------------------- Network ----------------------------------- -# -# Set the bind address to a specific IP (IPv4 or IPv6): -# -network.host: _local_ -# -# Set a custom port for HTTP: -# -http.port: 9200 -# -# For more information, consult the network module documentation. -# -# --------------------------------- Discovery ---------------------------------- -# -# Pass an initial list of hosts to perform discovery when this node is started: -# The default list of hosts is ["127.0.0.1", "[::1]"] -# -#discovery.seed_hosts: ["host1", "host2"] -# -# Bootstrap the cluster using an initial set of master-eligible nodes: -# -#cluster.initial_master_nodes: ["node-1", "node-2"] -# -# For more information, consult the discovery and cluster formation module documentation. -# -# ---------------------------------- Gateway ----------------------------------- -# -# Block initial recovery after a full cluster restart until N nodes are started: -# -#gateway.recover_after_nodes: 3 -# -# For more information, consult the gateway module documentation. -# -# ---------------------------------- Various ----------------------------------- -# -# Require explicit names when deleting indices: -# -#action.destructive_requires_name: true -# -# Disable starting multiple nodes on a single system: -# -node.max_local_storage_nodes: 1 diff --git a/integration-tests/elasticsearch-rest-high-level-client/src/test/resources/elasticsearch-maven-plugin/configuration/jvm.options b/integration-tests/elasticsearch-rest-high-level-client/src/test/resources/elasticsearch-maven-plugin/configuration/jvm.options deleted file mode 100644 index 91f3f0ee7dd56..0000000000000 --- a/integration-tests/elasticsearch-rest-high-level-client/src/test/resources/elasticsearch-maven-plugin/configuration/jvm.options +++ /dev/null @@ -1,125 +0,0 @@ -## JVM configuration - -################################################################ -## IMPORTANT: JVM heap size -################################################################ -## -## You should always set the min and max JVM heap -## size to the same value. For example, to set -## the heap to 4 GB, set: -## -## -Xms4g -## -Xmx4g -## -## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html -## for more information -## -################################################################ - -# Xms represents the initial size of total heap space -# Xmx represents the maximum size of total heap space - -# For Hibernate Search, we don't need as much as the default 2g -# Let's keep it low, so that we'll be able to run tests -# on memory-constrained CI slaves --Xms256m --Xmx256m - -################################################################ -## Expert settings -################################################################ -## -## All settings below this section are considered -## expert settings. Don't tamper with them unless -## you understand what you are doing -## -################################################################ - -## GC configuration --XX:+UseConcMarkSweepGC --XX:CMSInitiatingOccupancyFraction=75 --XX:+UseCMSInitiatingOccupancyOnly - -## G1GC Configuration -# NOTE: G1GC is only supported on JDK version 10 or later. -# To use G1GC uncomment the lines below. -# 10-:-XX:-UseConcMarkSweepGC -# 10-:-XX:-UseCMSInitiatingOccupancyOnly -# 10-:-XX:+UseG1GC -# 10-:-XX:InitiatingHeapOccupancyPercent=75 - -## DNS cache policy -# cache ttl in seconds for positive DNS lookups noting that this overrides the -# JDK security property networkaddress.cache.ttl; set to -1 to cache forever --Des.networkaddress.cache.ttl=60 -# cache ttl in seconds for negative DNS lookups noting that this overrides the -# JDK security property networkaddress.cache.negative ttl; set to -1 to cache -# forever --Des.networkaddress.cache.negative.ttl=10 - -## optimizations - -# pre-touch memory pages used by the JVM during initialization --XX:+AlwaysPreTouch - -## basic - -# explicitly set the stack size --Xss1m - -# set to headless, just in case --Djava.awt.headless=true - -# ensure UTF-8 encoding by default (e.g. filenames) --Dfile.encoding=UTF-8 - -# use our provided JNA always versus the system one --Djna.nosys=true - -# turn off a JDK optimization that throws away stack traces for common -# exceptions because stack traces are important for debugging --XX:-OmitStackTraceInFastThrow - -# flags to configure Netty --Dio.netty.noUnsafe=true --Dio.netty.noKeySetOptimization=true --Dio.netty.recycler.maxCapacityPerThread=0 - -# log4j 2 --Dlog4j.shutdownHookEnabled=false --Dlog4j2.disable.jmx=true - --Djava.io.tmpdir=${ES_TMPDIR} - -## heap dumps - -# generate a heap dump when an allocation from the Java heap fails -# heap dumps are created in the working directory of the JVM --XX:+HeapDumpOnOutOfMemoryError - -# specify an alternative path for heap dumps; ensure the directory exists and -# has sufficient space --XX:HeapDumpPath=data - -# specify an alternative path for JVM fatal error logs --XX:ErrorFile=logs/hs_err_pid%p.log - -## JDK 8 GC logging - -8:-XX:+PrintGCDetails -8:-XX:+PrintGCDateStamps -8:-XX:+PrintTenuringDistribution -8:-XX:+PrintGCApplicationStoppedTime -8:-Xloggc:logs/gc.log -8:-XX:+UseGCLogFileRotation -8:-XX:NumberOfGCLogFiles=32 -8:-XX:GCLogFileSize=64m - -# JDK 9+ GC logging -9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m -# due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise -# time/date parsing will break in an incompatible way for some date patterns and locals -9-:-Djava.locale.providers=COMPAT - -# temporary workaround for C2 bug with JDK 10 on hardware with AVX-512 -10-:-XX:UseAVX=2 \ No newline at end of file diff --git a/integration-tests/elasticsearch-rest-high-level-client/src/test/resources/elasticsearch-maven-plugin/configuration/log4j2.properties b/integration-tests/elasticsearch-rest-high-level-client/src/test/resources/elasticsearch-maven-plugin/configuration/log4j2.properties deleted file mode 100644 index e4789c251b25a..0000000000000 --- a/integration-tests/elasticsearch-rest-high-level-client/src/test/resources/elasticsearch-maven-plugin/configuration/log4j2.properties +++ /dev/null @@ -1,36 +0,0 @@ -status = error -appenders = console -loggers = action, metadata, cluster, settings, deprecation, slow_search, slow_indexing - -# log action execution errors for easier debugging -logger.action.name = org.elasticsearch.action -logger.action.level = info - -# do not log metadata too much as we generate a log of noise -logger.metadata.name = org.elasticsearch.cluster.metadata -logger.metadata.level = warn - -logger.cluster.name = org.elasticsearch.cluster.routing.allocation -logger.cluster.level = warn - -logger.settings.name = org.elasticsearch.common.settings -logger.settings.level = warn - -logger.deprecation.name = org.elasticsearch.deprecation -logger.deprecation.level = warn - -# Warn us about using inefficient Search operations -logger.slow_search.name = index.search.slowlog -logger.slow_search.level = trace - -# Warn us about using inefficient indexing actions -logger.slow_indexing.name = index.indexing.slowlog -logger.slow_indexing.level = trace - -appender.console.type = Console -appender.console.name = console -appender.console.layout.type = PatternLayout -appender.console.layout.pattern = %d{ABSOLUTE} (%t) %5p %c{1}:%L - %m%n - -rootLogger.level = info -rootLogger.appenderRef.console.ref = console diff --git a/integration-tests/hibernate-search-elasticsearch/pom.xml b/integration-tests/hibernate-search-elasticsearch/pom.xml index 9a223b265f1cf..80cdb89570642 100644 --- a/integration-tests/hibernate-search-elasticsearch/pom.xml +++ b/integration-tests/hibernate-search-elasticsearch/pom.xml @@ -111,26 +111,67 @@ false + + + + + + docker-elasticsearch + + + docker + + + + localhost:9200 + http + + + - com.github.alexcojocaru - elasticsearch-maven-plugin + io.fabric8 + docker-maven-plugin - 90 - ${project.build.directory}/test-classes/elasticsearch-maven-plugin/configuration/ - ${project.build.directory}/test-classes/elasticsearch-maven-plugin/init/init.script - true + + + ${elasticsearch.image} + elasticsearch + + + single-node + + + 9200:9200 + + + Elasticsearch: + default + cyan + + + + http://localhost:9200 + GET + 200 + + + + + + + true - - start-elasticsearch + docker-start process-test-classes - runforked + stop + start - stop-elasticsearch + docker-stop post-integration-test stop @@ -138,6 +179,22 @@ + + org.codehaus.mojo + exec-maven-plugin + + + docker-prune + generate-resources + + exec + + + ${basedir}/../../.github/docker-prune.sh + + + + diff --git a/integration-tests/hibernate-search-elasticsearch/src/main/resources/application.properties b/integration-tests/hibernate-search-elasticsearch/src/main/resources/application.properties index accba01582124..9d4653f8249da 100644 --- a/integration-tests/hibernate-search-elasticsearch/src/main/resources/application.properties +++ b/integration-tests/hibernate-search-elasticsearch/src/main/resources/application.properties @@ -9,6 +9,8 @@ quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-search.elasticsearch.version=7 +quarkus.hibernate-search.elasticsearch.hosts=${elasticsearch.hosts} +quarkus.hibernate-search.elasticsearch.protocol=${elasticsearch.protocol} quarkus.hibernate-search.elasticsearch.analysis.configurer=io.quarkus.it.hibernate.search.elasticsearch.search.DefaultITAnalysisConfigurer quarkus.hibernate-search.elasticsearch.schema-management.required-status=yellow quarkus.hibernate-search.schema-management.strategy=drop-and-create-and-drop diff --git a/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/configuration/elasticsearch.yml b/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/configuration/elasticsearch.yml deleted file mode 100644 index e15abadf05b9d..0000000000000 --- a/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/configuration/elasticsearch.yml +++ /dev/null @@ -1,92 +0,0 @@ -# ======================== Elasticsearch Configuration ========================= -# -# NOTE: Elasticsearch comes with reasonable defaults for most settings. -# Before you set out to tweak and tune the configuration, make sure you -# understand what are you trying to accomplish and the consequences. -# -# The primary way of configuring a node is via this file. This template lists -# the most important settings you may want to configure for a production cluster. -# -# Please consult the documentation for further information on configuration options: -# https://www.elastic.co/guide/en/elasticsearch/reference/index.html -# -# ---------------------------------- Cluster ----------------------------------- -# -# Use a descriptive name for your cluster: -# -#cluster.name: my-application -# -# ------------------------------------ Node ------------------------------------ -# -# Use a descriptive name for the node: -# -#node.name: node-1 -# -# Add custom attributes to the node: -# -#node.attr.rack: r1 -# -# ----------------------------------- Paths ------------------------------------ -# -# Path to directory where to store the data (separate multiple locations by comma): -# -#path.data: /path/to/data -# -# Path to log files: -# -#path.logs: /path/to/logs -# -# ----------------------------------- Memory ----------------------------------- -# -# Lock the memory on startup: -# -bootstrap.memory_lock: true -# -# Make sure that the heap size is set to about half the memory available -# on the system and that the owner of the process is allowed to use this -# limit. -# -# Elasticsearch performs poorly when the system is swapping the memory. -# -# ---------------------------------- Network ----------------------------------- -# -# Set the bind address to a specific IP (IPv4 or IPv6): -# -network.host: _local_ -# -# Set a custom port for HTTP: -# -http.port: 9200 -# -# For more information, consult the network module documentation. -# -# --------------------------------- Discovery ---------------------------------- -# -# Pass an initial list of hosts to perform discovery when this node is started: -# The default list of hosts is ["127.0.0.1", "[::1]"] -# -#discovery.seed_hosts: ["host1", "host2"] -# -# Bootstrap the cluster using an initial set of master-eligible nodes: -# -#cluster.initial_master_nodes: ["node-1", "node-2"] -# -# For more information, consult the discovery and cluster formation module documentation. -# -# ---------------------------------- Gateway ----------------------------------- -# -# Block initial recovery after a full cluster restart until N nodes are started: -# -#gateway.recover_after_nodes: 3 -# -# For more information, consult the gateway module documentation. -# -# ---------------------------------- Various ----------------------------------- -# -# Require explicit names when deleting indices: -# -#action.destructive_requires_name: true -# -# Disable starting multiple nodes on a single system: -# -node.max_local_storage_nodes: 1 diff --git a/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/configuration/jvm.options b/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/configuration/jvm.options deleted file mode 100644 index 91f3f0ee7dd56..0000000000000 --- a/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/configuration/jvm.options +++ /dev/null @@ -1,125 +0,0 @@ -## JVM configuration - -################################################################ -## IMPORTANT: JVM heap size -################################################################ -## -## You should always set the min and max JVM heap -## size to the same value. For example, to set -## the heap to 4 GB, set: -## -## -Xms4g -## -Xmx4g -## -## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html -## for more information -## -################################################################ - -# Xms represents the initial size of total heap space -# Xmx represents the maximum size of total heap space - -# For Hibernate Search, we don't need as much as the default 2g -# Let's keep it low, so that we'll be able to run tests -# on memory-constrained CI slaves --Xms256m --Xmx256m - -################################################################ -## Expert settings -################################################################ -## -## All settings below this section are considered -## expert settings. Don't tamper with them unless -## you understand what you are doing -## -################################################################ - -## GC configuration --XX:+UseConcMarkSweepGC --XX:CMSInitiatingOccupancyFraction=75 --XX:+UseCMSInitiatingOccupancyOnly - -## G1GC Configuration -# NOTE: G1GC is only supported on JDK version 10 or later. -# To use G1GC uncomment the lines below. -# 10-:-XX:-UseConcMarkSweepGC -# 10-:-XX:-UseCMSInitiatingOccupancyOnly -# 10-:-XX:+UseG1GC -# 10-:-XX:InitiatingHeapOccupancyPercent=75 - -## DNS cache policy -# cache ttl in seconds for positive DNS lookups noting that this overrides the -# JDK security property networkaddress.cache.ttl; set to -1 to cache forever --Des.networkaddress.cache.ttl=60 -# cache ttl in seconds for negative DNS lookups noting that this overrides the -# JDK security property networkaddress.cache.negative ttl; set to -1 to cache -# forever --Des.networkaddress.cache.negative.ttl=10 - -## optimizations - -# pre-touch memory pages used by the JVM during initialization --XX:+AlwaysPreTouch - -## basic - -# explicitly set the stack size --Xss1m - -# set to headless, just in case --Djava.awt.headless=true - -# ensure UTF-8 encoding by default (e.g. filenames) --Dfile.encoding=UTF-8 - -# use our provided JNA always versus the system one --Djna.nosys=true - -# turn off a JDK optimization that throws away stack traces for common -# exceptions because stack traces are important for debugging --XX:-OmitStackTraceInFastThrow - -# flags to configure Netty --Dio.netty.noUnsafe=true --Dio.netty.noKeySetOptimization=true --Dio.netty.recycler.maxCapacityPerThread=0 - -# log4j 2 --Dlog4j.shutdownHookEnabled=false --Dlog4j2.disable.jmx=true - --Djava.io.tmpdir=${ES_TMPDIR} - -## heap dumps - -# generate a heap dump when an allocation from the Java heap fails -# heap dumps are created in the working directory of the JVM --XX:+HeapDumpOnOutOfMemoryError - -# specify an alternative path for heap dumps; ensure the directory exists and -# has sufficient space --XX:HeapDumpPath=data - -# specify an alternative path for JVM fatal error logs --XX:ErrorFile=logs/hs_err_pid%p.log - -## JDK 8 GC logging - -8:-XX:+PrintGCDetails -8:-XX:+PrintGCDateStamps -8:-XX:+PrintTenuringDistribution -8:-XX:+PrintGCApplicationStoppedTime -8:-Xloggc:logs/gc.log -8:-XX:+UseGCLogFileRotation -8:-XX:NumberOfGCLogFiles=32 -8:-XX:GCLogFileSize=64m - -# JDK 9+ GC logging -9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m -# due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise -# time/date parsing will break in an incompatible way for some date patterns and locals -9-:-Djava.locale.providers=COMPAT - -# temporary workaround for C2 bug with JDK 10 on hardware with AVX-512 -10-:-XX:UseAVX=2 \ No newline at end of file diff --git a/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/configuration/log4j2.properties b/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/configuration/log4j2.properties deleted file mode 100644 index e4789c251b25a..0000000000000 --- a/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/configuration/log4j2.properties +++ /dev/null @@ -1,36 +0,0 @@ -status = error -appenders = console -loggers = action, metadata, cluster, settings, deprecation, slow_search, slow_indexing - -# log action execution errors for easier debugging -logger.action.name = org.elasticsearch.action -logger.action.level = info - -# do not log metadata too much as we generate a log of noise -logger.metadata.name = org.elasticsearch.cluster.metadata -logger.metadata.level = warn - -logger.cluster.name = org.elasticsearch.cluster.routing.allocation -logger.cluster.level = warn - -logger.settings.name = org.elasticsearch.common.settings -logger.settings.level = warn - -logger.deprecation.name = org.elasticsearch.deprecation -logger.deprecation.level = warn - -# Warn us about using inefficient Search operations -logger.slow_search.name = index.search.slowlog -logger.slow_search.level = trace - -# Warn us about using inefficient indexing actions -logger.slow_indexing.name = index.indexing.slowlog -logger.slow_indexing.level = trace - -appender.console.type = Console -appender.console.name = console -appender.console.layout.type = PatternLayout -appender.console.layout.pattern = %d{ABSOLUTE} (%t) %5p %c{1}:%L - %m%n - -rootLogger.level = info -rootLogger.appenderRef.console.ref = console diff --git a/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/init/init.script b/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/init/init.script deleted file mode 100644 index 7c20a72b48ffc..0000000000000 --- a/integration-tests/hibernate-search-elasticsearch/src/test/resources/elasticsearch-maven-plugin/init/init.script +++ /dev/null @@ -1,6 +0,0 @@ -PUT:_template/lightweight_index:{ "template" : "*", "order": -9999, "settings" : { "number_of_shards" : 1, "number_of_replicas" : 0 } } -PUT:_template/slowlogs_search_level:{ "template" : "*", "order": -9999, "settings" : { "index.search.slowlog.level": "debug" } } -PUT:_template/slowlogs_indexing_level:{ "template" : "*", "order": -9999, "settings" : { "index.indexing.slowlog.level": "debug" } } -PUT:_template/slowlogs_search_threshold_query:{ "template" : "*", "order": -9999, "settings" : { "index.search.slowlog.threshold.query.warn": "5s", "index.search.slowlog.threshold.query.info": "500ms", "index.search.slowlog.threshold.query.debug": "100ms", "index.search.slowlog.threshold.query.trace": "10ms" } } -PUT:_template/slowlogs_search_threshold_fetch:{ "template" : "*", "order": -9999, "settings" : { "index.search.slowlog.threshold.fetch.warn": "1s", "index.search.slowlog.threshold.fetch.info": "200ms", "index.search.slowlog.threshold.fetch.debug": "100ms", "index.search.slowlog.threshold.fetch.trace": "10ms" } } -PUT:_template/slowlogs_indexing_threshold_index:{ "template" : "*", "order": -9999, "settings" : { "index.indexing.slowlog.threshold.index.warn": "2s", "index.indexing.slowlog.threshold.index.info": "500ms", "index.indexing.slowlog.threshold.index.debug": "100ms", "index.indexing.slowlog.threshold.index.trace": "10ms" } }