Skip to content

Commit dbd152b

Browse files
authored
Update CI for bindings (#551)
This PR mainly makes changes to CI configs to cooperate with the bindings' change of removing VM submodules (mmtk/mmtk-jikesrvm#101 and mmtk/mmtk-openjdk#140). Changes: * Made CI call `ci-checkout.sh` after checking out binding repos for OpenJDK and JikesRVM * Changed how we collect binding info: * Now we use a reusable workflow to extract binding info (repos and refs) from one comment in a PR. * The workflow is used by both binding correctness tests and benchmarks. * Our CI now can run tests and benchmarks for binding PRs submitted from a fork. * This closes #246. * Updated porting guide for a more logically correct folder structure. * This closes #502. * Updated `ci-perf-kit` to 0.6.6, which changes the command line arguments used for JikesRVM (we no longer support setting MMTk options with camelCase - the fix changes options to snake_case). Related PRs: * mmtk/mmtk-openjdk#140 * mmtk/mmtk-jikesrvm#101 * mmtk/mmtk-v8#55
1 parent e85d997 commit dbd152b

File tree

8 files changed

+235
-119
lines changed

8 files changed

+235
-119
lines changed

.github/workflows/micro-bm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
with:
6262
repository: mmtk/ci-perf-kit
6363
token: ${{ secrets.GITHUB_TOKEN }}
64-
ref: "0.6.5"
64+
ref: "0.6.6"
6565
path: ci-perf-kit
6666
submodules: true
6767
# 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)

.github/workflows/perf-compare-ci.yml

Lines changed: 85 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This workflow is used to run benchmarks to compare a pull request (specified by the input 'pull_request')
2+
# and the current master. This workflow assumes the pull requests (mmtk-core PRs and the binding PRs are based on
3+
# their corresponding master). Otherwise the workflow may fail or return unexpected results.
4+
15
name: Binding Perf Tests
26

37
on:
@@ -8,55 +12,96 @@ on:
812
required: true
913

1014
jobs:
15+
# Figure out binding PRs.
16+
binding-refs:
17+
uses: ./.github/workflows/pr-binding-refs.yml
18+
with:
19+
pull_request: ${{ github.event.inputs.pull_request }}
20+
21+
# Figure out the core PR. We need to get the specific commit and repo from a pull request number.
22+
mmtk-refs:
23+
runs-on: ubuntu-18.04
24+
outputs:
25+
mmtk_repo: ${{ steps.print.outputs.mmtk_repo }}
26+
mmtk-ref: ${{ steps.print.outputs.mmtk_ref }}
27+
steps:
28+
- name: Get mmtk-core repo from pull_request
29+
uses: actions/github-script@v6
30+
id: core-repo
31+
with:
32+
result-encoding: string
33+
script: |
34+
var res = (await github.rest.pulls.get({
35+
owner: "mmtk",
36+
repo: "mmtk-core",
37+
pull_number: ${{ github.event.inputs.pull_request }}
38+
}))
39+
return res.data.head.repo.full_name
40+
- name: Get mmtk-core refs from pull_request
41+
uses: actions/github-script@v6
42+
id: core-ref
43+
with:
44+
result-encoding: string
45+
script: |
46+
var res = (await github.rest.pulls.get({
47+
owner: "mmtk",
48+
repo: "mmtk-core",
49+
pull_number: ${{ github.event.inputs.pull_request }}
50+
}))
51+
return res.data.head.sha
52+
- id: print
53+
run: |
54+
echo "::set-output name=mmtk_repo::${{ steps.core-repo.outputs.result }}"
55+
echo "::set-output name=mmtk_ref::${{ steps.core-ref.outputs.result }}"
56+
57+
# Run perf compare for JikesRVM
1158
jikesrvm-perf-compare:
1259
runs-on: [self-hosted, Linux, freq-scaling-off]
60+
needs: [binding-refs, mmtk-refs]
1361
steps:
14-
- run: echo "PERF_PR=${{ github.event.inputs.pull_request }}" >> $GITHUB_ENV
15-
- name: Check Revisions
16-
uses: qinsoon/[email protected]
17-
with:
18-
token: ${{ secrets.GITHUB_TOKEN }}
19-
pull_request: ${{ env.PERF_PR }}
20-
default_env: 'JIKESRVM_BINDING_TRUNK_REF=master,MMTK_CORE_TRUNK_REF=master,JIKESRVM_BINDING_BRANCH_REF=master,MMTK_CORE_BRANCH_REF=${{ github.event.pull_request.head.sha }}'
21-
# Trunk
62+
# Trunk - we always use master from the mmtk org
2263
# - binding
2364
- name: Checkout JikesRVM Binding Trunk
2465
uses: actions/checkout@v2
2566
with:
2667
repository: mmtk/mmtk-jikesrvm
27-
token: ${{ secrets.GITHUB_TOKEN }}
68+
ref: master
2869
path: mmtk-jikesrvm-trunk
29-
submodules: true
30-
ref: ${{ env.JIKESRVM_BINDING_TRUNK_REF }}
70+
- name: Checkout JikesRVM for Trunk
71+
working-directory: mmtk-jikesrvm-trunk
72+
run: ./.github/scripts/ci-checkout.sh
3173
# - core
3274
- name: Checkout MMTk Core
3375
uses: actions/checkout@v2
3476
with:
35-
ref: ${{ env.MMTK_CORE_TRUNK_REF }}
77+
repository: mmtk/mmtk-core
78+
ref: master
3679
path: mmtk-core-trunk
3780
# Branch
3881
# - binding
3982
- name: Checkout JikesRVM Binding Branch
4083
uses: actions/checkout@v2
4184
with:
42-
repository: mmtk/mmtk-jikesrvm
43-
token: ${{ secrets.GITHUB_TOKEN }}
85+
repository: ${{ needs.binding-refs.outputs.jikesrvm_binding_repo }}
86+
ref: ${{ needs.binding-refs.outputs.jikesrvm_binding_ref }}
4487
path: mmtk-jikesrvm-branch
45-
submodules: true
46-
ref: ${{ env.JIKESRVM_BINDING_BRANCH_REF }}
4788
# - core
4889
- name: Checkout MMTk Core
4990
uses: actions/checkout@v2
5091
with:
51-
ref: ${{ env.MMTK_CORE_BRANCH_REF }}
92+
repository: ${{ needs.mmtk-refs.outputs.mmtk_repo }}
93+
ref: ${{ needs.mmtk-refs.outputs.mmtk_ref }}
5294
path: mmtk-core-branch
95+
- name: Checkout JikesRVM for Branch
96+
working-directory: mmtk-jikesrvm-branch
97+
run: ./.github/scripts/ci-checkout.sh
5398
# Checkout perf-kit
5499
- name: Checkout Perf Kit
55100
uses: actions/checkout@v2
56101
with:
57102
repository: mmtk/ci-perf-kit
58-
token: ${{ secrets.GITHUB_TOKEN }}
59-
ref: "0.6.5"
103+
token: ${{ secrets.CI_ACCESS_TOKEN }}
104+
ref: "0.6.6"
60105
path: ci-perf-kit
61106
submodules: true
62107
# setup
@@ -72,7 +117,7 @@ jobs:
72117
with:
73118
github-token: ${{ secrets.CI_ACCESS_TOKEN }}
74119
repository: 'mmtk/mmtk-core'
75-
number: ${{ env.PERF_PR }}
120+
number: ${{ github.event.inputs.pull_request }}
76121
id: jikesrvm-perf-compare-comment
77122
message: 'Running benchmarks for JikesRVM...'
78123
recreate: true
@@ -100,7 +145,7 @@ jobs:
100145
with:
101146
github-token: ${{ secrets.CI_ACCESS_TOKEN }}
102147
repository: 'mmtk/mmtk-core'
103-
number: ${{ env.PERF_PR }}
148+
number: ${{ github.event.inputs.pull_request }}
104149
id: jikesrvm-perf-compare-comment
105150
message: ${{ steps.cat.outputs.text }}
106151
append: true
@@ -114,53 +159,51 @@ jobs:
114159
115160
openjdk-perf-compare:
116161
runs-on: [self-hosted, Linux, freq-scaling-off]
162+
needs: [binding-refs, mmtk-refs]
117163
steps:
118-
- run: echo "PERF_PR=${{ github.event.inputs.pull_request }}" >> $GITHUB_ENV
119-
- name: Check Revisions
120-
uses: qinsoon/[email protected]
121-
with:
122-
token: ${{ secrets.GITHUB_TOKEN }}
123-
pull_request: ${{ env.PERF_PR }}
124-
default_env: 'OPENJDK_BINDING_TRUNK_REF=master,MMTK_CORE_TRUNK_REF=master,OPENJDK_BINDING_BRANCH_REF=master,MMTK_CORE_BRANCH_REF=${{ github.event.pull_request.head.sha }}'
125-
# Trunk
164+
# Trunk - we always use master from the mmtk org
126165
# - binding
127166
- name: Checkout OpenJDK Binding Trunk
128167
uses: actions/checkout@v2
129168
with:
130169
repository: mmtk/mmtk-openjdk
131-
token: ${{ secrets.GITHUB_TOKEN }}
170+
ref: master
132171
path: mmtk-openjdk-trunk
133-
submodules: true
134-
ref: ${{ env.OPENJDK_BINDING_TRUNK_REF }}
172+
- name: Checkout OpenJDK for Trunk
173+
working-directory: mmtk-openjdk-trunk
174+
run: ./.github/scripts/ci-checkout.sh
135175
# -core
136176
- name: Checkout MMTk Core
137177
uses: actions/checkout@v2
138178
with:
139-
ref: ${{ env.MMTK_CORE_TRUNK_REF }}
179+
repository: mmtk/mmtk-core
180+
ref: master
140181
path: mmtk-core-trunk
141182
# Branch
142183
# - binding
143184
- name: Checkout OpenJDK Binding Branch
144185
uses: actions/checkout@v2
145186
with:
146-
repository: mmtk/mmtk-openjdk
147-
token: ${{ secrets.GITHUB_TOKEN }}
187+
repository: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
188+
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
148189
path: mmtk-openjdk-branch
149-
submodules: true
150-
ref: ${{ env.OPENJDK_BINDING_BRANCH_REF }}
190+
- name: Checkout OpenJDK for Branch
191+
working-directory: mmtk-openjdk-branch
192+
run: ./.github/scripts/ci-checkout.sh
151193
# - core
152194
- name: Checkout MMTk Core
153195
uses: actions/checkout@v2
154196
with:
155-
ref: ${{ env.MMTK_CORE_BRANCH_REF }}
197+
repository: ${{ needs.mmtk-refs.outputs.mmtk_repo }}
198+
ref: ${{ needs.mmtk-refs.outputs.mmtk_ref }}
156199
path: mmtk-core-branch
157200
# checkout perf-kit
158201
- name: Checkout Perf Kit
159202
uses: actions/checkout@v2
160203
with:
161204
repository: mmtk/ci-perf-kit
162-
token: ${{ secrets.GITHUB_TOKEN }}
163-
ref: "0.6.5"
205+
token: ${{ secrets.CI_ACCESS_TOKEN }}
206+
ref: "0.6.6"
164207
path: ci-perf-kit
165208
submodules: true
166209
# setup
@@ -176,7 +219,7 @@ jobs:
176219
with:
177220
github-token: ${{ secrets.CI_ACCESS_TOKEN }}
178221
repository: 'mmtk/mmtk-core'
179-
number: ${{ env.PERF_PR }}
222+
number: ${{ github.event.inputs.pull_request }}
180223
id: openjdk-perf-compare-comment
181224
message: 'Running benchmarks for OpenJDK...'
182225
recreate: true
@@ -204,7 +247,7 @@ jobs:
204247
with:
205248
github-token: ${{ secrets.CI_ACCESS_TOKEN }}
206249
repository: 'mmtk/mmtk-core'
207-
number: ${{ env.PERF_PR }}
250+
number: ${{ github.event.inputs.pull_request }}
208251
id: openjdk-perf-compare-comment
209252
message: ${{ steps.cat.outputs.text }}
210253
append: true

.github/workflows/perf-jikesrvm-baseline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
token: ${{ secrets.CI_ACCESS_TOKEN }}
2727
repository: mmtk/ci-perf-kit
28-
ref: "0.6.5"
28+
ref: "0.6.6"
2929
path: ci-perf-kit
3030
submodules: true
3131
# setup

.github/workflows/perf-openjdk-baseline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
token: ${{ secrets.CI_ACCESS_TOKEN }}
2727
repository: mmtk/ci-perf-kit
28-
ref: "0.6.5"
28+
ref: "0.6.6"
2929
path: ci-perf-kit
3030
submodules: true
3131
# setup

.github/workflows/perf-regression-ci.yml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,25 @@ jobs:
3131
uses: actions/checkout@v2
3232
with:
3333
repository: mmtk/mmtk-jikesrvm
34-
token: ${{ secrets.CI_ACCESS_TOKEN }}
3534
path: mmtk-jikesrvm
36-
submodules: true
35+
- name: Checkout JikesRVM
36+
working-directory: mmtk-jikesrvm
37+
run: |
38+
./.github/scripts/ci-checkout.sh
3739
# checkout perf-kit
3840
- name: Checkout Perf Kit
3941
uses: actions/checkout@v2
4042
with:
4143
repository: mmtk/ci-perf-kit
42-
token: ${{ secrets.CI_ACCESS_TOKEN }}
43-
ref: "0.6.5"
44+
ref: "0.6.6"
4445
path: ci-perf-kit
46+
token: ${{ secrets.CI_ACCESS_TOKEN }}
4547
submodules: true
4648
# setup
4749
- name: Overwrite MMTk core in JikesRVM binding
4850
run: cp -r mmtk-core mmtk-jikesrvm/repos/
4951
- name: Setup Rust Toolchain
50-
run: echo "RUSTUP_TOOLCHAIN=`cat mmtk-core/rust-toolchain`" >> $GITHUB_ENV
52+
run: echo "RUSTUP_TOOLCHAIN=`cat mmtk-core/rust-toolchain`" >> $GITHUB_ENV
5153
- name: Setup
5254
run: |
5355
./ci-perf-kit/scripts/history-run-setup.sh
@@ -76,7 +78,7 @@ jobs:
7678
publish_dir: ./reports
7779
publish_branch: gh-pages
7880
keep_files: true
79-
81+
8082
# OpenJDK
8183
openjdk-perf-regression:
8284
runs-on: [self-hosted, Linux, freq-scaling-off]
@@ -89,23 +91,25 @@ jobs:
8991
uses: actions/checkout@v2
9092
with:
9193
repository: mmtk/mmtk-openjdk
92-
token: ${{ secrets.CI_ACCESS_TOKEN }}
9394
path: mmtk-openjdk
94-
submodules: true
95+
- name: Checkout OpenJDK
96+
working-directory: mmtk-openjdk
97+
run: |
98+
./.github/scripts/ci-checkout.sh
9599
# checkout perf-kit
96100
- name: Checkout Perf Kit
97101
uses: actions/checkout@v2
98102
with:
99103
repository: mmtk/ci-perf-kit
100-
token: ${{ secrets.CI_ACCESS_TOKEN }}
101-
ref: "0.6.5"
104+
ref: "0.6.6"
102105
path: ci-perf-kit
106+
token: ${{ secrets.CI_ACCESS_TOKEN }}
103107
submodules: true
104108
# setup
105109
- name: Overwrite MMTk core in openjdk binding
106110
run: cp -r mmtk-core mmtk-openjdk/repos/
107111
- name: Setup Rust Toolchain
108-
run: echo "RUSTUP_TOOLCHAIN=`cat mmtk-core/rust-toolchain`" >> $GITHUB_ENV
112+
run: echo "RUSTUP_TOOLCHAIN=`cat mmtk-core/rust-toolchain`" >> $GITHUB_ENV
109113
# cleanup previosu build
110114
- name: Cleanup previous build
111115
run: |
@@ -120,7 +124,7 @@ jobs:
120124
sed -i 's/^#[[:space:]]mmtk/mmtk/g' mmtk-openjdk/mmtk/Cargo.toml
121125
- id: branch
122126
# we cannot use env vars in action input (the deploy step). So put the env var to this step's outputs.
123-
run: echo "::set-output name=branch_name::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
127+
run: echo "::set-output name=branch_name::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
124128
# run
125129
- name: Performance Run
126130
run: |
@@ -151,31 +155,33 @@ jobs:
151155
uses: actions/checkout@v2
152156
with:
153157
repository: mmtk/mmtk-openjdk
154-
token: ${{ secrets.CI_ACCESS_TOKEN }}
155158
path: mmtk-openjdk
156-
submodules: true
159+
- name: Checkout OpenJDK
160+
working-directory: mmtk-openjdk
161+
run: |
162+
./.github/scripts/ci-checkout.sh
157163
# checkout perf-kit
158164
- name: Checkout Perf Kit
159165
uses: actions/checkout@v2
160166
with:
161167
repository: mmtk/ci-perf-kit
162-
token: ${{ secrets.CI_ACCESS_TOKEN }}
163-
ref: "0.6.5"
168+
ref: "0.6.6"
164169
path: ci-perf-kit
170+
token: ${{ secrets.CI_ACCESS_TOKEN }}
165171
submodules: true
166172
# setup
167173
- name: Overwrite MMTk core in openjdk binding
168174
run: cp -r mmtk-core mmtk-openjdk/repos/
169175
- name: Setup Rust Toolchain
170-
run: echo "RUSTUP_TOOLCHAIN=`cat mmtk-core/rust-toolchain`" >> $GITHUB_ENV
176+
run: echo "RUSTUP_TOOLCHAIN=`cat mmtk-core/rust-toolchain`" >> $GITHUB_ENV
171177
# cleanup previosu build
172178
- name: Cleanup previous build
173179
run: |
174180
rm -rf mmtk-openjdk/repos/openjdk/scratch
175-
rm -rf mmtk-openjdk/repos/openjdk/build
181+
rm -rf mmtk-openjdk/repos/openjdk/build
176182
- id: branch
177183
# we cannot use env vars in action input (the deploy step). So put the env var to this step's outputs.
178-
run: echo "::set-output name=branch_name::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
184+
run: echo "::set-output name=branch_name::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
179185
- name: Setup
180186
run: |
181187
./ci-perf-kit/scripts/history-run-setup.sh
@@ -201,4 +207,4 @@ jobs:
201207
external_repository: mmtk/ci-perf-result
202208
publish_dir: ./reports
203209
publish_branch: gh-pages
204-
keep_files: true
210+
keep_files: true

0 commit comments

Comments
 (0)