From 8e1c04b1274515198710c400ffc1b9af5983ae08 Mon Sep 17 00:00:00 2001 From: Prathamesh Desai Date: Wed, 26 Jul 2023 12:58:29 +0530 Subject: [PATCH 1/7] Skeleton for jaeger_demo Signed-off-by: Prathamesh Desai --- common_helper.sh | 45 ++++++ jaeger_demo_setup.sh | 345 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 390 insertions(+) create mode 100755 jaeger_demo_setup.sh diff --git a/common_helper.sh b/common_helper.sh index 34b3840b..455f0ed2 100755 --- a/common_helper.sh +++ b/common_helper.sh @@ -106,6 +106,51 @@ function clone_repos() { echo } +function clone_jaeger() { + app_name=$1 + echo + echo "#######################################" + echo "1. Cloning ${app_name} git repos" + if [ ! -d ${app_name} ]; then + git clone git@github.com:kruize/${app_name}.git 2>/dev/null + if [ $? -ne 0 ]; then + git clone https://github.com/kruize/${app_name}.git 2>/dev/null + fi + check_err "ERROR: git clone of kruize/${app_name} failed." + fi + + if [ ! -d benchmarks ]; then + mkdir benchmarks + pushd benchmarks + git clone git@github.com:ozer550/Jaeger-demo-application.git + if [ $? -ne 0 ]; then + git clone https://github.com/ozer550/Jaeger-demo-application.git + fi + check_err "ERROR: git clone of Jaeger_demo_application failed." + fi + echo "done" + echo "#######################################" + echo + popd +} + +########################################### +# Jaeger Install +########################################### +function Jaeger_demo_install() { + echo + echo "#######################################" + pushd benchmarks >/dev/null + echo "5. Installing Jaeger_demo into cluster" + pushd Jaeger-demo-application >/dev/null + kubectl apply -f minikube-resources + check_err "ERROR: Jaeger_Demo app failed to start, exiting" + popd >/dev/null + popd >/dev/null + echo "#######################################" + echo +} + ########################################### # Cleanup git Repos ########################################### diff --git a/jaeger_demo_setup.sh b/jaeger_demo_setup.sh new file mode 100755 index 00000000..5271cf09 --- /dev/null +++ b/jaeger_demo_setup.sh @@ -0,0 +1,345 @@ +#!/bin/bash +# +# Copyright (c) 2020, 2022 Red Hat, IBM Corporation and others. +# +# 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 +# +# 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. +# + +# Default cluster +CLUSTER_TYPE="minikube" +target="crc" + +# include the common_utils.sh script to access methods +current_dir="$(dirname "$0")" +source ${current_dir}/common_helper.sh + +# Default docker image repo +AUTOTUNE_DOCKER_REPO="docker.io/kruize/autotune_operator" + +function usage() { + echo "Usage: $0 [-s|-t] [-d] [-p] [-i autotune-image] [-o hpo-image] [-r]" + echo "s = start (default), t = terminate" + echo "r = restart autotune only" + echo "d = Don't start experiments" + echo "p = expose prometheus port" + exit 1 +} + +########################################### +# Autotune Install +########################################### +function autotune_install() { + echo + echo "#######################################" + echo "6. Installing Autotune" + if [ ! -d autotune ]; then + echo "ERROR: autotune dir not found." + if [ ${autotune_restart} -eq 1 ]; then + echo "ERROR: autotune not running. Wrong use of restart command" + fi + exit -1 + fi + pushd autotune >/dev/null + # Checkout the mvp_demo branch for now + git checkout mvp_demo + + AUTOTUNE_VERSION="$(grep -A 1 "autotune" pom.xml | grep version | awk -F '>' '{ split($2, a, "<"); print a[1] }')" + YAML_TEMPLATE="./manifests/autotune-operator-deployment.yaml_template" + YAML_TEMPLATE_OLD="./manifests/autotune-operator-deployment.yaml_template.old" + + ./deploy.sh -c minikube -t 2>/dev/null + sleep 5 + if [ -z "${AUTOTUNE_DOCKER_IMAGE}" ]; then + AUTOTUNE_DOCKER_IMAGE=${AUTOTUNE_DOCKER_REPO}:${AUTOTUNE_VERSION} + fi + DOCKER_IMAGES="-i ${AUTOTUNE_DOCKER_IMAGE}" + if [ ! -z "${HPO_DOCKER_IMAGE}" ]; then + DOCKER_IMAGES="${DOCKER_IMAGES} -o ${HPO_DOCKER_IMAGE}" + fi + echo + echo "Starting install with ./deploy.sh -c minikube ${DOCKER_IMAGES}" + echo + + if [ ${EXPERIMENT_START} -eq 0 ]; then + cp ${YAML_TEMPLATE} ${YAML_TEMPLATE_OLD} + sed -e "s/imagePullPolicy: Always/imagePullPolicy: IfNotPresent/g" ${YAML_TEMPLATE_OLD} > ${YAML_TEMPLATE} + CURR_DRIVER=$(minikube config get driver 2>/dev/null) + if [ "${CURR_DRIVER}" == "docker" ]; then + echo "Setting docker env" + eval $(minikube docker-env) + elif [ "${CURR_DRIVER}" == "podman" ]; then + echo "Setting podman env" + eval $(minikube podman-env) + fi + fi + + ./deploy.sh -c minikube ${DOCKER_IMAGES} + check_err "ERROR: Autotune failed to start, exiting" + + if [ ${EXPERIMENT_START} -eq 0 ]; then + cp ${YAML_TEMPLATE_OLD} ${YAML_TEMPLATE} 2>/dev/null + fi + echo -n "Waiting 30 seconds for Autotune to sync with Prometheus..." + sleep 30 + echo "done" + popd >/dev/null + echo "#######################################" + echo +} + +function kruize_install() { + echo + echo "#######################################" + echo "6. Installing Kruize" + if [ ! -d autotune ]; then + echo "ERROR: autotune dir not found." + if [ ${autotune_restart} -eq 1 ]; then + echo "ERROR: Kruize not running. Wrong use of restart command" + fi + exit -1 + fi + pushd autotune >/dev/null + # Checkout mvp_demo to get the latest mvp_demo release version + git checkout mvp_demo >/dev/null 2>/dev/null + + AUTOTUNE_VERSION="$(grep -A 1 "autotune" pom.xml | grep version | awk -F '>' '{ split($2, a, "<"); print a[1] }')" + # Checkout the tag related to the last published mvp_demo version + git checkout "${AUTOTUNE_VERSION}" >/dev/null 2>/dev/null + + echo "Terminating existing installation of kruize with ./deploy.sh -c ${CLUSTER_TYPE} -m ${target} -t" + ./deploy.sh -c ${CLUSTER_TYPE} -m ${target} -t >/dev/null 2>/dev/null + sleep 5 + if [ -z "${AUTOTUNE_DOCKER_IMAGE}" ]; then + AUTOTUNE_DOCKER_IMAGE=${AUTOTUNE_DOCKER_REPO}:${AUTOTUNE_VERSION} + fi + DOCKER_IMAGES="-i ${AUTOTUNE_DOCKER_IMAGE}" + if [ ! -z "${HPO_DOCKER_IMAGE}" ]; then + DOCKER_IMAGES="${DOCKER_IMAGES} -o ${AUTOTUNE_DOCKER_IMAGE}" + fi + echo + echo "Starting kruize installation with ./deploy.sh -c ${CLUSTER_TYPE} ${DOCKER_IMAGES} -m ${target}" + echo + + if [ ${EXPERIMENT_START} -eq 0 ]; then + CURR_DRIVER=$(minikube config get driver 2>/dev/null) + if [ "${CURR_DRIVER}" == "docker" ]; then + echo "Setting docker env" + eval $(minikube docker-env) + elif [ "${CURR_DRIVER}" == "podman" ]; then + echo "Setting podman env" + eval $(minikube podman-env) + fi + fi + + ./deploy.sh -c ${CLUSTER_TYPE} ${DOCKER_IMAGES} -m ${target} + check_err "ERROR: kruize failed to start, exiting" + + echo -n "Waiting 40 seconds for Autotune to sync with Prometheus..." + sleep 40 + echo "done" + popd >/dev/null + echo "#######################################" + echo +} + +########################################### +# Install Autotune Objects +########################################### +function autotune_objects_install() { + echo + echo "#######################################" + pushd benchmarks >/dev/null + echo "7. Installing Autotune Object for techempower app" + pushd techempower >/dev/null + kubectl apply -f autotune/autotune-http_resp_time.yaml + check_err "ERROR: Failed to create Autotune object for techempower, exiting" + popd >/dev/null + popd >/dev/null + echo "#######################################" + echo +} + +########################################### +# Get URLs +########################################### +function get_urls() { + + kubectl_cmd="kubectl -n monitoring" + AUTOTUNE_PORT=$(${kubectl_cmd} get svc autotune --no-headers -o=custom-columns=PORT:.spec.ports[*].nodePort) + + kubectl_cmd="kubectl -n default" + TECHEMPOWER_PORT=$(${kubectl_cmd} get svc tfb-qrh-service --no-headers -o=custom-columns=PORT:.spec.ports[*].nodePort) + MINIKUBE_IP=$(minikube ip) + + echo + echo "#######################################" + echo "# Quarkus App #" + echo "#######################################" + echo "Info: Access techempower app at http://${MINIKUBE_IP}:${TECHEMPOWER_PORT}/db" + echo "Info: Access techempower app metrics at http://${MINIKUBE_IP}:${TECHEMPOWER_PORT}/q/metrics" + echo + echo "#######################################" + echo "# Autotune #" + echo "#######################################" + echo "Info: Access Autotune tunables at http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/listAutotuneTunables" + echo "###### The following links are meaningful only after an autotune object is deployed ######" + echo "Info: Autotune is monitoring these apps http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/listStacks" + echo "Info: List Layers in apps that Autotune is monitoring http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/listStackLayers" + echo "Info: List Tunables in apps that Autotune is monitoring http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/listStackTunables" + echo "Info: Autotune searchSpace at http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/searchSpace" + echo "Info: Autotune Experiments at http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/listExperiments" + echo "Info: Autotune Experiments Summary at http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/experimentsSummary" + echo "Info: Autotune Trials Status at http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/listTrialStatus" + echo "Info: Autotune Trials Status at http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/listTrialStatus?experiment_name=quarkus-resteasy-autotune-min-http-response-time-db&trial_number=0&verbose=true" + echo "Info: List Layers in autotune http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/query/listStackLayers?deployment_name=autotune&namespace=monitoring" + echo "Info: List Layers in tfb http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/query/listStackLayers?deployment_name=tfb-qrh-sample&namespace=default" + + echo + echo "Info: Access autotune objects using: kubectl -n default get autotune" + echo "Info: Access autotune tunables using: kubectl -n monitoring get autotuneconfig" + echo "#######################################" + echo +} + +function autotune_start() { + minikube >/dev/null + check_err "ERROR: minikube not installed" + # Start all the installs + start_time=$(get_date) + echo + echo "#######################################" + echo "# Autotune Demo Setup #" + echo "#######################################" + echo + + if [ ${autotune_restart} -eq 0 ]; then + clone_jaeger autotune + minikube_start + prometheus_install autotune + Jaeger_demo_install + fi + kruize_install + # autotune_install + # if [ ${EXPERIMENT_START} -eq 1 ]; then + # autotune_objects_install + # fi + echo + kubectl -n monitoring get pods + echo + get_urls + end_time=$(get_date) + elapsed_time=$(time_diff "${start_time}" "${end_time}") + echo "Success! Autotune demo setup took ${elapsed_time} seconds" + echo + if [ ${prometheus} -eq 1 ]; then + expose_prometheus + fi + + + # Set the lookback time to 7 days (604800000 milliseconds) + lookback=604800000 + + # Set the endTs based on the current timestamp + endTs=$(date +%s%3N) + + # Get the Minikube IP + minikube_ip=$(minikube ip) + # Get the NodePort for the port 16686 of the Jaeger service + jaeger_nodeport=$(kubectl get svc jaeger -o=jsonpath='{.spec.ports[?(@.port==16686)].nodePort}') + jaeger_nodeport="${jaeger_nodeport//\%}" + + # Get the NodePort for the port 8080 of the name-generator-service + nodeport_8080=$(kubectl get svc name-generator-service -o=jsonpath='{.spec.ports[?(@.port==8080)].nodePort}') + # Remove the '%' symbol from the NodePort value + nodeport_8080="${nodeport_8080//\%}" + + # Create the curl URL + curl_url="http://$minikube_ip:$jaeger_nodeport/api/dependencies?endTs=$endTs&lookback=$lookback" + http://192.168.49.2:30007/api/dependencies?endTs=1690347897323&lookback=604800000 + # Curl Url for demo application + name_generator_curl_url="http://$minikube_ip:$nodeport_8080/api/v1/names/random" + + # Hit the demo application to generate the data. + for ((i=1; i<=100; i++)); do + echo -e "\n\nCurling Name Generator API: Iteration $i" + curl "$name_generator_curl_url" + done + + echo + echo "#######################################" + echo "# Curlinggg the dependenciessss #" + echo "#######################################" + # Perform the curl operation + curl "$curl_url" + + +} + +function autotune_terminate() { + start_time=$(get_date) + echo + echo "#######################################" + echo "# Autotune Demo Terminate #" + echo "#######################################" + echo + delete_repos autotune + minikube_delete + end_time=$(get_date) + elapsed_time=$(time_diff "${start_time}" "${end_time}") + echo "Success! Autotune demo cleanup took ${elapsed_time} seconds" + echo +} + +# By default we start the demo and dont expose prometheus port +prometheus=0 +autotune_restart=0 +start_demo=1 +DOCKER_IMAGES="" +AUTOTUNE_DOCKER_IMAGE="" +HPO_DOCKER_IMAGE="" +EXPERIMENT_START=1 +# Iterate through the commandline options +while getopts di:o:prst gopts +do + case "${gopts}" in + d) + EXPERIMENT_START=0 + ;; + i) + AUTOTUNE_DOCKER_IMAGE="${OPTARG}" + ;; + o) + HPO_DOCKER_IMAGE="${OPTARG}" + ;; + p) + prometheus=1 + ;; + r) + autotune_restart=1 + ;; + s) + start_demo=1 + ;; + t) + start_demo=0 + ;; + *) + usage + esac +done + +if [ ${start_demo} -eq 1 ]; then + autotune_start +else + autotune_terminate +fi From f0e6aabbc247261713fc803d91bb7bf137952836 Mon Sep 17 00:00:00 2001 From: Prathamesh Desai Date: Wed, 26 Jul 2023 16:09:00 +0530 Subject: [PATCH 2/7] portforward jaeger service Signed-off-by: Prathamesh Desai --- common_helper.sh | 13 ++++++++++++- jaeger_demo_setup.sh | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/common_helper.sh b/common_helper.sh index 455f0ed2..6a8fae29 100755 --- a/common_helper.sh +++ b/common_helper.sh @@ -235,12 +235,23 @@ function benchmarks_install() { echo } +########################################### +# Expose Jaeger port +########################################### +function expose_jaeger() { + echo "Port forwarding Prometheus" + echo "Info: Prometheus accessible at http://localhost:9090" + kubectl port-forward svc/jaeger 16686:16686 +} + + + ########################################### # Expose Prometheus port ########################################### function expose_prometheus() { kubectl_cmd="kubectl -n monitoring" - echo "8. Port forwarding Prometheus" + echo "8. Port forwarding Jaeger" echo "Info: Prometheus accessible at http://localhost:9090" ${kubectl_cmd} port-forward prometheus-k8s-1 9090:9090 } diff --git a/jaeger_demo_setup.sh b/jaeger_demo_setup.sh index 5271cf09..3a4533bd 100755 --- a/jaeger_demo_setup.sh +++ b/jaeger_demo_setup.sh @@ -245,6 +245,8 @@ function autotune_start() { expose_prometheus fi + expose_jaeger + # Set the lookback time to 7 days (604800000 milliseconds) lookback=604800000 @@ -265,7 +267,7 @@ function autotune_start() { # Create the curl URL curl_url="http://$minikube_ip:$jaeger_nodeport/api/dependencies?endTs=$endTs&lookback=$lookback" - http://192.168.49.2:30007/api/dependencies?endTs=1690347897323&lookback=604800000 + # http://192.168.49.2:30007/api/dependencies?endTs=1690347897323&lookback=604800000 # Curl Url for demo application name_generator_curl_url="http://$minikube_ip:$nodeport_8080/api/v1/names/random" From d4965b1028aa192174a617c51832e4e83f3dc85f Mon Sep 17 00:00:00 2001 From: Prathamesh Desai Date: Fri, 28 Jul 2023 12:40:50 +0530 Subject: [PATCH 3/7] clean up code Signed-off-by: Prathamesh Desai --- common_helper.sh | 4 ++-- jaeger_demo_setup.sh | 23 +---------------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/common_helper.sh b/common_helper.sh index 6a8fae29..293b17cc 100755 --- a/common_helper.sh +++ b/common_helper.sh @@ -239,9 +239,9 @@ function benchmarks_install() { # Expose Jaeger port ########################################### function expose_jaeger() { - echo "Port forwarding Prometheus" + echo "Port forwarding Jaeger" echo "Info: Prometheus accessible at http://localhost:9090" - kubectl port-forward svc/jaeger 16686:16686 + kubectl port-forward svc/jaeger 16686:16686 & } diff --git a/jaeger_demo_setup.sh b/jaeger_demo_setup.sh index 3a4533bd..a323f937 100755 --- a/jaeger_demo_setup.sh +++ b/jaeger_demo_setup.sh @@ -246,28 +246,15 @@ function autotune_start() { fi expose_jaeger - - - # Set the lookback time to 7 days (604800000 milliseconds) - lookback=604800000 - - # Set the endTs based on the current timestamp - endTs=$(date +%s%3N) # Get the Minikube IP minikube_ip=$(minikube ip) - # Get the NodePort for the port 16686 of the Jaeger service - jaeger_nodeport=$(kubectl get svc jaeger -o=jsonpath='{.spec.ports[?(@.port==16686)].nodePort}') - jaeger_nodeport="${jaeger_nodeport//\%}" # Get the NodePort for the port 8080 of the name-generator-service nodeport_8080=$(kubectl get svc name-generator-service -o=jsonpath='{.spec.ports[?(@.port==8080)].nodePort}') # Remove the '%' symbol from the NodePort value nodeport_8080="${nodeport_8080//\%}" - # Create the curl URL - curl_url="http://$minikube_ip:$jaeger_nodeport/api/dependencies?endTs=$endTs&lookback=$lookback" - # http://192.168.49.2:30007/api/dependencies?endTs=1690347897323&lookback=604800000 # Curl Url for demo application name_generator_curl_url="http://$minikube_ip:$nodeport_8080/api/v1/names/random" @@ -277,14 +264,6 @@ function autotune_start() { curl "$name_generator_curl_url" done - echo - echo "#######################################" - echo "# Curlinggg the dependenciessss #" - echo "#######################################" - # Perform the curl operation - curl "$curl_url" - - } function autotune_terminate() { @@ -307,7 +286,7 @@ prometheus=0 autotune_restart=0 start_demo=1 DOCKER_IMAGES="" -AUTOTUNE_DOCKER_IMAGE="" +AUTOTUNE_DOCKER_IMAGE="kruize/autotune:jaeger_demo" HPO_DOCKER_IMAGE="" EXPERIMENT_START=1 # Iterate through the commandline options From b59f5d94af11546d6df42853391f850aae05e753 Mon Sep 17 00:00:00 2001 From: Prathamesh Desai Date: Fri, 28 Jul 2023 16:24:10 +0530 Subject: [PATCH 4/7] Change clone to kruize repo Signed-off-by: Prathamesh Desai --- common_helper.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common_helper.sh b/common_helper.sh index 293b17cc..5fa3b986 100755 --- a/common_helper.sh +++ b/common_helper.sh @@ -122,9 +122,9 @@ function clone_jaeger() { if [ ! -d benchmarks ]; then mkdir benchmarks pushd benchmarks - git clone git@github.com:ozer550/Jaeger-demo-application.git + git clone git@github.com:kruize/jaeger-demos.git if [ $? -ne 0 ]; then - git clone https://github.com/ozer550/Jaeger-demo-application.git + git clone https://github.com/kruize/jaeger-demos.git fi check_err "ERROR: git clone of Jaeger_demo_application failed." fi @@ -142,8 +142,8 @@ function Jaeger_demo_install() { echo "#######################################" pushd benchmarks >/dev/null echo "5. Installing Jaeger_demo into cluster" - pushd Jaeger-demo-application >/dev/null - kubectl apply -f minikube-resources + pushd jaeger-demos >/dev/null + kubectl apply -f kubernetes-resources check_err "ERROR: Jaeger_Demo app failed to start, exiting" popd >/dev/null popd >/dev/null From ff8a38ea5cc516f7e85bb641f02003ef776a3bd0 Mon Sep 17 00:00:00 2001 From: Prathamesh Desai Date: Mon, 31 Jul 2023 12:47:10 +0530 Subject: [PATCH 5/7] Update based on reccomendation Signed-off-by: Prathamesh Desai --- common_helper.sh | 34 +++++++++++++++++++--------------- jaeger_demo_setup.sh | 2 +- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/common_helper.sh b/common_helper.sh index 5fa3b986..a13918cf 100755 --- a/common_helper.sh +++ b/common_helper.sh @@ -119,19 +119,15 @@ function clone_jaeger() { check_err "ERROR: git clone of kruize/${app_name} failed." fi - if [ ! -d benchmarks ]; then - mkdir benchmarks - pushd benchmarks - git clone git@github.com:kruize/jaeger-demos.git - if [ $? -ne 0 ]; then - git clone https://github.com/kruize/jaeger-demos.git - fi - check_err "ERROR: git clone of Jaeger_demo_application failed." + git clone git@github.com:kruize/jaeger-demos.git + if [ $? -ne 0 ]; then + git clone https://github.com/kruize/jaeger-demos.git fi + check_err "ERROR: git clone of Jaeger_demo_application failed." + echo "done" echo "#######################################" echo - popd } ########################################### @@ -140,17 +136,25 @@ function clone_jaeger() { function Jaeger_demo_install() { echo echo "#######################################" - pushd benchmarks >/dev/null - echo "5. Installing Jaeger_demo into cluster" - pushd jaeger-demos >/dev/null - kubectl apply -f kubernetes-resources - check_err "ERROR: Jaeger_Demo app failed to start, exiting" - popd >/dev/null + echo "5. Installing Jaeger_demo into cluster" + pushd jaeger-demos >/dev/null + kubectl apply -f kubernetes-resources + check_err "ERROR: Jaeger_Demo app failed to start, exiting" popd >/dev/null echo "#######################################" echo } +########################################### +# Cleanup git Repos +########################################### +function delete_jaeger_repos() { + app_name=$1 + echo "1. Deleting ${app_name} git repos" + rm -rf ${app_name} jaeger-demos +} + + ########################################### # Cleanup git Repos ########################################### diff --git a/jaeger_demo_setup.sh b/jaeger_demo_setup.sh index a323f937..58dc52bd 100755 --- a/jaeger_demo_setup.sh +++ b/jaeger_demo_setup.sh @@ -273,7 +273,7 @@ function autotune_terminate() { echo "# Autotune Demo Terminate #" echo "#######################################" echo - delete_repos autotune + delete_jaeger_repos autotune minikube_delete end_time=$(get_date) elapsed_time=$(time_diff "${start_time}" "${end_time}") From b26053ab7910df7515d2c1614df58cf0322aacde Mon Sep 17 00:00:00 2001 From: Prathamesh Desai Date: Mon, 31 Jul 2023 14:41:06 +0530 Subject: [PATCH 6/7] more review fixes Signed-off-by: Prathamesh Desai --- JaegerDemo.md | 20 ++++++++++++++++++++ jaeger_demo_setup.sh | 11 +++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 JaegerDemo.md diff --git a/JaegerDemo.md b/JaegerDemo.md new file mode 100644 index 00000000..b56a9676 --- /dev/null +++ b/JaegerDemo.md @@ -0,0 +1,20 @@ +# Jaeger Demo +This demo instruments a microservices springboot application using Jaeger to fetch the dependecies using Jaeger API. + +## How do I run it? + +``` +./jaeger_demo_setup.sh +``` + +To view the dependecies Api response from Jaeger follow the given steps: + +- Find the name of Kruize pod. +``` +kubectl get pods -n monitoring +``` + +- To see the output of Kruize logs +``` +kubectl logs -n monitoring +``` diff --git a/jaeger_demo_setup.sh b/jaeger_demo_setup.sh index 58dc52bd..77bad39b 100755 --- a/jaeger_demo_setup.sh +++ b/jaeger_demo_setup.sh @@ -229,10 +229,8 @@ function autotune_start() { Jaeger_demo_install fi kruize_install - # autotune_install - # if [ ${EXPERIMENT_START} -eq 1 ]; then - # autotune_objects_install - # fi + + echo kubectl -n monitoring get pods echo @@ -263,6 +261,11 @@ function autotune_start() { echo -e "\n\nCurling Name Generator API: Iteration $i" curl "$name_generator_curl_url" done + + echo "#######################################" + echo "Check kruize pod logs to see the Jaeger api/dependencies output" + echo "#######################################" + } From f0a9d58bac4c8e15cdd500506e442589259d4bc2 Mon Sep 17 00:00:00 2001 From: Prathamesh Desai Date: Mon, 31 Jul 2023 15:40:49 +0530 Subject: [PATCH 7/7] Change copy right certificate date Signed-off-by: Prathamesh Desai --- JaegerDemo.md | 4 ++-- jaeger_demo_setup.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/JaegerDemo.md b/JaegerDemo.md index b56a9676..3aa16802 100644 --- a/JaegerDemo.md +++ b/JaegerDemo.md @@ -1,5 +1,5 @@ # Jaeger Demo -This demo instruments a microservices springboot application using Jaeger to fetch the dependecies using Jaeger API. +This demo deploys kruize, jaeger and a microservices spring boot application that is instrumented using jaeger in minikube. Kruize then fetches the microservices dependencies using the Jaeger [API](https://www.jaegertracing.io/docs/1.23/apis/#service-dependencies-graph-internal). You can find the details about the microservices application used [here](https://github.com/kruize/jaeger-demos/blob/main/JaegerDependencyDemo.md). ## How do I run it? @@ -7,7 +7,7 @@ This demo instruments a microservices springboot application using Jaeger to fet ./jaeger_demo_setup.sh ``` -To view the dependecies Api response from Jaeger follow the given steps: +To view the dependencies API response from Jaeger follow the given steps: - Find the name of Kruize pod. ``` diff --git a/jaeger_demo_setup.sh b/jaeger_demo_setup.sh index 77bad39b..53df5567 100755 --- a/jaeger_demo_setup.sh +++ b/jaeger_demo_setup.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2020, 2022 Red Hat, IBM Corporation and others. +# Copyright (c) 2020, 2023 Red Hat, IBM Corporation and others. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.