Skip to content

Commit 874690b

Browse files
committed
Benchmarks.
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
1 parent c3c570d commit 874690b

2 files changed

Lines changed: 110 additions & 2 deletions

File tree

.github/workflows/bench.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# .github/workflows/ci.yml
2+
3+
name: Benchmark DBSP
4+
5+
on:
6+
push:
7+
paths:
8+
- './crates/dbsp/**'
9+
- './crates/nexmark/**'
10+
- './crates/dataflow-jit/**'
11+
- './crates/adapters/**'
12+
pull_request:
13+
paths:
14+
- './crates/dbsp/**'
15+
- './crates/nexmark/**'
16+
- './crates/dataflow-jit/**'
17+
- './crates/adapters/**'
18+
19+
env:
20+
CARGO_TERM_COLOR: always
21+
CARGO_NET_RETRY: 10
22+
RUST_BACKTRACE: short
23+
RUSTUP_MAX_RETRIES: 10
24+
CI_MACHINE_TYPE: "skylake-2x"
25+
PR_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
26+
27+
jobs:
28+
pre_job:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
32+
steps:
33+
- id: skip_check
34+
uses: fkirc/skip-duplicate-actions@master
35+
with:
36+
concurrent_skipping: "same_content_newer"
37+
cancel_others: "true"
38+
skip_after_successful_duplicate: "true"
39+
do_not_skip: '["workflow_dispatch", "schedule"]'
40+
benchmark:
41+
permissions:
42+
contents: read
43+
packages: write
44+
runs-on: [self-hosted, skylake40]
45+
needs: [pre_job]
46+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
47+
env:
48+
FORCE_COLOR: 1
49+
steps:
50+
- uses: earthly/actions/setup-earthly@v1
51+
with:
52+
version: v0.7.17
53+
- uses: actions/checkout@v3
54+
# By default a merge commit is checked out. If you look at the SHA that
55+
# is checked out, it doesn't match your local commit SHA. Rather it's
56+
# the SHA of a merge commit (your branch + base branch). So for
57+
# pull_request actions it won't match the commit ID on the branch. This
58+
# is confusing for storing benchmark results because the commit ID we
59+
# find during `git rev-parse` exists nowhere in the history. Since we
60+
# don't do merge commits anyways, we make sure we check out the head
61+
# commit (which will exist in the history).
62+
with:
63+
ref: ${{ github.event.pull_request.head.sha }}
64+
submodules: true
65+
66+
- name: MUIX license
67+
run: echo "NEXT_PUBLIC_MUIX_PRO_KEY=${muix_license}" > web-console/.env && cat web-console/.env
68+
env:
69+
muix_license: ${{ secrets.muix_license }}
70+
71+
- name: Integration test .env
72+
run: echo ${itest_config} > deploy/.env
73+
env:
74+
itest_config: ${{ secrets.itest_config }}
75+
76+
- name: Earthly version
77+
run: earthly --version
78+
79+
# Find the PR associated with this push, if there is one. Note that this
80+
# is needed because `${{ github.event.pull_request.number }}` does not get
81+
# set on push requests.
82+
- uses: jwalton/gh-find-current-pr@v1
83+
id: findPr
84+
with:
85+
state: open
86+
87+
- name: Run Benchmarks
88+
run: earthly --verbose -P --ci +benchmarks
89+
90+
# Find comment with benchmark info if it exists
91+
- name: Find Comment
92+
uses: peter-evans/find-comment@v2
93+
# This action fails when not running on a PR.
94+
if: ${{ steps.findPr.outputs.pr != '' }}
95+
id: fc
96+
with:
97+
issue-number: ${{ steps.findPr.outputs.pr }}
98+
comment-author: 'github-actions[bot]'
99+
body-includes: Benchmark results
100+
101+
- name: Create or update comment
102+
uses: peter-evans/create-or-update-comment@v2
103+
if: ${{ steps.findPr.outputs.pr != '' }}
104+
with:
105+
comment-id: ${{ steps.fc.outputs.comment-id }}
106+
issue-number: ${{ steps.findPr.outputs.pr }}
107+
body-file: nexmark_comment.txt
108+
edit-mode: replace

scripts/ci.bash renamed to scripts/bench.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Usage (to test): $ SMOKE=true CI_MACHINE_TYPE='skylake-2x' bash scripts/ci.bash
3+
# Usage (to test): $ SMOKE=true CI_MACHINE_TYPE='skylake-2x' bash scripts/bench.bash
44
# For CI env: Don't set `SMOKE`
55
#
66
set -ex
@@ -31,7 +31,7 @@ if [ "$SMOKE" != "" ]; then
3131
EVENT_RATE=10000000
3232
MAX_EVENTS=1000000
3333
fi
34-
numactl --cpunodebind=1 cargo bench --bench nexmark -- --first-event-rate=${EVENT_RATE} --max-events=${MAX_EVENTS} --cpu-cores ${CORES} --num-event-generators ${GENERATORS} --source-buffer-size 10000 --input-batch-size 40000 --csv ${NEXMARK_CSV_FILE}
34+
cargo bench --bench nexmark -- --first-event-rate=${EVENT_RATE} --max-events=${MAX_EVENTS} --cpu-cores ${CORES} --num-event-generators ${GENERATORS} --source-buffer-size 10000 --input-batch-size 40000 --csv ${NEXMARK_CSV_FILE}
3535

3636
# Run galen benchmark
3737
cargo bench --bench galen --features="with-csv" -- --workers 10 --csv ${GALEN_CSV_FILE}

0 commit comments

Comments
 (0)