Skip to content

Latest commit

 

History

History
471 lines (401 loc) · 25 KB

default-runner-templates.md

File metadata and controls

471 lines (401 loc) · 25 KB

Public runner templates

中文

Qiniu maintains eight physical Linux x64 Sandbox templates for GitHub Actions: four standard images (Ubuntu Slim, Ubuntu 22.04, Ubuntu 24.04, and preview Ubuntu 26.04) plus four -large variants with an 80-GiB release minimum for available space. ubuntu-latest is a logical runner catalog mapping to Ubuntu 24.04, not a ninth image.

The four standard physical templates were published, catalog-checked, and release-smoke verified in both supported Sandbox regions on 2026-08-03. The regional IDs and evidence are retained in Issue #38. The managed Runner Spec rollout was end-to-end verified on 2026-08-04 CST by GitHub Actions run 30858489153: all five logical labels completed successfully, all five runner requests reached completed, every Sandbox was cleaned, and no self-hosted runner registration remained. See templates/README.md for pinned upstream provenance, the compatibility contract, and per-image differences.

The 2.337.0 refresh rebuilt all eight physical templates in both regions and verified both the standard and large workflow matrices on 2026-09-21. The catalog and production evidence are retained in Issue #93.

Ubuntu release smoke requires 20 GiB available on standard templates and 80 GiB on large templates (runnerd.min_free_disk_mb). Qshell 2.21.0 applies min_free_disk_mb on every build, including same-name rebuilds, using the configured release minimum. Publish and catalog checks use the release minimum as a lower bound on total disk size. Verify available space in a fresh Sandbox before publication.

Each standard source directory also contains a qshell.sandbox.large.toml for its -large variant. Standard and large configs reuse the same Dockerfile and scripts while using distinct physical template names. The large variants are documented operator-configured Runner Specs: operators create and enable them in Admin, using either a stable public name or an explicit physical template ID. Public directory inclusion additionally requires a verified public template (name or physical ID) and explicit catalog display. Qshell v2.21.0 template build options.

All eight qshell configurations across the four source directories use templates/ as the build context. The Dockerfiles copy shared setup functions and helper scripts from templates/common/, while each standard image retains its Ubuntu-specific steps. templates/common/actions-runner.env is the single source for the Actions Runner version, Linux x64 archive checksum, and archive size. It is copied only before the runtime phase so version upgrades reuse earlier provisioning layers. Build tasks download and verify the official archive on the operator's machine, then qshell uploads sixteen small COPY chunks. Verified chunks remain stable across concurrent build tasks. The remote builder reassembles them and verifies the complete SHA-256 in the same RUN as runtime installation, including cache-resumed builds. The checked local archive is cached under .build/; the chunks under templates/common/.build/ are ignored by Git. The pin is the image's preinstalled bootstrap baseline. Public-name specs use that copy directly; the regular template rebuild process advances it. Private-ID specs use a separate registration preflight: runnerd resolves and validates GitHub's official application descriptors for the Runner platform (Linux, or Windows when the spec labels include windows), and a stale Sandbox downloads, checksum-verifies, extracts, and version-verifies the selected archive before config.sh. Both paths leave GitHub's official self-update enabled after registration. The 2.337.0 baseline completed the two-region, eight-template rebuild, catalog, standard workflow, and large workflow gates recorded in Issue #93. common/ is source code, not a physical Sandbox template.

Automated Runner baseline update PRs

Fenno is the sole scheduled writer of Runner baseline upgrade PRs. The root .fennoai.yml requests a daily run at 09:00; confirm the repository scheduler uses Asia/Shanghai before activation. The scheduled agent follows maintain-actions-runner, uses the supplied task identity, and restores state from GitHub on each run. Configure one active maintenance task and verify the runtime's GitHub contents/PRs/Actions/Issues permissions, Node.js 24, Go, Task, jq, Docker and gh. A merged configuration alone is not evidence that the Fenno service is enabled.

scripts/update-actions-runner-pin.mjs reads the latest stable actions/runner release and validates both canonical Linux x64 .tar.gz and Windows x64 .zip assets. It rejects drafts, prereleases, downgrades on either platform, missing/duplicate assets, malformed metadata, and archives above 256 MiB (the Linux sixteen-chunk ceiling). Each changed archive is streamed with a five-minute deadline, a declared-size bound and SHA-256 verification. All changed assets are verified before either pin is written. Same-version metadata drift fails closed; a verified no-op downloads neither archive.

The updater writes the shared Linux pin and only the three RUNNER_WIN_X64_* fields in templates/github-runner-windows-11/template.env, preserving other Windows tool pins. It can bring an older Windows pin up to the already-current Linux baseline. Each file replacement is atomic; an observed second-write failure restores the first file. A process crash is not a cross-file transaction: discard partial task changes and regenerate from verified remote state before committing. For offline tests, use --release-json, --asset-file, --windows-asset-file, --pin-file, and --windows-pin-file together.

After a change, regenerate templates/runner-images-compatibility.json, run task template-check-all and the Windows/common pin consistency test, and inspect the three-file allowlist. Fenno maintains the single automation/actions-runner-update PR, protects branch updates with an explicit lease, and leaves review and merge to humans. Identical proposals keep their existing SHA. Both Check (check.yaml) and Template Check (template-check.yaml) must pass for the current PR head. Query all matching runs for each workflow, regardless of status, and dispatch that workflow only when none exists. Follow queued/running checks and reuse successful runs of the same workflow. Failed, cancelled or timed-out runs require diagnosis; they never count as absent. Deterministic or unclassified failures do not trigger replacement runs on subsequent days; only a diagnosed transient error permits a bounded retry of the existing run. A failed maintenance check is recorded without daily duplicate comments; maintenance tool fixes use a separate PR instead of relaxing verification.

.github/workflows/actions-runner-update.yaml remains a manual, read-only verification fallback. It has no cron, branch push, PR mutation or Sandbox credentials, so it cannot race Fenno for branch ownership. Its summary reports the validated version and whether changes would be required. Template Check runs the disk-gate regression, which isolates mock disks from the host's /etc/environment PATH.

The digest comparison establishes consistency with GitHub release metadata, not independent provenance; human PR review remains the merge trust boundary. After merge, the agent creates or reuses a versioned promotion record and links it to the first-upgrade acceptance Issue when applicable. Unchanged runs stay quiet; closing the initial acceptance Issue does not stop future maintenance.

Source automation receives no Sandbox credentials and cannot build, publish, unpublish or roll back templates. An operator uses the existing local Task targets to rebuild all eight Linux templates in both regions, run real Sandbox smoke, publish them, verify catalogs, and retain standard/large production Job evidence. Windows pin synchronization does not add Windows production promotion to that Linux acceptance checklist. Keep production credentials in the operator's shell and stop for review on uncertain outcomes.

Activation and acceptance

Before merging the schedule migration, confirm Fenno's repository access, timezone, one-task concurrency and execution budget; removing the old cron without enabling Fenno leaves no periodic check. After merge, retain the actual Fenno run links for no-op, changed, failure recovery and repeated-run behavior. Local fixture tests validate the updater, not the external scheduler or live PR permissions. The first real upgrade remains incomplete until the reviewed source PR and regional template/production Job evidence are both available.

Public catalog API

GET /api/public/runner-templates is available to signed-out and signed-in clients. Overlapping origin requests share one database read. The next request after it completes reads the catalog again. HTTP clients and proxies may cache a successful response for 60 seconds. The response groups enabled, published public-name specs in stable order and contains only these fields:

[
  {
    "default_template_name": "github-runner-ubuntu-24-04",
    "runner_spec_names": ["qiniu-ubuntu-24.04", "qiniu-ubuntu-latest"],
    "workflow_labels": [
      ["qiniu", "ubuntu-24.04"],
      ["qiniu", "ubuntu-latest"]
    ]
  }
]

The example shows one entry; the count depends on Admin configuration. Private bindings and unpublished/disabled entries are omitted, including private large specs. Published public-name large specs may appear. Provider IDs, regions, credentials and endpoints are always excluded. Provider-visible templates remain behind the credential-bound, account or organization scoped GET /user/sandbox/templates?region=<id> API. The two catalogs load independently. See Platform Runner Specs.

Workflow labels

Use the exact pair for the requested environment:

jobs:
  slim:
    runs-on: [qiniu, ubuntu-slim]
    steps:
      - uses: actions/checkout@v4
      - run: uname -a

  ubuntu_22:
    runs-on: [qiniu, ubuntu-22.04]
    steps:
      - uses: actions/checkout@v4
      - run: uname -a

  ubuntu_24:
    runs-on: [qiniu, ubuntu-24.04]
    steps:
      - uses: actions/checkout@v4
      - run: uname -a

  ubuntu_26_preview:
    runs-on: [qiniu, ubuntu-26.04]
    steps:
      - uses: actions/checkout@v4
      - run: uname -a

  latest:
    runs-on: [qiniu, ubuntu-latest]
    steps:
      - uses: actions/checkout@v4
      - run: uname -a

The public large defaults use the same contract and resources and require 80 GiB available at release:

Workflow label Physical template Available space required at release
[qiniu, ubuntu-slim-large] github-runner-ubuntu-slim-large 80 GiB
[qiniu, ubuntu-22.04-large] github-runner-ubuntu-22-04-large 80 GiB
[qiniu, ubuntu-24.04-large] github-runner-ubuntu-24-04-large 80 GiB
[qiniu, ubuntu-26.04-large] github-runner-ubuntu-26-04-large 80 GiB
[qiniu, ubuntu-latest-large] github-runner-ubuntu-24-04-large 80 GiB

ubuntu-latest-large is a logical public label mapped to the Ubuntu 24.04 large physical template; it does not add a fifth physical large image. These large specs are usable once their Admin entries are enabled and their labels accept the workflow. Public directory inclusion additionally requires a verified public template (name or physical ID) and explicit catalog display.

All specs enforce required_labels ⊆ job_labels ⊆ labels. Keep qiniu plus the exact OS label required for the standard examples; partial or unsupported extra labels must not match. Administrators maintain these fields, enablement and capacity in Admin. Physical image builds and catalog/runtime smoke remain separate release steps.

At bootstrap, public-name specs fail closed if Docker cannot become available. Private-ID specs retain best-effort Docker setup so non-Docker jobs can run. These existing behaviors follow the template binding and are not new admin settings.

Software compatibility

These templates track the pinned actions/runner-images reports item by item, but they are not byte-for-byte GitHub-hosted runner images. Earlier standard regional templates had roughly 22,222-MiB root disks. The complete GitHub-hosted runner inventory exceeded that allocation. The three versioned templates guarantee the Ubuntu Slim-compatible core on the requested Ubuntu release, plus Apache, Podman, Buildah, Skopeo, Ninja, Docker support, pinned Pester for installer validation, the preinstalled Actions runner, and the runner filesystem contract.

templates/runner-images-compatibility.json is the executable item-level contract. provided means release conformance must verify the item. excluded means the public template does not guarantee it; install the tool in the workflow or build a custom Sandbox template when it is required. An excluded executable might be present through an OS package dependency, but workflows must not rely on it.

Requirements

  • qiniu/qshell 2.21.0 or newer;
  • Node.js 24, plus task, jq, curl, sha256sum, and split on the build host;
  • a QINIU_API_KEY for the selected Sandbox region;
  • QINIU_SANDBOX_API_URL set to that region's endpoint.

If the required qshell is not on PATH, pass its executable explicitly:

task template-build-ubuntu-24-04 QSHELL=/path/to/qshell

Every remote target fails closed when either credential variable is empty. The tracked standard and large TOML files contain stable names and resource settings; qshell builds from temporary copies of the selected files. In qshell 2.21.0, template_id selects a base template, like from_template. For older local configs, remove any self-referencing template_id written by qshell and retain name as the target. Windows uses from_template = "windows11" as its base.

Build and verify one region

Run the fast, credential-free source checks first:

task template-runner-update-test
task template-check-all

Then build the actual Sandbox templates with qshell. Each target waits for qshell to report terminal Status: ready; if its wait stream exits early, the helper queries the exact Template ID and Build ID for up to five more minutes. It succeeds only when that build reaches ready or uploaded, and fails immediately when the exact build reaches a terminal error. If reconciliation ends while the build is still active, use the printed qshell sandbox template builds <template-id> <build-id> command to inspect it without starting another rebuild. If exact status queries remain unavailable, the helper prints the last qshell error before that inspection command.

The source gate rejects Actions Runner versions below 2.337.0. Release smoke checks the exact common-pinned preinstalled Runner version and the template name/version persisted into the Sandbox runtime environment. The effective Runner version may be newer after GitHub's official self-update and is verified separately from the immutable template baseline. This release smoke covers managed templates; custom-template acceptance instead expects the preinstalled and effective versions to differ when registration preflight upgrades a stale baseline. Release smoke also loads NVM as the runner user and requires /home/runner/.nvm to be writable, preventing a root-owned build skeleton from passing the release gate. Full runtime conformance also checks the exact pinned Azure CLI version, so Dockerfile versions, official checksums, and compatibility verification must be updated together. Python and pipx installation has bounded retries for transient package-index failures; other upstream installers are not retried automatically because they may not be idempotent. pipx is installed in the isolated /opt/pipx-bootstrap virtual environment, exposed through /usr/local/bin/pipx, while tools retain /opt/pipx and /opt/pipx_bin. This avoids pip attempting to uninstall apt-owned Python dependencies without a RECORD file. Run task template-python-test for the Docker/network regression against the pinned Ubuntu 26.04 rootfs and upstream installer; regional build and smoke verification remain separate.

task template-build-all
task template-build-ubuntu-slim
task template-build-ubuntu-22-04
task template-build-ubuntu-24-04
task template-build-ubuntu-26-04
task template-build-ubuntu-slim-large
task template-build-ubuntu-22-04-large
task template-build-ubuntu-24-04-large
task template-build-ubuntu-26-04-large

The regional batch builds the eight Ubuntu templates with up to four builds in flight. Add INCLUDE_WINDOWS=1 to include the Windows 11 preview, or set BUILD_CONCURRENCY=1 to run one at a time (valid range 1–9). The batch controller requires Python 3.11+ on a Unix build host.

task template-build-all BUILD_BATCH=nov-refresh INCLUDE_WINDOWS=1

Run the command in the shell where you exported the regional QINIU_SANDBOX_API_URL and QINIU_API_KEY. Every build and status query inherits them.

Repeat the same command to resume. The batch checks the saved Template ID and Build ID with qshell, waits for outstanding attempts and skips successful matching builds after checking the current catalog. A failed build is retried on the next run. Changes to a template's build inputs trigger a fresh build. Use a new BUILD_BATCH label for a periodic refresh with unchanged inputs. The default label is default. Receipts track the most recent attempt for each name and endpoint in this clone's Git common directory, shared across its worktrees. Each endpoint allows one batch controller at a time. Coordinate single-template commands and builds from other clones separately.

Status queries retry transient errors within the wait deadline (default 3600 seconds per build, configurable via the BUILD_WAIT_SECONDS environment variable). A response with mismatched IDs stops the batch immediately. After a query deadline expires, rerun the same batch.

If qshell fails or is interrupted before reporting both IDs or confirming Build started, the batch stops and reports the receipt path for inspection. A build registered without that confirmation is recorded as requested; reruns report it immediately. Check the regional build history and resolve any active or waiting attempt before moving its receipt outside the receipts directory and rerunning. Renaming it to another *.json within that directory still includes it in reconciliation. Older receipts may record a never-started build as pending; if it remains waiting, apply the same inspection procedure. Confirmed failed builds are retried without querying their old build again. A successful batch still requires the separate regional smoke and publication steps.

If an existing template falls short of the free-space target, rebuild it by name with qshell 2.21.0 to apply its configured request. Contact the provider if quota limits reject the request. Once qshell reports Status: ready, verify the total disk and use release smoke on that ID to check available space before publishing.

The Dockerfiles keep bootstrap, platform, node, toolchain, and runtime work in separate qshell-compatible cache layers where applicable. Template version metadata is applied after provisioning, and the runner-owned NVM copy is isolated between toolchain and runtime, so either change keeps the heavy installer layers reusable. After those layers, each Dockerfile writes the final /etc/resolv.conf with Cloudflare 1.1.1.1 and 1.0.0.1 before switching to the unprivileged runner user. Keeping this override late avoids invalidating the heavy provisioning layers. Release smoke checks the exact two-line resolver file in a real Sandbox before publication. Before platform, each Dockerfile downloads the checksum-pinned AWS SAM archive in independent 16 MiB-or-smaller Range layers. Completed chunks remain cacheable across a service timeout under /opt/qiniu-runner-build-cache; qshell does not restore cached /tmp outputs. The Dockerfile checks the assembled byte count and full SHA-256 digest, then runs the platform installer in the same layer. The checked oversized archive is consumed immediately and never becomes a cache output. Ubuntu 26.04 additionally preinstalls the pinned runner-images apt package list in eighteen cacheable batches before the upstream platform installer rechecks the packages and runs its Pester contract. Large emoji-font, ICU, RPM, Tk, Xvfb, binutils, and systemd-coredump dependency sets are isolated, and the final batch is open-ended so appended pinned packages are not skipped. If a remote build reaches the service time limit after completing an earlier layer, rerun the same command with the normal cache enabled. Do not force --no-cache; before smoke, verify that the build reached terminal Status: ready.

Use the Template ID from each ready build to run Sandbox smoke before publishing:

task template-smoke IMAGE_KEY=ubuntu-slim TEMPLATE_ID=<slim-template-id>
task template-smoke IMAGE_KEY=ubuntu-22.04 TEMPLATE_ID=<22.04-template-id>
task template-smoke IMAGE_KEY=ubuntu-24.04 TEMPLATE_ID=<24.04-template-id>
task template-smoke IMAGE_KEY=ubuntu-26.04 TEMPLATE_ID=<26.04-template-id>
task template-smoke IMAGE_KEY=ubuntu-slim-large TEMPLATE_ID=<slim-large-template-id>
task template-smoke IMAGE_KEY=ubuntu-22.04-large TEMPLATE_ID=<22.04-large-template-id>
task template-smoke IMAGE_KEY=ubuntu-24.04-large TEMPLATE_ID=<24.04-large-template-id>
task template-smoke IMAGE_KEY=ubuntu-26.04-large TEMPLATE_ID=<26.04-large-template-id>

Smoke creates a temporary Sandbox with qshell and checks the OS release, architecture, preinstalled Actions runner, outbound HTTPS, Docker daemon, writable work/tool-cache paths, runtime root disk size, and cleanup. Release smoke checks both total capacity and available bytes on the root filesystem. Preserve the emitted JSON paths as release evidence. The full compatibility manifest remains the static inventory contract; per-entry runtime conformance is an optional diagnostic and does not block the release usability gate. The Docker check imports and runs a local minimal root filesystem with networking disabled. Registry reachability is not part of the daemon check; outbound HTTPS is verified independently.

After all eight IDs pass smoke, publish the templates and verify the public catalog:

task template-publish-ubuntu-slim
task template-publish-ubuntu-22-04
task template-publish-ubuntu-24-04
task template-publish-ubuntu-26-04
task template-publish-ubuntu-slim-large
task template-publish-ubuntu-22-04-large
task template-publish-ubuntu-24-04-large
task template-publish-ubuntu-26-04-large
task template-defaults-check

template-defaults-check requires exactly one public ready or uploaded template with a nonempty ID for every physical name, including the four large variants. It rejects missing and duplicate catalog entries, a standard template whose total diskSizeMB is below 20,480 MiB, or a large template whose total diskSizeMB is below 81,920 MiB.

Local Docker builds and task template-conformance-local remain optional diagnostic tools. They are not substitutes for qshell template builds or Sandbox smoke.

First release in both regions

Complete the whole build, smoke, publish, and catalog sequence in this order:

  1. Export QINIU_SANDBOX_API_URL=https://cn-yangzhou-1-sandbox.qiniuapi.com and the Yangzhou QINIU_API_KEY.
  2. Build the four standard and four large templates. Run smoke on each rebuilt ID and verify total capacity before publishing. Then run task template-defaults-check to verify the eight public catalog entries.
  3. Retain the build output, catalog IDs, smoke JSON, and relevant workflow URL.
  4. Export QINIU_SANDBOX_API_URL=https://us-south-1-sandbox.qiniuapi.com and the US South QINIU_API_KEY.
  5. Repeat the builds, smoke checks, publication, and catalog check.
  6. Confirm both catalog results contain one runnable public entry for every physical stable name.
  7. Attach both-region evidence to Issue #38 before marking the template rows verified or enabling the separate managed-runner rollout.

Qiniu owns the eight physical images. ubuntu-latest changes only through a reviewed runner catalog revision with new regional smoke evidence. ubuntu-26.04 remains preview until upstream promotes it.

Rollback

Disable the managed Runner Specs and any enabled large custom specs before removing public availability. Then run the matching reversible publication rollback:

task template-unpublish-ubuntu-slim
task template-unpublish-ubuntu-22-04
task template-unpublish-ubuntu-24-04
task template-unpublish-ubuntu-26-04
task template-unpublish-ubuntu-slim-large
task template-unpublish-ubuntu-22-04-large
task template-unpublish-ubuntu-24-04-large
task template-unpublish-ubuntu-26-04-large

Do not delete template objects during an ordinary rollback. Keeping them private preserves build history and allows a reviewed version to be republished without changing custom Runner Specs.