Skip to content

Commit

Permalink
Updates to latest docker images, aligning maven version (#3775)
Browse files Browse the repository at this point in the history
This uses latest java images, and aligns with the following tools
provided by them:
* maven:3.9.8
* maven-help-plugin:3.4.1
* maven-dependency-plugin:3.7.1

To align, we run "mvn wrapper:wrapper -Dtype=bin" to update maven and
manually change any pom or script references to share the above plugin
versions.

Besides text replacement for current java versions, this also had to
switch `docker-compose` to `docker compose` as the former is no longer
in the base image.

All test images are updated to latest versions, as well.

This intentionally doesn't touch anything else, except bumping
testcontainers. For example, this doesn't update maven plugins that
aren't cached in the java image.

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
  • Loading branch information
codefromthecrypt committed Aug 3, 2024
1 parent 2f0a26f commit 2cf1850
Show file tree
Hide file tree
Showing 47 changed files with 262 additions and 235 deletions.
Binary file modified .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
6 changes: 4 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
wrapperVersion=3.3.2
distributionType=bin
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ServerIntegratedBenchmark {

@Test void elasticsearch() throws Exception {
GenericContainer<?> elasticsearch =
new GenericContainer<>(parse("ghcr.io/openzipkin/zipkin-elasticsearch7:3.3.1"))
new GenericContainer<>(parse("ghcr.io/openzipkin/zipkin-elasticsearch7:3.4.0"))
.withNetwork(Network.SHARED)
.withNetworkAliases("elasticsearch")
.withLabel("name", "elasticsearch")
Expand All @@ -95,7 +95,7 @@ class ServerIntegratedBenchmark {

@Test void cassandra3() throws Exception {
GenericContainer<?> cassandra =
new GenericContainer<>(parse("ghcr.io/openzipkin/zipkin-cassandra:3.3.1"))
new GenericContainer<>(parse("ghcr.io/openzipkin/zipkin-cassandra:3.4.0"))
.withNetwork(Network.SHARED)
.withNetworkAliases("cassandra")
.withLabel("name", "cassandra")
Expand All @@ -109,7 +109,7 @@ class ServerIntegratedBenchmark {

@Test void mysql() throws Exception {
GenericContainer<?> mysql =
new GenericContainer<>(parse("ghcr.io/openzipkin/zipkin-mysql:3.3.1"))
new GenericContainer<>(parse("ghcr.io/openzipkin/zipkin-mysql:3.4.0"))
.withNetwork(Network.SHARED)
.withNetworkAliases("mysql")
.withLabel("name", "mysql")
Expand Down Expand Up @@ -147,7 +147,7 @@ void runBenchmark(@Nullable GenericContainer<?> storage, GenericContainer<?> zip
// Use a quay.io mirror to prevent build outages due to Docker Hub pull quotas
// Use same version as in docker/examples/docker-compose-prometheus.yml
GenericContainer<?> prometheus =
new GenericContainer<>(parse("quay.io/prometheus/prometheus:v2.51.2"))
new GenericContainer<>(parse("quay.io/prometheus/prometheus:v2.53.1"))
.withNetwork(Network.SHARED)
.withNetworkAliases("prometheus")
.withExposedPorts(9090)
Expand All @@ -157,7 +157,7 @@ void runBenchmark(@Nullable GenericContainer<?> storage, GenericContainer<?> zip

// Use a quay.io mirror to prevent build outages due to Docker Hub pull quotas
// Use same version as in docker/examples/docker-compose-prometheus.yml
GenericContainer<?> grafana = new GenericContainer<>(parse("quay.io/giantswarm/grafana:7.5.9"))
GenericContainer<?> grafana = new GenericContainer<>(parse("quay.io/giantswarm/grafana:7.5.12"))
.withNetwork(Network.SHARED)
.withNetworkAliases("grafana")
.withExposedPorts(3000)
Expand All @@ -169,7 +169,7 @@ void runBenchmark(@Nullable GenericContainer<?> storage, GenericContainer<?> zip
// Use a quay.io mirror to prevent build outages due to Docker Hub pull quotas
// Use same version as in docker/examples/docker-compose-prometheus.yml
GenericContainer<?> grafanaDashboards =
new GenericContainer<>(parse("quay.io/cilium/alpine-curl:v1.9.0"))
new GenericContainer<>(parse("quay.io/cilium/alpine-curl:v1.10.0"))
.withNetwork(Network.SHARED)
.withWorkingDirectory("/tmp")
.withLogConsumer(new Slf4jLogConsumer(LOG))
Expand Down Expand Up @@ -277,7 +277,7 @@ GenericContainer<?> createZipkinContainer(@Nullable GenericContainer<?> storage)

final GenericContainer<?> zipkin;
if (RELEASE_VERSION == null) {
zipkin = new GenericContainer<>(parse("ghcr.io/openzipkin/java:21.0.3_p9"));
zipkin = new GenericContainer<>(parse("ghcr.io/openzipkin/java:21.0.4_p7"));
List<String> classpath = new ArrayList<>();
for (String item : System.getProperty("java.class.path").split(File.pathSeparator)) {
Path path = Paths.get(item);
Expand Down
2 changes: 1 addition & 1 deletion build-bin/docker-compose-zipkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
# Use fixed service and container name 'sut; so our test script can copy/pasta
sut:
container_name: sut
image: ghcr.io/openzipkin/alpine:3.20.0
image: ghcr.io/openzipkin/alpine:3.20.2
entrypoint: /bin/sh
# Keep the container running until HEALTHCHECK passes
command: "-c \"sleep 5m\""
Expand Down
2 changes: 1 addition & 1 deletion build-bin/docker/docker-healthcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
#

# HEALTHCHECK for use in `docker ps`, `docker-compose ps`, or a readiness probe in k8s.
# HEALTHCHECK for use in `docker ps`, `docker compose ps`, or a readiness probe in k8s.
#
# The following variables are read from ENV in the Dockerfile or env readable from pid 1.
# * HEALTHCHECK_KIND - must be "http" or "tcp". Defaults to "http"
Expand Down
4 changes: 2 additions & 2 deletions build-bin/docker/docker_args
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if [ -n "${DOCKER_TARGET}" ]; then
fi

# When non-empty, becomes the base layer including tag appropriate for the image being built.
# e.g. ghcr.io/openzipkin/java:21.0.3_p9-jre
# e.g. ghcr.io/openzipkin/java:21.0.4_p7-jre
#
# This is not required to be a base (FROM scratch) image like ghcr.io/openzipkin/alpine:3.12.3
# See https://docs.docker.com/glossary/#parent-image
Expand All @@ -51,7 +51,7 @@ if [ -n "${ALPINE_VERSION}" ]; then
docker_args="${docker_args} --build-arg alpine_version=${ALPINE_VERSION}"
fi

# When non-empty, becomes the build-arg java_version. e.g. "21.0.3_p9"
# When non-empty, becomes the build-arg java_version. e.g. "21.0.4_p7"
# Used to align base layers from https://github.com/orgs/openzipkin/packages/container/package/java
if [ -n "${JAVA_VERSION}" ]; then
docker_args="${docker_args} --build-arg java_version=${JAVA_VERSION}"
Expand Down
14 changes: 7 additions & 7 deletions build-bin/docker/docker_test_image
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@

set -ue

# export this variable so that docker-compose can use it
# export this variable so that docker compose can use it
export DOCKER_IMAGE=${1?full docker_tag is required. Ex openzipkin/zipkin:test}
# The two options are to run a single container of the image, or docker-compose which includes it.
# The two options are to run a single container of the image, or docker compose which includes it.
docker_compose_file=${2:-build-bin/docker-compose-$(echo ${DOCKER_IMAGE}| sed 's~.*/\(.*\):.*~\1~g').yml}
docker_container=${3:-sut}

# First try to run the intended containers.
health_rc=0
if test -f "${docker_compose_file}"; then
docker-compose -f "${docker_compose_file}" up --remove-orphans -d --quiet-pull || health_rc=1
docker compose -f "${docker_compose_file}" up --remove-orphans -d --quiet-pull || health_rc=1
else
docker run --name ${docker_container} -d ${DOCKER_IMAGE} || health_rc=1
fi
Expand All @@ -30,13 +30,13 @@ fi
if [ "${health_rc}" = "1" ] || ! build-bin/docker/docker_block_on_health ${docker_container}; then
>&2 echo "*** Failed waiting for health of ${docker_container}"

# Sadly, we can't `docker-compose inspect`. This means we may not see the inspect output of the
# container that failed in docker-compose until this is revised to work around compose/issues/4155
# Sadly, we can't `docker compose inspect`. This means we may not see the inspect output of the
# container that failed in docker compose until this is revised to work around compose/issues/4155
docker inspect --format='{{json .State.Health.Log}}' ${docker_container} || true

# Log any containers output to console before we remove them.
if test -f "${docker_compose_file}"; then
docker-compose -f "${docker_compose_file}" logs
docker compose -f "${docker_compose_file}" logs
else
docker logs ${docker_container} || true
fi
Expand All @@ -45,7 +45,7 @@ fi

# Clean up any containers, so that we can run this again without conflict.
if test -f "${docker_compose_file}"; then
docker-compose -f "${docker_compose_file}" down
docker compose -f "${docker_compose_file}" down
else
docker kill ${docker_container} && docker rm ${docker_container}
fi
Expand Down
2 changes: 1 addition & 1 deletion build-bin/maven/maven_unjar
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fi

if ! test -f ${artifact_id}.jar && [ ${is_release} = "true" ]; then
mvn_get="mvn -q --batch-mode -Denforcer.fail=false \
org.apache.maven.plugins:maven-dependency-plugin:3.6.1:get \
org.apache.maven.plugins:maven-dependency-plugin:3.7.1:get \
-Dtransitive=false -DgroupId=${group_id} -DartifactId=${artifact_id} -Dversion=${version}"

if [ -n "${classifier}" ]; then
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
# 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.3_p9
ARG java_version=21.0.4_p7

# 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.
# docker compose don't share layer hashes https://github.com/docker/compose/issues/883 normally.
# COPY --from= works around the issue.
FROM scratch as scratch

Expand Down
2 changes: 1 addition & 1 deletion docker/RATIONALE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependency: having HEALTHCHECK present makes triage and scripting a bit easier.

HEALTHCHECK on our test image serves primarily three purposes:
* ad-hoc or scripted status of health using docker ps instead of knowing Kafka commands
* to allow manual usage of the docker-compose v2 service_healthy condition
* to allow manual usage of the docker compose v2 service_healthy condition
* support Docker Hub automated test service

Ex. The following command can be used ad-hoc or in scripts without the user knowing Kafka:
Expand Down
44 changes: 22 additions & 22 deletions docker/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

This project is configured to run docker containers using
[docker-compose](https://docs.docker.com/compose/). Note that the default
configuration requires docker-compose 1.6.0+ and docker-engine 1.10.0+.
configuration requires docker compose 1.6.0+ and docker-engine 1.10.0+.

To start the default docker-compose configuration, run:
To start the default docker compose configuration, run:

```bash
# To use the last released version of zipkin
$ docker-compose up
$ docker compose up
# To use the last built version of zipkin
$ TAG=master docker-compose up
$ TAG=master docker compose up
```

View the web UI at $(docker ip):9411. Traces are stored in memory.
Expand All @@ -26,7 +26,7 @@ own containers.

To add ActiveMQ configuration, run:
```bash
$ docker-compose -f docker-compose-activemq.yml up
$ docker compose -f docker-compose-activemq.yml up
```

Then configure the [ActiveMQ sender](https://github.com/openzipkin/zipkin-reporter-java/blob/master/activemq-client/src/main/java/zipkin2/reporter/activemq/ActiveMQSender.java)
Expand All @@ -41,15 +41,15 @@ You can store traces in [Cassandra](../test-images/zipkin-cassandra/README.md) i
To start the Cassandra-backed configuration, run:

```bash
$ docker-compose -f docker-compose-cassandra.yml up
$ docker compose -f docker-compose-cassandra.yml up
```

The `zipkin-dependencies` container is a scheduled task that runs every hour.
If you want to see the dependency graph before then, you can run it manually
in another terminal like so:

```bash
$ docker-compose -f docker-compose-cassandra.yml run --rm --no-deps --entrypoint start-zipkin-dependencies dependencies
$ docker compose -f docker-compose-cassandra.yml run --rm --no-deps --entrypoint start-zipkin-dependencies dependencies
```

## Elasticsearch
Expand All @@ -61,15 +61,15 @@ using the `docker-compose-elasticsearch.yml` file. This configuration starts `zi
To start the Elasticsearch-backed configuration, run:

```bash
$ docker-compose -f docker-compose-elasticsearch.yml up
$ docker compose -f docker-compose-elasticsearch.yml up
```

The `zipkin-dependencies` container is a scheduled task that runs every hour.
If you want to see the dependency graph before then, you can run it manually
in another terminal like so:

```bash
$ docker-compose -f docker-compose-elasticsearch.yml run --rm --no-deps --entrypoint start-zipkin-dependencies dependencies
$ docker compose -f docker-compose-elasticsearch.yml run --rm --no-deps --entrypoint start-zipkin-dependencies dependencies
```

## Kafka
Expand All @@ -80,7 +80,7 @@ own containers.

To add Kafka configuration, run:
```bash
$ docker-compose -f docker-compose-kafka.yml up
$ docker compose -f docker-compose-kafka.yml up
```

Then configure the [Kafka sender](https://github.com/openzipkin/zipkin-reporter-java/blob/master/kafka/src/main/java/zipkin2/reporter/kafka/KafkaSender.java) using a `bootstrapServers` value of `host.docker.internal:9092` if your application is inside the same docker network or `localhost:19092` if not, but running on the same host.
Expand All @@ -101,7 +101,7 @@ You can store traces in [MySQL](../test-images/zipkin-mysql/README.md) instead o
To start the MySQL-backed configuration, run:

```bash
$ docker-compose -f docker-compose-mysql.yml up
$ docker compose -f docker-compose-mysql.yml up
```

## RabbitMQ
Expand All @@ -112,7 +112,7 @@ own containers.

To add RabbitMQ configuration, run:
```bash
$ docker-compose -f docker-compose-rabbitmq.yml up
$ docker compose -f docker-compose-rabbitmq.yml up
```

Then configure the [RabbitMQ sender](https://github.com/openzipkin/zipkin-reporter-java/blob/master/amqp-client/src/main/java/zipkin2/reporter/amqp/RabbitMQSender.java)
Expand All @@ -129,18 +129,18 @@ discover zipkin's endpoint from `eureka` and use it to send spans.

To try this out, run:
```bash
$ docker-compose -f docker-compose.yml -f docker-compose-eureka.yml up
$ docker compose -f docker-compose.yml -f docker-compose-eureka.yml up
```

## Example

The docker-compose configuration can be extended to host an [example application](https://github.com/openzipkin/brave-example)
using the `docker-compose-example.yml` file. That file employs [docker-compose overrides](https://docs.docker.com/compose/extends/#multiple-compose-files)
The docker compose configuration can be extended to host an [example application](https://github.com/openzipkin/brave-example)
using the `docker-compose-example.yml` file. That file employs [docker compose overrides](https://docs.docker.com/compose/extends/#multiple-compose-files)
to add a "frontend" and "backend" service.

To add the example configuration, run:
```bash
$ docker-compose -f docker-compose.yml -f docker-compose-example.yml up
$ docker compose -f docker-compose.yml -f docker-compose-example.yml up
```

Once the services start, open http://localhost:8081/
Expand All @@ -150,15 +150,15 @@ Afterward, you can view traces that went through the backend via http://localhos

## UI

The docker-compose configuration can be extended to [host the UI](../test-images/zipkin-ui/README.md) on port 80
The docker compose configuration can be extended to [host the UI](../test-images/zipkin-ui/README.md) on port 80
using the `docker-compose-ui.yml` file. That file employs
[docker-compose overrides](https://docs.docker.com/compose/extends/#multiple-compose-files)
[docker compose overrides](https://docs.docker.com/compose/extends/#multiple-compose-files)
to add an NGINX container and relevant settings.

To start the NGINX configuration, run:

```bash
$ docker-compose -f docker-compose.yml -f docker-compose-ui.yml up
$ docker compose -f docker-compose.yml -f docker-compose-ui.yml up
```

This container doubles as a skeleton for creating proxy configuration around
Expand All @@ -176,14 +176,14 @@ $ docker run -d -p 80:80 \

## UI Proxy

The docker-compose configuration can be extended to [proxy the UI](../test-images/zipkin-uiproxy/README.md) on port 80
The docker compose configuration can be extended to [proxy the UI](../test-images/zipkin-uiproxy/README.md) on port 80
using the `docker-compose-uiproxy.yml` file. That file employs
[docker-compose overrides](https://docs.docker.com/compose/extends/#multiple-compose-files) to add an NGINX container and relevant settings.
[docker compose overrides](https://docs.docker.com/compose/extends/#multiple-compose-files) to add an NGINX container and relevant settings.

To start the NGINX configuration, run:

```bash
$ docker-compose -f docker-compose.yml -f docker-compose-uiproxy.yml up
$ docker compose -f docker-compose.yml -f docker-compose-uiproxy.yml up
```

This container helps verify the `ZIPKIN_UI_BASEPATH` variable by setting it to
Expand Down
2 changes: 1 addition & 1 deletion docker/examples/docker-compose-activemq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#

# This file uses the version 2 docker-compose file format, described here:
# This file uses the version 2 docker compose file format, described here:
# https://docs.docker.com/compose/compose-file/#version-2
#
# It extends the default configuration from docker-compose.yml to add a test
Expand Down
2 changes: 1 addition & 1 deletion docker/examples/docker-compose-cassandra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#

# This file uses the version 2 docker-compose file format, described here:
# This file uses the version 2 docker compose file format, described here:
# https://docs.docker.com/compose/compose-file/#version-2
#
# It extends the default configuration from docker-compose.yml to run the
Expand Down
2 changes: 1 addition & 1 deletion docker/examples/docker-compose-elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#

# This file uses the version 2 docker-compose file format, described here:
# This file uses the version 2 docker compose file format, described here:
# https://docs.docker.com/compose/compose-file/#version-2
#
# It extends the default configuration from docker-compose.yml to run the
Expand Down
2 changes: 1 addition & 1 deletion docker/examples/docker-compose-eureka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#

# This file uses the version 2 docker-compose file format, described here:
# This file uses the version 2 docker compose file format, described here:
# https://docs.docker.com/compose/compose-file/#version-2
#
# It extends the default configuration from docker-compose.yml to register
Expand Down
2 changes: 1 addition & 1 deletion docker/examples/docker-compose-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#

# This file uses the version 2 docker-compose file format, described here:
# This file uses the version 2 docker compose file format, described here:
# https://docs.docker.com/compose/compose-file/#version-2
#
# It extends the default configuration from docker-compose.yml to add a test
Expand Down
2 changes: 1 addition & 1 deletion docker/examples/docker-compose-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#

# This file uses the version 2 docker-compose file format, described here:
# This file uses the version 2 docker compose file format, described here:
# https://docs.docker.com/compose/compose-file/#version-2
#
# This runs the zipkin and zipkin-mysql containers, using docker-compose's
Expand Down
Loading

0 comments on commit 2cf1850

Please sign in to comment.