Skip to content

Commit 2477658

Browse files
k-sareencaizixian
andauthored
Add new correctness CI (#206)
This commit adds a new correctness CI which parallelizes builds and tests. It uses running-ng, the latest DaCapo snapshot, and reuses build artifacts across runs. All running-ng outputs are uploaded as artifacts at the end of the workflow. Co-authored-by: Zixian Cai <[email protected]>
1 parent 2831a5e commit 2477658

File tree

7 files changed

+297
-1
lines changed

7 files changed

+297
-1
lines changed

.github/configs/base.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
includes:
2+
- "$RUNNING_NG_PACKAGE_DATA/base/runbms.yml"
3+
4+
suites:
5+
dacapochopin-04132797-ci:
6+
type: DaCapo
7+
release: evaluation
8+
path: "DACAPO_PATH/dacapo-evaluation-git-04132797.jar"
9+
minheap: mmtk-openjdk-11-MarkCompact
10+
minheap_values:
11+
mmtk-openjdk-11-MarkCompact:
12+
avrora: 8
13+
batik: 426
14+
biojava: 197
15+
cassandra: 117
16+
eclipse: 439
17+
fop: 24
18+
graphchi: 195
19+
h2: 1122
20+
h2o: 136
21+
jme: 236
22+
jython: 48
23+
kafka: 243
24+
luindex: 25
25+
lusearch: 36
26+
pmd: 291
27+
spring: 110
28+
sunflow: 37
29+
tradebeans: .inf
30+
tradesoap: .inf
31+
tomcat: 55
32+
xalan: 19
33+
zxing: 427
34+
nominal-heap-sizes:
35+
avrora: 7
36+
batik: 192
37+
biojava: 97
38+
cassandra: 74
39+
eclipse: 346
40+
fop: 17
41+
graphchi: 179
42+
h2: 506
43+
h2o: 102
44+
jme: 29
45+
jython: 29
46+
kafka: 207
47+
luindex: 44
48+
lusearch: 19
49+
pmd: 114
50+
spring: 47
51+
sunflow: 25
52+
tradebeans: 101
53+
tradesoap: 89
54+
tomcat: 17
55+
xalan: 9
56+
zxing: 66
57+
timing_iteration: 3
58+
timeout: 900
59+
60+
overrides:
61+
invocations: 3
62+
remote_host: null
63+
64+
modifiers:
65+
mmtk_gc:
66+
type: "EnvVar"
67+
var: "MMTK_PLAN"
68+
val: "{0}"
69+
70+
runtimes:
71+
jdk11-master:
72+
type: OpenJDK
73+
release: 11
74+
home: "/home/runner/work/mmtk-openjdk/mmtk-openjdk/bundles/jdk"
75+
76+
configs:
77+
- "jdk11-master|ms|s|mmtk_gc-SemiSpace|tph"
78+
- "jdk11-master|ms|s|mmtk_gc-GenCopy|tph"
79+
- "jdk11-master|ms|s|mmtk_gc-Immix|tph"
80+
- "jdk11-master|ms|s|mmtk_gc-GenImmix|tph"
81+
- "jdk11-master|ms|s|mmtk_gc-StickyImmix|tph"
82+
- "jdk11-master|ms|s|mmtk_gc-MarkSweep|tph"
83+
- "jdk11-master|ms|s|mmtk_gc-MarkCompact|tph"
84+
85+
benchmarks:
86+
dacapochopin-04132797-ci:

.github/scripts/build-normal.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -xe
4+
5+
. $(dirname "$0")/new-common.sh
6+
7+
# Use fastdebug if DEBUG_LEVEL is unset
8+
DEBUG_LEVEL=${DEBUG_LEVEL:="fastdebug"}
9+
10+
# Build product bundle
11+
cd $OPENJDK_PATH
12+
sh configure --disable-warnings-as-errors --with-debug-level=$DEBUG_LEVEL
13+
make CONF=linux-x86_64-normal-server-$DEBUG_LEVEL THIRD_PARTY_HEAP=$BINDING_PATH/openjdk product-bundles
14+
15+
if [[ $DEBUG_LEVEL == "fastdebug" ]]; then
16+
pushd build/linux-x86_64-normal-server-fastdebug/bundles
17+
F=`ls *_bin-debug.tar.gz`
18+
mv $F ${F/_bin-debug/_bin}
19+
popd
20+
fi

.github/scripts/new-common.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BINDING_PATH=$(realpath $(dirname "$0"))/../..
2+
OPENJDK_PATH=$BINDING_PATH/../openjdk
3+
DACAPO_PATH=$BINDING_PATH/../dacapo
4+
RUSTUP_TOOLCHAIN=`cat $BINDING_PATH/mmtk/rust-toolchain`

.github/scripts/pgo-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUSTFLAGS="-Cprofile-generate=/tmp/$USER/pgo-data" make CONF=linux-x86_64-normal
77
rm -rf /tmp/$USER/pgo-data/*
88

99
# Profile using fop
10-
MMTK_PLAN=GenImmix MMTK_STRESS_FACTOR=4194304 MMTK_PRECISE_STRESS=false ./build/linux-x86_64-normal-server-release/images/jdk/bin/java -XX:MetaspaceSize=500M -XX:+DisableExplicitGC -XX:-TieredCompilation -Xcomp -XX:+UseThirdPartyHeap -Xms60M -Xmx60M -jar /usr/share/benchmarks/dacapo/dacapo-evaluation-git-6e411f33.jar -n 5 fop
10+
MMTK_PLAN=GenImmix MMTK_STRESS_FACTOR=16777216 MMTK_PRECISE_STRESS=false ./build/linux-x86_64-normal-server-release/images/jdk/bin/java -XX:MetaspaceSize=500M -XX:+DisableExplicitGC -XX:-TieredCompilation -Xcomp -XX:+UseThirdPartyHeap -Xms60M -Xmx60M -jar /usr/share/benchmarks/dacapo/dacapo-evaluation-git-6e411f33.jar -n 5 fop
1111

1212
# Merge profiling data
1313
/opt/rust/toolchains/1.66.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -o /tmp/$USER/pgo-data/merged.profdata /tmp/$USER/pgo-data

.github/scripts/setup.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -xe
4+
5+
. $(dirname "$0")/new-common.sh
6+
7+
# Install nightly rust
8+
rustup toolchain install $RUSTUP_TOOLCHAIN
9+
rustup target add i686-unknown-linux-gnu --toolchain $RUSTUP_TOOLCHAIN
10+
rustup component add clippy --toolchain $RUSTUP_TOOLCHAIN
11+
rustup component add rustfmt --toolchain $RUSTUP_TOOLCHAIN
12+
rustup override set $RUSTUP_TOOLCHAIN
13+
14+
# Install running
15+
pip3 install running-ng
16+
17+
# Install dependencies
18+
sudo apt-get update -y
19+
sudo apt-get install dos2unix
20+
sudo apt-get install build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libcups2-dev libasound2-dev libxrandr-dev

.github/scripts/style-check.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
set -xe
4+
5+
. $(dirname "$0")/new-common.sh
6+
7+
export RUSTFLAGS="-D warnings"
8+
9+
pushd $BINDING_PATH/mmtk
10+
cargo clippy || exit $?
11+
cargo clippy --release || exit $?
12+
13+
cargo fmt -- --check || exit $?
14+
popd
15+
16+
find $BINDING_PATH/openjdk \
17+
$BINDING_PATH/mmtk \
18+
-name '*.hpp' \
19+
-o -name '*.cpp' \
20+
-o -name '*.rs' \
21+
-o -name '*.toml' \
22+
-o -name '*.gmk' \
23+
-exec $(dirname "$0")/ci-check-lineends.sh '{}' \;
24+

.github/workflows/main.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build-linux-x64:
14+
name: linux-x64
15+
runs-on: ubuntu-22.04
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
debug-level: ["fastdebug", "release"]
20+
steps:
21+
- name: Checkout MMTk OpenJDK binding
22+
uses: actions/checkout@v3
23+
with:
24+
path: ./git/mmtk-openjdk
25+
- name: Extract OpenJDK revision
26+
id: extract-openjdk-revision
27+
run: |
28+
OPENJDK_VERSION=`sed -n 's/^openjdk_version.=."\(.*\)"$/\1/p' < git/mmtk-openjdk/mmtk/Cargo.toml`
29+
echo "openjdk-revision=$OPENJDK_VERSION" >> $GITHUB_OUTPUT
30+
- name: Checkout OpenJDK
31+
uses: actions/checkout@v3
32+
with:
33+
repository: mmtk/openjdk
34+
path: ./git/openjdk
35+
ref: ${{ steps.extract-openjdk-revision.outputs.openjdk-revision }}
36+
- name: Setup environment
37+
run: ./.github/scripts/setup.sh
38+
working-directory: ./git/mmtk-openjdk
39+
- name: Style checks
40+
run: ./.github/scripts/style-check.sh
41+
working-directory: ./git/mmtk-openjdk
42+
- name: Build MMTk OpenJDK ${{ matrix.debug-level }}
43+
run: DEBUG_LEVEL=${{ matrix.debug-level }} ./.github/scripts/build-normal.sh
44+
working-directory: ./git/mmtk-openjdk
45+
- name: Upload bundles
46+
uses: actions/upload-artifact@v3
47+
with:
48+
name: linux-x86_64-server-${{ matrix.debug-level }}-bundles
49+
path: ./git/openjdk/build/linux-x86_64-normal-server-${{ matrix.debug-level }}/bundles/*_bin.tar.gz
50+
retention-days: 2
51+
52+
test-linux-x64:
53+
name: linux-x64
54+
needs:
55+
- build-linux-x64
56+
runs-on: ubuntu-22.04
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
debug-level: ["fastdebug", "release"]
61+
benchmark:
62+
- avrora
63+
- batik
64+
- biojava
65+
- cassandra
66+
- eclipse
67+
- fop
68+
- graphchi
69+
- h2
70+
- h2o
71+
- jme
72+
- jython
73+
- kafka
74+
- luindex
75+
- lusearch
76+
- pmd
77+
# spring
78+
- sunflow
79+
- tomcat
80+
# tradebeans
81+
# tradesoap
82+
- xalan
83+
- zxing
84+
steps:
85+
- name: Checkout MMTk OpenJDK binding
86+
uses: actions/checkout@v3
87+
- name: Setup environment
88+
run: |
89+
pip3 install running-ng
90+
sudo apt-get update -y
91+
sudo apt-get install -y build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libcups2-dev libasound2-dev libxrandr-dev
92+
- name: Cache DaCapo Chopin git-04132797
93+
id: dacapo-04132797
94+
uses: actions/cache@v3
95+
with:
96+
path: dacapo/dacapo-evaluation-git-04132797.zip
97+
key: dacapo-chopin-git-04132797
98+
- name: Install DaCapo Chopin git-04132797
99+
if: steps.dacapo-04132797.outputs.cache-hit != 'true'
100+
run: |
101+
mkdir -p dacapo
102+
pushd dacapo
103+
wget -q "https://cloudstor.aarnet.edu.au/plus/s/9cMreAgANcMUOzq/download" -O dacapo-evaluation-git-04132797.zip
104+
popd
105+
- name: Unzip DaCapo Chopin git-04132797
106+
run: |
107+
pushd dacapo
108+
unzip dacapo-evaluation-git-04132797.zip
109+
popd
110+
- name: Download bundles
111+
uses: actions/download-artifact@v3
112+
with:
113+
name: linux-x86_64-server-${{ matrix.debug-level }}-bundles
114+
path: bundles
115+
- name: Extract OpenJDK
116+
run: |
117+
pushd bundles
118+
tar xvf *.tar.gz
119+
BIN_DIR=`find . -name bin`
120+
mv `dirname $BIN_DIR` jdk
121+
popd
122+
- name: Run DaCapo Chopin git-04132797 ${{ matrix.benchmark }} on MMTk OpenJDK ${{ matrix.debug-level }} with 2.5x MarkCompact minheap
123+
run: |
124+
DACAPO_PATH=`realpath ./dacapo`
125+
sed -i "s;DACAPO_PATH;$DACAPO_PATH;g" .github/configs/base.yml
126+
echo " - ${{ matrix.benchmark }}" >> .github/configs/base.yml
127+
running runbms /tmp .github/configs/base.yml -s 2.5 -p linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }} | tee /tmp/running.stdout
128+
- name: Extract running run id
129+
id: extract-running-run-id
130+
run: |
131+
RUN_ID=`sed -n 's/^Run id:.\(.*\)$/\1/p' < /tmp/running.stdout`
132+
echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT
133+
- name: Upload running artifacts
134+
uses: actions/upload-artifact@v3
135+
with:
136+
name: linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }}
137+
path: /tmp/${{ steps.extract-running-run-id.outputs.run-id }}/
138+
- name: Check for test failures
139+
run: |
140+
RUNNING_OUTPUT=`sed -n "s/^\(${{ matrix.benchmark }} .*\)$/\1/p" < /tmp/running.stdout`
141+
echo $RUNNING_OUTPUT
142+
echo $RUNNING_OUTPUT | grep -vq "\."

0 commit comments

Comments
 (0)