-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathrun_ci.sh
36 lines (27 loc) · 1.15 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
#!/bin/bash
set -e
function handle_err() {
local exit_code=$?
local line_no=${BASH_LINENO[0]}
echo "Error occurred line=$line_no exit_code=$exit_code"
echo "Error in benchmarking ${QDRANT_VERSION@A} ${ENGINE_NAME@A} ${DATASETS@A}"
echo "{failed}={error}" >> $GITHUB_OUTPUT
}
function handle_term() {
echo "Timeout in benchmarking ${QDRANT_VERSION@A} ${ENGINE_NAME@A} ${DATASETS@A}"
echo "{failed}={timeout}" >> $GITHUB_OUTPUT
}
trap 'handle_err' ERR
trap 'handle_term' TERM
# Script, that runs benchmark within the GitHub Actions CI environment
SCRIPT=$(realpath "$0")
SCRIPT_PATH=$(dirname "$SCRIPT")
bash -x "${SCRIPT_PATH}/run_remote_benchmark.sh"
# Upload to postgres
# -t sorts by modification time
export SEARCH_RESULTS_FILE=$(ls -t results/*-search-*.json | head -n 1)
export UPLOAD_RESULTS_FILE=$(ls -t results/*-upload-*.json | head -n 1)
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)
bash -x "${SCRIPT_PATH}/upload_results_postgres.sh"