Skip to content

actions: runner daemon (T2.1) and tier2 package - #56

Open
calvin-archastro wants to merge 1 commit into
mainfrom
actions/runner
Open

calvin-archastro wants to merge 1 commit into
mainfrom
actions/runner

Conversation

@calvin-archastro

Copy link
Copy Markdown
Contributor

Merge order: after the pail obj PR (feat/obj-cli) for real use. The runner shells out to pail obj; the integration test falls back to a contract fake (tier2/fakepail) when the pail binary has no obj, so CI is green either way.

What

Task T2.1 (runner daemon) and minimal T2.3: pail-actions runner --store URL --labels a,b [--name ID] [--once], speaking the bucket protocol of docs/actions.md sections 5 and 8.

  1. actions/internal/tier2: Go types for every Tier 2 record, path helpers (QueuePath, LeasePath, ResultPath, ...), Store interface, PailStore (pail obj), MemStore (in-memory, with fault injection), FakeClock, fakepail (shell stand-in for pail obj in tests).
  2. actions/internal/runner: poll, claim (create or takeover seq+1 by version match, never delete+recreate), 15 s refresh, loss detection (stops all writes, cancels act), cancel marker, progress, log chunks (64 KB or 2 s) then full.log, result at results/.../<seq>, runners/<id>.json heartbeat. act runs a one-job workflow synthesized from the entry; actions/checkout becomes pail clone --at; act github context comes from the entry.
  3. actions/RUNNER.md: usage, tests, manual docker command and result, what is left.

Contract change

docs/actions.md section 5.1 only adds optional queue entry keys (runs_on, name, container, services, defaults; github.run_number|actor|head_ref|base_ref) and says steps are the YAML step objects verbatim. No existing field changes.

Tests

  1. MemStore unit tests: claim race (8 runners, one wins), takeover bumps seq, live lease not taken, finished job not re-run, refresh failure stops writes only after local expiry, taken-over lease stops writes and leaves the successor's progress alone, cancel marker (before and during), step/skip accounting, log chunking, --once waits and heartbeats.
  2. PailStore contract test against the fake pail obj, same suite as MemStore.
  3. Integration: real act, host mode, file:// store: success, failure, cancel. Skipped without a pail binary.
  4. Docker mode checked by hand (see RUNNER.md).

Not done

Secrets (ignored with a log line), job outputs, artifacts/cache, scaler (T2.2). See RUNNER.md.

🤖 Generated with Claude Code

internal/tier2: Tier 2 record types, key paths, Store interface, PailStore
(shells out to pail obj), MemStore, and a fake pail obj for tests.
internal/runner: queue scan, lease claim/takeover/refresh, cancel, progress,
log chunks, results; act executor with checkout swapped for pail clone --at.
docs/actions.md 5.1: optional job keys on the queue entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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