rickub/ci-benchpublic Fork 0
39ba5db452f23f08907cce6b693297d70f8ec54a
Commits
Clone
git clone https://git.rickub.com/rickub/ci-bench.git
git clone ssh://git@rickub.com/rickub/ci-bench.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

ci-bench: cross-platform CI race scaffold (rickub CI vs GitHub Actions) 0baf736Unverified · on 39ba5db452f23f08907cce6b693297d70f8ec54a · Olivier Girardot · yesterday
bench.yml · 97 lines · 3.6 KBYAML Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: bench

# THE RICKUB side of the CI race. Runs only on rickub's own CI: once
# .rickub/workflows/ exists, rickub reads it as the SOLE workflow source and
# ignores .github/workflows/ entirely (web/ci_dispatch.go walkWorkflows), so
# this file and the GitHub copy never double-fire on one platform. Keep the
# STEP ORDER identical to .github/workflows/bench.yml — that is the point of
# the benchmark.
#
# runs-on: large (4 vCPU / 8 GiB / 32 GiB scratch, Docker-in-Docker guest
# rootfs-docker-glibc.ext4) to roughly match github.com's ubuntu-latest
# (4 vCPU / 16 GiB). The vCPU count matches; RAM does not — documented in the
# README as a known asymmetry and a user decision (ubuntu-latest on rickub is
# 2 vCPU / 4 GiB, cheaper and arguably the fairer "as-consumed" comparison).
#
# Deliberately NO `concurrency:` block: queue depth is part of what we
# measure.

on:
  push:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read

defaults:
  run:
    shell: bash

env:
  BENCH_PLATFORM: rickub

jobs:
  bench:
    runs-on: large
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

      - name: mark job-start
        run: |
          rid="${GITHUB_RUN_ID:-0}-${GITHUB_RUN_ATTEMPT:-1}-$(git rev-parse --short HEAD)"
          echo "BENCH_RUN_ID=$rid" >> "$GITHUB_ENV"
          source "${GITHUB_WORKSPACE:-$PWD}/scripts/emit_timing.sh"
          BENCH_RUN_ID="$rid" bench_mark job-start

      # COLD build: every rickub job boots a fresh Firecracker microVM with a
      # read-only rootfs and a fresh scratch disk, so this cargo run fetches
      # every crate and compiles the full tree — exactly the GitHub twin's
      # cold path. `rm -rf target` is belt and braces. No cache action on
      # purpose.
      - name: rust cold build
        run: |
          set -euo pipefail
          source "${GITHUB_WORKSPACE:-$PWD}/scripts/emit_timing.sh"
          bench_step rust-cold-build bash -ec \
            'rm -rf workloads/rust-build/target && cargo build --manifest-path workloads/rust-build/Cargo.toml'

      # WARM build: same job, same VM, target/ populated — the incremental
      # no-op rebuild path.
      - name: rust warm build
        run: |
          set -euo pipefail
          source "${GITHUB_WORKSPACE:-$PWD}/scripts/emit_timing.sh"
          bench_step rust-warm-build cargo build --manifest-path workloads/rust-build/Cargo.toml

      - name: rust test
        run: |
          set -euo pipefail
          source "${GITHUB_WORKSPACE:-$PWD}/scripts/emit_timing.sh"
          bench_step rust-test cargo test --manifest-path workloads/rust-build/Cargo.toml

      # The large class runs Docker-in-Docker (dockerd in the guest), so this
      # exercises the guest's dockerd + registry pull path. Still guarded: a
      # runner without docker records "skipped" instead of failing the job.
      - name: docker build
        run: |
          set -euo pipefail
          source "${GITHUB_WORKSPACE:-$PWD}/scripts/emit_timing.sh"
          if command -v docker >/dev/null 2>&1; then
            bench_step docker-build bash -ec \
              'docker build -t ci-bench:docker workloads/docker-build && docker run --rm ci-bench:docker'
          else
            bench_skip docker-build "docker not available on runner"
          fi

      - name: probe runner
        run: bash workloads/probe/probe.sh

      - name: show results
        run: cat "${GITHUB_WORKSPACE:-$PWD}/results.jsonl"

      - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
        with:
          name: bench-results
          path: results.jsonl