Skip to content

feat: pluggable bootstrap — pre-runner-script + user-data-template#58

Merged
kurok merged 1 commit into
mainfrom
feat/pluggable-bootstrap
Jul 2, 2026
Merged

feat: pluggable bootstrap — pre-runner-script + user-data-template#58
kurok merged 1 commit into
mainfrom
feat/pluggable-bootstrap

Conversation

@kurok

@kurok kurok commented Jul 2, 2026

Copy link
Copy Markdown

Closes #46 — roadmap (#49) Phase 3. Soft-depends on bootstrap diagnostics (#41) for failure attribution.

Problem

The README told non-yum users to "fork and replace the userData array." Forks drift and miss security fixes. Keep the built-in yum bootstrap as the only supported path, but make it pluggable so no one forks.

Two escape hatches

pre-runner-script (the 80% case)

Root snippet injected into the built-in bootstrap before runner config (install docker, mount caches, certs). Runs under set -euo pipefail with its own phase tag → a failure surfaces as failed:pre-runner-script in the fast-fail diagnostics.

user-data-template (full control)

Replaces the bootstrap entirely — repo-relative path or inline string. The action substitutes documented placeholders and submits the result:
{{RUNNER_VERSION}}, {{RUNNER_CHECKSUM_X64}}/{{RUNNER_CHECKSUM_ARM64}}, {{REGISTRATION_TOKEN}}, {{REPO_URL}}, {{LABEL}}, {{TTL_MINUTES}}.

Guard rails

  • Unknown {{...}} tokens error at render (typo protection).
  • Mutually exclusive inputs (config error).
  • 16 KB size guard on the rendered payload.
  • Zero-diff default: neither input set → built-in user-data byte-identical to today.
  • Registration token is rendered into user-data (needed to register) but never logged; the console-capture redaction still scrubs it.

Unfork Ubuntu

examples/user-data/ubuntu.sh.tpl (community-maintained) + examples/user-data/README.md stating the support boundary — the perennial Ubuntu ask becomes "copy one file."

Tests / build

  • renderUserDataTemplate (substitution, repeats, unused-OK, unknown-token error, token rendered), assertUserDataSize (limit + multibyte), pre-runner-script injection (phase tag, before handoff) + default-absent, config mutual-exclusion. 203 tests pass (was 190). Lint clean, dist rebuilt (verify-dist green).

Docs

README top callout rewritten (no more "fork and replace"); "Custom bootstrap" section with placeholder table + support boundary; action.yml inputs.

Not automated

Booting the Ubuntu template on a real 24.04 AMI is a manual checklist item (can't provision EC2 in CI). Rendering + validation are unit-tested.

…nfork Ubuntu et al.)

"Fork and replace the userData array" was a maintenance sentence nobody should
serve. Keep the built-in yum bootstrap as the only supported path, but make the
bootstrap pluggable so any distro/extra-setup need is a template away.

- pre-runner-script (the 80% case): a root snippet injected into the built-in
  bootstrap before runner configuration (install docker, mount caches, certs).
  Runs under set -euo pipefail with its own phase tag, so a failure surfaces as
  failed:pre-runner-script in the diagnostics flow.
- user-data-template (full control): replaces the bootstrap entirely. Repo-
  relative file path or inline string. The action substitutes documented
  placeholders — {{RUNNER_VERSION}}, {{RUNNER_CHECKSUM_X64/ARM64}},
  {{REGISTRATION_TOKEN}}, {{REPO_URL}}, {{LABEL}}, {{TTL_MINUTES}} — and submits
  the result. Unknown {{...}} tokens error at render (typo protection).
- The two inputs are mutually exclusive (config error). Rendered payload is
  size-guarded against the EC2 16 KB limit. Built-in path with neither input is
  byte-identical to today (regression).
- examples/user-data/ubuntu.sh.tpl (community-maintained) + examples/user-data/
  README stating the support boundary — converts the perennial Ubuntu ask from
  "fork" to "copy one file".

Tests: renderUserDataTemplate (substitution, repeats, unknown-token error, token
rendered), assertUserDataSize (limit + multibyte), pre-runner-script injection +
default-absent, config mutual-exclusion (203 tests total). README support-
boundary section replaces the "fork and replace" paragraph; action.yml inputs.

Closes #46

Signed-off-by: kurok <22548029+kurok@users.noreply.github.com>
@kurok kurok merged commit c1c31b8 into main Jul 2, 2026
5 checks passed
@kurok kurok deleted the feat/pluggable-bootstrap branch July 2, 2026 19:34
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.

Pluggable bootstrap: pre-runner-script injection and user-data-template override (unfork Ubuntu et al.)

1 participant