Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/bench-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Dispatches benchmark workflows when benchmark labels are added to pull requests.
# This is a separate workflow so that non-benchmark label events don't create
# phantom check suites that obscure in-progress benchmark runs on the PR.

name: Benchmark Dispatch

on:
pull_request:
types: [labeled]
branches: ["develop"]

permissions:
actions: write
contents: read
pull-requests: write # for label removal and PR comments
id-token: write # enables AWS-GitHub OIDC

jobs:
remove-bench-label:
runs-on: ubuntu-latest
timeout-minutes: 2
if: github.event.label.name == 'action/benchmark'
steps:
- uses: actions-ecosystem/action-remove-labels@v1
if: github.event.pull_request.head.repo.full_name == 'vortex-data/vortex'
with:
labels: action/benchmark
fail_on_error: true

bench:
needs: remove-bench-label
uses: ./.github/workflows/bench-pr.yml
secrets: inherit

remove-sql-label:
runs-on: ubuntu-latest
timeout-minutes: 2
if: github.event.label.name == 'action/benchmark-sql'
steps:
- uses: actions-ecosystem/action-remove-labels@v1
if: github.event.pull_request.head.repo.full_name == 'vortex-data/vortex'
with:
labels: action/benchmark-sql
fail_on_error: true

sql-bench:
needs: remove-sql-label
uses: ./.github/workflows/sql-pr.yml
secrets: inherit
27 changes: 5 additions & 22 deletions .github/workflows/bench-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Runs all benchmarks once when we add the `action/benchmark` tag to a pull request.
# Runs all benchmarks once for a pull request.
# Called from bench-dispatch.yml when the `action/benchmark` label is added.

name: PR Benchmarks

Expand All @@ -9,32 +10,16 @@ concurrency:
cancel-in-progress: false

on:
pull_request:
types: [labeled, synchronize]
branches: ["develop"]
workflow_call: { }
workflow_dispatch: { }

permissions:
actions: write # for removing labels
contents: read
pull-requests: write # for commenting on PRs
id-token: write # enables AWS-GitHub OIDC

jobs:
label_trigger:
runs-on: ubuntu-latest
timeout-minutes: 120
if: ${{ contains(github.event.head_commit.message, '[benchmark]') || github.event.label.name == 'action/benchmark' && github.event_name == 'pull_request' }}
steps:
# We remove the benchmark label first so that the workflow can be re-triggered.
- uses: actions-ecosystem/action-remove-labels@v1
if: ${{ github.event.pull_request.head.repo.full_name == 'vortex-data/vortex' }}
with:
labels: action/benchmark
fail_on_error: true

bench:
needs: label_trigger
timeout-minutes: 120
runs-on: >-
${{ github.repository == 'vortex-data/vortex'
Expand All @@ -48,7 +33,6 @@ jobs:
build_args: "--features lance"
- id: compress-bench
name: Compression
if: ${{ contains(github.event.head_commit.message, '[benchmark]') || github.event.label.name == 'action/benchmark' && github.event_name == 'pull_request' }}
steps:
- uses: runs-on/action@v2
if: github.event.pull_request.head.repo.fork == false
Expand Down Expand Up @@ -137,17 +121,16 @@ jobs:
comment-tag: bench-pr-comment-${{ matrix.benchmark.id }}

- name: Comment PR on failure
if: failure() && inputs.mode == 'pr' && github.event.pull_request.head.repo.fork == false
if: failure() && github.event.pull_request.head.repo.fork == false
uses: thollander/actions-comment-pull-request@v3
with:
message: |
# 🚨🚨🚨❌❌❌ BENCHMARK FAILED ❌❌❌🚨🚨🚨
# BENCHMARK FAILED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty


Benchmark `${{ matrix.benchmark.name }}` failed! Check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.
comment-tag: bench-pr-comment-${{ matrix.benchmark.id }}

sql:
needs: label_trigger
uses: ./.github/workflows/sql-benchmarks.yml
secrets: inherit
with:
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/sql-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Runs once when we add the `benchmark-sql` tag to a pull request.
# Runs SQL benchmarks once for a pull request.
# Called from bench-dispatch.yml when the `action/benchmark-sql` label is added.

name: PR SQL Benchmarks

Expand All @@ -7,32 +8,16 @@ concurrency:
cancel-in-progress: true

on:
pull_request:
types: [labeled, synchronize]
branches: ["develop"]
workflow_call: { }
workflow_dispatch: { }

permissions:
actions: write # for removing labels
contents: read
pull-requests: write # for commenting on PRs
id-token: write # enables AWS-GitHub OIDC

jobs:
label_trigger:
runs-on: ubuntu-latest
timeout-minutes: 2
if: ${{ contains(github.event.head_commit.message, '[benchmark-sql]') || github.event.label.name == 'action/benchmark-sql' && github.event_name == 'pull_request' }}
steps:
# We remove the benchmark label first so that the workflow can be re-triggered.
- uses: actions-ecosystem/action-remove-labels@v1
if: ${{ github.event.pull_request.head.repo.full_name == 'vortex-data/vortex' }}
with:
labels: action/benchmark-sql
fail_on_error: true

sql:
needs: label_trigger
uses: ./.github/workflows/sql-benchmarks.yml
secrets: inherit
with:
Expand Down
Loading