| 1 |
name: Benchmark |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: |
| 5 |
- main |
| 6 |
pull_request: |
| 7 |
|
| 8 |
env: |
| 9 |
DOCKER_BUILDKIT: 1 |
| 10 |
|
| 11 |
jobs: |
| 12 |
hello-bench: |
| 13 |
runs-on: ubuntu-22.04 |
| 14 |
name: HelloBench |
| 15 |
env: |
| 16 |
BENCHMARK_LOG_DIR: ${{ github.workspace }}/log/ |
| 17 |
BENCHMARK_RESULT_DIR: ${{ github.workspace }}/benchmark/ |
| 18 |
BENCHMARK_REGISTRY: ghcr.io |
| 19 |
BENCHMARK_USER: stargz-containers |
| 20 |
BENCHMARK_TARGETS: python:3.10 gcc:11.2.0 postgres:14.2 tomcat:10.1.0-jdk17-openjdk-bullseye |
| 21 |
BENCHMARK_SAMPLES_NUM: 5 |
| 22 |
BENCHMARK_PERCENTILE: 95 |
| 23 |
BENCHMARK_PERCENTILES_GRANULARITY: 25 |
| 24 |
strategy: |
| 25 |
fail-fast: false |
| 26 |
max-parallel: 1 |
| 27 |
matrix: |
| 28 |
runtime: ["podman", "containerd"] |
| 29 |
steps: |
| 30 |
- name: Install tools |
| 31 |
run: | |
| 32 |
sudo apt-get update && sudo apt-get --no-install-recommends install -y gnuplot |
| 33 |
pip install numpy |
| 34 |
- uses: actions/checkout@v3 |
| 35 |
- name: Prepare directories |
| 36 |
run: mkdir "${BENCHMARK_RESULT_DIR}" "${BENCHMARK_LOG_DIR}" |
| 37 |
- name: Get instance information |
| 38 |
run: | |
| 39 |
curl -H "Metadata:true" "http://169.254.169.254/metadata/instance?api-version=2019-11-01" | \ |
| 40 |
jq '{ location : .compute.location, vmSize : .compute.vmSize }' | \ |
| 41 |
tee ${{ env.BENCHMARK_RESULT_DIR }}/instance.json |
| 42 |
- name: Run benchmark |
| 43 |
env: |
| 44 |
BENCHMARK_RUNTIME_MODE: ${{ matrix.runtime }} |
| 45 |
run: make benchmark |
| 46 |
- uses: actions/upload-artifact@v3 |
| 47 |
if: ${{ always() }} |
| 48 |
with: |
| 49 |
name: benchmarking-result-${{ matrix.runtime }} |
| 50 |
path: ${{ env.BENCHMARK_RESULT_DIR }} |