|
2 | 2 | title: CI & Runner |
3 | 3 | --- |
4 | 4 |
|
5 | | -## GitHub Actions |
| 5 | +## PR Commands |
6 | 6 |
|
7 | | -HttpArena uses four GitHub Actions workflows to automate validation, benchmarking, and deployment. |
| 7 | +Comment on any PR to trigger validation or benchmarks. The framework is auto-detected from changed files, or you can specify it explicitly. |
8 | 8 |
|
9 | | -### Validate Framework |
| 9 | +| Command | Description | |
| 10 | +|---------|-------------| |
| 11 | +| `/validate` | Run the 18-point validation suite | |
| 12 | +| `/validate -f <framework>` | Validate a specific framework | |
| 13 | +| `/benchmark` | Run all benchmark tests | |
| 14 | +| `/benchmark -t <test>` | Run a specific test profile | |
| 15 | +| `/benchmark -f <framework> -t <test>` | Run a specific framework and test | |
| 16 | +| `/benchmark --save` | Run and save results (updates leaderboard on merge) | |
10 | 17 |
|
11 | | -**Trigger:** Automatically on every PR that modifies files under `frameworks/` or `scripts/validate.sh`. |
| 18 | +### Flags |
12 | 19 |
|
13 | | -Detects which frameworks were changed in the PR and runs `./scripts/validate.sh` against each one. If validation fails, the PR check fails — you must fix the issues before merging. |
| 20 | +- **`-f <framework>`** — Override auto-detection. Use the directory name under `frameworks/` (e.g. `-f actix`, `-f go-fasthttp`). |
| 21 | +- **`-t <test>`** — Run a specific test profile (e.g. `-t baseline`, `-t mixed`, `-t async-db`). |
| 22 | +- **`--save`** — Save benchmark results to the PR branch. When the PR is merged, results are included in the next site deployment and appear on the leaderboard. |
14 | 23 |
|
15 | | -### Benchmark |
| 24 | +### Comparison with main |
16 | 25 |
|
17 | | -**Trigger:** Automatically when a push to `main` modifies files under `frameworks/`, or manually via workflow dispatch. |
| 26 | +After every benchmark run, results are automatically compared against the current published data on main. A delta table is posted in the PR comment showing changes in RPS, latency, CPU, and memory for each connection count. New frameworks with no prior results show "NEW" instead of deltas. |
| 27 | + |
| 28 | +## GitHub Actions |
| 29 | + |
| 30 | +HttpArena uses four GitHub Actions workflows. |
| 31 | + |
| 32 | +### PR Commands (`pr-commands.yml`) |
18 | 33 |
|
19 | | -When triggered automatically, it detects which frameworks changed in the latest commit and benchmarks only those. When triggered manually, you can specify: |
20 | | -- **Framework** — a specific framework name, or leave empty to benchmark all changed frameworks |
21 | | -- **Profile** — a specific test profile (e.g. `baseline`, `baseline-h2`), or leave empty to run all profiles |
| 34 | +**Trigger:** Comment on a PR containing `/validate` or `/benchmark`. |
22 | 35 |
|
23 | | -Results are committed and pushed to `main` automatically by the HttpArena Bot. |
| 36 | +Parses the command and flags from the comment, detects the framework from changed PR files (or uses the `-f` flag), and either runs validation directly or dispatches the benchmark workflow. Adds a rocket reaction to the comment and posts results when done. |
24 | 37 |
|
25 | | -### Benchmark PR |
| 38 | +### Benchmark PR (`benchmark-pr.yml`) |
26 | 39 |
|
27 | | -**Trigger:** Manual only (workflow dispatch). Requires a PR number and framework name. |
| 40 | +**Trigger:** Dispatched by the PR Commands workflow, or manually via workflow dispatch. |
28 | 41 |
|
29 | | -Checks out the PR branch, runs the benchmark, and posts the results as a comment on the PR. This lets maintainers benchmark a new framework submission before merging, so contributors can see how their implementation performs on the hosted runner. An optional profile parameter lets you run a specific test instead of the full suite. |
| 42 | +Checks out the PR branch, runs the benchmark with optional `--save`, compares results against main using `scripts/compare.sh`, and posts a comment with raw results and a comparison table. If `--save` is used, results are committed and pushed to the PR branch. |
30 | 43 |
|
31 | | -### Deploy Site |
| 44 | +### Benchmark (`benchmark.yml`) |
| 45 | + |
| 46 | +**Trigger:** Automatically when a push to `main` modifies files under `frameworks/`, or manually via workflow dispatch. |
| 47 | + |
| 48 | +Detects which frameworks changed and benchmarks them with `--save`. Results are committed to `main` and the site data is rebuilt. |
| 49 | + |
| 50 | +### Deploy Site (`deploy.yml`) |
32 | 51 |
|
33 | 52 | **Trigger:** Automatically when a push to `main` modifies files under `site/`, or manually via workflow dispatch. |
34 | 53 |
|
35 | | -Builds the Hugo site and deploys it to GitHub Pages. This runs on GitHub-hosted Ubuntu runners (not the self-hosted runner). |
| 54 | +Builds the Hugo site and deploys it to GitHub Pages. Runs on GitHub-hosted runners (not the self-hosted benchmark machine). |
| 55 | + |
| 56 | +## Hosted Runner |
36 | 57 |
|
37 | | -## Hosted runner |
| 58 | +The Validate, Benchmark, and Benchmark PR workflows run on a **self-hosted runner** — a dedicated 64-core bare-metal machine configured for reproducible benchmarking: |
38 | 59 |
|
39 | | -The Validate, Benchmark, and Benchmark PR workflows run on a **self-hosted runner** — a dedicated bare-metal machine configured for reproducible, low-noise benchmarking. This ensures all frameworks are tested on identical hardware under controlled conditions, with CPU governors locked, background services minimized, and no resource contention from other CI jobs. |
| 60 | +- CPU governor locked to `performance` mode during benchmarks |
| 61 | +- Kernel caches dropped between runs |
| 62 | +- Docker daemon restarted for clean state |
| 63 | +- `somaxconn` and TCP backlog tuned for high connection counts |
| 64 | +- `ulimit` set to maximum file descriptors |
| 65 | +- Host networking for minimal overhead |
40 | 66 |
|
41 | | -Only the Deploy Site workflow uses GitHub-hosted runners, since it only builds static HTML and doesn't need controlled hardware. |
| 67 | +Only the Deploy Site workflow uses GitHub-hosted runners. |
0 commit comments