Skip to content

Commit f032697

Browse files
authored
Performance history canary (#1209)
This PR adds a "canary" build to the performance regression CI of OpenJDK. The "canary" is a chosen revision of mmtk-core and mmtk-openjdk that is tested alongside each merged PR. The performance of the "canary" should not change unless there is an environment change or there is a noise. Spotting a change in the "canary" performance can help us identify environment changes that are unintended or otherwise unnoticed, and also identify the noise level. Currently, we choose a specific release version as the version of the "canary". Using a release version has the advantage of being easy to specify the exact revision of both the mmtk-core and the mmtk-openjdk repository. We may also switch to some methods of automatically select the canary version in the future. There are other minor changes made. - We slightly change the directory structure. We create two directory, namely `latest` and `canary`. In each of the directories, we check out `mmtk-core` and `mmtk-openjdk` of the latest and the canary versions, respectively. - We use the `ci-replace-mmtk-dep.py` script to replace the revision of the `mmtk-core` dependency in `mmtk-openjdk`. As a result, we no longer need to use `sed`, and no longer need to copy the `mmtk-core` directory into `mmtk-openjdk/repos`. - We no longer set the `RUSTUP_TOOLCHAIN` environment variable because 1. The latest and the canary version may not use the same toolchain, and, 2. the right toolchain will be chosen when running the `cargo` command according to the `rust-toolchain` file in the directory. - The scripts in https://github.com/mmtk/ci-perf-kit are changed to take the canary into consideration, too.
1 parent 80b11a0 commit f032697

File tree

1 file changed

+62
-23
lines changed

1 file changed

+62
-23
lines changed

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

+62-23
Original file line numberDiff line numberDiff line change
@@ -97,45 +97,81 @@ jobs:
9797
openjdk-perf-regression:
9898
runs-on: [self-hosted, Linux, freq-scaling-off]
9999
timeout-minutes: 1440
100+
env:
101+
# This version will be used as the canary version, and will be used to checkout both
102+
# `mmtk-core` and `mmtk-openjdk`.
103+
#
104+
# A "canary" is a chosen version that is tested alongside each merged pull request. The
105+
# performance of the canary should not change unless
106+
#
107+
# 1. There is an environment change, such as changes of the operating system, the hardware,
108+
# the firmware, or the methodology we use for testing, or
109+
# 2. There are non-deterministic factors (i.e. noises) affecting each execution.
110+
#
111+
# Running the canary alongside regular regression tests help us identify unnoticed environment
112+
# changes and the level of noise.
113+
#
114+
# Currently, we choose one release version as the canary, and will use it until we can no
115+
# longer run it for any reason, such as the toolchain for compiling that version is no longer
116+
# available. Then we may change to another release version and mark the change of canary on
117+
# the timeline, or introduce a mechanism to dynamically choose the canary version.
118+
CANARY_VERSION: "v0.28.0"
100119
steps:
101-
- name: Checkout MMTk Core
120+
# checkout latest versions
121+
- name: Checkout MMTk Core (latest)
102122
uses: actions/checkout@v4
103123
with:
104-
path: mmtk-core
105-
- name: Checkout OpenJDK Binding
124+
path: latest/mmtk-core
125+
- name: Checkout OpenJDK Binding (latest)
106126
uses: actions/checkout@v4
107127
with:
108128
repository: mmtk/mmtk-openjdk
109-
path: mmtk-openjdk
110-
- name: Checkout OpenJDK
111-
working-directory: mmtk-openjdk
129+
path: latest/mmtk-openjdk
130+
- name: Checkout OpenJDK (latest)
131+
working-directory: latest/mmtk-openjdk
112132
run: |
113133
./.github/scripts/ci-checkout.sh
114134
# checkout perf-kit
115135
- name: Checkout Perf Kit
116136
uses: actions/checkout@v4
117137
with:
118138
repository: mmtk/ci-perf-kit
119-
ref: "0.8.0"
139+
ref: "0.8.1"
120140
path: ci-perf-kit
121-
token: ${{ secrets.CI_ACCESS_TOKEN }}
122141
submodules: true
123-
# setup
124-
- name: Overwrite MMTk core in openjdk binding
125-
run: cp -r mmtk-core mmtk-openjdk/repos/
126-
- name: Setup Rust Toolchain
127-
run: echo "RUSTUP_TOOLCHAIN=`cat mmtk-core/rust-toolchain`" >> $GITHUB_ENV
128-
# cleanup previosu build
129-
- name: Cleanup previous build
142+
# checkout canary versions.
143+
- name: Checkout MMTk Core (canary)
144+
uses: actions/checkout@v4
145+
with:
146+
ref: ${{ env.CANARY_VERSION }}
147+
path: canary/mmtk-core
148+
- name: Checkout OpenJDK Binding (canary)
149+
uses: actions/checkout@v4
150+
with:
151+
ref: ${{ env.CANARY_VERSION }}
152+
repository: mmtk/mmtk-openjdk
153+
path: canary/mmtk-openjdk
154+
- name: Checkout OpenJDK (canary)
155+
working-directory: canary/mmtk-openjdk
130156
run: |
131-
rm -rf mmtk-openjdk/repos/openjdk/scratch
132-
rm -rf mmtk-openjdk/repos/openjdk/build
133-
- name: Setup
157+
./.github/scripts/ci-checkout.sh
158+
# setup
159+
- name: Setup directory structures
134160
run: |
135-
./ci-perf-kit/scripts/history-run-setup.sh
136-
sed -i 's/^mmtk[[:space:]]=/#ci:mmtk=/g' mmtk-openjdk/mmtk/Cargo.toml
137-
sed -i 's/^#[[:space:]]mmtk/mmtk/g' mmtk-openjdk/mmtk/Cargo.toml
138-
- id: branch
161+
for BASE_DIR in ./latest ./canary; do
162+
pushd $BASE_DIR
163+
# replace dependency
164+
# Note that ci-replace-mmtk-dep.sh will apply `realpath()` to the `--mmtk-core-path` option.
165+
# so we specify the relative path from the PWD to the mmtk-core repo.
166+
./mmtk-core/.github/scripts/ci-replace-mmtk-dep.sh mmtk-openjdk/mmtk/Cargo.toml \
167+
--mmtk-core-path mmtk-core
168+
# cleanup previous build
169+
rm -rf mmtk-openjdk/repos/openjdk/scratch
170+
rm -rf mmtk-openjdk/repos/openjdk/build
171+
popd
172+
done
173+
- name: Setup branch name
174+
id: branch
139175
# we cannot use env vars in action input (the deploy step). So put the env var to this step's outputs.
140176
run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_OUTPUT
141177
# run
@@ -145,7 +181,10 @@ jobs:
145181
export RESULT_REPO_BRANCH=${{ env.RESULT_REPO_BRANCH }}
146182
export RESULT_REPO_ACCESS_TOKEN=${{ secrets.CI_ACCESS_TOKEN }}
147183
export FROM_DATE=2020-07-10
148-
./ci-perf-kit/scripts/openjdk-history-run.sh ./mmtk-openjdk ./reports/${{ steps.branch.outputs.branch_name }}
184+
./ci-perf-kit/scripts/openjdk-history-run.sh \
185+
./latest/mmtk-openjdk \
186+
./canary/mmtk-openjdk \
187+
./reports/${{ steps.branch.outputs.branch_name }}
149188
# deploy
150189
- name: Deploy to Github Page
151190
if: ${{ env.DEPLOY == 'true' }}

0 commit comments

Comments
 (0)