CI jobs check out main from a Git mirror on the runner's host
With nerudo-runner's --git-mirror, each batch job gets a read-only mirror of the trunk branch, and nerudo/nerudo's checkout step now fetches only what the mirror lacks: 3 to 4 s instead of 40 to 59 s on the job pages captured.
Recorded product walkthrough
Every CI job of a nerudo/nerudo batch starts with the same step, "checkout exact candidate". It fetches the full history of main and the batch from the forge, so that ancestry checks, native Git tests and gitleaks see the whole graph. For this repository that meant a 417 MiB pack for each of the six jobs in a batch, and 40 seconds or more each time. Those long fetches were also the ones cut off with "Connection reset by peer".
T-374 changes this in two commits. 1b26175 (PR #443) adds --git-mirror to nerudo-runner daemon, in runner version 0.2.2. With it, the runner keeps a mirror of each repository's trunk branch on its host and mounts it read-only into every job of a batch. 7a8bbb4 (PR #444) makes nerudo/nerudo's checkout step use that mirror when the runner provides one. Anyone running their own nerudo-runner with the apple, docker or podman driver can use the flag and point their checkout at the mirror the same way.
All five figures are signed-out captures of production: public job pages under nerudo.dev/nerudo/nerudo/pipelines, shot in headless Chromium.
How it works
With --git-mirror, the runner keeps a bare mirror of each repository whose batches it checks, at WORK-DIR/git/OWNER/REPO.git, using the host's git. When it takes a job of a batch, and before the job's machine starts, it checks whether the mirror's trunk branch already contains the batch's base commit. If it doesn't, the runner fetches that branch from the forge with the job's own token. The token reaches git only through environment variables, never through its arguments or the mirror's config. Git runs without user or system config, so no credential helper can keep the token. The fetch gets at most 300 seconds and a quarter of the job's time. Meanwhile the runner keeps reporting to the forge, which treats a runner silent for a minute as gone. Then git gc --auto packs loose objects.
The mirror is mounted read-only at /git-mirror, and every step gets NERUDO_GIT_MIRROR=/git-mirror. Before its fetch, the checkout step writes $NERUDO_GIT_MIRROR/objects into .git/objects/info/alternates. Git then reads the mirror's objects as its own and downloads only the ones it lacks, which are mostly the batch's own commits. The history stays whole. Only the host writes the mirror, and only while no job machine exists, so no job can change what a later one checks out. If an update fails, the job still runs: its first step's log says why, and its checkout fetches more. Without the variable, on an older runner or the Kubernetes driver (which refuses the flag: a pod has no host directory to share), the step works as before.
What the job pages show

Figure 1 is the qa job of batch #427. That batch landed the runner change but still ran the old checkout step. The job took 1 m 04 s, and 59 s of that was "checkout exact candidate".

Figure 2 is the same job in batch #428, the first batch whose checkout points alternates at the mirror. The checkout took 4 s. The job as a whole still took 48 s, although its three steps add up to 7 s. A job's time runs from the moment a runner picks it up, so it also covers starting the machine and any mirror update before that. The page doesn't break those out, so the figures can't say what filled the gap.

Figure 3 is the qa job of batch #435, the newest at capture time, on the same runner as Figure 1: 12 s in all, 4 s of it checkout.


Figures 4 and 5 are the longer web job, on the other runner, in batches #427 and #435. Its checkout went from 40 s to 3 s. The job itself only went from 6 m 32 s to 6 m 09 s, because building and testing the Worker takes most of it. All six jobs in the graphs start with the same checkout step, but their other steps also vary between batches, so only the checkout rows compare like with like.
Limits
The pages show step times, not bytes. The 417 MiB and 128 KiB numbers are the first commit's own measurement on a runner host with the CI image, the mirror three landings behind main; these captures don't show them.
No job page says that a job used the mirror, because the runner writes a line to the first step's log only when the update fails. The claim that both runners use it is an inference from the checkout times. The step adds the alternates only when NERUDO_GIT_MIRROR is set, and only a runner started with --git-mirror sets it.
Each figure is a single job, and job times vary between batches. The forge's per-job timings are served only to agents and aren't shown.
The mirror holds only the trunk branch. It is used only for jobs that check a batch: a job without a merge group, such as a deploy of main, gets no mirror. Nothing prunes the mirror beyond gc --auto. Removing WORK-DIR/git while the daemon is stopped is safe: the next job copies the repository again.
Walkthrough details
Signed-out headless Chromium captures of nerudo/nerudo's public job pages on nerudo.dev, before and after the two T-374 commits landed: the qa job in batches #427, #428 and #435 and the web job in batches #427 and #435. The pages show step and job times; the runner's mirror update, token handling and read-only mount are described from the code, not observed.
- Open the qa job of batch #427 (the runner change, old checkout step) and read the 'checkout exact candidate' time.
- Open the qa job of batch #428 (the first batch with the alternates line in its checkout step) and read the same step's time and the job's time.
- Open the qa job of batch #435 on the same runner as the batch #427 job and read the step and job times.
- Open the web job of batches #427 and #435 on the other runner and compare their checkout and job times.
Captured · Product view · Verification source