Skip to content

Commit 0c2f808

Browse files
authored
ci: Run benchmarks on main on the new oracle dedicated workers (#2942)
1 parent d4eb35a commit 0c2f808

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.github/workflows/benchmark.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,45 @@ on:
1515
name: benchmark pull requests
1616
permissions:
1717
contents: read
18-
1918
jobs:
2019
runBenchmark:
2120
name: run benchmark
2221
permissions:
2322
pull-requests: write
2423

25-
# If we're running on a PR, use ubuntu-latest - a shared runner. We can't use the self-hosted
26-
# runners on arbitrary PRs, and we don't want to unleash that load on the pool anyway.
27-
# If we're running on main, use the OTEL self-hosted runner pool.
28-
29-
# TODO - temporarily move main to the shared workers, until we've resolved the instance setup issue
30-
# runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'self-hosted' }}
31-
runs-on: 'ubuntu-latest'
24+
# If we're running on main, use our oracle bare-metal runner for accuracy.
25+
# If we're running on a PR, use github's shared workers to save resources.
26+
runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'oracle-bare-metal-64cpu-512gb-x86-64' }}
3227
if: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'performance')) || github.event_name == 'push' }}
28+
container:
29+
image: rust:slim-bullseye
3330
env:
3431
# For PRs, compare against the base branch - e.g., 'main'.
3532
# For pushes to main, compare against the previous commit
3633
BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.base_ref || github.event.before }}
34+
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
3735
steps:
3836
- name: Harden the runner (Audit all outbound calls)
3937
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
4038
with:
4139
egress-policy: audit
4240

41+
- name: Setup container environment
42+
run: |
43+
apt-get update && apt-get install --fix-missing -y unzip cmake build-essential pkg-config curl git
44+
cargo install cargo-criterion
45+
46+
- name: Make repo safe for Git inside container
47+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
48+
4349
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4450
with:
45-
fetch-depth: 10 # Fetch current commit and its parent
51+
fetch-depth: 10 # Fetch a bit of history so we can do perf diffs
52+
4653
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
4754
with:
4855
repo-token: ${{ secrets.GITHUB_TOKEN }}
49-
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
50-
with:
51-
toolchain: stable
56+
5257
- uses: boa-dev/criterion-compare-action@adfd3a94634fe2041ce5613eb7df09d247555b87 # v3.2.4
5358
with:
5459
branchName: ${{ env.BRANCH_NAME }}

0 commit comments

Comments
 (0)