Skip to content

Commit a044642

Browse files
authored
ci: read custom runner labels from repo variables (#3573)
## Summary E2E and the image-build jobs run on org-level larger runners (`8-core-playwright`, `Large-Runner-x64-32`, `Large-Runner-ARM64-32`, `ubuntu-latest-arm64`). Those don't move with the repo when it transfers to the ClickHouse org. If nothing in the new org has those labels, the jobs don't fail; they sit queued waiting for a runner. This reads each label from a repo variable and falls back to today's label, so nothing changes until a variable is set. A value is either a plain label (`ubuntu-24.04`) or a JSON array of labels (`["self-hosted","linux","x64"]`), so the variables can also target self-hosted runners that are selected by a label set. On transfer day we can point the jobs at whatever runners ClickHouse has, or at standard GitHub runners, from Settings → Secrets and variables → Actions → Variables, without a PR. | Variable | Default | Used by | | --- | --- | --- | | `RUNNER_E2E` | `8-core-playwright` | `e2e-tests.yml` (every PR) | | `RUNNER_LARGE_X64` | `Large-Runner-x64-32` | Image builds in `release.yml`, `release-nightly.yml` | | `RUNNER_LARGE_ARM64` | `Large-Runner-ARM64-32` | Image builds in `release.yml`, `release-nightly.yml` | | `RUNNER_ARM64` | `ubuntu-latest-arm64` | arm64 build in `release.yml`, `release-nightly.yml` | | `E2E_WORKERS` | unset (Playwright config default, 4 on CI) | `e2e-tests.yml` | `E2E_WORKERS` is already read by `playwright.config.ts`. It's passed through because 4 workers timed out on the 4-vCPU runner before; set it to `2` if `RUNNER_E2E` points at a smaller machine. Standard-runner fallback: `RUNNER_E2E=ubuntu-24.04` + `E2E_WORKERS=2`, `RUNNER_LARGE_X64=ubuntu-24.04`, `RUNNER_LARGE_ARM64=ubuntu-24.04-arm`, `RUNNER_ARM64=ubuntu-24.04-arm`. Image builds will be slower. No changeset: CI only. ### How to reproduce 1. On this branch with no variables set, the E2E jobs on this PR run on `8-core-playwright` as before (check the "Set up job" log for the runner name). 2. Optional: set `RUNNER_E2E=ubuntu-24.04` and `E2E_WORKERS=2`, re-run E2E, and confirm it picks up the standard runner and 2 workers. Unset both afterwards. Not run: actionlint. I checked that the YAML parses and passes Prettier. `vars` is a documented context for both `runs-on` and `strategy`; the first CI run on this PR confirms the E2E path, and the release paths only run on `main`/nightly. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent f56d4ad commit a044642

3 files changed

Lines changed: 50 additions & 23 deletions

File tree

‎.github/workflows/e2e-tests.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ jobs:
88
# 8-core runner so the 4 Playwright workers (see playwright.config.ts) have
99
# CPU headroom alongside the app + ClickHouse + MongoDB — 4 workers
1010
# over-subscribed the 4-vCPU ubuntu-24.04 runner and caused timeouts.
11-
runs-on: 8-core-playwright
11+
# RUNNER_E2E is a label or a JSON array of labels. On a smaller
12+
# runner, set the E2E_WORKERS variable to 2 as well.
13+
runs-on:
14+
${{ startsWith(vars.RUNNER_E2E, '[') && fromJSON(vars.RUNNER_E2E) ||
15+
vars.RUNNER_E2E || '8-core-playwright' }}
1216
timeout-minutes: 15
1317
permissions:
1418
contents: read
@@ -25,6 +29,9 @@ jobs:
2529
uses: ./.github/actions/e2e-setup
2630

2731
- name: Run Playwright tests (full-stack mode)
32+
env:
33+
# Unset falls back to the default in playwright.config.ts.
34+
E2E_WORKERS: ${{ vars.E2E_WORKERS }}
2835
run: |
2936
cd packages/app
3037
yarn test:e2e --shard=${{ matrix.shard }}/4

‎.github/workflows/release-nightly.yml‎

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ jobs:
2020
strategy:
2121
fail-fast: true
2222
matrix:
23+
# runner is a label, or a JSON array of labels so the RUNNER_* repo
24+
# variables can target self-hosted label sets.
2325
include:
2426
- arch: amd64
2527
platform: linux/amd64
2628
runner: ubuntu-latest
2729
- arch: arm64
2830
platform: linux/arm64
29-
runner: ubuntu-latest-arm64
30-
runs-on: ${{ matrix.runner }}
31+
runner: ${{ vars.RUNNER_ARM64 || 'ubuntu-latest-arm64' }}
32+
runs-on:
33+
${{ startsWith(matrix.runner, '[') && fromJSON(matrix.runner) ||
34+
matrix.runner }}
3135
steps:
3236
- name: Checkout
3337
uses: actions/checkout@v6
@@ -92,11 +96,13 @@ jobs:
9296
include:
9397
- arch: amd64
9498
platform: linux/amd64
95-
runner: Large-Runner-x64-32
99+
runner: ${{ vars.RUNNER_LARGE_X64 || 'Large-Runner-x64-32' }}
96100
- arch: arm64
97101
platform: linux/arm64
98-
runner: Large-Runner-ARM64-32
99-
runs-on: ${{ matrix.runner }}
102+
runner: ${{ vars.RUNNER_LARGE_ARM64 || 'Large-Runner-ARM64-32' }}
103+
runs-on:
104+
${{ startsWith(matrix.runner, '[') && fromJSON(matrix.runner) ||
105+
matrix.runner }}
100106
steps:
101107
- name: Checkout
102108
uses: actions/checkout@v6
@@ -167,11 +173,13 @@ jobs:
167173
include:
168174
- arch: amd64
169175
platform: linux/amd64
170-
runner: Large-Runner-x64-32
176+
runner: ${{ vars.RUNNER_LARGE_X64 || 'Large-Runner-x64-32' }}
171177
- arch: arm64
172178
platform: linux/arm64
173-
runner: Large-Runner-ARM64-32
174-
runs-on: ${{ matrix.runner }}
179+
runner: ${{ vars.RUNNER_LARGE_ARM64 || 'Large-Runner-ARM64-32' }}
180+
runs-on:
181+
${{ startsWith(matrix.runner, '[') && fromJSON(matrix.runner) ||
182+
matrix.runner }}
175183
steps:
176184
- name: Checkout
177185
uses: actions/checkout@v6
@@ -244,11 +252,13 @@ jobs:
244252
include:
245253
- arch: amd64
246254
platform: linux/amd64
247-
runner: Large-Runner-x64-32
255+
runner: ${{ vars.RUNNER_LARGE_X64 || 'Large-Runner-x64-32' }}
248256
- arch: arm64
249257
platform: linux/arm64
250-
runner: Large-Runner-ARM64-32
251-
runs-on: ${{ matrix.runner }}
258+
runner: ${{ vars.RUNNER_LARGE_ARM64 || 'Large-Runner-ARM64-32' }}
259+
runs-on:
260+
${{ startsWith(matrix.runner, '[') && fromJSON(matrix.runner) ||
261+
matrix.runner }}
252262
steps:
253263
- name: Checkout
254264
uses: actions/checkout@v6

‎.github/workflows/release.yml‎

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -798,14 +798,18 @@ jobs:
798798
strategy:
799799
fail-fast: true
800800
matrix:
801+
# runner is a label, or a JSON array of labels so the RUNNER_* repo
802+
# variables can target self-hosted label sets.
801803
include:
802804
- arch: amd64
803805
platform: linux/amd64
804806
runner: ubuntu-latest
805807
- arch: arm64
806808
platform: linux/arm64
807-
runner: ubuntu-latest-arm64
808-
runs-on: ${{ matrix.runner }}
809+
runner: ${{ vars.RUNNER_ARM64 || 'ubuntu-latest-arm64' }}
810+
runs-on:
811+
${{ startsWith(matrix.runner, '[') && fromJSON(matrix.runner) ||
812+
matrix.runner }}
809813
steps:
810814
- name: Checkout
811815
uses: actions/checkout@v6
@@ -875,11 +879,13 @@ jobs:
875879
include:
876880
- arch: amd64
877881
platform: linux/amd64
878-
runner: Large-Runner-x64-32
882+
runner: ${{ vars.RUNNER_LARGE_X64 || 'Large-Runner-x64-32' }}
879883
- arch: arm64
880884
platform: linux/arm64
881-
runner: Large-Runner-ARM64-32
882-
runs-on: ${{ matrix.runner }}
885+
runner: ${{ vars.RUNNER_LARGE_ARM64 || 'Large-Runner-ARM64-32' }}
886+
runs-on:
887+
${{ startsWith(matrix.runner, '[') && fromJSON(matrix.runner) ||
888+
matrix.runner }}
883889
steps:
884890
- name: Checkout
885891
uses: actions/checkout@v6
@@ -958,11 +964,13 @@ jobs:
958964
include:
959965
- arch: amd64
960966
platform: linux/amd64
961-
runner: Large-Runner-x64-32
967+
runner: ${{ vars.RUNNER_LARGE_X64 || 'Large-Runner-x64-32' }}
962968
- arch: arm64
963969
platform: linux/arm64
964-
runner: Large-Runner-ARM64-32
965-
runs-on: ${{ matrix.runner }}
970+
runner: ${{ vars.RUNNER_LARGE_ARM64 || 'Large-Runner-ARM64-32' }}
971+
runs-on:
972+
${{ startsWith(matrix.runner, '[') && fromJSON(matrix.runner) ||
973+
matrix.runner }}
966974
steps:
967975
- name: Checkout
968976
uses: actions/checkout@v6
@@ -1064,11 +1072,13 @@ jobs:
10641072
include:
10651073
- arch: amd64
10661074
platform: linux/amd64
1067-
runner: Large-Runner-x64-32
1075+
runner: ${{ vars.RUNNER_LARGE_X64 || 'Large-Runner-x64-32' }}
10681076
- arch: arm64
10691077
platform: linux/arm64
1070-
runner: Large-Runner-ARM64-32
1071-
runs-on: ${{ matrix.runner }}
1078+
runner: ${{ vars.RUNNER_LARGE_ARM64 || 'Large-Runner-ARM64-32' }}
1079+
runs-on:
1080+
${{ startsWith(matrix.runner, '[') && fromJSON(matrix.runner) ||
1081+
matrix.runner }}
10721082
steps:
10731083
- name: Checkout
10741084
uses: actions/checkout@v6

0 commit comments

Comments
 (0)