From 72de5a83eb9d8673b596b63678491222c0e3c879 Mon Sep 17 00:00:00 2001 From: Crypt Keeper <64215+codefromthecrypt@users.noreply.github.com> Date: Thu, 25 Jan 2024 06:41:44 +0800 Subject: [PATCH] docker: uses portable config between ES 7 and 8 (#3708) also fixes regression by using an older JRE for ES 8 Signed-off-by: Adrian Cole --- .../zipkin-elasticsearch7/Dockerfile | 2 +- .../config/elasticsearch.yml | 19 ++++++++++--- .../config/log4j2.properties | 5 +++- .../zipkin-elasticsearch8/Dockerfile | 8 ++++-- .../config/elasticsearch.yml | 28 ------------------- .../config/log4j2.properties | 28 ------------------- 6 files changed, 25 insertions(+), 65 deletions(-) delete mode 100644 docker/test-images/zipkin-elasticsearch8/config/elasticsearch.yml delete mode 100644 docker/test-images/zipkin-elasticsearch8/config/log4j2.properties diff --git a/docker/test-images/zipkin-elasticsearch7/Dockerfile b/docker/test-images/zipkin-elasticsearch7/Dockerfile index 009a04a38f1..b2ef2e23a97 100644 --- a/docker/test-images/zipkin-elasticsearch7/Dockerfile +++ b/docker/test-images/zipkin-elasticsearch7/Dockerfile @@ -35,7 +35,7 @@ WORKDIR /install # Use latest 7.x version from https://www.elastic.co/downloads/past-releases#elasticsearch-no-jdk # This is defined in many places because Docker has no "env" script functionality unless you use # docker-compose: When updating, update everywhere. -ARG elasticsearch7_version=7.17.16 +ARG elasticsearch7_version=7.17.17 # Download only the OSS distribution (lacks X-Pack) RUN \ diff --git a/docker/test-images/zipkin-elasticsearch7/config/elasticsearch.yml b/docker/test-images/zipkin-elasticsearch7/config/elasticsearch.yml index 1e0eb78366e..5975e169814 100644 --- a/docker/test-images/zipkin-elasticsearch7/config/elasticsearch.yml +++ b/docker/test-images/zipkin-elasticsearch7/config/elasticsearch.yml @@ -12,13 +12,24 @@ # the License. # +cluster.name: "docker-cluster" network.host: 0.0.0.0 node.name: zipkin-elasticsearch -cluster.name: "docker-cluster" -xpack.ml.enabled: false -cluster.initial_master_nodes: - - zipkin-elasticsearch + +# Enable development mode and disable bootstrap checks +# See https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html +discovery.type: single-node + +# This is a test image, so we are not afraid to delete all indices. Avoids: +# Wildcard expressions or all indices are not allowed +action.destructive_requires_name: false # Avoid "flood stage disk watermark" errors cluster.routing.allocation.disk.threshold_enabled: false # We don't use geoip ingest.geoip.downloader.enabled: false + +# disable all xpack features than can be disabled +xpack.graph.enabled: false +xpack.ml.enabled: false +xpack.security.enabled: false +xpack.watcher.enabled: false diff --git a/docker/test-images/zipkin-elasticsearch7/config/log4j2.properties b/docker/test-images/zipkin-elasticsearch7/config/log4j2.properties index 079b0959b97..e4f9cf4141a 100644 --- a/docker/test-images/zipkin-elasticsearch7/config/log4j2.properties +++ b/docker/test-images/zipkin-elasticsearch7/config/log4j2.properties @@ -1,5 +1,5 @@ # -# Copyright 2015-2020 The OpenZipkin Authors +# Copyright 2015-2024 The OpenZipkin Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at @@ -22,3 +22,6 @@ appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%ma rootLogger.level = info rootLogger.appenderRef.console.ref = console +# unsolved https://github.com/sherifabdlnaby/elastdocker/issues/108 +logger.aws.name = com.amazonaws.auth.profile.internal.BasicProfileConfigFileLoader +logger.aws.level = error diff --git a/docker/test-images/zipkin-elasticsearch8/Dockerfile b/docker/test-images/zipkin-elasticsearch8/Dockerfile index 016056a80d6..4c5ff2ff4bb 100644 --- a/docker/test-images/zipkin-elasticsearch8/Dockerfile +++ b/docker/test-images/zipkin-elasticsearch8/Dockerfile @@ -17,7 +17,7 @@ # Use latest version here: https://github.com/orgs/openzipkin/packages/container/package/java # This is defined in many places because Docker has no "env" script functionality unless you use # docker-compose: When updating, update everywhere. -ARG java_version=21.0.2_p13 +ARG java_version=21.0.1_p12 # We copy files from the context into a scratch container first to avoid a problem where docker and # docker-compose don't share layer hashes https://github.com/docker/compose/issues/883 normally. @@ -26,16 +26,18 @@ FROM scratch as scratch COPY build-bin/docker/docker-healthcheck /docker-bin/ COPY docker/test-images/zipkin-elasticsearch8/start-elasticsearch /docker-bin/ -COPY docker/test-images/zipkin-elasticsearch8/config/ /config/ +COPY docker/test-images/zipkin-elasticsearch7/config/ /config/ FROM ghcr.io/openzipkin/java:${java_version} as install WORKDIR /install -# Use latest 7.x version from https://www.elastic.co/downloads/past-releases#elasticsearch +# Use latest 8.x version from https://www.elastic.co/downloads/past-releases#elasticsearch # This is defined in many places because Docker has no "env" script functionality unless you use # docker-compose: When updating, update everywhere. ARG elasticsearch7_version=8.12.0 +# TODO ^^ match java_version with others and remove this comment on 8.13.1 +# See https://github.com/elastic/elasticsearch/pull/104347 # Download only the OSS distribution (lacks X-Pack) RUN \ diff --git a/docker/test-images/zipkin-elasticsearch8/config/elasticsearch.yml b/docker/test-images/zipkin-elasticsearch8/config/elasticsearch.yml deleted file mode 100644 index cbcb0068529..00000000000 --- a/docker/test-images/zipkin-elasticsearch8/config/elasticsearch.yml +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright 2015-2024 The OpenZipkin Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -# in compliance with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under -# the License. -# - -network.host: 0.0.0.0 -node.name: zipkin-elasticsearch -cluster.name: "docker-cluster" -xpack.security.enabled: false -xpack.ml.enabled: false -cluster.initial_master_nodes: - - zipkin-elasticsearch -# This is a test image, so we are not afraid to delete all indices. Avoids: -# Wildcard expressions or all indices are not allowed -action.destructive_requires_name: false -# Avoid "flood stage disk watermark" errors -cluster.routing.allocation.disk.threshold_enabled: false -# We don't use geoip -ingest.geoip.downloader.enabled: false diff --git a/docker/test-images/zipkin-elasticsearch8/config/log4j2.properties b/docker/test-images/zipkin-elasticsearch8/config/log4j2.properties deleted file mode 100644 index aa85f561e6b..00000000000 --- a/docker/test-images/zipkin-elasticsearch8/config/log4j2.properties +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright 2015-2023 The OpenZipkin Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -# in compliance with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under -# the License. -# - -status = error - -appender.console.type = Console -appender.console.name = console -appender.console.layout.type = PatternLayout -appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%marker %m%n - -rootLogger.level = info -rootLogger.appenderRef.console.ref = console - -# unsolved https://github.com/sherifabdlnaby/elastdocker/issues/108 -logger.aws.name = com.amazonaws.auth.profile.internal.BasicProfileConfigFileLoader -logger.aws.level = error -