114 lines
3.9 KiB
YAML
114 lines
3.9 KiB
YAML
name: Benchmark Asterinas
|
|
on:
|
|
# In case of manual trigger, use workflow_dispatch
|
|
workflow_dispatch:
|
|
schedule:
|
|
# Schedule to run on every day at 20:00 UTC (04:00 Beijing Time)
|
|
- cron: '0 20 * * *'
|
|
|
|
jobs:
|
|
Benchmarks:
|
|
runs-on: self-hosted
|
|
strategy:
|
|
matrix:
|
|
benchmark:
|
|
- sysbench-cpu
|
|
- sysbench-thread
|
|
# Process-related benchmarks
|
|
- lmbench-ctx
|
|
- lmbench-fork
|
|
- lmbench-exec
|
|
- lmbench-shell
|
|
# Memory-related benchmarks
|
|
- lmbench-mem-frd
|
|
- lmbench-mem-fwr
|
|
- lmbench-mem-fcp
|
|
# IPC-related benchmarks
|
|
- lmbench-unix-latency
|
|
- lmbench-unix-bandwidth
|
|
- lmbench-pipe-latency
|
|
- lmbench-pipe-bandwidth
|
|
# Syscall-related benchmarks
|
|
- lmbench-getpid
|
|
- lmbench-fstat
|
|
- lmbench-open
|
|
- lmbench-stat
|
|
- lmbench-write
|
|
- lmbench-read
|
|
# Signal-related benchmarks
|
|
- lmbench-signal
|
|
- lmbench-signal-install
|
|
- lmbench-signal-prot
|
|
# File-related benchmarks
|
|
- lmbench-file-rd-bandwidth
|
|
- lmbench-select-file
|
|
- lmbench-fs-create-delete-files-0k
|
|
- lmbench-fs-create-delete-files-10k
|
|
# Mmap-related benchmarks
|
|
- lmbench-pagefault
|
|
- lmbench-mmap-bandwidth
|
|
- lmbench-mmap-latency
|
|
# Semaphore benchmark
|
|
- lmbench-semaphore
|
|
fail-fast: false
|
|
timeout-minutes: 60
|
|
container:
|
|
image: asterinas/asterinas:0.6.2
|
|
options: --device=/dev/kvm
|
|
env:
|
|
# Need to set up proxy since the self-hosted CI server is located in China,
|
|
# which has poor network connection to the official Rust crate repositories.
|
|
RUSTUP_DIST_SERVER: https://mirrors.ustc.edu.cn/rust-static
|
|
RUSTUP_UPDATE_ROOT: https://mirrors.ustc.edu.cn/rust-static/rustup
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up the environment
|
|
run: |
|
|
chmod +x test/benchmark/bench_linux_and_aster.sh
|
|
# Set up git due to the network issue on the self-hosted runner
|
|
git config --global --add safe.directory /__w/asterinas/asterinas
|
|
git config --global http.sslVerify false
|
|
git config --global http.version HTTP/1.1
|
|
|
|
- name: Run benchmark
|
|
uses: nick-invision/retry@v2 # Retry the benchmark command in case of failure
|
|
with:
|
|
timeout_minutes: 20
|
|
max_attempts: 3
|
|
command: |
|
|
make install_osdk
|
|
bash test/benchmark/bench_linux_and_aster.sh ${{ matrix.benchmark }}
|
|
|
|
- name: Set up benchmark configuration
|
|
run: |
|
|
ALERT_THRESHOLD=$(jq -r '.alert_threshold' test/benchmark/${{ matrix.benchmark }}/config.json)
|
|
echo "ALERT_THRESHOLD=$ALERT_THRESHOLD" >> $GITHUB_ENV
|
|
|
|
ALERT_TOOL=$(jq -r '.alert_tool' test/benchmark/${{ matrix.benchmark }}/config.json)
|
|
if [ "${ALERT_TOOL}" = "null" ]; then
|
|
ALERT_TOOL="customSmallerIsBetter"
|
|
fi
|
|
echo "ALERT_TOOL=$ALERT_TOOL" >> $GITHUB_ENV
|
|
|
|
DESCRIPTION=$(jq -r '.description' test/benchmark/${{ matrix.benchmark }}/config.json)
|
|
if [ -z "$DESCRIPTION" ]; then
|
|
DESCRIPTION=""
|
|
fi
|
|
echo "DESCRIPTION=$DESCRIPTION" >> $GITHUB_ENV
|
|
|
|
- name: Store benchmark results
|
|
uses: asterinas/github-action-benchmark@v2
|
|
with:
|
|
name: ${{ matrix.benchmark }} Benchmark
|
|
tool: ${{ env.ALERT_TOOL }}
|
|
output-file-path: result_${{ matrix.benchmark }}.json
|
|
benchmark-data-dir-path: ''
|
|
github-token: ${{ secrets.BENCHMARK_SECRET }}
|
|
gh-repository: 'github.com/asterinas/benchmark'
|
|
auto-push: true
|
|
alert-threshold: ${{ env.ALERT_THRESHOLD }}
|
|
comment-on-alert: true
|
|
fail-on-alert: true
|
|
chart-description: ${{ env.DESCRIPTION }}
|