Skip to content

Binding Perf Tests

Binding Perf Tests #20

Workflow file for this run

# 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@v6
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@v6
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 "::set-output name=mmtk_repo::${{ steps.core-repo.outputs.result }}"
echo "::set-output name=mmtk_ref::${{ steps.core-ref.outputs.result }}"
# 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@v2
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@v2
with:
repository: mmtk/mmtk-core
ref: master
path: mmtk-core-trunk
# Branch
# - binding
- name: Checkout JikesRVM Binding Branch
uses: actions/checkout@v2
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@v2
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@v2
with:
repository: mmtk/ci-perf-kit
token: ${{ secrets.CI_ACCESS_TOKEN }}
ref: "test-0.7.1"
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@v3
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@v3
with:
name: jikesrvm-compare-logs
path: ${{ env.CI_PERF_KIT_LOG }}
if-no-files-found: error
- uses: actions/upload-artifact@v2
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@v2
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@v2
with:
repository: mmtk/mmtk-core
ref: master
path: mmtk-core-trunk
# Branch
# - binding
- name: Checkout OpenJDK Binding Branch
uses: actions/checkout@v2
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@v2
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@v2
with:
repository: mmtk/ci-perf-kit
token: ${{ secrets.CI_ACCESS_TOKEN }}
ref: "test-0.7.1"
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@v3
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@v3
with:
name: openjdk-compare-logs
path: ${{ env.CI_PERF_KIT_LOG }}
if-no-files-found: error
- uses: actions/upload-artifact@v2
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