Skip to content

Commit

Permalink
Moves from JDK 15 to LTS version 17 (#92)
Browse files Browse the repository at this point in the history
Also bumps patch versions of other LTS JDKs and updates maven

Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt authored Dec 5, 2023
1 parent 59215c3 commit b28e164
Show file tree
Hide file tree
Showing 29 changed files with 267 additions and 292 deletions.
Binary file modified .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
20 changes: 18 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ this using Java commands or Docker.
Once the services start, open http://localhost:8081/
* This calls the backend (http://127.0.0.1:9000/api) and shows its result: a formatted date.

Afterwards, you can view traces that went through the backend via http://127.0.0.1:9411/zipkin?serviceName=backend
Afterward, you can view traces that went through the backend via http://127.0.0.1:9411/zipkin?serviceName=backend
* This is a locally run zipkin service which keeps traces in memory

## Tips
Expand All @@ -37,17 +37,17 @@ There are some interesting details that apply to all examples:
Here are the example projects you can try:

* [armeria](armeria) `BRAVE_EXAMPLE=armeria docker-compose up`
* Runtime: Armeria, SLF4J 1.7, JRE 15
* Runtime: Armeria, SLF4J 1.7, JRE 17
* Trace Instrumentation: [Armeria](https://armeria.dev/), [SLF4J](https://github.com/openzipkin/brave/tree/master/context/slf4j)
* Trace Configuration: [Brave API](https://github.com/openzipkin/brave/tree/master/brave#setup) [Java](armeria/src/main/java/brave/example/HttpTracingFactory.java)

* [armeria-kafka](armeria-kafka) `BRAVE_EXAMPLE=armeria-kafka docker-compose -f docker-compose.yml -f docker-compose-kafka.yml up`
* Runtime: Armeria, Kafka Clients and Streams 2.7, SLF4J 1.7, JRE 15
* Runtime: Armeria, Kafka Clients and Streams 2.7, SLF4J 1.7, JRE 17
* Trace Instrumentation: [Armeria](https://armeria.dev/), [Kafka Clients](https://github.com/openzipkin/brave/tree/master/instrumentation/kafka-clients), [Kafka Streams](https://github.com/openzipkin/brave/tree/master/instrumentation/kafka-streams), [SLF4J](https://github.com/openzipkin/brave/tree/master/context/slf4j)
* Trace Configuration: [Brave API](https://github.com/openzipkin/brave/tree/master/brave#setup) [Java](armeria/src/main/java/brave/example/HttpTracingFactory.java)

* [dropwizard](dropwizard) `BRAVE_EXAMPLE=dropwizard docker-compose up`
* Runtime: JaxRS 2, Jersey 2.31, Apache HttpClient 4.5, Jetty 9.4, SLF4J 1.7, JRE 15
* Runtime: JaxRS 2, Jersey 2.31, Apache HttpClient 4.5, Jetty 9.4, SLF4J 1.7, JRE 17
* Trace Instrumentation: [Jersey Server](https://github.com/openzipkin/brave/tree/master/instrumentation/jersey-server), [Apache HttpClient](https://github.com/openzipkin/brave/tree/master/instrumentation/httpclient), [SLF4J](https://github.com/openzipkin/brave/tree/master/context/slf4j)
* Trace Configuration: [Dropwizard Zipkin](https://github.com/smoketurner/dropwizard-zipkin) [Java](dropwizard/src/main/java/brave/example/ExampleApplication.java) [Yaml](dropwizard/src/main/resources/server.yml)

Expand All @@ -57,17 +57,17 @@ Here are the example projects you can try:
* Trace Configuration: [Brave API](https://github.com/openzipkin/brave/tree/master/brave#setup) [XML](jersey2-cassandra3/src/main/webapp/WEB-INF/tracing.xml)

* [netty4-grpc](netty4-grpc) `BRAVE_EXAMPLE=netty4-grpc docker-compose up`
* Runtime: Netty 4.1, Google gRPC 1.34 , SLF4J 1.7, JRE 15
* Runtime: Netty 4.1, Google gRPC 1.34 , SLF4J 1.7, JRE 17
* Trace Instrumentation: [Netty Codec HTTP](https://github.com/openzipkin/brave/tree/master/instrumentation/netty-codec-http), [Google gRPC](https://github.com/openzipkin/brave/tree/master/instrumentation/grpc), [SLF4J](https://github.com/openzipkin/brave/tree/master/context/slf4j)
* Trace Configuration: [Brave API](https://github.com/openzipkin/brave/tree/master/brave#setup) [Java](netty4-grpc/src/main/java/brave/example/TracingConfiguration.java)

* [ratpack](ratpack) `BRAVE_EXAMPLE=ratpack docker-compose up`
* Runtime: Ratpack 1.8, Guice 4, SLF4J 1.7, JRE 15
* Runtime: Ratpack 1.8, Guice 4, SLF4J 1.7, JRE 17
* Trace Instrumentation: [Brave Ratpack](https://github.com/openzipkin-contrib/brave-ratpack)
* Trace Configuration: [Brave Ratpack Guice](https://github.com/openzipkin-contrib/brave-ratpack) [Java](ratpack/src/main/java/brave/example/Backend.java)

* [webflux5-sleuth](webflux5-sleuth) `BRAVE_EXAMPLE=webflux5-sleuth docker-compose up`
* Runtime: Spring 5.2, Reactor Netty 0.9, Spring Boot 2.3, Spring Cloud Sleuth 2.2, Log4J 2.13, JRE 15
* Runtime: Spring 5.2, Reactor Netty 0.9, Spring Boot 2.3, Spring Cloud Sleuth 2.2, Log4J 2.13, JRE 17
* Trace Instrumentation: [WebFlux Server](https://github.com/spring-cloud/spring-cloud-sleuth/blob/2.2.x/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/TraceWebFilter.java), [WebFlux Client](https://github.com/spring-cloud/spring-cloud-sleuth/blob/2.2.x/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/TraceWebClientBeanPostProcessor.java), [Reactor Context](https://github.com/spring-cloud/spring-cloud-sleuth/blob/2.2.x/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/reactor/ScopePassingSpanSubscriber.java), [SLF4J](https://github.com/openzipkin/brave/tree/master/context/slf4j)
* Trace Configuration: [Spring Cloud Sleuth](https://github.com/spring-cloud/spring-cloud-sleuth/tree/2.2.x/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/autoconfig) [Properties](webflux5-sleuth/src/main/resources/application.properties)

Expand Down
2 changes: 1 addition & 1 deletion armeria-kafka/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Tracing Example: Armeria/Kafka Clients and Streams/Java 15
## Tracing Example: Armeria/Kafka Clients and Streams/Java 17

Instead of client/server, this example implements a http->producer->streams->consumer flow.

Expand Down
4 changes: 2 additions & 2 deletions armeria-kafka/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<packaging>jar</packaging>

<name>brave-example-armeria-kafka</name>
<description>Tracing Example: Armeria/Kafka Clients and Streams/Java 15</description>
<description>Tracing Example: Armeria/Kafka Clients and Streams/Java 17</description>

<properties>
<jre.version>15</jre.version>
<jre.version>17</jre.version>
<maven.compiler.release>8</maven.compiler.release>

<armeria.version>1.6.0</armeria.version>
Expand Down
4 changes: 2 additions & 2 deletions armeria/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<packaging>jar</packaging>

<name>brave-example-armeria</name>
<description>Tracing Example: Armeria/ Java 15</description>
<description>Tracing Example: Armeria/ Java 17</description>

<properties>
<jre.version>15</jre.version>
<jre.version>17</jre.version>
<maven.compiler.release>8</maven.compiler.release>

<armeria.version>1.6.0</armeria.version>
Expand Down
101 changes: 13 additions & 88 deletions build-bin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ Finally, as this is an example project, there are no release tags in git, and it
`build-bin` holds portable scripts used in CI to test and deploy the project.

The scripts here are portable. They do not include any CI provider-specific logic or ENV variables.
This helps `.travis.yml` and `test.yml` (GitHub Actions) contain nearly the same contents, even if
This helps `test.yml` (GitHub Actions) and alternatives contain nearly the same contents, even if
certain OpenZipkin projects need slight adjustments here. Portability has proven necessary, as
OpenZipkin has had to transition CI providers many times due to feature and quota constraints.

These scripts serve a second purpose, which is to facilitate manual releases, which has also
happened many times due usually to service outages of CI providers. While tempting to use
CI-provider specific tools, doing so can easily create a dependency where no one knows how to
release anymore. Do not use provider-specific mechanisms to implement release flow. Instead,
automate triggering of the scripts here.
automate triggering of the scripts here.

The only scripts that should be modified per project are in the base directory. Those in sub
directories, such as [docker], should not vary project to project except accident of version drift.
Intentional changes in sub directories should be relevant and tested on multiple projects to ensure
they can be blindly copy/pasted.

Conversely, the files in the base directory are project specific entry-points for test and deploy
actions and are entirely appropriate to vary per project. Here's an overview:
actions and are entirely appropriate to vary per project. Here's an overview:

## Test

Expand All @@ -54,15 +54,15 @@ blank. Tests should not run on documentation-only commits. Tests must not depend
resources, as running tests can leak credentials. Git checkouts should include the full history so
that license headers or other git analysis can take place.

* [configure_test] - Sets up build environment for tests.
* [test] - Builds and runs tests for this project.
* [configure_test] - Sets up build environment for tests.
* [test] - Builds and runs tests for this project.

### Example GitHub Actions setup

A simplest GitHub Actions `test.yml` runs tests after configuring them, but only on relevant event
conditions. The name `test.yml` and job `test` allows easy references to status badges and parity of
the scripts it uses.

The `on:` section obviates job creation and resource usage for irrelevant events. Notably, GitHub
Actions includes the ability to skip documentation-only jobs.

Expand All @@ -81,7 +81,7 @@ jobs:
test:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # full git history for license check
- name: Test
Expand All @@ -90,67 +90,40 @@ jobs:
build-bin/test
```
### Example Travis setup
`.travis.yml` is a monolithic configuration file broken into stages, of which the default is "test".
A simplest Travis `test` job configures tests in `install` and runs them as `script`, but only on
relevant event conditions.

The `if:` section obviates job creation and resource usage for irrelevant events. Travis does not
support file conditions. A `before_install` step to skip documentation-only commits will likely
complete in less than a minute (10 credit cost).

Here's a partial `.travis.yml` including only the aspects mentioned above.
```yaml
git:
depth: false # full git history for license check, and doc-only skipping
jobs:
include:
- stage: test
if: branch = master AND tag IS blank AND type IN (push, pull_request)
name: Run unit and integration tests
before_install: |
if [ -n "${TRAVIS_COMMIT_RANGE}" ] && ! git diff --name-only "${TRAVIS_COMMIT_RANGE}" -- | grep -qv '\.md$'; then
echo "Stopping job as changes only affect documentation (ex. README.md)"
travis_terminate 0
fi
install: ./build-bin/configure_test
script: ./build-bin/test
```

## Deploy
Deploy builds and pushes artifacts to a remote repository for master and release commits on it. CI
providers deploy pushes to master on when the tag is blank, but not on documentation-only commits.
Releases should deploy on version tags (ex `/^[0-9]+\.[0-9]+\.[0-9]+/`), without consideration of if
the commit is documentation only or not.

* [configure_deploy] - Sets up environment and logs in, assuming [configure_test] was not called.
* [deploy] - deploys the project, with arg0 being "master" or a release commit like "1.2.3"
* [configure_deploy] - Sets up environment and logs in, assuming [configure_test] was not called.
* [deploy] - deploys the project, with arg0 being "master" or a release commit like "1.2.3"

### Example GitHub Actions setup

A simplest GitHub Actions `deploy.yml` deploys after logging in, but only on relevant event
conditions. The name `deploy.yml` and job `deploy` allows easy references to status badges and
parity of the scripts it uses.

The `on:` section obviates job creation and resource usage for irrelevant events. GitHub Actions
cannot implement "master, except documentation only-commits" in the same file. Hence, deployments of
master will happen even on README change.

Here's a partial `deploy.yml` including only the aspects mentioned above. Notice env variables are
explicitly defined and `on.tags` is a [glob pattern](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet).

```yaml
on:
push:
tags: '[0-9]+.[0-9]+.[0-9]+**' # Ex. 8.272.10 or 15.0.1_p9
tags: '[0-9]+.[0-9]+.[0-9]+**' # e.g. 8.272.10 or 15.0.1_p9
branches: master
jobs:
deploy:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1 # only needed to get the sha label
- name: Configure Deploy
Expand All @@ -162,51 +135,3 @@ jobs:
# GITHUB_REF will be refs/heads/master or refs/tags/1.2.3
run: build-bin/deploy $(echo ${GITHUB_REF} | cut -d/ -f 3)
```
'[0-9]+.[0-9]+.[0-9]+**'
### Example Travis setup
`.travis.yml` is a monolithic configuration file broken into stages. This means `test` and `deploy`
are in the same file. A simplest Travis `deploy` stage has two jobs: one for master pushes and
another for version tags. These jobs are controlled by event conditions.

The `if:` section obviates job creation and resource usage for irrelevant events. Travis does not
support file conditions. A `before_install` step to skip documentation-only commits will likely
complete in less than a minute (10 credit cost).

As billing is by the minute, it is most cost effective to combine test and deploy on master push.

Here's a partial `.travis.yml` including only the aspects mentioned above. Notice YAML anchors work
in Travis and `tag =~` [condition](https://github.com/travis-ci/travis-conditions) is a regular
expression.
```yaml
git:
depth: false # full git history for license check, and doc-only skipping
_terminate_if_only_docs: &terminate_if_only_docs |
if [ -n "${TRAVIS_COMMIT_RANGE}" ] && ! git diff --name-only "${TRAVIS_COMMIT_RANGE}" -- | grep -qv '\.md$'; then
echo "Stopping job as changes only affect documentation (ex. README.md)"
travis_terminate 0
fi
jobs:
include:
- stage: test
if: branch = master AND tag IS blank AND type IN (push, pull_request)
before_install: *terminate_if_only_docs
install: |
if [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
export SHOULD_DEPLOY=true
./build-bin/configure_deploy
else
export SHOULD_DEPLOY=false
./build-bin/configure_test
fi
script:
- ./build-bin/test || travis_terminate 1
- if [ "${SHOULD_DEPLOY}" != "true" ]; then travis_terminate 0; fi
- travis_wait ./build-bin/deploy master
- stage: deploy
# Ex. 8.272.10 or 15.0.1_p9
if: tag =~ /^[0-9]+\.[0-9]+\.[0-9]+/ AND type = push AND env(GH_TOKEN) IS present
install: ./build-bin/configure_deploy
script: ./build-bin/deploy ${TRAVIS_TAG}
```
4 changes: 2 additions & 2 deletions build-bin/docker-compose-kafka.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: "2.4"
services:
sut:
container_name: sut
image: ghcr.io/openzipkin/alpine:3.12.3
image: ghcr.io/openzipkin/alpine:3.18.5
entrypoint: /bin/sh
# Keep the container running until HEALTHCHECK passes
command: "-c \"sleep 5m\""
Expand All @@ -18,7 +18,7 @@ services:

get_frontend:
container_name: get_frontend
image: ghcr.io/openzipkin/alpine:3.12.3
image: ghcr.io/openzipkin/alpine:3.18.5
entrypoint: /bin/sh
# Pass a trace header with a constant trace ID, so that we know what to look for later
command: "-c \"wget -qO- --header 'b3: cafebabecafebabe-cafebabecafebabe-1' http://frontend:8081\""
Expand Down
4 changes: 2 additions & 2 deletions build-bin/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: "2.4"
services:
sut:
container_name: sut
image: ghcr.io/openzipkin/alpine:3.12.3
image: ghcr.io/openzipkin/alpine:3.18.5
entrypoint: /bin/sh
# Keep the container running until HEALTHCHECK passes
command: "-c \"sleep 5m\""
Expand All @@ -16,7 +16,7 @@ services:
condition: service_started
get_frontend:
container_name: get_frontend
image: ghcr.io/openzipkin/alpine:3.12.3
image: ghcr.io/openzipkin/alpine:3.18.5
entrypoint: /bin/sh
# Pass a trace header with a constant trace ID, so that we know what to look for later
command: "-c \"wget -qO- --header 'b3: cafebabecafebabe-cafebabecafebabe-1' http://frontend:8081\""
Expand Down
8 changes: 2 additions & 6 deletions build-bin/docker/configure_docker
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2013-2020 The OpenZipkin Authors
# 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
Expand All @@ -23,14 +23,10 @@ set -ue
# this is Docker related, it is coupled to integration tests configuration invoked with Maven.
# * See https://www.testcontainers.org/supported_docker_environment/image_registry_rate_limiting/
# * checks.disable=true - saves time and a docker.io pull of alpine
# * ryuk doesn't count against docker.io rate limits because Docker approved testcontainers as OSS
echo checks.disable=true >> ~/.testcontainers.properties
# * change ryuk to ghcr.io until: https://github.com/testcontainers/moby-ryuk/issues/15 and 16
echo ryuk.container.image=ghcr.io/openzipkin/testcontainers-ryuk:latest >> ~/.testcontainers.properties

# We don't use any docker.io images, but add a Google's mirror in case something implicitly does
# * See https://cloud.google.com/container-registry/docs/pulling-cached-images
echo '{ "registry-mirrors": ["https://mirror.gcr.io"] }' | sudo tee /etc/docker/daemon.json
sudo service docker restart

# * Ensure buildx and related features are disabled
mkdir -p ${HOME}/.docker && echo '{"experimental":"disabled"}' > ${HOME}/.docker/config.json
7 changes: 5 additions & 2 deletions build-bin/docker/configure_docker_push
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2013-2020 The OpenZipkin Authors
# 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
Expand Down Expand Up @@ -50,5 +50,8 @@ fi
# See https://github.com/multiarch/qemu-user-static
#
# Mirrored image use to avoid docker.io pulls:
# docker tag multiarch/qemu-user-static:5.1.0-7 ghcr.io/openzipkin/multiarch-qemu-user-static:latest
# docker tag multiarch/qemu-user-static:7.2.0-1 ghcr.io/openzipkin/multiarch-qemu-user-static:latest
#
# Note: This image only works on x86_64/amd64 architecture.
# See: https://github.com/multiarch/qemu-user-static#supported-host-architectures
docker run --rm --privileged ghcr.io/openzipkin/multiarch-qemu-user-static --reset -p yes
10 changes: 9 additions & 1 deletion build-bin/docker/docker_arch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2013-2020 The OpenZipkin Authors
# 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
Expand All @@ -21,6 +21,8 @@
set -ue

# Normalize docker_arch to what's available
#
# Note: s390x and ppc64le were added for Knative
docker_arch=${DOCKER_ARCH:-$(uname -m)}
case ${docker_arch} in
amd64* )
Expand All @@ -35,6 +37,12 @@ case ${docker_arch} in
aarch64* )
docker_arch=arm64
;;
s390x* )
docker_arch=s390x
;;
ppc64le* )
docker_arch=ppc64le
;;
* )
>&2 echo "Unsupported DOCKER_ARCH: ${docker_arch}"
exit 1;
Expand Down
Loading

0 comments on commit b28e164

Please sign in to comment.