Skip to content
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
2bdfe28
changes
chahatsagarmain Aug 18, 2025
95e1763
changes
chahatsagarmain Aug 18, 2025
8c57e22
changes
chahatsagarmain Aug 18, 2025
7c0c256
changes
chahatsagarmain Aug 18, 2025
63c3ef8
changes
chahatsagarmain Aug 18, 2025
2f3e4aa
changes
chahatsagarmain Aug 18, 2025
223c4f5
changes
chahatsagarmain Aug 18, 2025
98fd199
changes
chahatsagarmain Aug 22, 2025
6132012
use local
chahatsagarmain Aug 22, 2025
219bb40
changes
chahatsagarmain Aug 22, 2025
8378ca8
use localhost
chahatsagarmain Aug 22, 2025
ea579a7
changes
chahatsagarmain Aug 22, 2025
b2ee5cd
test
chahatsagarmain Aug 22, 2025
8e5ca4c
test
chahatsagarmain Aug 22, 2025
c5e13cb
test
chahatsagarmain Aug 22, 2025
b045b54
test
chahatsagarmain Aug 22, 2025
174100b
test
chahatsagarmain Aug 22, 2025
f047d11
test
chahatsagarmain Aug 22, 2025
c0935d8
test
chahatsagarmain Aug 22, 2025
04d9dff
test
chahatsagarmain Aug 22, 2025
8bb31c7
test
chahatsagarmain Aug 22, 2025
a8b0a3f
test
chahatsagarmain Aug 23, 2025
da6a60a
test
chahatsagarmain Aug 23, 2025
a332851
test
chahatsagarmain Aug 23, 2025
bb792b1
test
chahatsagarmain Aug 23, 2025
6c5c6c6
test
chahatsagarmain Aug 23, 2025
5d966bf
test
chahatsagarmain Aug 23, 2025
f118fae
test
chahatsagarmain Aug 23, 2025
b4df1e1
test
chahatsagarmain Aug 23, 2025
a1632b2
test
chahatsagarmain Aug 23, 2025
fb28659
test
chahatsagarmain Aug 23, 2025
bd92135
test
chahatsagarmain Aug 23, 2025
44c7cfc
test
chahatsagarmain Aug 23, 2025
3784daa
test
chahatsagarmain Aug 23, 2025
04cd926
test
chahatsagarmain Aug 23, 2025
c721951
test
chahatsagarmain Aug 23, 2025
bfe5989
test
chahatsagarmain Aug 23, 2025
02754d8
test
chahatsagarmain Aug 23, 2025
996c6ba
test
chahatsagarmain Aug 23, 2025
d2bdc77
test
chahatsagarmain Aug 23, 2025
ecc7edc
test
chahatsagarmain Aug 23, 2025
a132218
test
chahatsagarmain Aug 23, 2025
692c330
test
chahatsagarmain Aug 23, 2025
9d48bc9
test
chahatsagarmain Aug 23, 2025
c2e53c3
test
chahatsagarmain Aug 23, 2025
88e7cc5
test
chahatsagarmain Aug 23, 2025
fdff655
test
chahatsagarmain Aug 23, 2025
ef37e17
test
chahatsagarmain Aug 23, 2025
59061d8
test
chahatsagarmain Aug 23, 2025
1f5315e
test
chahatsagarmain Aug 23, 2025
70d2926
test
chahatsagarmain Aug 23, 2025
8d15815
test
chahatsagarmain Aug 23, 2025
0b6c08e
test
chahatsagarmain Aug 23, 2025
a029072
Merge branch 'main' into kind-ci
chahatsagarmain Aug 23, 2025
b8c047f
clean up
chahatsagarmain Aug 23, 2025
5bcd4f6
changes
chahatsagarmain Aug 23, 2025
1e5d02d
remove example
chahatsagarmain Aug 23, 2025
7c952d2
remove example
chahatsagarmain Aug 23, 2025
c3cd827
add mode validation
chahatsagarmain Aug 24, 2025
3dd24e3
change base path
chahatsagarmain Aug 24, 2025
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
5 changes: 2 additions & 3 deletions .github/workflows/ci-deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ jobs:

- name: Deploy using appropriate script
run: |
cd ./examples/oci
if [ "${{ github.event_name }}" = "schedule" ]; then
echo "🕒 Scheduled run - using deploy-all.sh (upgrade mode)"
bash ./deploy-all.sh
bash ./examples/oci/deploy-all.sh
else
echo "🔄 Manual run - using deploy-all.sh with clean mode (uninstall/install)"
bash ./deploy-all.sh clean
bash ./examples/oci/deploy-all.sh clean
fi
7 changes: 3 additions & 4 deletions .github/workflows/ci-docker-hotrod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
matrix:
runtime: [docker, k8s]
jaeger-version: [v1, v2]
exclude:
- runtime: k8s
jaeger-version: v1

steps:
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
Expand Down Expand Up @@ -64,10 +67,6 @@ jobs:
with:
version: 'latest'

- name: Install Kustomize
if: matrix.runtime == 'k8s'
uses: imranismail/setup-kustomize@2ba527d4d055ab63514ba50a99456fc35684947f # v2

- name: Create k8s Kind Cluster
if: matrix.runtime == 'k8s'
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1
Expand Down
7 changes: 6 additions & 1 deletion examples/oci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ service:
service.name: jaeger
metrics:
level: detailed
address: 0.0.0.0:8888
readers:
- pull:
exporter:
prometheus:
host: 0.0.0.0
port: 8888
logs:
level: DEBUG

Expand Down
58 changes: 38 additions & 20 deletions examples/oci/deploy-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
set -euo pipefail

MODE="${1:-upgrade}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

add comments explaining valid values

IMAGE_TAG="${2:-latest}"

if [[ "$MODE" == "upgrade" ]]; then
HELM_JAEGER_CMD="upgrade --install --force"
Expand All @@ -23,11 +24,15 @@ else
HELM_PROM_CMD="install"
fi

# Clone Jaeger Helm Charts (v2 branch) if not already present
# Navigate to the script's directory (examples/oci)
cd $(dirname $0)

# Clone Jaeger Helm Charts if not already present
if [ ! -d "helm-charts" ]; then
echo "📥 Cloning Jaeger Helm Charts..."
git clone https://github.com/jaegertracing/helm-charts.git
cd helm-charts
echo "Using v2 branch for Jaeger v2..."
git checkout v2
echo "Adding required Helm repositories..."
helm repo add bitnami https://charts.bitnami.com/bitnami
Expand All @@ -40,25 +45,34 @@ else
echo "📁 Jaeger Helm Charts already exist. Skipping clone."
fi

# Navigate into examples/oci if not already in it
if [[ "$(basename $PWD)" != "oci" ]]; then
if [ -d "./examples/oci" ]; then
echo "📂 Changing to ./examples/oci directory..."
cd ./examples/oci
else
echo "❌ Cannot find ./examples/oci directory. Exiting."
exit 1
fi
fi
# Set image repositories and deploy based on mode
if [[ "$MODE" == "local" ]]; then

echo "🟣 Deploying Jaeger..."
helm $HELM_JAEGER_CMD jaeger ./helm-charts/charts/jaeger \
--set provisionDataStore.cassandra=false \
--set allInOne.enabled=true \
--set storage.type=memory \
--set-file userconfig="./config.yaml" \
--set-file uiconfig="./ui-config.json" \
-f ./jaeger-values.yaml
echo "🟣 Deploying Jaeger with local registry images..."
helm $HELM_JAEGER_CMD jaeger ./helm-charts/charts/jaeger \
--set provisionDataStore.cassandra=false \
--set allInOne.enabled=true \
--set storage.type=memory \
--set hotrod.enabled=true \
--set allInOne.image.repository="localhost:5000/jaegertracing/jaeger" \
--set allInOne.image.tag="${IMAGE_TAG}" \
--set allInOne.image.pullPolicy="Never" \
--set hotrod.image.repository="localhost:5000/jaegertracing/example-hotrod" \
--set hotrod.image.tag="${IMAGE_TAG}" \
--set hotrod.image.pullPolicy="Never" \
--set-file userconfig="./config.yaml" \
--set-file uiconfig="./ui-config.json" \
-f ./jaeger-values.yaml
else
echo "🟣 Deploying Jaeger..."
helm $HELM_JAEGER_CMD jaeger ./helm-charts/charts/jaeger \
--set provisionDataStore.cassandra=false \
--set allInOne.enabled=true \
--set storage.type=memory \
--set-file userconfig="./config.yaml" \
--set-file uiconfig="./ui-config.json" \
-f ./jaeger-values.yaml
fi

echo "🟢 Deploying Prometheus..."
kubectl apply -f prometheus-svc.yaml
Expand Down Expand Up @@ -90,4 +104,8 @@ echo "Then open:"
echo "🔍 Jaeger: http://localhost:16686/jaeger"
echo "📈 Prometheus: http://localhost:9090"
echo "📊 Grafana: http://localhost:9091"
echo "🚕 HotROD: http://localhost:8080"
echo "🚕 HotROD: http://localhost:8080"
echo ""
echo "📝 Note: If you made changes to Jaeger configuration files (e.g., config.yaml, ui-config.json), you may need to run this script in clean mode:"
echo " ./deploy-all.sh clean"
echo "Or manually restart the CI workflow to ensure your changes are applied."
49 changes: 37 additions & 12 deletions scripts/build/build-hotrod-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2024 The Jaeger Authors.
# SPDX-License-Identifier: Apache-2.0

set -euf -o pipefail
set -exuf -o pipefail

print_help() {
echo "Usage: $0 [-h] [-l] [-o] [-p platforms] [-v jaeger_version]"
Expand Down Expand Up @@ -75,8 +75,7 @@ dump_logs() {

echo "::group:: Logs"
if [ "$runtime" == "k8s" ]; then
kubectl logs -n example-hotrod -l app=example-hotrod
kubectl logs -n example-hotrod -l app=jaeger
kubectl logs -l app.kubernetes.io/name=jaeger
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The log collection command has been changed to only capture Jaeger logs, but it's missing the HotROD application logs that were previously collected. Since the deployment structure has changed with the new Helm-based approach, the label selectors need to be updated to capture both services:

# For Jaeger logs
kubectl logs -l app.kubernetes.io/name=jaeger

# For HotROD logs
kubectl logs -l app.kubernetes.io/name=jaeger-hotrod

Or consider using a more comprehensive approach that captures all relevant components:

kubectl get pods -l 'app.kubernetes.io/name in (jaeger,jaeger-hotrod)' --no-headers | awk '{print $1}' | xargs -I{} kubectl logs {}

This ensures both application components are properly logged for debugging purposes.

Suggested change
kubectl logs -l app.kubernetes.io/name=jaeger
kubectl get pods -l 'app.kubernetes.io/name in (jaeger,jaeger-hotrod)' --no-headers | awk '{print $1}' | xargs -I{} kubectl logs {}

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

else
docker compose -f "$compose_file" logs
fi
Expand All @@ -95,7 +94,8 @@ teardown() {
if [[ -n "${JAEGER_PORT_FWD_PID:-}" ]]; then
kill "$JAEGER_PORT_FWD_PID" || true
fi
kubectl delete namespace example-hotrod --ignore-not-found=true
helm uninstall jaeger --ignore-not-found || true
helm uninstall prometheus --ignore-not-found || true
else
docker compose -f "$docker_compose_file" down
fi
Expand Down Expand Up @@ -132,12 +132,29 @@ if [[ "${runtime}" == "k8s" ]]; then
fi

echo '::group:: run on Kubernetes'
kustomize build ./examples/hotrod/kubernetes | kubectl apply -n example-hotrod -f -
kubectl wait --for=condition=available --timeout=180s -n example-hotrod deployment/example-hotrod
echo '::group:: Loading images into Kind cluster'

kubectl port-forward -n example-hotrod service/example-hotrod 8080:frontend &
docker pull localhost:5000/jaegertracing/jaeger:"${GITHUB_SHA}"
docker pull localhost:5000/jaegertracing/example-hotrod:"${GITHUB_SHA}"

# Get the actual cluster name
CLUSTER_NAME=$(kind get clusters | head -n1)
if [[ -n "$CLUSTER_NAME" ]]; then
echo "Loading images into '$CLUSTER_NAME' cluster..."
kind load docker-image localhost:5000/jaegertracing/jaeger:"${GITHUB_SHA}" --name "$CLUSTER_NAME"
kind load docker-image localhost:5000/jaegertracing/example-hotrod:"${GITHUB_SHA}" --name "$CLUSTER_NAME"
else
echo "No Kind clusters found!"
exit 1
fi
Comment on lines +145 to +149
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Potential race condition in cluster detection

The current approach of getting the cluster name with kind get clusters | head -n1 could be problematic in environments with multiple clusters or where cluster state changes during execution. Consider:

  1. If multiple clusters exist, the script always selects the first one without validation
  2. If the selected cluster is deleted between the head -n1 command and the kind load command, the load operation will fail with a non-obvious error

A more robust approach might be to:

# Either use a specific, known cluster name
CLUSTER_NAME="your-specific-cluster"

# Or verify the cluster exists immediately before using it
if kind get clusters | grep -q "$CLUSTER_NAME"; then
  kind load docker-image ... --name "$CLUSTER_NAME"
else
  echo "Cluster '$CLUSTER_NAME' no longer exists"
  exit 1
fi
Suggested change
CLUSTER_NAME=$(kind get clusters | head -n1)
if [[ -n "$CLUSTER_NAME" ]]; then
echo "Loading images into '$CLUSTER_NAME' cluster..."
kind load docker-image jaegertracing/all-in-one:latest --name "$CLUSTER_NAME"
kind load docker-image jaegertracing/example-hotrod:latest --name "$CLUSTER_NAME"
else
echo "No Kind clusters found!"
exit 1
fi
CLUSTER_NAME=${KIND_CLUSTER_NAME:-$(kind get clusters | head -n1)}
if [[ -z "$CLUSTER_NAME" ]]; then
echo "No Kind clusters found!"
exit 1
fi
if ! kind get clusters | grep -q "$CLUSTER_NAME"; then
echo "Cluster '$CLUSTER_NAME' does not exist or is not accessible!"
exit 1
fi
echo "Loading images into '$CLUSTER_NAME' cluster..."
kind load docker-image jaegertracing/all-in-one:latest --name "$CLUSTER_NAME"
kind load docker-image jaegertracing/example-hotrod:latest --name "$CLUSTER_NAME"

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.


bash ./examples/oci/deploy-all.sh local "${GITHUB_SHA}"
kubectl wait --for=condition=available --timeout=180s deployment/jaeger-hotrod
kubectl wait --for=condition=available --timeout=180s deployment/jaeger

kubectl port-forward svc/jaeger-hotrod 8080:80 &
HOTROD_PORT_FWD_PID=$!
kubectl port-forward -n example-hotrod service/jaeger 16686:frontend &
kubectl port-forward svc/jaeger-query 16686:16686 &
JAEGER_PORT_FWD_PID=$!
echo '::endgroup::'

Expand All @@ -147,22 +164,30 @@ else
echo '::endgroup::'
fi

if [[ "${runtime}" == "k8s" ]]; then
HOTROD_URL="http://localhost:8080/hotrod"
JAEGER_QUERY_URL="http://localhost:16686/jaeger"
else
HOTROD_URL="http://localhost:8080"
JAEGER_QUERY_URL="http://localhost:16686"
fi

i=0
while [[ "$(curl -s -o /dev/null -w '%{http_code}' localhost:8080)" != "200" && $i -lt 30 ]]; do
while [[ "$(curl -s -o /dev/null -w '%{http_code}' ${HOTROD_URL})" != "200" && $i -lt 30 ]]; do
sleep 1
i=$((i+1))
done

echo '::group:: check HTML'
echo 'Check that home page contains text Rides On Demand'
body=$(curl localhost:8080)
body=$(curl ${HOTROD_URL})
if [[ $body != *"Rides On Demand"* ]]; then
echo "String \"Rides On Demand\" is not present on the index page"
exit 1
fi
echo '::endgroup::'

response=$(curl -i -X POST "http://localhost:8080/dispatch?customer=123")
response=$(curl -i -X POST "${HOTROD_URL}/dispatch?customer=123")
TRACE_ID=$(echo "$response" | grep -Fi "Traceresponse:" | awk '{print $2}' | cut -d '-' -f 2)

if [ -n "$TRACE_ID" ]; then
Expand All @@ -172,7 +197,6 @@ else
exit 1
fi

JAEGER_QUERY_URL="http://localhost:16686"
EXPECTED_SPANS=35
MAX_RETRIES=30
SLEEP_INTERVAL=3
Expand Down Expand Up @@ -208,3 +232,4 @@ success="true"
# Ensure the image is published after successful test (maybe with -l flag if on a pull request).
# This is where all those multi-platform binaries we built earlier are utilized.
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -c example-hotrod -d examples/hotrod -p "${platforms}"

Loading