-
Notifications
You must be signed in to change notification settings - Fork 0
feat: warm up runner images on startup (docker pull / tart pull) #14
Copy link
Copy link
Open
Labels
Description
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:
- For each
dockerrunner set:docker pull <image>(with--platformif specified) - For each
tartrunner 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-warmupflag for development/testing
Affected Files
internal/backend/docker.go— addPullImage(ctx, platform)methodinternal/backend/tart.go— already has pull logic inRun(), extract toPullImage(ctx)internal/backend/backend.go— addWarmUp(ctx)to Backend interfacecmd/elastic-fruit-runner/main.goorinternal/controller/controller.go— call warm-up on startup
Reactions are currently unavailable