Skip to content

Commit

Permalink
feat: add CodSpeed to the project
Browse files Browse the repository at this point in the history
  • Loading branch information
adriencaccia committed Apr 17, 2024
1 parent f4cee67 commit 852fbd9
Show file tree
Hide file tree
Showing 3 changed files with 358 additions and 399 deletions.
65 changes: 9 additions & 56 deletions .github/workflows/ibis-benchmarks.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
name: Benchmarks

on:
push:
branches:
- main
- "*.x.x"
merge_group:

# since we're writing to cloud storage, we don't want to have multiple
# instances of this job running at one time
concurrency: benchmarks-${{ github.repository }}

permissions:
# increase the rate limit for github operations, but limit token permissions
# to read-only
contents: read
- "main" # or "master"
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
Expand All @@ -38,47 +30,8 @@ jobs:
- name: install ibis
run: poetry install --without dev --without docs --all-extras

- name: make benchmark output dir
run: mkdir .benchmarks

- name: benchmark
run: poetry run pytest --benchmark-enable --benchmark-json .benchmarks/output.json ibis/tests/benchmarks

- uses: google-github-actions/auth@v2
- name: Run benchmarks
uses: CodSpeedHQ/action@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}

- uses: google-github-actions/setup-gcloud@v2

- name: show gcloud info
run: gcloud info

- name: download the latest duckdb release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
gh release download -R duckdb/duckdb --pattern 'duckdb_cli-linux-amd64.zip'
unzip duckdb_cli-linux-amd64.zip
- name: convert json data to parquet
run: |
set -euo pipefail
# sort json keys
jq --sort-keys -rcM < "$PWD/.benchmarks/output.json" > output.json
# connect to a file to allow spilling to disk
./duckdb json2parquet.ddb <<EOF
COPY (
SELECT * FROM read_ndjson_auto('output.json', maximum_object_size=2**27)
) TO 'output.parquet' (FORMAT PARQUET, COMPRESSION ZSTD)
EOF
- name: copy data to gcs
run: |
set -euo pipefail
timestamp="$(date --iso-8601=ns --utc | tr ',' '.')"
gsutil cp output.parquet "gs://ibis-benchmark-data/ci/${timestamp}.parquet"
token: ${{ secrets.CODSPEED_TOKEN }}
run: poetry run pytest --benchmark-enable
Loading

0 comments on commit 852fbd9

Please sign in to comment.