NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
▲Subminute CI (engineering.moab.com)
brennerm 4 days ago [-]
Quick shameful plug because it fits the topic very well. I'm currently building pipescan, a tool to gather insight about your CI pipelines and visualize the data. The goal is to easily identify the jobs/step that yield the most potential for improvements.

It's currently in beta and only supports Github Actions, but I'm actively working on supporting other CI systems such as Gitlab CI, Jenkins, etc.

Have a look at the demo and feel free to give a try with your repo.

Site: https://pipescan.shipit.dev/ Demo: https://pipescan.shipit.dev/demo

phil-martin 4 days ago [-]
That sounds awesome!

Related only that it’s also a shameful plug (sans links because I don’t have any)

I’ve built a proof-of-concept CI yaml compiler that converts it all into runnable nodes that track dependencies appearing it to figure out and flag where there are missed opportunities for parallelism

Once it has this new compiled DAG a schedule goes and sends out the work across available build agents, using a scheduler that continually measures and optimises for earliest completion time or whatever metric matters to you

It sounds like wasted effort but the ability to dynamically prioritise at a broad or granular level, and to not depend on the CI systems scheduler, and control how results are cached has been a really big deal for us

hgo 3 days ago [-]
Looks completely great! Thank you for sharing. I'm not on GHA right now, so can't try it yet. Hope to get notified when support comes.
brennerm 3 days ago [-]
Which CI provider are you looking for?
hgo 3 days ago [-]
Gitea. (It uses a GHA clone, I think. Selfhosted.)
bravura 4 days ago [-]
Support blacksmith.sh?
brennerm 4 days ago [-]
AFAIK they just provide the runners that Github Actions will put your pipelines on. So the CI provider is still Github Actions which is supported. (y)
bobjordan 4 days ago [-]
My main project now has a pytest suite with over ~75,000 tests. I had to shut off the github actions and just rely on using a local 10+yr old workstation with an Intel Xeon E5-2696 v4 with 22 cores and 44 threads for our testing. Paying for a VM with similar compute is priced nuts right now while this system can be built for hundreds of dollars. This local test rig is constantly utilized and well worth the one-time investment.
satvikpendem 3 days ago [-]
Can you move to more modern test suites for Python like rustest, pyrn or maelstrom? They are in Rust and can cut your wall clock time significantly, due to other optimizations than just their programmed language.
ddorian43 2 days ago [-]
Just because it's rust doesn't mean it's fast, example being maelstorm. rusttest doesn't have hooks/plugins/etc.

pyrn looks interesting, I've done some of it's optimizations on top of pytest.

rienbdj 3 days ago [-]
Do you impact every test on every PR? Bazel may help if not.
alexgandy 3 days ago [-]
I just did something similar, except I had a little Beelink SER5 PRO Mini PC sitting around. I set up GARM with Incus containers and was off and running...basically all Github actions for my side project https://gaffer.sh are faster and free now.
javier123454321 3 days ago [-]
Woodpecker?
theaniketmaurya 3 days ago [-]
[dead]
teiferer 4 days ago [-]
In my experience, a major reason for CI slowness is that people are just terrible at writing tests. End-to-end style tests that could just be super fast unit tests. And run a test 1000x with random input "just in case" as if that helps. If as much thought would go into testing as the product code then testing would be much better and also much faster. But testing is still treated as the thing the new hire writes, or some low-effort LLM and you just merge it. Of course it ends up terrible with that attitude.
shoo 4 days ago [-]
> run a test 1000x with random input "just in case" as if that helps

if the code being tested does something interesting is responsible for processing variably sized inputs that can encode a variety of different situations, if you're throwing randomly generated inputs at broken code, the broken code may succeed for 10,000 random inputs but only start to fail & give you a clue that the defect exists once you throw 100,000+ inputs at it. i've seen this happen a few times when working on domain specific graph algorithm type stuff, where the inputs are some kind of annotated graph & defects only manifest when the input has a graph with a particular topology.

still, probably not worth it to run 10,000+ random inputs each time CI runs -- maybe better to have a protocol of manually doing a run of 100,000 or 1000,000 random test cases whenever someone modifies that code & if that surfaces any cases that cause their proposed change to fail, capture those specific counterexamples to be re-run every build.

could probably be streamlined with sufficiently clever logic to figure out the subset of tests that need to be run for any given code change. most of the time you're not modifying the guts of subsystems like this so running any of its tests is waste.

teiferer 3 days ago [-]
Thanks for this example because it is exactly one of the things I mean. I do think this is the wrong approach.

You need to think hard to drive your code into all those dark corners deterministically with your tests. Sometimes that involves factoring your code with testing in mind, ideally from day 1. And yes, you need to think and work hard for it, at least as hard as coming up with the implementation itself.

Just throwing 100,000+ random inputs at it is basically giving up, crossing fingers and hoping for the best. That's exactly what makes such test suites slow, unreliable, and in the end you get less confidence in the product's quality than you think.

Unfortunately this attitude is quite prevalent in our industry.

slimski 3 days ago [-]
Mobile has its own specifics. Especially iOS. Build and tests only run on macOS. Running tests also requires launching a simulator and uploading the build there. All of these take time.

For example, I have 2 small apps where I'm also trying to save money. So I use Xcode Cloud to run it. Just build takes about a minute. Then launching and running just unit tests take another 2. But if I add UI tests, it would be an extra 5-10 minutes.

Kinrany 4 days ago [-]
I'm surprised they measure the median time. It would be a very bad CI setup if 60% of runs were taking one second and 40% were taking one hour.
jayyhk 4 days ago [-]
One of the post authors here.

The metric we used is the median (P50) of the critical path time (aka the amount of time it takes all required checks to complete).

P50 is a good metric, because CI time varies little between runs. In practice, P50, P90, and P95 often end up being the same.

KneeAwn 4 days ago [-]
Wouldn’t you want P90 or P95 for when those times aren’t the same?
sbysb 4 days ago [-]
P90/95 might make the better internal measure, but I bet they use p50 because it hits 1 minute and is a better blog title. If you are choosing between p90 at 1:30/ P95 at 2:15 or p50 at 0:58 - one of these makes a much more eye catching article title
xishi 3 days ago [-]
The post links to a video of Boris Cherny citing Claude Code's p50 CI time.
anamexis 3 days ago [-]
OK?
anon7000 3 days ago [-]
Not true if you determine what runs based on affected projects, like in a monorepo. Some projects can have thousands of heavy end to end tests and others barely one or two unit tests
xishi 4 days ago [-]
median != mean
8n4vidtmkvmk 3 days ago [-]
Correct
iveqy 4 days ago [-]
caching in a CI is terribly hard to do correct. Specially if you can't trust all code starting a CI run. It's really easy to end up with poisonous cache.

Apart from that managing hardware bugs is a pita. Your build manifest should be able to tell which hardware built what code, I bet most cache solutions can't share that information.

arialdomartini 4 days ago [-]
You might like https://dagger.io/
binsquare 4 days ago [-]
+1, i like dagger
iveqy 3 days ago [-]
thanks, but how does it solve my problems?
vodol 4 days ago [-]
[dead]
jwilliams 4 days ago [-]
One other approach I’ll throw in the mix too: Using git trailers to avoid repeated work. https://jonathannen.com/abusing-git-trailers/
IshKebab 4 days ago [-]
That seems... pretty janky to be honest. Not compatible with merge queues (which should be the default). The way it should really work is you have an accurate build graph with sandboxing and cache the results. Basically Bazel, Buck2, etc. Then when your agent runs tests the results get cached, and when CI does it again it uses the cache... but it also works if something has changed.
jwilliams 4 days ago [-]
I wouldn't disagree - the post calls it a poor man's Bazel. Jumping to Bazel isn't always a natural increment though, and the trailer works for things outside the build graph too. It works well for our case.
whateveracct 3 days ago [-]
buck2 is pretty neat
derinbay 3 days ago [-]
the line about one engineer being able to slow the whole thing down with a few bad tests is the part i'd underline. i co-founded a test platform team at my last company, and in my experience getting ci fast was the easy part, keeping it fast after a few months of everyone adding tests was the hard part.
tamentis 3 days ago [-]
You need to get to a place where you can throw money at it and add more cores to the problem.
satvikpendem 3 days ago [-]
It's an AI slop comment you're replying to, check their other recent comments.
derinbay 3 days ago [-]
[dead]
satvikpendem 3 days ago [-]
You went from posting all the way back in 2019 to now using AI for all "your" comments. Running lowercase() doesn't mean we can't tell.
martin_drapeau 4 days ago [-]
Just did a similar thing for Laravel + Vue. CI runs on a dedicated AWS instance, builds assets and publishes them to CDN, runs smoke tests (headless browser) and then lets Laravel Forge deploy to web servers. Down to 5 minutes. I would love to bring that down further.
axelfontaine 4 days ago [-]
If you want to go further down this route, we built Sprinters (https://sprinters.sh) where you get a fresh ephemeral EC2 instance for each build at $0.01/job + AWS cost (you bring your own account).
codynaut 3 days ago [-]
[dead]
helsenki 4 days ago [-]
[dead]
esafak 4 days ago [-]
How do you get subminute runs on Github Actions ? It's barely working as we speak: https://www.githubstatus.com/incidents/121bhnw0ptrb
4 days ago [-]
globuous 3 days ago [-]
Very interesting. I'm really struggling to get fast CI's, really, really am. I see that you're throwing 16vCPU machines per job. I assume you've gone from 3h for your pytest-xdist jobs to sub minute on the same hardware? Could we have information on your aggregate CPU time, and/or the number of tests (and the proportion of database dependent tests) and/or your monthly CI bill? Thanks!
ddorian43 3 days ago [-]
I'm pretty advanced on python/pytest-xdist stack and available for contracting if you're interested. I squeezed a test suite because I need to keep agents happy and run the full test suite locally across multiple worktrees. Scales linearly & efficiently with number of cores. More advanced/efficient than the article (had the same stack).
SaaSPocalypse 3 days ago [-]
Are these builds still reproducible?
joe-esquibel 4 days ago [-]
I've also been trying to squeeze the maximum amount of juice from my CI pipeline. It's typically the bottleneck in my agentic code factory. I don't think I did anything too novel just applied all the typical skips, smart loading of jobs, sharding, O(N) reduction, analyses of all the jobs to minimize time. It really helped. I built a little feed back loop, I measure my CI back log estimate and that dictates the rate at which new agents launch on the repo.
outageroom 4 days ago [-]
I’m glad that our biggest projects are open source, so we don’t have to pay $3k a month for CI...
anon7000 3 days ago [-]
Even seem significantly worse. Like two orders of magnitude worse at least.
kccqzy 4 days ago [-]
I’m surprised that they still use forking. It probably means that they aren’t using threads at all, and are likely leaving performance on the table. Even if they mainly use Python, native code extensions still benefit from threads and thread pools.
byroot 4 days ago [-]
You can fork and use threads, what POSIX disallow is to fork after having started threads, as long as you fork before you're in the clear.

And in practice, at least on Linux, forking after having spawned threads is possible if done extremely carefully, but hard to do.

Culmone 4 days ago [-]
Forking is a parallelization strategy, not evidence of an absence of multithreading.

I'm skeptical that pure threading would improve throughput here.

colek42 4 days ago [-]
One thing I have been experimenting with in our development lifecycle is moving everything into the agentic loop. The key part is building a layer of trust around everything the agent does or schedules. But there's absolutely no reason why your orchestrator needs to be a CI pipeline. The agent can be the orchestrator itself as long as you can validate what it does matches a policy.

This has cut our compute down to about 50% of what it was before and just removed a lot of the problems we had with integrating code at 20+ PRs an hour. We're probably going to move most of our projects over to this methodology fairly soon.

We have been building this into our open-source project, cilock.dev, which, full disclosure, is the core of a new developer tool we are building, pushgate.dev. This all comes from our work on in-toto and software supply chain provenance at Testifysec over the past 6 years.

CBLT 4 days ago [-]
I agree with the premise, but why did you chose signatures and attestation over just job caching? Having job infra that can be driven by CI or local, and caches by input hashes, is the "traditional" way of doing this in big tech.
colek42 2 days ago [-]
It still takes too much time and you are reliant on a Rube Goldberg machine in order to get your deployment out the door. There's just too much that goes wrong in CI/CD pipelines. They're never done and they never work the way we want them to. The moment they do start working, there's some change that changes our assumptions about what should happen and we have to redo the whole thing. There's a literally a whole job category for DevOps engineers because we've made this whole thing way too complex.
philipp-gayret 4 days ago [-]
> The key part is building a layer of trust around everything the agent does or schedules.

I can attest to this, the way I approach it is to give my agents (inside of a private software factory running all day) tooling to run their CI-equivalent processes on the same machines they build and deploy to. Every build, test, deploy and so forth is attested by the server and there's no way around it, entire process takes about 5 seconds to get a Docker image minus tests. Tests are measured outside of individual tasks to keep it sub 10-sec. Has been working amazingly well.

colek42 2 days ago [-]
Exactly. Does it really matter how the work gets done as long as you can attest to it? I'd love it if you would give cilock.dev a try to see if it works for you.
jillesvangurp 3 days ago [-]
I've been doing this for about fifteen years now.

1) Ensure tests don't depend on each other. Avoid shared test fixtures, randomize data (to avoid colissions on primary keys, etc.)

2) Don't run cleanup logic in between tests. No need if tests don't depend on each other.

3) Parallelize. If tests don't depend on each other, they can run at the same time.

4) Run your tests on machines with lots of memory/cpu. If the CPU is not maxed out, you have central bottlenecks and you are wasting resources.

5) Realize that your real users also don't use your system by themselves in isolation. There's value in testing your system still works under load. You get that for free here.

6) Deal with any flakiness. You want to find the flakiness this exposes. Those are real bugs that you needed to find.

This works great but you need to deliberately engineer for it. Easier when you do it from day 1. Once you have fast build times, you'll never not want to have that.

bill10 3 days ago [-]
I want subsecond CI, but how? Given that I no longer read the code or the PR, I need more tests to give me the shallow insurance at the least. And then the agent writes the tests as well that I don't want to read, then I use another agent to review and test, then..... it only grows longer....
iamleppert 4 days ago [-]
Sounds like a nightmare of side effects and non-deterministic tests
viraptor 3 days ago [-]
Which part specifically? This is a very vague comment.
muqsitnawaz 4 days ago [-]
We reduced our CI time from 11 mins to 70 seconds. Best investment we ever made! Pretty much agree with all the techniques mentioned in the article
vpaulus 4 days ago [-]
I am still wondering what "AI-native" means
bigfishrunning 4 days ago [-]
I think it means "from Anguilla"
K3UL 4 days ago [-]
That's great, but when you run on Github Actions, going subminute is actually a waste considering Github bills the first minute as a whole
guhidalg 4 days ago [-]
Your time is free?
mystifyingpoi 4 days ago [-]
Someone should make it mine some crypto up till :59 mark then.
pjm331 4 days ago [-]
just did a similar exercise to get ours from ~20+ mins down to <5, and had by no means exhausted opportunities to go faster, just felt like that was good enough

as a rails shop so much of our test time is spent on factory_bot, if I wanted to get subminute moving to fixtures would do the trick, just a bigger project than it's worth right now

emschwartz 4 days ago [-]
I'd be curious if anyone with a Rust code base can manage this
nicoburns 3 days ago [-]
My Rust web browser engine (https://github.com/dioxuslabs/blitz) currently has 4-5 minute CI times. It could trivially be brought down to 2-3 minutes by using the faster runners they're using, but so far I haven't judged that difference to be worth the lift. Sub 1-minute would probably be difficult.

This includes running 200k WPT tests. Although that job is already run on a fast runner.

uaksom 3 days ago [-]
We have a large Rust codebase. Our tests run quickly, but take a long time to compile. So for smaller workspaces it is absolutely possible.

It always starts with caching: Naive attempts like tar+gzipping the Cargo registry and workspace target folders (which the popular GHA rust-cache action does) will only lead to misery as your caches bloat to tens or even hundreds of gigabytes, which need to be downloaded and uploaded in full in every run.

A much better approach is using sccache, which is fine-grained, so it only downloads relevant artifacts. It's still not free lunch: Compilation output hashes are part of the cache keys, so you don't know which key to fetch until compilation happens. That's a classic waterfall problem. It introduces some latency to builds in case of cache misses. You're also doing the whole compilation "from scratch" each time, but with fine-grained caching. Cargo doesn't skip compiling dependencies, they are fetched from cache if the keys match. This can result in nasty rebuilds more often than you'd like if cache keys change for various reasons. It also comes with its own set of problems to solve. Dependencies with `crate-type=cdylib`, absolute paths embedded in cache keys which change between runs, infinitely growing artifact storage, etc.

A proper build system using Bazel or Buck2 can help you with much smarter caching and introspection capabilities. If you didn't start with a build system, migrating to one is not easy, but it's the only way to make larger polyglot monorepos manageable. You can vibecode these things nowadays, LLMs are good at writing build systems, but you do still need ~1 dedicated person to maintain it.

And in the end, even with good caching, we have individual crates which spend >1 minute in rustc's frontend. Usually heavily generic/async code, sometimes macro-heavy. Rewriting code to avoid stuff that tanks compile times is hard. For example, the entire tokio ecosystem is awful for compile times.

thesurlydev 4 days ago [-]
This is one of the reasons I decided to experiment. I have a platform which has zero dependency "core" apps combined with hexagonal architecture. For example, zero dependency business logic with hand-written reusable modules combined with ops/infra (without the zero dependency constraint). Because you don't want to be hand-rolling things like crypto for TLS termination, etc. I instead use Pingora as a gateway for common things like credential injection and TLS termination. It turns out you can get pretty far with this setup and compile times are extremely fast compared to apps that have dozens or hundreds of crate deps.
rockwotj 4 days ago [-]
unlikely a large rust codebase can compile this fast and run tests without remote caching and incremental test running (they mention at the end they don’t do this)
six_seven 4 days ago [-]
Or needs to run tests on embedded devices.
bob1029 4 days ago [-]
The gaming industry has been leaning on vendors like Incredibuild to dramatically reduce iteration times.

It looks like they might have a whole new market segment to play with.

xiaoliangliang 3 days ago [-]
The decision to still run every unit test is the interesting constraint. Once you give up "only run what the PR might have broken," the rest of the post is about keeping that full suite under a minute: freeze the app and fork per vCPU, pack with LPT (and hash-partition tests that have no timing history), keep a git mirror plus Docker data root on a persistent disk, and pull an S3 snapshot of the dev DB so ordinary PRs skip DDL. Two 16-vCPU runners starting in 8-12s beat one 32-vCPU box in their tests, and they report results before runner teardown so cleanup isn't in the critical path. The 3-hour timeout when they replayed the original pytest+xdist GitHub Actions setup is the baseline that makes those cuts legible.
ballcatcher 3 days ago [-]
[dead]
minfazhai 3 days ago [-]
[dead]
rshossain 3 days ago [-]
[dead]
sumwise 4 days ago [-]
[dead]
YuliuWang 3 days ago [-]
[dead]
vaidyahunt 4 days ago [-]
[dead]
yunyu 4 days ago [-]
[flagged]
falcor84 4 days ago [-]
I don't see the relevance of AI in this scenario. If you believe that the average human programmer can be just trusted to write correct, useful and fast tests, without requiring a detailed code review, then you probably work at a different industry from mine.
yunyu 4 days ago [-]
I think human programmers are more judicious about the tests they write, vs models that have been PTSDed into writing a bunch of low-value checks that basically duplicate implementation details. I say this as a strong proponent of AI coding agents.
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 10:25:50 GMT+0000 (Coordinated Universal Time) with Vercel.