Skip to content

Commit b66b4c5

Browse files
authored
feat: Add 15m timeout for CI benchmarks (qdrant#157)
* feat: Add 15m timeout for CI benchmarks * feat: Add Slack alert for CI benchmarks (qdrant#158) * feat: Add Slack alert for CI benchmarks * Update continuous-benchmark.yaml * fix: Use quotes on func name to declare they arent commands * feat: Separate failure reasons * fix: YAML error
1 parent 884fda3 commit b66b4c5

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

.github/workflows/continuous-benchmark.yaml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
with:
1717
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
1818
- name: Benches
19+
id: benches
1920
run: |
2021
export HCLOUD_TOKEN=${{ secrets.HCLOUD_TOKEN }}
2122
export POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}
@@ -28,15 +29,42 @@ jobs:
2829
DATASET_TO_ENGINE["h-and-m-2048-angular-filters"]="qdrant-continuous-benchmark"
2930
DATASET_TO_ENGINE["dbpedia-openai-100K-1536-angular"]="qdrant-bq-continuous-benchmark"
3031
32+
set +e
33+
3134
for dataset in "${!DATASET_TO_ENGINE[@]}"; do
3235
export ENGINE_NAME=${DATASET_TO_ENGINE[$dataset]}
3336
export DATASETS=$dataset
3437
3538
# Benchmark the dev branch:
3639
export QDRANT_VERSION=ghcr/dev
37-
bash -x tools/run_ci.sh
40+
timeout 15m bash -x tools/run_ci.sh
3841
3942
# Benchmark the master branch:
4043
export QDRANT_VERSION=docker/master
41-
bash -x tools/run_ci.sh
44+
timeout 15m bash -x tools/run_ci.sh
4245
done
46+
47+
set -e
48+
- name: Fail job if any of the benches failed
49+
if: steps.benches.outputs.failed == 'error' || steps.benches.outputs.failed == 'timeout'
50+
run: exit 1
51+
- name: Send Notification
52+
if: failure() || cancelled()
53+
uses: slackapi/slack-github-action@v1.26.0
54+
with:
55+
payload: |
56+
{
57+
"text": "CI benchmarks run status: ${{ job.status }}",
58+
"blocks": [
59+
{
60+
"type": "section",
61+
"text": {
62+
"type": "mrkdwn",
63+
"text": "CI benchmarks failed because of ${{ steps.benches.outputs.failed }}.\nView the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
64+
}
65+
}
66+
]
67+
}
68+
env:
69+
SLACK_WEBHOOK_URL: ${{ secrets.CI_ALERTS_CHANNEL_WEBHOOK_URL }}
70+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

tools/run_ci.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
set -e
44

5+
function handle_error() {
6+
echo "Error occured ${QDRANT_VERSION@A} ${ENGINE_NAME@A} ${DATASETS@A}"
7+
echo "{failed}={error}" >> $GITHUB_OUTPUT
8+
}
9+
10+
function handle_term() {
11+
echo "Timeout occured ${QDRANT_VERSION@A} ${ENGINE_NAME@A} ${DATASETS@A}"
12+
echo "{failed}={timeout}" >> $GITHUB_OUTPUT
13+
}
14+
15+
trap 'handle_err' ERR
16+
trap 'handle_term' TERM
17+
518
# Script, that runs benchmark within the GitHub Actions CI environment
619

720
SCRIPT=$(realpath "$0")

0 commit comments

Comments
 (0)