Adopt Forgejo 16 run cancellation for stale-job reaping #621

Open
opened 2026-07-24 06:20:47 +00:00 by coilyco-ops · 0 comments
Member

Blocked by coilyco-flight-deck/infrastructure#620.

Goal

Infrastructure adopts Forgejo 16's workflow run cancellation API and adds an out-of-band stale-job reaper for Forgejo Actions jobs that stop making progress.

Runner topology

  • The general pool runs one job per Docker-in-Docker runner.
  • The image-build pool runs up to four jobs against shared Docker-in-Docker and BuildKit services.
  • The deploy runner uses host mode and needs an explicitly coarser fallback.

Work

  • Infrastructure defines an activity lease from CPU, block I/O, network I/O, container events, and log progress. CPU idleness alone must not classify a job as stuck.
  • Infrastructure maps each Forgejo task and run to the correct job container.
  • The reaper requests cancellation through the Forgejo API first, waits through a bounded grace period, and kills only the mapped job container as a fallback.
  • The reaper never kills a shared Docker-in-Docker daemon, BuildKit service, or runner daemon.
  • Infrastructure defines separate thresholds for general jobs, image builds, and deploy jobs.
  • Infrastructure ships dry-run mode, structured audit output, and an alert before enforcement.
  • Tests exercise active low-CPU work, genuinely stalled work, shared-builder contention, cancellation failure, and fallback cleanup.
  • The operator performs live verification against each runner topology before enabling enforcement.

Done

  • A stalled job is cancelled without taking unrelated jobs or shared services down.
  • Legitimate low-CPU or long export work renews the activity lease.
  • Every cancellation records the run, job, reason, evidence, and cleanup result.
  • The operator can disable enforcement without redeploying the runner fleet.
Blocked by coilyco-flight-deck/infrastructure#620. ## Goal Infrastructure adopts Forgejo 16's workflow run cancellation API and adds an out-of-band stale-job reaper for Forgejo Actions jobs that stop making progress. ## Runner topology * The general pool runs one job per Docker-in-Docker runner. * The image-build pool runs up to four jobs against shared Docker-in-Docker and BuildKit services. * The deploy runner uses host mode and needs an explicitly coarser fallback. ## Work * Infrastructure defines an activity lease from CPU, block I/O, network I/O, container events, and log progress. CPU idleness alone must not classify a job as stuck. * Infrastructure maps each Forgejo task and run to the correct job container. * The reaper requests cancellation through the Forgejo API first, waits through a bounded grace period, and kills only the mapped job container as a fallback. * The reaper never kills a shared Docker-in-Docker daemon, BuildKit service, or runner daemon. * Infrastructure defines separate thresholds for general jobs, image builds, and deploy jobs. * Infrastructure ships dry-run mode, structured audit output, and an alert before enforcement. * Tests exercise active low-CPU work, genuinely stalled work, shared-builder contention, cancellation failure, and fallback cleanup. * The operator performs live verification against each runner topology before enabling enforcement. ## Done * A stalled job is cancelled without taking unrelated jobs or shared services down. * Legitimate low-CPU or long export work renews the activity lease. * Every cancellation records the run, job, reason, evidence, and cleanup result. * The operator can disable enforcement without redeploying the runner fleet.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/infrastructure#621
No description provided.