-
Notifications
You must be signed in to change notification settings - Fork 166
246 lines (235 loc) · 9.22 KB
/
bench.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
name: Benchmark
# We use environments to require approval to run benchmarks on PRs, but not on pushes to `main`
# (which have been approved already since PRs are required for `main`).
on:
workflow_call:
inputs:
environment:
type: string
publish:
type: boolean
default: false
ref:
required: true
type: string
s3_bench_results_prefix:
type: string
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
S3_BUCKET_NAME: ${{ vars.S3_BENCH_BUCKET_NAME }}
S3_BUCKET_TEST_PREFIX: ${{ vars.S3_BUCKET_BENCH_PREFIX || 'mountpoint-benchmark/' }}
S3_BUCKET_BENCH_FILE: ${{ vars.BENCH_FILE_NAME || 'bench100GB.bin' }}
S3_BUCKET_SMALL_BENCH_FILE: ${{ vars.SMALL_BENCH_FILE_NAME || 'bench5MB.bin' }}
# Optional endpoint url, can be empty
S3_ENDPOINT_URL: ${{ vars.S3_BENCH_ENDPOINT_URL }}
S3_REGION: ${{ vars.S3_BENCH_REGION }}
jobs:
bench:
name: Benchmark (Throughput)
runs-on: [self-hosted, linux, x64, nvme-high-performance]
environment: ${{ inputs.environment }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ACTIONS_BENCH_IAM_ROLE }}
aws-region: ${{ vars.S3_BENCH_REGION }}
role-duration-seconds: 21600
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
submodules: true
persist-credentials: false
- name: Install operating system dependencies
uses: ./.github/actions/install-dependencies
with:
fuseVersion: 2
libunwind: true
fio: true
- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# setup-rust-toolchain sets "-D warnings" by default, and Rust treats any warning as compile error.
# We need to this currently because `vendor/fuser` contains some warnings and it breaks the build.
rustflags: ""
- name: Build
run: cargo build --release
- name: Run Benchmark
run: mountpoint-s3/scripts/fs_bench.sh
- name: Save benchmark results in S3
if: inputs.s3_bench_results_prefix
run: .github/actions/scripts/save-benchmark-results.sh
env:
S3_BENCH_REGION: ${{ vars.S3_BENCH_REGION }}
S3_BENCH_BUCKET_NAME: ${{ vars.S3_BENCH_RESULTS_BUCKET_NAME }}
S3_BENCH_RESULTS_PREFIX: ${{ inputs.s3_bench_results_prefix }}/${{ github.job }}
COMMIT_ID: ${{ inputs.ref }}
- name: Check benchmark results
uses: benchmark-action/github-action-benchmark@v1
with:
name: Throughput Benchmark (S3 Standard)
tool: 'customBiggerIsBetter'
output-file-path: results/output.json
# This is default value, just make it more explicit
benchmark-data-dir-path: dev/bench
alert-threshold: "200%"
fail-on-alert: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Store the results and deploy GitHub pages automatically if the results are from main branch
auto-push: ${{ inputs.publish }}
comment-on-alert: true
max-items-in-chart: 20
summary-always: true
- name: Check resource utilization
uses: benchmark-action/github-action-benchmark@v1
with:
name: Throughput Benchmark - Peak Memory Usage (S3 Standard)
tool: 'customSmallerIsBetter'
output-file-path: results/peak_mem_usage.json
benchmark-data-dir-path: dev/bench/peak_mem_usage
alert-threshold: "200%"
fail-on-alert: false
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Store the results and deploy GitHub pages automatically if the results are from main branch
auto-push: ${{ inputs.publish }}
comment-on-alert: false
max-items-in-chart: 20
skip-fetch-gh-pages: true
summary-always: true
latency-bench:
name: Benchmark (Latency)
runs-on: [self-hosted, linux, x64, nvme-high-performance]
environment: ${{ inputs.environment }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ACTIONS_BENCH_IAM_ROLE }}
aws-region: ${{ vars.S3_BENCH_REGION }}
role-duration-seconds: 21600
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
submodules: true
persist-credentials: false
- name: Install operating system dependencies
uses: ./.github/actions/install-dependencies
with:
fuseVersion: 2
libunwind: true
fio: true
- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# setup-rust-toolchain sets "-D warnings" by default, and Rust treats any warning as compile error.
# We need to this currently because `vendor/fuser` contains some warnings and it breaks the build.
rustflags: ""
- name: Build
run: cargo build --release
- name: Run Benchmark
run: mountpoint-s3/scripts/fs_latency_bench.sh
- name: Save benchmark results in S3
if: inputs.s3_bench_results_prefix
run: .github/actions/scripts/save-benchmark-results.sh
env:
S3_BENCH_REGION: ${{ vars.S3_BENCH_REGION }}
S3_BENCH_BUCKET_NAME: ${{ vars.S3_BENCH_RESULTS_BUCKET_NAME }}
S3_BENCH_RESULTS_PREFIX: ${{ inputs.s3_bench_results_prefix }}/${{ github.job }}
COMMIT_ID: ${{ inputs.ref }}
- name: Check benchmark results
uses: benchmark-action/github-action-benchmark@v1
with:
name: Latency Benchmark (S3 Standard)
tool: 'customSmallerIsBetter'
output-file-path: results/output.json
benchmark-data-dir-path: dev/latency_bench
alert-threshold: "200%"
fail-on-alert: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Store the results and deploy GitHub pages automatically if the results are from main branch
auto-push: ${{ inputs.publish }}
comment-on-alert: false
max-items-in-chart: 20
summary-always: true
cache-bench:
name: Benchmark (Cache)
runs-on: [self-hosted, linux, x64, nvme-high-performance]
environment: ${{ inputs.environment }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ACTIONS_BENCH_IAM_ROLE }}
aws-region: ${{ vars.S3_BENCH_REGION }}
role-duration-seconds: 21600
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
submodules: true
persist-credentials: false
- name: Install operating system dependencies
uses: ./.github/actions/install-dependencies
with:
fuseVersion: 2
libunwind: true
fio: true
- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# setup-rust-toolchain sets "-D warnings" by default, and Rust treats any warning as compile error.
# We need to this currently because `vendor/fuser` contains some warnings and it breaks the build.
rustflags: ""
- name: Build
run: cargo build --release
- name: Run Benchmark
env:
S3_MOUNT_LOCAL_STORAGE: yes
run: mountpoint-s3/scripts/fs_cache_bench.sh
- name: Save benchmark results in S3
if: inputs.s3_bench_results_prefix
run: .github/actions/scripts/save-benchmark-results.sh
env:
S3_BENCH_REGION: ${{ vars.S3_BENCH_REGION }}
S3_BENCH_BUCKET_NAME: ${{ vars.S3_BENCH_RESULTS_BUCKET_NAME }}
S3_BENCH_RESULTS_PREFIX: ${{ inputs.s3_bench_results_prefix }}/${{ github.job }}
COMMIT_ID: ${{ inputs.ref }}
- name: Check benchmark results
uses: benchmark-action/github-action-benchmark@v1
with:
name: Cache Throughput Benchmark (S3 Standard)
tool: 'customBiggerIsBetter'
output-file-path: results/output.json
benchmark-data-dir-path: dev/cache_bench
alert-threshold: "200%"
fail-on-alert: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Store the results and deploy GitHub pages automatically if the results are from main branch
auto-push: ${{ inputs.publish }}
comment-on-alert: false
max-items-in-chart: 20
summary-always: true
- name: Check resource utilization
uses: benchmark-action/github-action-benchmark@v1
with:
name: Cache Throughput Benchmark - Peak Memory Usage (S3 Standard)
tool: 'customSmallerIsBetter'
output-file-path: results/peak_mem_usage.json
benchmark-data-dir-path: dev/cache_bench/peak_mem_usage
alert-threshold: "200%"
fail-on-alert: false
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Store the results and deploy GitHub pages automatically if the results are from main branch
auto-push: ${{ inputs.publish }}
comment-on-alert: false
max-items-in-chart: 20
skip-fetch-gh-pages: true
summary-always: true