Skip to content

Add GitHub Actions to launch benchmark machines on AWS#993

Merged
alexey-milovidov merged 3 commits into
mainfrom
automate-benchmark-launches
Jul 20, 2026
Merged

Add GitHub Actions to launch benchmark machines on AWS#993
alexey-milovidov merged 3 commits into
mainfrom
automate-benchmark-launches

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jul 20, 2026

Copy link
Copy Markdown
Member

Automates launching ClickBench machines with GitHub Actions. The GitHub-hosted runner is used only to launch: it assumes a federated IAM role (OIDC) and runs the existing run-benchmark.sh, which starts a self-terminating EC2 machine. The machine clones the repository, runs <system>/benchmark.sh under cloud-init, sends its log to the results sink at play.clickhouse.com, and shuts down — exactly the current manual flow. run-benchmark.sh and cloud-init.sh.in are unchanged. Collecting results will be implemented separately.

Workflows

Workflow Trigger What it launches
benchmark-daily.yml daily, 02:00 UTC clickhouse, clickhouse-web, clickhouse-parquet, clickhouse-parquet-partitioned, clickhouse-datalake, clickhouse-datalake-partitioned, each on c6a.4xlarge, c6a.2xlarge, c6a.xlarge, c6a.large, t3a.small, c6a.metal, c8g.4xlarge, c8g.metal-48xl, c7a.metal-48xl, from main
benchmark-manual.yml manual any systems, machines, repository and branch
benchmark-pr.yml pull requests the systems whose directories the PR changes, from the PR's repository and branch, after approval

All three share a composite action (.github/actions/launch-benchmark) that assumes the role and calls run-benchmark.sh in a loop, one launch per (machine, system) pair; a failed launch does not stop the rest and is reported at the end. The role ARN is set in the action, and the region defaults to us-east-1. The role's trust policy only admits workflow runs of this repository, so assuming it fails everywhere else, including forks.

The PR workflow

  • Uses pull_request_target: the workflow and launcher scripts always come from the trusted base branch, and OIDC works for PRs from forks. PR code never runs on the runner — only on the disposable benchmark machine.
  • Detects systems to benchmark: top-level directories the PR touches (changes under results/ and *.md files don't count) that contain benchmark.sh at the PR head — so newly added systems are included, and results-only PRs launch nothing. Verified against real PRs: Add more measurements for mariadb-duckdb and Spice.ai #989 and Update ClickHouse #991 detect nothing (results-only), Revert "Revert "Add Spice.ai OSS (Cayenne, Parquet single, Parquet partitioned)"" #987 detects the three Spice.ai systems.
  • The launch job requires approval: it targets the benchmark-approval environment, which must be configured with required reviewers.
  • A new push to the PR cancels runs that are still waiting for approval.

Setup required (see .github/workflows/README.md)

  1. The ClickBenchLauncher IAM role trusting GitHub's OIDC provider, restricted to repo:ClickHouse/ClickBench:*, with ec2:RunInstances, ec2:CreateTags, ec2:DescribeImages, ec2:DescribeInstanceTypes — done.
  2. An environment named benchmark-approval with required reviewers.

🤖 Generated with Claude Code

alexey-milovidov and others added 3 commits July 20, 2026 02:38
Three workflows around the existing run-benchmark.sh launcher, using a
federated IAM role via OIDC. The GitHub-hosted runner only launches the
self-terminating EC2 machine; the machine runs the benchmark unattended
and sends its log to the results sink as before.

- benchmark-daily.yml: the six ClickHouse variants on c6a.4xlarge, daily.
- benchmark-manual.yml: any system/machine/repo/branch on demand.
- benchmark-pr.yml: systems whose directories a PR changes (ignoring
  results and *.md), from the PR's repo/branch, gated by required
  reviewers on the benchmark-approval environment. pull_request_target
  keeps the launcher scripts on the trusted base branch; PR code only
  runs on the disposable machine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The role ARN and region were repository variables passed through every
workflow. The role is a single fixed thing, so set it directly in the
composite action; the region defaults to us-east-1 (cheaper). The
variables and the skip-when-unconfigured check are gone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…trix

The composite action now takes space-separated lists of systems and
machines and launches one EC2 machine per pair, sequentially, in the
same job. A failed launch does not stop the rest; the failures are
reported at the end. The daily workflow launches the six ClickHouse
variants on nine machine types; the PR workflow loses its matrix; the
manual workflow accepts lists.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try...

@alexey-milovidov alexey-milovidov self-assigned this Jul 20, 2026
@alexey-milovidov
alexey-milovidov merged commit b5de357 into main Jul 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant