-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Validate Jaeger demo configurations in CI workflow #7464
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
Changes from 56 commits
2bdfe28
95e1763
8c57e22
7c0c256
63c3ef8
2f3e4aa
223c4f5
98fd199
6132012
219bb40
8378ca8
ea579a7
b2ee5cd
8e5ca4c
c5e13cb
b045b54
174100b
f047d11
c0935d8
04d9dff
8bb31c7
a8b0a3f
da6a60a
a332851
bb792b1
6c5c6c6
5d966bf
f118fae
b4df1e1
a1632b2
fb28659
bd92135
44c7cfc
3784daa
04cd926
c721951
bfe5989
02754d8
996c6ba
d2bdc77
ecc7edc
a132218
692c330
9d48bc9
c2e53c3
88e7cc5
fdff655
ef37e17
59061d8
1f5315e
70d2926
8d15815
0b6c08e
a029072
b8c047f
5bcd4f6
1e5d02d
7c952d2
c3cd827
3dd24e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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]" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -75,8 +75,7 @@ dump_logs() { | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
yurishkuro marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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-hotrodOr 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
Spotted by Diamond |
||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose -f "$compose_file" logs | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -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 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
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
Spotted by Diamond |
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| 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::' | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -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 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -172,7 +197,6 @@ else | |||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| JAEGER_QUERY_URL="http://localhost:16686" | ||||||||||||||||||||||||||||||||||||||||||||||||
| EXPECTED_SPANS=35 | ||||||||||||||||||||||||||||||||||||||||||||||||
| MAX_RETRIES=30 | ||||||||||||||||||||||||||||||||||||||||||||||||
| SLEEP_INTERVAL=3 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -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}" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
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