Skip to content

Commit 428e17c

Browse files
committed
test caller and called workflow for benchmarking
1 parent 00c9815 commit 428e17c

File tree

2 files changed

+53
-4
lines changed

2 files changed

+53
-4
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Prepare benchmarking databases by restoring dumps
2+
3+
on:
4+
workflow_call:
5+
# no inputs needed
6+
7+
defaults:
8+
run:
9+
shell: bash -euxo pipefail {0}
10+
11+
jobs:
12+
setup-databases:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
# the following hard-coded connection string which contains a password is just used for testing the workflow
18+
# and project will be immediately deleted after the workflow is running
19+
# so please don't worry about the "security issue" for now
20+
- BENCHMARK_CONNSTR: "postgresql://neondb_owner:4czu1xJeBkdN@ep-noisy-frost-w2k417od.us-east-2.aws.neon.build/neondb?sslmode=require"
21+
env:
22+
BENCHMARK_CONNSTR: ${{ matrix.BENCHMARK_CONNSTR }}
23+
24+
runs-on: [ self-hosted, us-east-2, x64 ]
25+
container:
26+
image: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:pinned
27+
options: --init
28+
29+
steps:
30+
- name: Download Neon artifact
31+
uses: ./.github/actions/download
32+
with:
33+
name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
34+
path: /tmp/neon/
35+
prefix: latest
36+
37+
# we create a table that has one row for each database that we want to restore with the status whether the restore is done
38+
- name: Create benchmark_restore_status table if it does not exist
39+
run: |
40+
/tmp/neon/pg_install/v16/bin/psql "${{ env.BENCHMARK_CONNSTR }}" -c "
41+
CREATE TABLE IF NOT EXISTS benchmark_restore_status (
42+
databasename text,
43+
restore_done boolean
44+
);
45+
"

.github/workflows/benchmarking.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,13 @@ jobs:
299299
300300
echo "matrix=$(echo "$matrix" | jq --compact-output '.')" >> $GITHUB_OUTPUT
301301
302+
prepare_AWS_RDS_databases:
303+
uses: ./.github/workflows/_benchmarking_preparation.yml
304+
secrets: inherit
305+
302306
pgbench-compare:
303307
if: ${{ github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null }}
304-
needs: [ generate-matrices ]
308+
needs: [ generate-matrices, prepare_AWS_RDS_databases ]
305309

306310
strategy:
307311
fail-fast: false
@@ -547,7 +551,7 @@ jobs:
547551
# *_CLICKBENCH_CONNSTR: Genuine ClickBench DB with ~100M rows
548552
# *_CLICKBENCH_10M_CONNSTR: DB with the first 10M rows of ClickBench DB
549553
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
550-
needs: [ generate-matrices, pgbench-compare ]
554+
needs: [ generate-matrices, pgbench-compare, prepare_AWS_RDS_databases ]
551555

552556
strategy:
553557
fail-fast: false
@@ -636,7 +640,7 @@ jobs:
636640
#
637641
# *_TPCH_S10_CONNSTR: DB generated with scale factor 10 (~10 GB)
638642
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
639-
needs: [ generate-matrices, clickbench-compare ]
643+
needs: [ generate-matrices, clickbench-compare, prepare_AWS_RDS_databases ]
640644

641645
strategy:
642646
fail-fast: false
@@ -723,7 +727,7 @@ jobs:
723727

724728
user-examples-compare:
725729
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
726-
needs: [ generate-matrices, tpch-compare ]
730+
needs: [ generate-matrices, tpch-compare, prepare_AWS_RDS_databases ]
727731

728732
strategy:
729733
fail-fast: false

0 commit comments

Comments
 (0)