Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai 2e5d7c0c79 ci: keep frontend and e2e on GitHub-hosted runners
Both are CPU-bound (vitest, Chromium) and ran slower on the light self-hosted
runners than on ubuntu-latest, with e2e pages timing out.
2026-11-27 13:48:42 +08:00
l0ng-ai 3beadbcf63 ci: give self-hosted runner containers a 2 GB /dev/shm
Docker's 64 MB default starves Chromium, so e2e pages rendered slowly enough
to hit the test timeout.
2026-11-27 13:20:15 +08:00
l0ng-ai ac58b3380b ci: run the macOS Rust job on the self-hosted Mac for trusted events
Same routing rule as the Linux runners: trusted events while SELFHOSTED_RUNNERS
is true. Self-hosted runners without a preset CARGO_TARGET_DIR keep the target
dir next to the checkout so incremental builds survive actions/checkout's clean.
2026-11-27 12:25:50 +08:00
l0ng-ai c9bf8a3502 ci: route jobs that don't compile Rust to a separate self-hosted label
changes, rust-checks, deny, frontend, catalog and e2e (and language-smoke's
changes) now run on openidea-selfhosted-light, so a host with little disk can
register runners that only take these jobs. Rust builds stay on
openidea-selfhosted.
2026-11-27 12:11:54 +08:00
4 змінених файлів з 31 додано та 18 видалено

No files matched your search

+18 -9
Переглянути файл
@@ -30,7 +30,7 @@ jobs:
name: Changes
# Self-hosted runners (scripts/selfhost-runner) only for trusted events, and only while the
# SELFHOSTED_RUNNERS repository variable is 'true': runs-on cannot fall back when none is online.
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted"]') || 'ubuntu-latest' }}
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted-light"]') || 'ubuntu-latest' }}
timeout-minutes: 5
permissions:
pull-requests: read
@@ -111,9 +111,10 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
# Self-hosted runners (scripts/selfhost-runner) only for trusted events, and only while the
# SELFHOSTED_RUNNERS repository variable is 'true': runs-on cannot fall back when none is online.
runs-on: ${{ matrix.os == 'ubuntu-latest' && vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted"]') || matrix.os }}
# Self-hosted runners (scripts/selfhost-runner for Linux, a Mac with the macOS/ARM64 labels) only
# for trusted events, and only while the SELFHOSTED_RUNNERS repository variable is 'true':
# runs-on cannot fall back when none is online. Windows always runs GitHub-hosted.
runs-on: ${{ matrix.os != 'windows-latest' && vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && (matrix.os == 'macos-latest' && fromJSON('["self-hosted", "macOS", "ARM64"]') || fromJSON('["self-hosted", "openidea-selfhosted"]')) || matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
@@ -137,6 +138,12 @@ jobs:
shell: bash
run: |
echo "CARGO_INCREMENTAL=1" >> "$GITHUB_ENV"
# The Linux runner containers set CARGO_TARGET_DIR; elsewhere keep it next to the checkout,
# which actions/checkout cleans on every run.
if [ -z "${CARGO_TARGET_DIR:-}" ]; then
CARGO_TARGET_DIR="$(dirname "$RUNNER_WORKSPACE")/cargo-target"
echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR" >> "$GITHUB_ENV"
fi
size=$(du -sm "$CARGO_TARGET_DIR" 2>/dev/null | cut -f1 || true)
if [ "${size:-0}" -gt 40000 ]; then
echo "$CARGO_TARGET_DIR is ${size} MB; clearing it"
@@ -216,7 +223,7 @@ jobs:
name: Rust checks
needs: [changes, rust]
if: always()
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted"]') || 'ubuntu-latest' }}
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted-light"]') || 'ubuntu-latest' }}
timeout-minutes: 5
steps:
- env:
@@ -327,7 +334,7 @@ jobs:
needs: changes
if: needs.changes.outputs.deny == 'true'
timeout-minutes: 15
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted"]') || 'ubuntu-latest' }}
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted-light"]') || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
@@ -339,7 +346,8 @@ jobs:
needs: changes
if: needs.changes.outputs.frontend == 'true'
timeout-minutes: 30
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted"]') || 'ubuntu-latest' }}
# Chromium and vitest need more CPU than the light runners have; GitHub-hosted runners are faster here.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# scripts/smoke-paths.test.ts runs `cargo metadata`, which is not preinstalled in the runner container.
@@ -366,7 +374,7 @@ jobs:
needs: changes
if: needs.changes.outputs.catalog == 'true'
timeout-minutes: 15
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted"]') || 'ubuntu-latest' }}
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted-light"]') || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
@@ -384,7 +392,8 @@ jobs:
needs: changes
if: needs.changes.outputs.e2e == 'true'
timeout-minutes: 45
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted"]') || 'ubuntu-latest' }}
# Chromium and vitest need more CPU than the light runners have; GitHub-hosted runners are faster here.
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
+1 -1
Переглянути файл
@@ -78,7 +78,7 @@ jobs:
name: Changes
# Self-hosted runners (scripts/selfhost-runner) only for trusted events, and only while the
# SELFHOSTED_RUNNERS repository variable is 'true': runs-on cannot fall back when none is online.
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted"]') || 'ubuntu-latest' }}
runs-on: ${{ vars.SELFHOSTED_RUNNERS == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "openidea-selfhosted-light"]') || 'ubuntu-latest' }}
timeout-minutes: 5
permissions:
pull-requests: read
+10 -8
Переглянути файл
@@ -2,7 +2,7 @@
Runs _N_ persistent, isolated GitHub Actions runners via Docker Compose on a single Docker named volume (`runner-persist`) without requiring repository admin Personal Access Tokens.
In `.github/workflows/ci.yml` and `.github/workflows/language-smoke.yml`, every Linux job routes to `["self-hosted", "openidea-selfhosted"]` on trusted events (`push`, `merge_group`, `workflow_dispatch`, and same-repo pull requests) while the `SELFHOSTED_RUNNERS` repository variable is `true`. Fork pull requests, and every run while the variable is unset, fall back to `ubuntu-latest`. Workflows triggered on `pull_request_target` with write-scoped `GITHUB_TOKEN` permissions (`pr-check.yml`, `cancel-on-close.yml`) stay on `ubuntu-latest`.
In `.github/workflows/ci.yml` and `.github/workflows/language-smoke.yml`, Linux jobs that compile Rust route to `["self-hosted", "openidea-selfhosted"]` and the short jobs that don't (`changes`, `rust-checks`, `deny`, `catalog`) route to `["self-hosted", "openidea-selfhosted-light"]` on trusted events (`push`, `merge_group`, `workflow_dispatch`, and same-repo pull requests) while the `SELFHOSTED_RUNNERS` repository variable is `true`. Fork pull requests, and every run while the variable is unset, fall back to `ubuntu-latest`. `frontend` and `e2e` always run on `ubuntu-latest`: they are CPU-bound and finish faster there. Workflows triggered on `pull_request_target` with write-scoped `GITHUB_TOKEN` permissions (`pr-check.yml`, `cancel-on-close.yml`) stay on `ubuntu-latest`.
> **Availability requirement:** GitHub Actions `runs-on` cannot fall back to GitHub-hosted runners when no matching self-hosted runner is online; jobs stay queued until one connects. Set `SELFHOSTED_RUNNERS=true` (**Settings → Secrets and variables → Actions → Variables**) only once the runners are up, and delete it before taking the host down.
@@ -86,13 +86,15 @@ Run all commands from `scripts/selfhost-runner/`:
You can pass variables on the command line or place them in a local `.env` file in this directory (git-ignored):
| Variable | Default | Description |
| -------------------- | ------------------------------------- | ---------------------------------------------------------------------- |
| `RUNNER_COUNT` | `4` | Number of concurrent runner replicas |
| `RUNNER_NAME_PREFIX` | `openidea-runner` | Runner name prefix; registers as `<prefix>-1`, `<prefix>-2`, … |
| `RUNNER_LABELS` | `openidea-selfhosted` | Comma-separated labels attached to each runner |
| `REPO_URL` | `https://github.com/l0ng-ai/openidea` | Target GitHub repository URL |
| `RUNNER_TOKEN` | _(empty)_ | One-time registration token (required only when registering new slots) |
| Variable | Default | Description |
| -------------------- | --------------------- | -------------------------------------------------------------- |
| `RUNNER_COUNT` | `4` | Number of concurrent runner replicas |
| `RUNNER_NAME_PREFIX` | `openidea-runner` | Runner name prefix; registers as `<prefix>-1`, `<prefix>-2`, … |
| `RUNNER_LABELS` | `openidea-selfhosted` | Comma-separated labels attached to each runner |
A host with little disk can take only the lightweight jobs with `RUNNER_LABELS=openidea-selfhosted-light`; a host that should take both kinds uses `RUNNER_LABELS=openidea-selfhosted,openidea-selfhosted-light`.
| `REPO_URL` | `https://github.com/l0ng-ai/openidea` | Target GitHub repository URL |
| `RUNNER_TOKEN` | _(empty)_ | One-time registration token (required only when registering new slots) |
## Troubleshooting & Tips
+2
Переглянути файл
@@ -7,6 +7,8 @@ services:
restart: unless-stopped
deploy:
replicas: ${RUNNER_COUNT:-4}
# Docker's 64 MB default /dev/shm starves Chromium: e2e pages render slowly enough to time out.
shm_size: 2gb
environment:
RUNNER_SCOPE: repo