Skip to content

feat: warm up runner images on startup (docker pull / tart pull) #14

@STRRL

Description

@STRRL

Problem

When the controller starts, the first job for each runner set is slow because it needs to pull the container image (Docker) or VM image (Tart) on demand. This adds significant latency to the first job:

  • Docker image pull: can take 30-60+ seconds depending on image size and network
  • Tart VM image pull: can take several minutes for large macOS VM images

Worse, if the image doesn't exist locally (e.g. fresh machine deployment), the first job will fail entirely.

Proposal

Add a warm-up phase at controller startup that pre-pulls all required images before starting the listener loop:

  1. For each docker runner set: docker pull <image> (with --platform if specified)
  2. For each tart runner set: tart pull <image> (if image is a remote reference)

Behavior

  • Run warm-up after config validation but before registering scale sets
  • Log progress: "warming up image" runnerSet=X image=Y
  • Fail fast with clear error if pull fails (e.g. image not found, no network)
  • Skip pull if image already exists locally (check first, pull if needed)
  • Optional: add a --skip-warmup flag for development/testing

Affected Files

  • internal/backend/docker.go — add PullImage(ctx, platform) method
  • internal/backend/tart.go — already has pull logic in Run(), extract to PullImage(ctx)
  • internal/backend/backend.go — add WarmUp(ctx) to Backend interface
  • cmd/elastic-fruit-runner/main.go or internal/controller/controller.go — call warm-up on startup

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions