-
Notifications
You must be signed in to change notification settings - Fork 69
279 lines (271 loc) · 11.3 KB
/
perf-compare-ci.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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# This workflow is used to run benchmarks to compare a pull request (specified by the input 'pull_request')
# and the current master. This workflow assumes the pull requests (mmtk-core PRs and the binding PRs are based on
# their corresponding master). Otherwise the workflow may fail or return unexpected results.
name: Binding Perf Tests
on:
workflow_dispatch:
inputs:
pull_request:
description: The pull request number to run the perf tests. The workflow compares the specified pull request with the trunk.
required: true
concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
# Directories in ci-perf-kit that will be uploaded as artifacts. The dirs can be found in ci-perf-kit/scripts/common.sh
CI_PERF_KIT_BUILD: ci-perf-kit/upload
CI_PERF_KIT_LOG: ci-perf-kit/logs-ng
jobs:
# Figure out binding PRs.
binding-refs:
uses: ./.github/workflows/pr-binding-refs.yml
with:
pull_request: ${{ github.event.inputs.pull_request }}
# Figure out the core PR. We need to get the specific commit and repo from a pull request number.
mmtk-refs:
runs-on: ubuntu-22.04
outputs:
mmtk_repo: ${{ steps.print.outputs.mmtk_repo }}
mmtk-ref: ${{ steps.print.outputs.mmtk_ref }}
steps:
- name: Get mmtk-core repo from pull_request
uses: actions/github-script@v7
id: core-repo
with:
result-encoding: string
script: |
var res = (await github.rest.pulls.get({
owner: "mmtk",
repo: "mmtk-core",
pull_number: ${{ github.event.inputs.pull_request }}
}))
return res.data.head.repo.full_name
- name: Get mmtk-core refs from pull_request
uses: actions/github-script@v7
id: core-ref
with:
result-encoding: string
script: |
var res = (await github.rest.pulls.get({
owner: "mmtk",
repo: "mmtk-core",
pull_number: ${{ github.event.inputs.pull_request }}
}))
return res.data.head.sha
- id: print
run: |
echo "mmtk_repo=${{ steps.core-repo.outputs.result }}" >> $GITHUB_OUTPUT
echo "mmtk_ref=${{ steps.core-ref.outputs.result }}" >> $GITHUB_OUTPUT
# Run perf compare for JikesRVM
jikesrvm-perf-compare:
runs-on: [self-hosted, Linux, freq-scaling-off]
needs: [binding-refs, mmtk-refs]
timeout-minutes: 1440
steps:
# Trunk - we always use master from the mmtk org
# - binding
- name: Checkout JikesRVM Binding Trunk
uses: actions/checkout@v4
with:
repository: mmtk/mmtk-jikesrvm
ref: master
path: mmtk-jikesrvm-trunk
- name: Checkout JikesRVM for Trunk
working-directory: mmtk-jikesrvm-trunk
run: ./.github/scripts/ci-checkout.sh
# - core
- name: Checkout MMTk Core
uses: actions/checkout@v4
with:
repository: mmtk/mmtk-core
ref: master
path: mmtk-core-trunk
# Branch
# - binding
- name: Checkout JikesRVM Binding Branch
uses: actions/checkout@v4
with:
repository: ${{ needs.binding-refs.outputs.jikesrvm_binding_repo }}
ref: ${{ needs.binding-refs.outputs.jikesrvm_binding_ref }}
path: mmtk-jikesrvm-branch
# - core
- name: Checkout MMTk Core
uses: actions/checkout@v4
with:
repository: ${{ needs.mmtk-refs.outputs.mmtk_repo }}
ref: ${{ needs.mmtk-refs.outputs.mmtk_ref }}
path: mmtk-core-branch
- name: Checkout JikesRVM for Branch
working-directory: mmtk-jikesrvm-branch
run: ./.github/scripts/ci-checkout.sh
# Checkout perf-kit
- name: Checkout Perf Kit
uses: actions/checkout@v4
with:
repository: mmtk/ci-perf-kit
token: ${{ secrets.CI_ACCESS_TOKEN }}
ref: "0.8.0"
path: ci-perf-kit
submodules: true
# setup
# Use rust-toolchain in the trunk (it doesnt matter much - if the toolchains defined in the trunk and the branch are different, we cant run anyway)
- name: Setup Rust Toolchain
run: echo "RUSTUP_TOOLCHAIN=`cat mmtk-core-trunk/rust-toolchain`" >> $GITHUB_ENV
# run compare
- uses: hasura/[email protected]
with:
github-token: ${{ secrets.CI_ACCESS_TOKEN }}
repository: 'mmtk/mmtk-core'
number: ${{ github.event.inputs.pull_request }}
id: jikesrvm-perf-compare-comment
message: 'Running benchmarks for JikesRVM...'
recreate: true
- name: Compare Performance
id: run
run: |
JAVA_HOME=/opt/jdk1.6.0_45/ PATH=/opt/apache-ant-1.9.16/bin/:/opt/jdk1.6.0_45/bin/:$PATH ./ci-perf-kit/scripts/jikesrvm-compare.sh mmtk-jikesrvm-trunk/ mmtk-core-trunk/ mmtk-jikesrvm-branch/ mmtk-core-branch/ jikesrvm-compare-report.md
# set report.md to output
- uses: pCYSl5EDgo/cat@master
id: cat
with:
path: jikesrvm-compare-report.md
# upload run results
- name: Upload build as artifacts
uses: actions/upload-artifact@v4
with:
name: jikesrvm-compare-build
path: ${{ env.CI_PERF_KIT_BUILD }}
if-no-files-found: error
- name: Upload logs as artifacts
uses: actions/upload-artifact@v4
with:
name: jikesrvm-compare-logs
path: ${{ env.CI_PERF_KIT_LOG }}
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: jikesrvm-compare-report.md
path: jikesrvm-compare-report.md
# report
- uses: hasura/[email protected]
if: always()
with:
github-token: ${{ secrets.CI_ACCESS_TOKEN }}
repository: 'mmtk/mmtk-core'
number: ${{ github.event.inputs.pull_request }}
id: jikesrvm-perf-compare-comment
message: ${{ steps.cat.outputs.text }}
append: true
# Cleanup logs (this is necessary for self-hosted runners)
# [`always()`](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#always) ensures we clean up the logs even if some steps fail
- name: Clean up logs and reports
if: always()
run: |
rm -rf ${{ env.CI_PERF_KIT_LOG }}
rm jikesrvm-compare-report.md
openjdk-perf-compare:
runs-on: [self-hosted, Linux, freq-scaling-off]
needs: [binding-refs, mmtk-refs]
timeout-minutes: 1440
steps:
# Trunk - we always use master from the mmtk org
# - binding
- name: Checkout OpenJDK Binding Trunk
uses: actions/checkout@v4
with:
repository: mmtk/mmtk-openjdk
ref: master
path: mmtk-openjdk-trunk
- name: Checkout OpenJDK for Trunk
working-directory: mmtk-openjdk-trunk
run: ./.github/scripts/ci-checkout.sh
# -core
- name: Checkout MMTk Core
uses: actions/checkout@v4
with:
repository: mmtk/mmtk-core
ref: master
path: mmtk-core-trunk
# Branch
# - binding
- name: Checkout OpenJDK Binding Branch
uses: actions/checkout@v4
with:
repository: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
path: mmtk-openjdk-branch
- name: Checkout OpenJDK for Branch
working-directory: mmtk-openjdk-branch
run: ./.github/scripts/ci-checkout.sh
# - core
- name: Checkout MMTk Core
uses: actions/checkout@v4
with:
repository: ${{ needs.mmtk-refs.outputs.mmtk_repo }}
ref: ${{ needs.mmtk-refs.outputs.mmtk_ref }}
path: mmtk-core-branch
# checkout perf-kit
- name: Checkout Perf Kit
uses: actions/checkout@v4
with:
repository: mmtk/ci-perf-kit
token: ${{ secrets.CI_ACCESS_TOKEN }}
ref: "0.8.0"
path: ci-perf-kit
submodules: true
# setup
# Use rust-toolchain in the trunk (it doesnt matter much - if the toolchains defined in the trunk and the branch are different, we cant run anyway)
- name: Setup Rust Toolchain
run: echo "RUSTUP_TOOLCHAIN=`cat mmtk-core-trunk/rust-toolchain`" >> $GITHUB_ENV
# run compare
- uses: hasura/[email protected]
with:
github-token: ${{ secrets.CI_ACCESS_TOKEN }}
repository: 'mmtk/mmtk-core'
number: ${{ github.event.inputs.pull_request }}
id: openjdk-perf-compare-comment
message: 'Running benchmarks for OpenJDK...'
recreate: true
- name: Compare Performance
id: run
run: |
./ci-perf-kit/scripts/openjdk-compare.sh mmtk-openjdk-trunk/ mmtk-core-trunk/ mmtk-openjdk-branch/ mmtk-core-branch/ openjdk-compare-report.md
# set report.md to output
- uses: pCYSl5EDgo/cat@master
id: cat
with:
path: openjdk-compare-report.md
# upload run results
- name: Upload build as artifacts
uses: actions/upload-artifact@v4
with:
name: openjdk-compare-build
path: ${{ env.CI_PERF_KIT_BUILD }}
if-no-files-found: error
- name: Upload logs as artifacts
uses: actions/upload-artifact@v4
with:
name: openjdk-compare-logs
path: ${{ env.CI_PERF_KIT_LOG }}
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: openjdk-compare-report.md
path: openjdk-compare-report.md
# report
- uses: hasura/[email protected]
if: always()
with:
github-token: ${{ secrets.CI_ACCESS_TOKEN }}
repository: 'mmtk/mmtk-core'
number: ${{ github.event.inputs.pull_request }}
id: openjdk-perf-compare-comment
message: ${{ steps.cat.outputs.text }}
append: true
# Cleanup logs (this is necessary for self-hosted runners)
- name: Clean up logs and reports
if: always()
run: |
rm -rf ${{ env.CI_PERF_KIT_LOG }}
rm openjdk-compare-report.md