From b7618abd83471e220c46477f7422e8dd3d851c22 Mon Sep 17 00:00:00 2001 From: KShivendu Date: Mon, 17 Jun 2024 16:54:00 +0530 Subject: [PATCH 1/3] feat: Add debug logs --- tools/qdrant_collect_stats.sh | 3 ++- tools/run_ci.sh | 3 ++- tools/run_client_script.sh | 3 ++- tools/run_experiment.sh | 3 ++- tools/run_remote_benchmark.sh | 3 ++- tools/run_server_container.sh | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/qdrant_collect_stats.sh b/tools/qdrant_collect_stats.sh index 7ccf9c29..659aaeeb 100644 --- a/tools/qdrant_collect_stats.sh +++ b/tools/qdrant_collect_stats.sh @@ -1,6 +1,7 @@ #!/bin/bash -set -e +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +set -euo pipefail # Examples: qdrant-single-node, qdrant-single-node-rps CONTAINER_NAME=$1 diff --git a/tools/run_ci.sh b/tools/run_ci.sh index f470da0c..c4ff574b 100644 --- a/tools/run_ci.sh +++ b/tools/run_ci.sh @@ -1,6 +1,7 @@ #!/bin/bash -set -e +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +set -euo pipefail function handle_err() { echo "Error occured ${QDRANT_VERSION@A} ${ENGINE_NAME@A} ${DATASETS@A}" diff --git a/tools/run_client_script.sh b/tools/run_client_script.sh index 783ae793..f4a45659 100644 --- a/tools/run_client_script.sh +++ b/tools/run_client_script.sh @@ -1,6 +1,7 @@ #!/bin/bash -set -e +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +set -euo pipefail CLOUD_NAME=${CLOUD_NAME:-"hetzner"} SERVER_USERNAME=${SERVER_USERNAME:-"root"} diff --git a/tools/run_experiment.sh b/tools/run_experiment.sh index 6179b88b..957ad3b7 100644 --- a/tools/run_experiment.sh +++ b/tools/run_experiment.sh @@ -1,6 +1,7 @@ #!/bin/bash -set -e +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +set -euo pipefail ENGINE_NAME=${ENGINE_NAME:-"qdrant-continuous-benchmark"} diff --git a/tools/run_remote_benchmark.sh b/tools/run_remote_benchmark.sh index bcba6a23..8a79ba08 100644 --- a/tools/run_remote_benchmark.sh +++ b/tools/run_remote_benchmark.sh @@ -1,6 +1,7 @@ #!/bin/bash -set -e +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +set -euo pipefail # Setup 2 machines in Hetzner Cloud # One machine will be used as a server, another one as a client diff --git a/tools/run_server_container.sh b/tools/run_server_container.sh index d04f1199..4f72c940 100644 --- a/tools/run_server_container.sh +++ b/tools/run_server_container.sh @@ -1,6 +1,7 @@ #!/bin/bash -set -e +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +set -euo pipefail # Examples: qdrant-continuous-benchmarks CONTAINER_NAME=$1 From 3e1a83b9a74552b04377fd623a66c479703e343e Mon Sep 17 00:00:00 2001 From: KShivendu Date: Mon, 17 Jun 2024 17:06:30 +0530 Subject: [PATCH 2/3] feat: Add file and func name in logs --- tools/qdrant_collect_stats.sh | 2 +- tools/run_ci.sh | 6 +++--- tools/run_client_script.sh | 2 +- tools/run_experiment.sh | 2 +- tools/run_remote_benchmark.sh | 4 ++-- tools/run_server_container.sh | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/qdrant_collect_stats.sh b/tools/qdrant_collect_stats.sh index 659aaeeb..871ad921 100644 --- a/tools/qdrant_collect_stats.sh +++ b/tools/qdrant_collect_stats.sh @@ -1,6 +1,6 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' set -euo pipefail # Examples: qdrant-single-node, qdrant-single-node-rps diff --git a/tools/run_ci.sh b/tools/run_ci.sh index c4ff574b..56adee27 100644 --- a/tools/run_ci.sh +++ b/tools/run_ci.sh @@ -1,15 +1,15 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' set -euo pipefail function handle_err() { - echo "Error occured ${QDRANT_VERSION@A} ${ENGINE_NAME@A} ${DATASETS@A}" + echo "Error occured qdrant_version=${QDRANT_VERSION} engine_name=${ENGINE_NAME} dataset=${DATASETS}" echo "{failed}={error}" >> $GITHUB_OUTPUT } function handle_term() { - echo "Timeout occured ${QDRANT_VERSION@A} ${ENGINE_NAME@A} ${DATASETS@A}" + echo "Timeout occured qdrant_version=${QDRANT_VERSION} engine_name=${ENGINE_NAME} dataset=${DATASETS}" echo "{failed}={timeout}" >> $GITHUB_OUTPUT } diff --git a/tools/run_client_script.sh b/tools/run_client_script.sh index f4a45659..d56cab07 100644 --- a/tools/run_client_script.sh +++ b/tools/run_client_script.sh @@ -1,6 +1,6 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' set -euo pipefail CLOUD_NAME=${CLOUD_NAME:-"hetzner"} diff --git a/tools/run_experiment.sh b/tools/run_experiment.sh index 957ad3b7..da4c1e83 100644 --- a/tools/run_experiment.sh +++ b/tools/run_experiment.sh @@ -1,6 +1,6 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' set -euo pipefail ENGINE_NAME=${ENGINE_NAME:-"qdrant-continuous-benchmark"} diff --git a/tools/run_remote_benchmark.sh b/tools/run_remote_benchmark.sh index 8a79ba08..887dd49f 100644 --- a/tools/run_remote_benchmark.sh +++ b/tools/run_remote_benchmark.sh @@ -1,13 +1,13 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' set -euo pipefail # Setup 2 machines in Hetzner Cloud # One machine will be used as a server, another one as a client cleanup() { - echo "cleaning up..." + echo "cleaning up file=$BASH_SOURCE" # bash -x "${SCRIPT_PATH}/tear_down.sh" } diff --git a/tools/run_server_container.sh b/tools/run_server_container.sh index 4f72c940..cd6c21d9 100644 --- a/tools/run_server_container.sh +++ b/tools/run_server_container.sh @@ -1,6 +1,6 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' set -euo pipefail # Examples: qdrant-continuous-benchmarks From 74d3b06cc3eb48d8d7edfaf71dc0915cd67e16f5 Mon Sep 17 00:00:00 2001 From: KShivendu Date: Mon, 17 Jun 2024 17:10:05 +0530 Subject: [PATCH 3/3] fix: Remove funcname --- tools/qdrant_collect_stats.sh | 2 +- tools/run_ci.sh | 2 +- tools/run_client_script.sh | 2 +- tools/run_experiment.sh | 2 +- tools/run_remote_benchmark.sh | 2 +- tools/run_server_container.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/qdrant_collect_stats.sh b/tools/qdrant_collect_stats.sh index 871ad921..8b81c9ad 100644 --- a/tools/qdrant_collect_stats.sh +++ b/tools/qdrant_collect_stats.sh @@ -1,6 +1,6 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE ' set -euo pipefail # Examples: qdrant-single-node, qdrant-single-node-rps diff --git a/tools/run_ci.sh b/tools/run_ci.sh index 56adee27..b9b1113a 100644 --- a/tools/run_ci.sh +++ b/tools/run_ci.sh @@ -1,6 +1,6 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE ' set -euo pipefail function handle_err() { diff --git a/tools/run_client_script.sh b/tools/run_client_script.sh index d56cab07..da95da32 100644 --- a/tools/run_client_script.sh +++ b/tools/run_client_script.sh @@ -1,6 +1,6 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE ' set -euo pipefail CLOUD_NAME=${CLOUD_NAME:-"hetzner"} diff --git a/tools/run_experiment.sh b/tools/run_experiment.sh index da4c1e83..0ee29375 100644 --- a/tools/run_experiment.sh +++ b/tools/run_experiment.sh @@ -1,6 +1,6 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE ' set -euo pipefail ENGINE_NAME=${ENGINE_NAME:-"qdrant-continuous-benchmark"} diff --git a/tools/run_remote_benchmark.sh b/tools/run_remote_benchmark.sh index 887dd49f..26ae75da 100644 --- a/tools/run_remote_benchmark.sh +++ b/tools/run_remote_benchmark.sh @@ -1,6 +1,6 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE ' set -euo pipefail # Setup 2 machines in Hetzner Cloud diff --git a/tools/run_server_container.sh b/tools/run_server_container.sh index cd6c21d9..c28e145c 100644 --- a/tools/run_server_container.sh +++ b/tools/run_server_container.sh @@ -1,6 +1,6 @@ #!/bin/bash -PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE func=${FUNCNAME[0]} ' +PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE ' set -euo pipefail # Examples: qdrant-continuous-benchmarks