Skip to main content
All articles

GitHub flagged us. Here's how we kept shipping.

GitHub stopped running our checks and deploys. What it was really doing for us, how big a check actually is, and the cascade of machines that now keeps shipping when the laptop is closed.

Cato8 min read

On 15 November, GitHub stopped running anything for our organization. The code was still there. Pull requests still opened. But the machines that checked every change, merged the finished ones and put them online had gone quiet, all at once.

The first article was about why: our AI agents had quietly grown our automation to 2,100 runs a day. This one is about the five days after, and what we learned about what GitHub had actually been doing for us all along.

4 days
to our own git server in Nuremberg
25
repositories measured, one at a time
13
of them fit a server costing a few euros a month
144
"no" answers from a free cloud in twelve hours

What a change has to go through

Nobody visits GitHub to use our products. They visit an app on our own server. A change only reaches them after four steps:

flowchart TD
  C["1 · Checked<br/>tests, types, lint"] --> M["2 · Merged"]
  M --> B["3 · Built"]
  B --> D["4 · Copied to the server<br/>and restarted"]

GitHub stores the code. Steps 1, 3 and 4 need a machine to do the work, and something that notices a change and tells a machine to start. For years GitHub Actions was both, and free. When it stopped, all of it stopped at once, while the code itself sat untouched.

So the question was never "where do we put the code". It was "who does the work".

The foreman and the workers

Within four days we had our own Gitea server running in Nuremberg, with a copy of every repository, refreshed from GitHub every ten minutes.

It is easy to say Gitea "replaces GitHub". It does not. The code still lives on GitHub; Gitea keeps a copy. What Gitea replaces is the foreman: the part that says "it's time, check the open pull requests", hands the job to a machine that is online, keeps the keys the job needs, and shows what happened.

The workers are machines. GitHub lent us a fresh one for every job, from a pool so large we never had to think about it. With Gitea, we bring our own.

Gitea gave us a foreman in a day. Nobody gives you the workers.

Which raised a question we had never had to ask.

How big is a check?

We had never measured it, because we never had to. So we ran the full check of 25 repositories, one at a time, on the small Nuremberg server (2 CPUs, under 4 GB of memory, which also has to keep Gitea itself alive) and recorded how long each took and how much memory it needed at its peak.

Peak memory of one full check, 25 repositories
repositories02.557.510under 1 GB1–1.5 GB1.5–2 GB2–2.5 GB2.5 GB
RepositoriesPeak memory
Fit comfortably13, including Heidi (6.7 minutes, 1.1 GB)up to ~1.9 GB
Borderline72.0 – 2.5 GB
Too heavy5: one ran out of memory, two crashed inside their tests, two were known to be too bigmore than the server has

Half our repositories can be checked on a machine that costs a few euros a month. The other half cannot, and they are the products with the most users.

Under the hood: how we measured

Each repository's full verify (lint, typecheck, tests) ran alone on the Nuremberg server, with a memory ceiling, and we recorded wall time and peak memory. The raw results are one line per repository: name, seconds, peak MB, outcome.

  • Fastest that passed: 28 seconds. Slowest that passed: about 11 minutes (643 s).
  • Two runs reached 2,500 MB: one passed right at it, one was killed for running out of memory.
  • Two failed with exit code 134, an abort inside the test run.
  • Peak memory is the highest the whole process tree reached, not an average.

The light/heavy labels came straight from this table. A repository that is not in it counts as heavy until it is measured.

Looking for free machines

The obvious next step was more machines, without paying for them. We could not find another service that hands out free compute anywhere near GitHub's scale. The closest is Oracle's free tier, which includes a reasonably large machine at no cost. We signed up and asked for one in Zurich.

Oracle said no: out of host capacity. We set up a small program that asks again every five minutes. In its first twelve hours it asked 144 times. All 144 answers were the same.

So for now the heavy repositories are checked on a laptop. When the laptop is closed, their merges wait. Nothing breaks. It just waits.

A cascade instead of a single point

"The laptop does everything" has an obvious problem: the laptop is not always on.

Gitea lets each machine say what it can handle, using labels. We gave the jobs two labels, light for the 13 repositories that fit the small server and heavy for the rest, and let each machine pick up only what it can carry:

MachineTakes
Laptoplight and heavy
Nuremberg serverlight only
Oracle machine, once it existsheavy

When the laptop is closed, the light repositories keep merging on the Nuremberg server, and nobody has to switch anything. That is the whole cascade: not a plan someone has to remember, but a property of how the jobs are labelled.

Because the Nuremberg server is small and must never take Gitea down with it, four rules protect it:

  • A memory ceiling. Checks there can use at most 2.6 GB.
  • Taking turns. A merge check and a deploy build never run on it at the same time. One waits, and waiting counts as "try again shortly", never as a failure.
  • No double work. Before checking a pull request, a machine looks for a fresh "being checked" mark from another machine and leaves that one alone.
  • Unknown means heavy. A new repository is never assumed to be small. Guessing low is how a check takes the server down.
Under the hood: the four rules
  • Ceiling: the check runs inside a memory limit of 2.6 GB; past it, the check is killed, not the server.
  • Taking turns: every check and every deploy build takes the same lock file. A check waits up to 30 minutes for it; if it still cannot get it, it exits with a distinct "busy" code that the scheduler treats as "retry on the next round", so a busy server never shows up as a red check.
  • No double work: a machine that starts on a pull request posts a "being checked" status with a timestamp. Another machine that sees a fresh one skips that pull request.
  • Unknown means heavy: the tier list (tiers.conf) names the light repositories, taken from the measurement above. Anything not listed as light is heavy.

Is a schedule not a timer?

Our first article ended with a rule: nothing wakes up on a timer to look around. And yet our replacement runs on a schedule.

The difference is what a run costs. GitHub's timers started a fresh machine in every repository, every hour, whether or not there was work. Ours is one small job that asks one question ("is anything ready?") and does real work only when the answer is yes. We would rather react the moment something happens, the way GitHub could. A copy of the code refreshed every ten minutes cannot. When GitHub runs Actions for us again, this goes back to being instant, and the schedule becomes the spare.

What we would tell anyone who depends on one free service

  • Know what each piece does for you. "GitHub" was really four things for us: storage, a foreman, workers and a gate. Only one of them stopped, but nothing worked without it.
  • Measure your work before you need to move it. We could only build a cascade because we knew which checks fit which machine.
  • Make failover a property, not a procedure. If someone has to notice and switch, it will happen at 2 a.m. and nobody will.

We have told GitHub what we found and what we changed, and we hope they turn Actions back on. If they do, it will be the fastest part of the system again. If they don't, the work still gets checked, merged and shipped, one labelled job at a time.


bitbaum builds OrangeCat, Loki, Solon and Heidi in public. If you run your own runners, have spare compute to share, or want to build with us, the door is open.

Discussion

Sign in to join the conversation.

Loading comments…