Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: updates Elasticsearch 7.x image to Elastic licensed 7.17.16 #3654

Merged
merged 6 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions docker/test-images/zipkin-elasticsearch7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,37 @@ FROM scratch as scratch
COPY build-bin/docker/docker-healthcheck /docker-bin/
COPY docker/test-images/zipkin-elasticsearch7/start-elasticsearch /docker-bin/
COPY docker/test-images/zipkin-elasticsearch7/config/ /config/
COPY docker/test-images/zipkin-elasticsearch7/NOTICE.txt /

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 7.x version from https://www.elastic.co/downloads/past-releases#elasticsearch-no-jdk
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xeraa why is there no 8.x here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@xeraa xeraa Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we don't build those any more for 8. It's recommended to stick to the default JDK we provide, but you can delete the shipped JDK folder (optional) and link to any JDK you like (with or without deleting the default JDK)

# This is defined in many places because Docker has no "env" script functionality unless you use
# docker-compose: When updating, update everywhere.
#
# TODO: 7.10.2 is the last OSS no-jdk version. To update requires a switch to non OSS.
# See https://www.elastic.co/downloads/past-releases#elasticsearch-oss-no-jdk
ARG elasticsearch7_version=7.10.2
ARG elasticsearch7_version=7.17.16

# Download only the OSS distribution (lacks X-Pack)
RUN \
# Connection resets are frequent in GitHub Actions workflows \
wget --random-wait --tries=5 -qO- \
# We don't download bin scripts as we customize for reasons including BusyBox problems
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-${elasticsearch7_version}-no-jdk-linux-x86_64.tar.gz| tar xz \
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${elasticsearch7_version}-no-jdk-linux-x86_64.tar.gz| tar xz \
--wildcards --strip=1 --exclude=*/bin && mkdir classes

COPY --from=scratch /config/ ./config/

FROM ghcr.io/openzipkin/java:${java_version}-jre as zipkin-elasticsearch7
LABEL org.opencontainers.image.description="Elasticsearch OSS distribution on OpenJDK and Alpine Linux"
ARG elasticsearch7_version=7.10.2
# Use a full Java distribution rather than adding test modules to the
# production -jre base layer used by zipkin and zipkin-slim.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FROM ghcr.io/openzipkin/java:${java_version} as zipkin-elasticsearch7
LABEL org.opencontainers.image.description="Elasticsearch distribution on OpenJDK and Alpine Linux"
ARG elasticsearch7_version=7.17.16
LABEL elasticsearch-version=$elasticsearch7_version

# This image is only for testing Zipkin, but alert users anyway about the
# Elastic license. The license ends up on disk as /elasticsearch/LICENSE.txt
codefromthecrypt marked this conversation as resolved.
Show resolved Hide resolved
LABEL org.opencontainers.image.licenses="Elastic-License-2.0"

# Add HEALTHCHECK and ENTRYPOINT scripts into the default search path
COPY --from=scratch /docker-bin/* /usr/local/bin/
# We use start period of 30s to avoid marking the container unhealthy on slow or contended CI hosts
Expand All @@ -74,4 +77,5 @@ COPY --from=install --chown=${USER} /install .

# Use to set heap, trust store or other system properties.
ENV JAVA_OPTS="-Xms256m -Xmx256m -XX:+ExitOnOutOfMemoryError"
ENV LIBFFI_TMPDIR=/tmp
EXPOSE 9200
8 changes: 8 additions & 0 deletions docker/test-images/zipkin-elasticsearch7/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ $ DOCKER_FILE=docker/test-images/zipkin-elasticsearch7/Dockerfile build-bin/dock
You can use the env variable `JAVA_OPTS` to change settings such as heap size for Elasticsearch.

#### Host setup

Elasticsearch is [strict](https://github.com/docker-library/docs/tree/master/elasticsearch#host-setup)
about virtual memory. You will need to adjust accordingly (especially if you notice Elasticsearch crash!)

Expand All @@ -21,3 +22,10 @@ $ sudo sysctl -w vm.max_map_count=262144
# If using docker-machine/Docker Toolbox/Boot2Docker, remotely adjust the same
$ docker-machine ssh default "sudo sysctl -w vm.max_map_count=262144"
```

#### License

This Elasticsearch image is only made for testing features supported by Zipkin,
and is subject to [Elastic-License-2.0](https://www.elastic.co/licensing/elastic-license).
For more details, inspect the LICENSE.txt and NOTICE.txt in the /elasticsearch
directory of this image.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
network.host: 0.0.0.0
node.name: zipkin-elasticsearch
cluster.name: "docker-cluster"
xpack.ml.enabled: false
cluster.initial_master_nodes:
- zipkin-elasticsearch
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Builder computeStorageBuilder() {
if (warningHeader != null) {
if (IGNORE_THESE_WARNINGS.stream().noneMatch(p -> p.matcher(warningHeader).find())) {
throw new IllegalArgumentException("Detected usage of deprecated API for request "
+ req.toString() + ":\n" + warningHeader);
+ req + ":\n" + warningHeader);
}
}
// Convert AggregatedHttpResponse back to HttpResponse.
Expand Down Expand Up @@ -127,7 +127,7 @@ String baseUrl() {
// mostly waiting for https://github.com/testcontainers/testcontainers-java/issues/3537
static final class ElasticsearchContainer extends GenericContainer<ElasticsearchContainer> {
ElasticsearchContainer(int majorVersion) {
super(parse("ghcr.io/openzipkin/zipkin-elasticsearch" + majorVersion + ":2.25.0"));
super(parse("openzipkin/zipkin-elasticsearch7:test"));
if ("true".equals(System.getProperty("docker.skip"))) {
throw new TestAbortedException("${docker.skip} == true");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ abstract class IgnoredDeprecationWarnings {
// These will be matched using header.contains(ignored[i]), so find a unique substring of the
// warning header for it to be ignored
static List<Pattern> IGNORE_THESE_WARNINGS = asList(
// Basic license doesn't include x-pack.
// https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-minimal-setup.html#_enable_elasticsearch_security_features
compile("Elasticsearch built-in security features are not enabled."),
compile("Elasticsearch 7\\.x will read, but not allow creation of new indices containing ':'"),
compile("has index patterns \\[.*] matching patterns from existing older templates"),
compile("has index patterns \\[.*] matching patterns from existing composable templates")
Expand Down
Loading