- All playbooks
- Unnecessary work
- Serve checkouts from pre-warmed repository clones
Serve checkouts from pre-warmed repository clones
Keep repository clones warm on a few machines and run Git operations against them, so jobs skip the cold clone.
How Uber used this technique
Read what Uber changed and follow the original sources.
Serve checkouts from pre-warmed repository clones
Translated to GitHub Actions
- What Uber built
- Uber's GitFarm serves checkouts from pre-warmed bare clones, so clients get a full Git checkout in under 500 milliseconds.
- Your GitHub Actions version
- Check out from a pre-warmed repository clone or a shallow fetch, sized to what the job reads.
Cloning Uber's Go monorepo takes roughly 15 minutes and consumes around 6 CPU cores, 32 GB of memory and over 40 GB of disk. GitFarm runs standard Git commands for other services inside ephemeral sandboxes backed by pre-warmed repository checkouts. Each backend keeps one bare clone per repository, updated by push-based events with a fetch every 5 minutes behind them. Clients get a full Git checkout in under 500 milliseconds and no local clone.
Uber reports that clients get a full Git checkout in under 500 milliseconds, and services no longer suffer cold starts of 10-15 minutes due to initial clones on each host. Source
Uber reports a CODEOWNERS service's startup time going from 15-20 minutes to under 1 minute, and its CPU from over 70 cores to 16 cores, after switching to GitFarm API calls. Source
- Use it when
- Many jobs or services clone the same large repository, and each pays for the clone and adds load on the Git server.
- Before applying it
- Freshness is eventually consistent with the upstream repository, so let a caller ask for the latest state when a job needs it.
- GitHub Actions adaptation
- Compare the source system with your own workflow before applying this translation.
Company Playbooks
- Read Anthropic’s playbookRun only affected tests
- Read DoorDash’s playbookRun build and test in parallel, sharded across CI agents
- Read Linear’s playbookBenchmark the same job on faster hardware
- Read Mastra’s playbookStarSling runners for the slowest test workflow
- Read OpenAI’s playbookRank CI fixes by the minutes they save
- Read Ramp’s playbookMove a CPU-bound test suite to a faster CPU
- Read Shopify’s playbookLet an agent iterate against one CI metric
- Read Spotify’s playbookBuild arm64 on native arm64 runners
- Read Stripe’s playbookRun only the tests a change can reach
- Read Uber’s playbookBuild the merge-queue speculations most likely to be needed