Subminute CI engineering.moab.com · 86 points · 29 comments · HN thread TL;DR Mo...
HN Best 200 @best
Subminute CI engineering.moab.com · 86 points · 29 comments · HN thread
TL;DR Moab, an ERP company for equipment businesses, migrated its codebase to a monorepo over a weekend in August and brought median CI time under one minute while growing its test count. The post lists the techniques used across four themes: parallelism, caching, hardware, and elimination of unnecessary work. The team says it deliberately runs every unit test on every change rather than predicting which tests are affected.
- Codebase is millions of lines; the initial pytest plus xdist setup on GitHub Actions timed out after 3 hours.
- Parallelism: the app is initialized, frozen and forked per vCPU; tests are split across runners by historical timings and within runners by Longest Processing Time, with hash partitioning for untimed tests.
- Caching: a persistent disk on runners holds a git mirror (shallow fetch only), Docker images and a development database snapshot stored in S3, with migrations applied when a PR contains them.
- Hardware: most jobs use 16 vCPU runners starting in 8 to 12 seconds; two 16 vCPU machines were measured to start faster than one 32 vCPU machine.
- Elimination: lazy imports, skipped garbage collection, dropping xdist for native forking, disabling telemetry and pytest plugins, squashing migrations, and swapping in faster tools such as uv, ruff and oxlint.
- Every check runs as a separate job, and the team considers CI time a proxy for engineering culture because one slow test can degrade the whole pipeline.
Discussion The thread mixes practical CI war stories with a few tangents. Many commenters share their own speedups (from 5 to 20 minutes down to a few, or from 11 minutes to 70 seconds), local or self-hosted runners, and CI vendors and tools. A recurring theme is that CI speed now matters more because agents generate many PRs. Some commenters push back on the metrics and technical choices, such as the use of median time, forking versus threads, and caching trust. The mood is mostly engaged and appreciative, with some skepticism and self-promotion.
- Test quality and test design are the main cause of slow CI (some): Several commenters argue that slow pipelines come from end-to-end tests where unit tests would do, or from repeating tests with random inputs. They say testing gets less care than product code.
- Agents or local infrastructure can replace hosted CI (some): One commenter runs agent-driven attested builds on the same machines they deploy to, reporting about 5 seconds per Docker image. Another runs tests on a local 22-core workstation because cloud VMs are expensive.
- Achieving this speed is useful but GitHub billing limits its value (a few): A commenter notes GitHub bills in whole-minute increments, so going below one minute saves nothing on that platform. Replies respond that developer time is free to count in that trade-off.
- Caching in CI is hard to do safely (a few): One commenter warns that caches can be poisoned when not all code is trusted and that hardware differences complicate builds. Another suggests Dagger as a tool for reproducible pipelines.
- Forking is inferior to threads for Python performance (a few): A commenter argues threads would help native extensions, while others reply that forking is a valid parallelism strategy and that forking after threads is possible but tricky on Linux.
- Rust and compiled codebases are harder to bring under a minute (a few): Commenters doubt a large Rust codebase could match this without remote caching and incremental test selection, though one describes a small, dependency-light setup that compiles quickly.
Links from the comments
- Pipescan, a beta tool for visualizing GitHub Actions pipeline bottlenecks (shared by brennerm)
- Sprinters, a service that provides a fresh ephemeral EC2 instance per CI build, billed per job plus AWS cost (shared by axelfontaine)
- Dagger, a tool for programmable and cacheable CI pipelines (suggested by arialdomartini)