Skip to content

Commit d97ffa0

Browse files
authored
chore: run load test with new label (#15035)
1 parent 9334956 commit d97ffa0

File tree

4 files changed

+53
-7
lines changed

4 files changed

+53
-7
lines changed

.github/workflows/cloud.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818

1919
jobs:
2020
info:
21-
if: contains(github.event.pull_request.labels.*.name, 'ci-cloud') || contains(github.event.pull_request.labels.*.name, 'ci-benchmark') || contains(github.event.pull_request.labels.*.name, 'ci-benchmark-cloud') || contains(github.event.pull_request.labels.*.name, 'ci-benchmark-local')
21+
if: contains(github.event.pull_request.labels.*.name, 'ci-cloud') || contains(github.event.pull_request.labels.*.name, 'ci-benchmark') || contains(github.event.pull_request.labels.*.name, 'ci-benchmark-cloud') || contains(github.event.pull_request.labels.*.name, 'ci-benchmark-load') || contains(github.event.pull_request.labels.*.name, 'ci-benchmark-local')
2222
runs-on: ubuntu-latest
2323
outputs:
2424
sha: ${{ steps.sha.outputs.sha }}
@@ -37,6 +37,8 @@ jobs:
3737
echo "target=all" >> $GITHUB_OUTPUT
3838
elif ${{ contains(github.event.pull_request.labels.*.name, 'ci-benchmark-cloud') }}; then
3939
echo "target=cloud" >> $GITHUB_OUTPUT
40+
elif ${{ contains(github.event.pull_request.labels.*.name, 'ci-benchmark-load') }}; then
41+
echo "target=load" >> $GITHUB_OUTPUT
4042
elif ${{ contains(github.event.pull_request.labels.*.name, 'ci-benchmark-local') }}; then
4143
echo "target=local" >> $GITHUB_OUTPUT
4244
fi

.github/workflows/reuse.benchmark.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ jobs:
104104
- { dataset: hits, size: Large }
105105
- { dataset: tpch, size: Small }
106106
- { dataset: tpch, size: Large }
107-
- { dataset: load, size: Small }
108107
fail-fast: true
109108
max-parallel: 1
110109
steps:
@@ -130,6 +129,47 @@ jobs:
130129
cloud_user: ${{ secrets.BENCHMARK_CLOUD_USER }}
131130
cloud_password: ${{ secrets.BENCHMARK_CLOUD_PASSWORD }}
132131
cloud_gateway: ${{ secrets.BENCHMARK_CLOUD_GATEWAY }}
132+
- name: clean
133+
if: always()
134+
continue-on-error: true
135+
env:
136+
BENDSQL_DSN: "databend://${{ secrets.BENCHMARK_CLOUD_USER }}:${{ secrets.BENCHMARK_CLOUD_PASSWORD }}@${{ secrets.BENCHMARK_CLOUD_GATEWAY }}:443/?warehouse=default"
137+
run: |
138+
echo "DROP WAREHOUSE IF EXISTS 'benchmark-${{ inputs.run_id }}';" | bendsql
139+
140+
load:
141+
runs-on: ubuntu-latest
142+
steps:
143+
- uses: actions/checkout@v4
144+
if: inputs.source == 'release'
145+
- uses: actions/checkout@v4
146+
if: inputs.source == 'pr'
147+
with:
148+
ref: "refs/pull/${{ inputs.source_id }}/merge"
149+
- uses: ./.github/actions/setup_bendsql
150+
- uses: ./.github/actions/benchmark_cloud
151+
if: inputs.target == 'load' || inputs.target == 'all'
152+
timeout-minutes: 120
153+
id: benchmark
154+
with:
155+
sha: ${{ inputs.sha }}
156+
run_id: ${{ inputs.run_id }}
157+
dataset: load
158+
source: ${{ inputs.source }}
159+
source_id: ${{ inputs.source_id }}
160+
size: Small
161+
version: ${{ inputs.version }}
162+
cloud_user: ${{ secrets.BENCHMARK_CLOUD_USER }}
163+
cloud_password: ${{ secrets.BENCHMARK_CLOUD_PASSWORD }}
164+
cloud_gateway: ${{ secrets.BENCHMARK_CLOUD_GATEWAY }}
165+
- name: clean
166+
if: always()
167+
continue-on-error: true
168+
env:
169+
BENDSQL_DSN: "databend://${{ secrets.BENCHMARK_CLOUD_USER }}:${{ secrets.BENCHMARK_CLOUD_PASSWORD }}@${{ secrets.BENCHMARK_CLOUD_GATEWAY }}:443/?warehouse=default"
170+
run: |
171+
echo "DROP DATABASE IF EXISTS 'load_test_${{ inputs.run_id }}';" | bendsql
172+
echo "DROP WAREHOUSE IF EXISTS 'benchmark-${{ inputs.run_id }}';" | bendsql
133173
134174
comment:
135175
needs: [local, cloud]

benchmark/clickbench/benchmark_cloud.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ done
7373

7474
export BENDSQL_DSN="databend://${CLOUD_USER}:${CLOUD_PASSWORD}@${CLOUD_GATEWAY}:443/${BENCHMARK_DATABASE}?warehouse=${CLOUD_WAREHOUSE}"
7575

76-
echo "Creating database..."
77-
echo "DROP DATABASE IF EXISTS ${BENCHMARK_DATABASE};" | bendsql --database default
78-
echo "CREATE DATABASE ${BENCHMARK_DATABASE};" | bendsql --database default
76+
if [[ "${BENCHMARK_DATASET}" == "load" ]]; then
77+
echo "Creating database..."
78+
echo "DROP DATABASE IF EXISTS ${BENCHMARK_DATABASE};" | bendsql --database default
79+
echo "CREATE DATABASE ${BENCHMARK_DATABASE};" | bendsql --database default
80+
fi
7981

8082
echo "Checking session settings..."
8183
bendsql --query="select * from system.settings where value != default;" -o table
@@ -105,7 +107,8 @@ function run_query() {
105107

106108
QUERY_NUM=0
107109
for query in "${BENCHMARK_DATASET}"/queries/*.sql; do
108-
echo -e "\n==>Running Q${QUERY_NUM}: ${query}"
110+
echo
111+
echo "==> Running Q${QUERY_NUM}: ${query}"
109112
cat "$query"
110113
yq -i ".result += [[]]" -o json result.json
111114
for i in $(seq 1 "$BENCHMARK_TRIES"); do

benchmark/clickbench/benchmark_local.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ function run_query() {
110110
TRIES=3
111111
QUERY_NUM=0
112112
for query in "${BENCHMARK_DATASET}"/queries/*.sql; do
113-
echo -e "\n==>Running Q${QUERY_NUM}: ${query}"
113+
echo
114+
echo "==> Running Q${QUERY_NUM}: ${query}"
114115
cat "$query"
115116
sync
116117
echo 3 | sudo tee /proc/sys/vm/drop_caches

0 commit comments

Comments
 (0)