-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy pathrun_ci.sh
executable file
·58 lines (43 loc) · 1.92 KB
/
run_ci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
PS4='ts=$(date "+%Y-%m-%dT%H:%M:%SZ") level=DEBUG line=$LINENO file=$BASH_SOURCE '
set -euo pipefail
function handle_err() {
echo "qdrant_version=${QDRANT_VERSION}" >> $GITHUB_OUTPUT
echo "engine_name=${ENGINE_NAME}" >> $GITHUB_OUTPUT
echo "dataset=${DATASETS}" >> $GITHUB_OUTPUT
echo "failed=error" >> $GITHUB_OUTPUT
}
function handle_term() {
echo "qdrant_version=${QDRANT_VERSION}" >> $GITHUB_OUTPUT
echo "engine_name=${ENGINE_NAME}" >> $GITHUB_OUTPUT
echo "dataset=${DATASETS}" >> $GITHUB_OUTPUT
echo "failed=timeout" >> $GITHUB_OUTPUT
}
trap 'handle_err' ERR
trap 'handle_term' TERM
# Script, that runs benchmark within the GitHub Actions CI environment
BENCHMARK_STRATEGY=${BENCHMARK_STRATEGY:-"default"}
SCRIPT=$(realpath "$0")
SCRIPT_PATH=$(dirname "$SCRIPT")
bash -x "${SCRIPT_PATH}/run_remote_benchmark.sh"
# Upload to postgres
# -t sorts by modification time
if [[ "$BENCHMARK_STRATEGY" == "collection-reload" ]]; then
export TELEMETRY_API_RESPONSE_FILE=$(ls -t results/telemetry-api-*.json | head -n 1)
else
# any other strategies are considered to have search & upload results
export SEARCH_RESULTS_FILE=$(ls -t results/*-search-*.json | head -n 1)
export UPLOAD_RESULTS_FILE=$(ls -t results/*-upload-*.json | head -n 1)
if [[ "$BENCHMARK_STRATEGY" == "parallel" ]]; then
export PARALLEL_UPLOAD_RESULTS_FILE=$(ls -t results/parallel/*-upload-*.json | head -n 1)
export PARALLEL_SEARCH_RESULTS_FILE=$(ls -t results/parallel/*-search-*.json | head -n 1)
fi
fi
export VM_RSS_MEMORY_USAGE_FILE=$(ls -t results/vm-rss-memory-usage-*.txt | head -n 1)
export RSS_ANON_MEMORY_USAGE_FILE=$(ls -t results/rss-anon-memory-usage-*.txt | head -n 1)
export ROOT_API_RESPONSE_FILE=$(ls -t results/root-api-*.json | head -n 1)
if [[ "$BENCHMARK_STRATEGY" == "parallel" ]]; then
bash -x "${SCRIPT_PATH}/upload_parallel_results_postgres.sh"
else
bash -x "${SCRIPT_PATH}/upload_results_postgres.sh"
fi