From ff0faea53d2a90e86e33b391b45cffff6ea9c182 Mon Sep 17 00:00:00 2001 From: zzzk1 Date: Sat, 11 Jan 2025 18:44:12 +0800 Subject: [PATCH] [Enhancement] Hotrod and Monitor Use Docker Compose V2 as Default Signed-off-by: zzzk1 --- docker-compose/monitor/Makefile | 2 +- docker-compose/monitor/README.md | 8 ++++---- .../{docker-compose.yml => docker-compose-v1.yml} | 0 examples/hotrod/README.md | 2 +- .../{docker-compose.yml => docker-compose-v1.yml} | 0 scripts/build/build-hotrod-image.sh | 10 +++++----- scripts/e2e/spm.sh | 10 +++++----- 7 files changed, 16 insertions(+), 16 deletions(-) rename docker-compose/monitor/{docker-compose.yml => docker-compose-v1.yml} (100%) rename examples/hotrod/{docker-compose.yml => docker-compose-v1.yml} (100%) diff --git a/docker-compose/monitor/Makefile b/docker-compose/monitor/Makefile index 821307a2018a..1c80742b97a6 100644 --- a/docker-compose/monitor/Makefile +++ b/docker-compose/monitor/Makefile @@ -20,7 +20,7 @@ build: clean-jaeger .PHONY: dev dev: export JAEGER_IMAGE_TAG = dev dev: - docker compose -f docker-compose.yml up $(DOCKER_COMPOSE_ARGS) + docker compose -f docker-compose-v1.yml up $(DOCKER_COMPOSE_ARGS) .PHONY: dev-v2 dev-v2: export JAEGER_IMAGE_TAG = dev diff --git a/docker-compose/monitor/README.md b/docker-compose/monitor/README.md index b020dda7fd9f..cc34040c2e57 100644 --- a/docker-compose/monitor/README.md +++ b/docker-compose/monitor/README.md @@ -69,7 +69,7 @@ This brings up the system necessary to use the SPM feature locally. It uses the latest image tags from both Jaeger and OpenTelemetry. ```shell -docker compose up +docker compose -f docker-compose-v1.yml up ``` **Jaeger v2** @@ -83,7 +83,7 @@ docker compose -f docker-compose-v2.yml up - Navigate to Jaeger UI at http://localhost:16686/ and inspect the Monitor tab. Select `redis` service from the dropdown to see more than one endpoint. - To visualize the raw metrics stored on the Prometheus server (for debugging and local development use cases), use the built-in Prometheus UI at http://localhost:9090/query. For example, http://localhost:9090/query?g0.expr=traces_span_metrics_calls_total&g0.tab=0&g0.range_input=5m -**Warning:** The included [docker-compose.yml](./docker-compose.yml) file uses the `latest` version of Jaeger and other components. If your local Docker registry already contains older versions, which may still be tagged as `latest`, you may want to delete those images before running the full set, to ensure consistent behavior: +**Warning:** The included [docker-compose-v1.yml](./docker-compose-v1.yml) file uses the `latest` version of Jaeger and other components. If your local Docker registry already contains older versions, which may still be tagged as `latest`, you may want to delete those images before running the full set, to ensure consistent behavior: ```bash make clean-all @@ -92,7 +92,7 @@ make clean-all To use an official published image of Jaeger, specify the version via environment variable: ```shell -JAEGER_IMAGE_TAG=1.62.0 docker compose up +JAEGER_IMAGE_TAG=1.62.0 docker compose -f docker-compose-v1.yml up ``` or for Jaeger v2: @@ -126,7 +126,7 @@ to emit traces to the OpenTelemetry Collector which, in turn, will aggregate the Start the local stack needed for SPM, if not already done: ```shell -docker compose up +docker compose -f docker-compose-v2.yml up ``` Generate a specific number of traces with: diff --git a/docker-compose/monitor/docker-compose.yml b/docker-compose/monitor/docker-compose-v1.yml similarity index 100% rename from docker-compose/monitor/docker-compose.yml rename to docker-compose/monitor/docker-compose-v1.yml diff --git a/examples/hotrod/README.md b/examples/hotrod/README.md index f6afce1054bd..6009272a9a6a 100644 --- a/examples/hotrod/README.md +++ b/examples/hotrod/README.md @@ -23,7 +23,7 @@ As of Jaeger v1.42.0 this application was upgraded to use the OpenTelemetry SDK ### Run everything via `docker compose` -* Download `docker-compose.yml` from https://github.com/jaegertracing/jaeger/blob/main/examples/hotrod/docker-compose.yml +* Download `docker-compose-v1.yml` from https://github.com/jaegertracing/jaeger/blob/main/examples/hotrod/docker-compose-v1.yml * Optional: find the latest Jaeger version (see https://www.jaegertracing.io/download/) and pass it via environment variable `JAEGER_VERSION`. Otherwise `docker compose` will use the `latest` tag, which is fine for the first time you download the images, but once they are in your local registry the `latest` tag is never updated and you may be running stale (and possibly incompatible) verions of Jaeger and the HotROD app. * Run Jaeger backend and HotROD demo, e.g.: * `JAEGER_VERSION=1.52 docker compose -f path-to-yml-file up` diff --git a/examples/hotrod/docker-compose.yml b/examples/hotrod/docker-compose-v1.yml similarity index 100% rename from examples/hotrod/docker-compose.yml rename to examples/hotrod/docker-compose-v1.yml diff --git a/scripts/build/build-hotrod-image.sh b/scripts/build/build-hotrod-image.sh index 0590c91cfed8..02784a378bb7 100755 --- a/scripts/build/build-hotrod-image.sh +++ b/scripts/build/build-hotrod-image.sh @@ -11,16 +11,16 @@ print_help() { echo "-l: Enable local-only mode that only pushes images to local registry" echo "-o: overwrite image in the target remote repository even if the semver tag already exists" echo "-p: Comma-separated list of platforms to build for (default: all supported)" - echo "-v: Jaeger version to use for hotrod image (v1 or v2, default: v1)" + echo "-v: Jaeger version to use for hotrod image (v1 or v2, default: v2)" echo "-r: Runtime to test with (docker|k8s, default: docker)" exit 1 } -docker_compose_file="./examples/hotrod/docker-compose.yml" +docker_compose_file="./examples/hotrod/docker-compose-v2.yml" platforms="$(make echo-linux-platforms)" current_platform="$(go env GOOS)/$(go env GOARCH)" -jaeger_version="v1" -binary="all-in-one" +jaeger_version="v2" +binary="jaeger" FLAGS=() success="false" runtime="docker" @@ -54,7 +54,7 @@ done case "$jaeger_version" in v1) - docker_compose_file="./examples/hotrod/docker-compose.yml" + docker_compose_file="./examples/hotrod/docker-compose-v1.yml" binary="all-in-one" ;; v2) diff --git a/scripts/e2e/spm.sh b/scripts/e2e/spm.sh index 6d1ac3952768..64e7b15b7f75 100755 --- a/scripts/e2e/spm.sh +++ b/scripts/e2e/spm.sh @@ -7,13 +7,13 @@ set -euf -o pipefail print_help() { echo "Usage: $0 [-b binary]" - echo "-b: Which binary to build: 'all-in-one' (default) or 'jaeger' (v2)" + echo "-b: Which binary to build: 'all-in-one' or 'jaeger' (v2) (default)" echo "-h: Print help" exit 1 } -BINARY='all-in-one' -compose_file=docker-compose/monitor/docker-compose.yml +BINARY='jaeger' +compose_file=docker-compose/monitor/docker-compose-v2.yml while getopts "b:h" opt; do case "${opt}" in @@ -28,8 +28,8 @@ done set -x -if [ "$BINARY" == "jaeger" ]; then - compose_file=docker-compose/monitor/docker-compose-v2.yml +if [ "$BINARY" == "all-in-one" ]; then + compose_file=docker-compose/monitor/docker-compose-v1.yml fi timeout=600