Skip to content

Commit 57cf321

Browse files
authored
Merge pull request #102 from data-catering/feature/clean-docs
Update benchmark to use correct version from gradle properties
2 parents a86caa0 + 0b3a5b1 commit 57cf321

1 file changed

Lines changed: 38 additions & 5 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,63 @@
11
name: Run performance benchmark tests
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
workflow_run:
5+
workflows: ["Build docker images"]
6+
types:
7+
- completed
8+
# Allow manual triggering for testing
9+
workflow_dispatch:
710

811
jobs:
912
build:
1013
runs-on: ubuntu-latest
14+
# Only run if:
15+
# 1. Manual trigger, OR
16+
# 2. Build workflow completed successfully after a tag push
17+
if: |
18+
github.event_name == 'workflow_dispatch' ||
19+
(github.event.workflow_run.conclusion == 'success' &&
20+
github.event.workflow_run.event == 'push')
1121
defaults:
1222
run:
1323
working-directory: example
1424
steps:
1525
- name: Checkout monorepo
1626
uses: actions/checkout@v4
1727
with:
28+
# For workflow_run, we need to checkout the specific commit that triggered the build
29+
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
1830
fetch-depth: 2
1931
- name: Check if benchmark has already run
2032
run: |
21-
version=$(grep dataCatererVersion ../gradle.properties | cut -d= -f2)
33+
version=$(grep -E "^version=" ../gradle.properties | cut -d= -f2)
2234
if [ ! -f benchmark/results/benchmark_results_${version}.txt ]; then
2335
echo "No benchmark results for version: $version, starting to run benchmarks"
2436
else
2537
echo "Benchmarks already run!"
2638
exit 1
2739
fi
40+
- name: Wait for Docker image to be available
41+
run: |
42+
version=$(grep -E "^version=" ../gradle.properties | cut -d= -f2)
43+
echo "Waiting for Docker image datacatering/data-caterer:${version} to be available..."
44+
max_attempts=10
45+
attempt=1
46+
while [ $attempt -le $max_attempts ]; do
47+
if docker pull datacatering/data-caterer:${version} 2>/dev/null; then
48+
echo "Docker image is available!"
49+
break
50+
else
51+
echo "Attempt $attempt/$max_attempts: Image not yet available, waiting 30 seconds..."
52+
sleep 30
53+
((attempt++))
54+
fi
55+
done
56+
57+
if [ $attempt -gt $max_attempts ]; then
58+
echo "ERROR: Docker image not available after $max_attempts attempts"
59+
exit 1
60+
fi
2861
- name: Checkout datafusion-comet repo
2962
uses: actions/checkout@v4
3063
with:
@@ -35,7 +68,7 @@ jobs:
3568
run: bash benchmark/setup_query_engine_jars.sh
3669
- name: Run benchmark script
3770
run: |
38-
version=$(grep dataCatererVersion ../gradle.properties | cut -d= -f2)
71+
version=$(grep -E "^version=" ../gradle.properties | cut -d= -f2)
3972
bash benchmark/run_benchmark.sh
4073
bash benchmark/compare_benchmark_results.sh "$version"
4174
- name: Create pull request

0 commit comments

Comments
 (0)