← Back to all projects

Case study

gpu-fleet

  • Python
  • FastAPI
  • PostgreSQL
  • Terraform
  • Google Cloud Run
  • AWS S3
  • Kubernetes (GKE Autopilot + KEDA)
  • Ansible
  • Docker
  • Proxmox
  • Ollama
  • Qwen3-VL
  • OpenTelemetry

In short

gpu-fleet hands GPU jobs to whatever hardware is free (my PC and laptop, Colab, Cloud Run, Kubernetes, homelab VMs) for $0 in compute. Workers pull jobs and never hold cloud keys. Its main job is describing a game’s cutscenes for an accessibility mod: one cutscene’s 89 shots took 12 minutes on two GPUs, and chapter 1’s 21 pieces took 26 minutes.

The problem

My Metaphor: ReFantazio accessibility mod needs audio descriptions of its cutscenes for blind players. Making them is GPU work: many small jobs, each one a model call. I have one AMD GPU at home, a laptop, and GPU time I’ve already paid for in Colab notebooks, and none of them can be reached from outside.

gpu-fleet is the system for that. It is also how I’m learning cloud and DevOps, phase by phase, on something real instead of a tutorial (phases).

Where it stands on 3 December: phases 0 to 8 are done. Phase 9, the real run, is in progress: chapter 1’s pass 1 has run, and the full run is ahead. Contributor mode (phase 10) is built and was drilled in a disposable Windows VM; no contributor has joined yet.

The approach

Three rules shape the design:

  • Workers pull leased jobs from a broker. A lease is a worker’s time-limited right to run one job, proven by a token. Most places a worker runs sit behind NAT, so pulling is the only direction that works everywhere (ADR 0002, ADR 0006).
  • Results are content-addressed, named by a hash of their input, model and prompt version, so a duplicate is the same file and “at least once” delivery is enough (ADR 0003).
  • No metered compute bill. The fleet runs on capacity that is already paid for (the GPU I own, a prepaid Colab balance, Google Cloud credits), and no bug, failure or attacker may turn into an open-ended bill. Every choice is priced before it’s made.
How each cost was priced
  • The one fixed cost is the database. Cloud SQL’s smallest machine with 10 GB is about $9 a month, paid from credits. Everything else scales to zero: the broker bills per request, and at this load that’s inside the free tier.
  • Telemetry without an always-on CPU. Exporting metrics in the background would need CPU allocated all the time, by my estimate about 5 million vCPU-seconds a month against 180,000 free. Instead Cloud Scheduler calls a flush route once a minute: 43,200 requests a month, inside the free tier (ADR 0027).
  • A budget that actually fires. The kill-switch budget is $20 a month counted before credits. Counted after credits, spending would read near $0 and the alert would never trigger (ADR 0024). On AWS, a second budget of $5 a month, beside the $30 one, emails me on actual or forecast spend (ADR 0062).
  • A flood can cost uptime, not money. Cloud Run bills rejected requests too: 50 a second for a month is about 130 million requests and $52 (learning log, phase 4 checkpoint), while budget data lags by hours. So an alert on rejected requests (more than 5 a second for 5 minutes) trips the same kill switch (ADR 0028).
  • One shot per job, because of the card’s memory. Eight frames are about 8,000 image tokens and 1.2 GB of the model’s working memory per request (its KV cache). A 15-shot cutscene in one request would need about 18 GB of KV cache on top of the weights, more than a 16 GB card holds (ADR 0039).
  • Kubernetes only for a session. The GKE Autopilot cluster is created at the start of a session and destroyed at the end: a forgotten cluster still bills KEDA’s own pods, about $11 a month (ADR 0035).
  • Colab units are the GPU budget. 600 units at about 1.87 an hour on a T4 is roughly 320 GPU-hours. A worker leaves after 15 idle minutes instead of a forgotten tab burning units until Colab’s 12-hour cap (ADR 0030).

Colab’s free runtimes didn’t make the cut: their FAQ rules out running workers without a unit balance. Kaggle was dropped because its GPUs need photo-ID verification, a privacy cost I chose not to pay.

Architecture

gpu-fleet architecture, as builtfleet-enqueue uploads inputs to S3 and posts jobs to a Cloud Run broker on Google Cloud, whose jobs live in Cloud SQL PostgreSQL. Read-only viewer tools, fleet-progress and fleet-timeline, which draws a batch as a per-worker swimlane, read batches from the broker. Beside the broker, a kill switch takes its public access away on a budget or flood alert. Six kinds of worker pull work from the broker over HTTPS with named worker tokens and hold no cloud keys: the PC's AMD RX 9070 running Ollama, a laptop's RTX 4070 running Ollama, a Colab notebook on a T4, Cloud Run jobs on CPU, Kubernetes pods scaled by KEDA on kind or GKE Autopilot, and two Proxmox homelab VMs configured by Ansible. Only the PC, laptop and Colab workers are cleared for game footage; the others take open jobs only. Workers read inputs from and write results to AWS S3 through presigned URLs. The broker signs those URLs with short-lived credentials it gets by OIDC workload identity federation, stores no AWS keys, and may sign open and footage links but never derived text. Built for phase 10, but no contributor has joined yet: contributors' PCs, open jobs only, one lease at a time.fleet-enqueueuploads inputs, thenposts jobs (admin)viewer toolsfleet-progressfleet-timelinePOST /jobsGET, read-onlyGOOGLE CLOUD · CREDITSkill switchon budget orflood: offlineCloud Run brokerFastAPI, scales to zerojobs in Cloud SQL Postgreslease · heartbeat · completeHTTPS, named worker tokenWORKERS · PULL ONLY, NO CLOUD KEYSPC workerOllama on RX 9070open + footageLaptop workerOllama on RTX 4070open + footageColab workerOllama on a T4open + footageCloud Run jobson demand, CPUopen onlyKubernetes + KEDAkind, GKE Autopilotopen onlyProxmox homelab2 VMs, by Ansibleopen onlyContributor PCsbuilt, none joined yetopen only, 1 leasepresigned GET · PUTAWS · COORDINATION ONLYS3 inputs and resultsbroker signs via OIDC federation, no keysopen and footage links: yesderived text: never signedhas run workbuilt, no contributor yet
As built on 3 December: solid boxes have run real work; the dashed one is built, but no contributor has joined yet. Workers only ever call out to the broker, and job data goes straight to S3, never through it. Each worker runs when a batch needs it.

The broker is a FastAPI service on Cloud Run, with its jobs in Cloud SQL PostgreSQL, reached through the Cloud SQL Auth Proxy with an IAM login, so there is no database password to store (ADR 0021). It reaches AWS by OIDC federation: Google signs a token saying which service this is, and AWS trades it for credentials that last an hour (ADR 0025). No cloud key is stored anywhere.

Workers are a small Python package. On my PC it runs in a container, with Ollama native on Windows and on the GPU (ADR 0014). On Colab, a private notebook installs a release wheel pinned by its hash and signed with a build attestation (ADR 0030). Phases 6 to 8 added backends that start only on demand, each to learn one platform:

  • Cloud Run jobs, on CPU: Google refused GPU quota for an L4 (ADR 0033).
  • Kubernetes workers scaled by KEDA, which scales pods from a number outside the cluster (here the queue depth) down to zero: first on kind (Kubernetes in Docker on my PC), then on GKE Autopilot (Google-managed nodes billed per pod) (ADR 0034).
  • Two homelab VMs on Proxmox, created by Terraform and configured by Ansible. CI runs the playbook twice and requires the second run to change nothing (ADR 0036, ADR 0037).

One job, start to finish

  1. fleet-enqueue uploads the job’s input to S3, then posts the job: the input hash, the model, the prompt version and a data class. If any upload fails, it registers nothing (ADR 0031).
  2. A worker asks for work, naming the prompt versions and models it has. In one SQL statement the broker claims the oldest matching job the worker’s token is cleared for. FOR UPDATE SKIP LOCKED is the PostgreSQL clause that lets many workers claim rows at once without waiting on, or double-taking, the same job. The reply carries a fresh lease token and a presigned URL: a link S3 signs for one object and one action, which expires, so the worker needs no AWS key.
  3. The worker checks the input’s hash and computes the result’s key. If that result already exists, it only reports the job done.
  4. Otherwise it runs the job, renewing the lease in the background, and asks for an upload link bound to the result’s exact length and hash. S3 refuses anything else, and refuses a second write.
  5. On complete, the broker recomputes the key, checks the object is in S3, and accepts it only with the current lease token.
One job, start to finish, as a sequence diagramFive lifelines: enqueue on my PC, the broker on Cloud Run, Postgres on Cloud SQL, S3 on AWS, and a worker. 1: enqueue puts the input in S3, then posts the job to the broker, which inserts it. 2: the worker asks for work; the broker claims the oldest job the token is cleared for with SKIP LOCKED and answers with a new lease token and a 10 minutes GET link. 3: the worker gets the input from S3, checks its hash, and if the result already exists only reports done. 4: the worker renews every 40 seconds, asks for an upload link, gets a 5 minutes PUT link bound to length and SHA-256, and puts the result; S3 refuses a wrong length, a wrong hash or a second write. 5: the worker completes with its token; the broker recomputes the key, checks the object in S3, and marks the job done only for the current token.enqueuemy PCbrokerCloud RunPostgresCloud SQLS3AWSworkerany backend1PUT inputPOST /jobsinsertinputs first, then the job2claim: the worker asksSKIP LOCKEDlease token + GET linkoldest job this token is cleared for · GET link 10 min3GET inputhash checked · result already stored? only report done4renew, every 40 sask for an upload linkPUT link, 5 minPUT resultS3 checks the write itself: wrong length 403,wrong SHA-256 400, a second write 4125complete, with the tokenHEAD resultdonekey recomputed · object checked · current token onlyOne job, start to finish, as a sequence diagramFive lifelines: enqueue on my PC, the broker on Cloud Run, Postgres on Cloud SQL, S3 on AWS, and a worker. 1: enqueue puts the input in S3, then posts the job to the broker, which inserts it. 2: the worker asks for work; the broker claims the oldest job the token is cleared for with SKIP LOCKED and answers with a new lease token and a 10 minutes GET link. 3: the worker gets the input from S3, checks its hash, and if the result already exists only reports done. 4: the worker renews every 40 seconds, asks for an upload link, gets a 5 minutes PUT link bound to length and SHA-256, and puts the result; S3 refuses a wrong length, a wrong hash or a second write. 5: the worker completes with its token; the broker recomputes the key, checks the object in S3, and marks the job done only for the current token.enqueuemy PCbrokerCloud RunPostgresCloud SQLS3AWSworkerany backend1PUT inputPOST /jobsinsertinputs first, then the job2claim: the worker asksSKIP LOCKEDlease token + GET linkoldest job this token is cleared forGET link: 10 min3GET inputhash checked · result already stored?if so, only report done4renew, every 40 sask for an upload linkPUT link, 5 minPUT resultS3 checks the write itself: wrong length 403,wrong SHA-256 400, a second write 4125complete, with the tokenHEAD resultdonekey recomputed · object checked ·current token only
The steps and numbers
  1. fleet-enqueue puts the input in S3, then posts the job; the broker inserts it into Postgres. If an upload fails, nothing is registered.
  2. The worker asks for work. The broker claims the oldest job its token is cleared for, with FOR UPDATE SKIP LOCKED, and answers with a fresh lease token and a GET link that lasts 10 minutes.
  3. The worker gets the input from S3 and checks its hash. If the result already exists, it only reports the job done.
  4. While it runs, it renews the lease every 40 s. It asks for an upload link bound to the result's exact length and SHA-256, good for 5 minutes, and puts the result. S3 refuses a wrong length (403), a wrong hash (400) and a second write (412).
  5. On complete, the broker recomputes the result's key, checks the object is in S3, and accepts only the current lease token.
One job in five steps. Every request starts at the caller and nothing calls the worker; job bytes go straight between S3 and the machines that make or use them, S3 checks every write itself, and at the end the broker trusts the lease token, not the worker.
A Tempo trace waterfall for one fleet-worker job lasting 310 milliseconds. Its child spans are lease 6.8 ms, run 291 ms, store 4.8 ms and complete 6.8 ms, with the fleet-broker span POST /complete, 5.9 ms, nested under complete.
The slowest job of a three-worker GPU run on the local stack, in Grafana's trace view: 310 ms, of which 291 ms is the model call.

When a worker dies

There is no reaper process. If a worker dies, its lease renewals stop, and the next claim treats the expired lease as free work and hands it out with a new token. After three attempts the job goes to dead (ADR 0006). A worker that is alive but can’t do a job calls /fail with a reason code, and an admin can requeue failed jobs (ADR 0039). An old worker that comes back can’t finish, because its token is no longer current; even if both wrote a result, it would be the same file.

A worker dies, and its job moves to the next worker that asksColab session 1 claims a job at 0 seconds: attempt 1, token A, a 60 second lease. It renews at 40 and 80 seconds, each time moving the expiry 60 seconds ahead. The session restarts and renewals stop. The lease expires at 140 seconds and nothing happens then: there is no reaper. Session 2's next claim finds the lapsed lease and takes the same job as attempt 2 with token B, and finishes it. If session 1 returns with token A, the broker refuses it.brokerColabsession 1Colabsession 260 slease expires:nothing runsattempt 1 · token Aclaimrenewrenewsession restartsnext claim finds it lapsed:attempt 2 · token Bdonetoken A:refused040 s80 s140 slaterseconds since the claimA worker dies, and its job moves to the next worker that asksColab session 1 claims a job at 0 seconds: attempt 1, token A, a 60 second lease. It renews at 40 and 80 seconds, each time moving the expiry 60 seconds ahead. The session restarts and renewals stop. The lease expires at 140 seconds and nothing happens then: there is no reaper. Session 2's next claim finds the lapsed lease and takes the same job as attempt 2 with token B, and finishes it. If session 1 returns with token A, the broker refuses it.secondssince the claimbrokerColabsession 1Colabsession 2040 s80 s140 slater60 slease expires:nothing runsattempt 1 ·token Aclaimrenewrenewsessionrestartsnext claim finds the lease lapsedattempt 2 ·token Bdonetoken A: refused
The steps and numbers
  1. 0 s: Colab session 1 claims the job: attempt 1, token A. The lease lasts 60 s.
  2. The worker renews at two thirds of the lease, every 40 s (40 s, 80 s). Each renewal moves the expiry to 60 s ahead.
  3. The session restarts. Renewals stop, so the lease runs out 60 s after the last one (140 s here).
  4. Nothing runs at that moment: there is no reaper. Until someone claims the job, the old lease could even still be renewed.
  5. Session 2's next claim finds the lapsed lease and gets the same job: attempt 2, token B. It finishes.
  6. Only now, with token B in place, is token A refused if session 1 comes back: the token, not the worker, owns the job.
  7. In the real Colab drill, the restarted session's leases expired after about 2.5 minutes and the jobs finished, none lost.
When a worker dies, nothing happens until somebody asks for work. The lease lapses quietly; the next claim gets the job with a new token, and the old token stops working.

Who sees what

Each job has a data class: open (anything I may share), footage (copyrighted game video) or derived (text made from the footage). The broker, not the worker, decides which classes a worker’s named token may receive, its clearance (ADR 0015, ADR 0029, clearance by backend):

  • my PC, my laptop and my Colab notebook: footage, derived and open (the laptop since PR #111 and ADR 0067);
  • the homelab VMs, the Cloud Run job and GKE: open only;
  • contributors: open only, one lease at a time.
The footage rules

From ADR 0039:

  • Only machines I control get it. What counts is who controls the machine, not who owns the hardware.
  • Nothing is kept longer than needed. Clips are deleted from the worker after each job, and S3 deletes the uploaded copies after 14 days. The results, which double as the cache, are kept.
  • Nothing about the footage reaches a log. A failed job reports a reason code (bad_output, bad_input, model_error, oom, timeout) and counts, never the model’s text.
  • The clip is treated as hostile. It is opened as mp4 only, from a local file, with its headers checked before decoding (at most 4K, 120 seconds, 4 streams) and a 200 MiB download cap.
Credential lifetimes and scopes, on a log time scaleLease token: 60 seconds, renewed every 40 seconds, one job. Upload link: 5 minutes, one object of an exact length and SHA-256, no second write. Download link: 10 minutes, one object, read only. The broker's AWS session: 1 hour, open and footage prefixes, never derived, no deletes. Named worker token: no expiry, one per name, its own clearance only; in the drill the revoked token got its 401 about 60 seconds after a new token registry was published. Stored AWS key: none.lease token60 sone job · renewed at 40 s (the tick) while the worker livesupload link (presigned PUT)5 minone object · exact length and SHA-256 · no second writedownload link (presigned GET)10 minone object · read onlybroker's AWS session1 hopen and footage prefixes · never derived · no deletesnamed worker tokenuntil revokedper named token · revoked: 401 about 60 s after a new registrystored AWS keynonethe broker federates by OIDC; workers get links, never keys1 s1 min10 min1 h1 dayhow long it works, log scaleCredential lifetimes and scopes, on a log time scaleLease token: 60 seconds, renewed every 40 seconds, one job. Upload link: 5 minutes, one object of an exact length and SHA-256, no second write. Download link: 10 minutes, one object, read only. The broker's AWS session: 1 hour, open and footage prefixes, never derived, no deletes. Named worker token: no expiry, one per name, its own clearance only; in the drill the revoked token got its 401 about 60 seconds after a new token registry was published. Stored AWS key: none.lease token60 sone job · renewed at 40 s (the tick)while the worker livesupload link (presigned PUT)5 minone object · exact length and SHA-256no second writedownload link (presigned GET)10 minone object · read onlybroker's AWS session1 hopen and footage prefixes ·never derived · no deletesnamed worker tokenuntil revokedits clearance only · per named tokenrevoked: 401 about 60 s after a new registrystored AWS keynonethe broker federates by OIDC;workers get links, never keys1 s1 min10 min1 h1 dayhow long it works, log scale
The rows
  • Lease token: 60 s, renewed every 40 s while the worker lives. Worth one job.
  • Upload link (presigned PUT): 5 min. One object, its exact length and SHA-256, and S3 refuses a second write.
  • Download link (presigned GET): 10 min. One object, read only.
  • The broker's AWS session: 1 h. The open and footage prefixes, never derived, no deletes.
  • Named worker token: no expiry, one per name. Its own clearance only. In the drill the revoked token got its 401 about 60 s after a new token registry was published.
  • Stored AWS key: none. The broker gets its AWS session by OIDC federation, and workers only get links.
What each credential is worth if it leaks, and for how long. Everything that expires is bound to one job or one object; the one credential with no expiry is per named token, and in the drill a revoked one got its 401 about a minute after a new token registry. The last row is the point: there is no stored AWS key to leak.

The kill switch

A private Cloud Run service listens for two alerts: the budget reaching 100% of $20, or a flood of rejected requests. Either one makes it remove public access from the broker, through a custom role with just the two permissions it needs. Restoring access is a reviewed terraform apply (ADR 0024).

Contributor mode

A few people I know can lend a Windows PC’s GPU, for open jobs only (ADR 0044, PR #94). It is built; no contributor has joined yet.

  • An invite file, not a pasted token. The installer checks it strictly, including that its broker address matches the one built into the installer, stores the token encrypted for that Windows user, and deletes the invite.
  • One lease per contributor token, so a forwarded invite exposes a single open-only job that shows up by name. Each token also gets its own rate-limit bucket.
  • A failure breaker. The worker stops after a set number of failures in a row (--max-consecutive-failures), because on 1 December a broken setup burned three attempts on each of 89 jobs before anything stopped.
  • A PowerShell installer, per user and without admin rights. It checks the GPU (NVIDIA or AMD, an 8 GB card or larger; it accepts a card whose driver reports just under 8 GiB, from 7.5 GiB) and the disk before downloading anything, and pins every download by its hash (PR #112).

The pipeline is built up to the step before the words

One cutscene goes through eleven stations between a recorded playthrough and a description a blind player hears. Code does most of them; at a few, I decide. Pick a station, or press Play, to see what goes in, what comes out and who does the work. Every example in the figure is invented.

Goals

  • Follow the cutscene all the way to the player.
  • Find a station that isn't built yet.
  • code runs it
  • I decide
  • not built yet
An invented example.

1. Footage

I decidebuilt

A recorded playthrough of the chapter goes into the footage folder, which never leaves my PC. The mod's repo exports the script table (every line and its speaker) and the game's event data (who stands where, where the camera is).

The example shows: A strip of film frames, hours long, beside two tables exported from the game: the script table and the event data.

Who
Me, once per chapter (the tables once per game)
In
A long playthrough video
Out
playthrough.mkv
script-table.jsonl   29,752 lines
evt-timeline.jsonl   783 events parsed

The first four stations work like this: the segmenter finds where each cutscene starts and ends (voice lines anchor the scenes, the game’s event timing predicts starts, and the picture snaps the borders, ADR 0048); I confirm the borders in fleet-review, below; fleet-segment shots cuts the scenes into pieces; and the fleet runs pass 1 on them (ADR 0052). On chapter 1 the segmenter found 8 scenes (4 in-engine, 4 movies) and aligned 95 of 118 voice lines, in 65 seconds with the transcript cached.

The story bible, choices, the pass 2 review with its listening room, and the scene-card export are built too (PR #150). Nothing yet writes a description a player can hear: that waits on the pass 2 runner, and on a names page.

As of 5 December 2026. Chapter 1's opening, stage by stage:

Scenes found
8 of 8
Borders confirmed
5 of 8
Described by pass 1
5 of 8
Story bible confirmed
yes, 9 characters
Pass 2 texts
0 of 8
Scene cards
0 of 8

The whole game is about 1,096 scenes and 29,752 lines, so the 8 scenes of chapter 1's opening are under 1% of it.

What stays mine at full scale: reviewing, not writing

My partHow oftenHow it shrinks
Find and record playthrough footagePer chapterIt doesn't: it is the input
Confirm scene bordersPer scene, about 1,096I check proposals instead of marking from scratch
Name decisionsOnce for the gameEasier once the exporter adds the name shown in the box
Story bible: place-me clicks, check, confirmPer chapterConfirmed characters carry into later chapters
Mark choicesPer choiceSmall already
Review pass 2 texts and importancePer scene; importance on reference scenesImportance review drops once the model agrees with me often enough
Blind listening feedbackOnce, then now and thenNeeds other people, not me

When it’s done, the mod reads each scene card. Before the first voice, a short orientation; between dialogue boxes, what the words don’t say, held until it finishes; before a movie, a card. A key repeats or deepens any description, and before a choice the player hears the context they need. Several of these are mod-side work.

Pass 1

Pass 1 is one job per shot. The input is the shot’s clip, at most 30 seconds, with the sound removed. The worker samples a frame every 2 seconds (2 to 8 frames) and asks a vision model, Qwen3-VL 8B Instruct, for one JSON report of what is on screen: the people, what they do, the setting, the camera and any text. The prompt follows a checklist of 13 rules cited to the Netflix, DCMP and ACB audio-description guidelines: people are described by what can be seen, never by race or ethnicity, and gender only as “appears to be” when it is clear (ADR 0040). A report that fails the schema gets one repair retry, then the job fails with a reason code.

One guard came from reading how the model server fails. If a prompt outgrows the model’s context window, Ollama silently drops the images, and the model invents an answer that still passes the schema. So the worker fails the job when the reply was cut off, or when the prompt counted fewer tokens than the frames must have used.

The game’s footage is copyrighted, so I can’t show it here. To show the style, I ran the same pipeline on two minutes of the Blender Foundation’s open film Sintel: 28 shots, a mean of 8.3 seconds each on my GPU.

A still from Sintel: a narrow, sunlit alley between old wooden buildings, littered with bricks and planks. A small figure with reddish-brown hair bends over a plank in the middle of the alley.
Shot 2 of the Sintel run: one of the three frames the model saw. The model took 8.2 seconds. Sintel © copyright Blender Foundation | durian.blender.org, CC BY 3.0.

What the model reported for that shot (the setting in full, the other fields shortened):

Setting: A narrow, sunlit alleyway between old, weathered buildings. The ground is uneven and littered with broken bricks, wooden planks, and debris. The buildings have wooden doors, windows, and tiled roofs. Dust hangs in the air, illuminated by bright sunlight coming from above.
Person: short, reddish-brown hair, a light-colored top and dark pants; in the center of the alley, near a pile of debris.
Actions: bends over and grips a large wooden plank; lifts it and begins to move it; continues to move it, shifting its position.
Camera: Wide shot, still.

Five more shots from the Sintel run
A still from Sintel: a vast, densely packed city of small brown roofs under a hazy, pale sky, with a tall thin tower on the horizon at left and a large stepped ruin at right.
Shot 1, the opening wide shot: three frames, 10.2 seconds. Sintel © copyright Blender Foundation | durian.blender.org, CC BY 3.0.
A still from Sintel, seen from below: a girl with short red hair climbs over the edge of a steep tiled roof between timber buildings, one arm raised, against a bright sky.
Shot 6, under two seconds long: two frames, 6.5 seconds. Sintel © copyright Blender Foundation | durian.blender.org, CC BY 3.0.
A still from Sintel: a small, scaly baby dragon lies on stone roof tiles beside a wall, its pale wings spread and one of them stained with blood.
Shot 9, a close-up the camera moves along: two frames, 6.4 seconds. Sintel © copyright Blender Foundation | durian.blender.org, CC BY 3.0.
A still from Sintel: the red-haired girl smiles at the baby dragon she holds in both hands, in a dim room with blurred orange lights behind her.
Shot 19, indoors by firelight: two frames, 6.6 seconds. Sintel © copyright Blender Foundation | durian.blender.org, CC BY 3.0.
A still from Sintel: a sunlit market street between tall timber buildings, with barrels, crates and apples spilled on the ground. The red-haired girl stands in the middle; a man and a woman wait by a fruit stall on the right, and more people walk in the distance.
Shot 26, a street with five people in it: two frames, 13.1 seconds. Sintel © copyright Blender Foundation | durian.blender.org, CC BY 3.0.

The human in the loop

Someone has to check the machine’s guesses, such as where each cutscene starts and ends. That used to mean editing files by hand. Now it’s fleet-review, a small web app that runs only on my PC, because the footage can’t leave it (ADR 0046, PR #100). Its first real use was confirming chapter 1’s scene borders.

Fixing a scene's borders in fleet-review. Made-up test data: the real tool runs only on my PC, because the footage is copyrighted.
Text description of this video

A 13-second clip with no sound. On a dark timeline under a test-pattern video, a scene’s end is pulled in frame by frame, its start is dragged to the right, and Save confirms both frame numbers.

  • Every decision is a new row in a log that is never edited. In SQLite, triggers abort any update or delete; in PostgreSQL the same rule would be a permission (REVOKE UPDATE, DELETE). An undo is a row that points at the row it undoes. Each row stores a hash of the machine output it corrects, so when the segmenter runs again, old corrections are marked stale instead of being applied silently.
  • A queue ranked by why each item needs a look: a conflict first, then a neighbour that changed, stale corrections, low confidence, and not reviewed.
  • Safe on localhost. Any website open in the same browser can send requests to 127.0.0.1. A random token for each start (moved into an HttpOnly, SameSite=Strict cookie after the first request) and checks on the Origin and Host headers stop cross-site posts and DNS rebinding.
  • Fast previews. Scene previews are cut from a per-chapter 540p proxy by stream copy: 0.06 seconds for 30 seconds of video, against 4.1 seconds re-encoding the 1080p source (ADR 0056, PR #114).

The review app has 164 tests of its own and costs nothing to run. I haven’t measured how long a scene takes to review yet.

Results

The first cutscene, 1 December

One complete cutscene from the game, 89 shots, shared between my RX 9070 and a Colab T4. All 89 finished in 11 minutes 59 seconds. The PC took a median of 10.7 seconds a shot and did 62, about 70%; the T4 took 17.3 seconds and did 27. No scheduler split the work: the faster GPU simply asked for jobs more often. The PC alone would have needed about 16.5 minutes, so adding the T4 made the batch 1.37 times faster, about 1.6 times without Colab’s cold start. The first try failed completely (see Lessons); after the fix and a requeue, every job finished on its first attempt (learning log).

A swimlane timeline titled Pass 1, one cutscene: 89 shots on two GPUs. The PC (RX 9070) row has 62 jobs with a median of 10.7 seconds; the Colab (T4) row has 27 jobs with a median of 17.3 seconds, starting with one long bar. The time axis runs from 0:00 to about 12:00. Footer: 89 jobs, 89 done, wall time 11:59.
The trial cutscene as the broker recorded it: one bar per shot, from lease to done. Colab's long first bar is its cold start. Only shot numbers, workers and times are shown.

Chapter 1, 3 December

21 pieces in 26 minutes, no retries. My RTX 4070 laptop did 20, at a median of 68.7 seconds (30 to 139); a Colab T4 did 1, in 225 seconds including a cold start; the PC worker wasn’t running. The laptop’s 8 GB card can’t hold the model, which spills into system memory, so each piece took about six times the RX 9070’s 10.7 seconds.

Drills

  • Budget kill switch: on a real billing notification, the public endpoint returned 403 2 minutes 18 seconds after the message was published, and the internal telemetry flush kept working throughout.
  • Flood: about 90 seconds from the alert to a blocked endpoint.
  • Revoking a token: 300 jobs on two workers. I published a new token registry at 18:30:30 UTC, the new revision served at 18:31:14, and the revoked token got a 401 at 18:31:30, about a minute end to end. 300 of 300 jobs finished, none lost.
  • Contributor install: in Windows Sandbox, 4 pinned downloads all matched their hashes, and 5 of 5 smoke jobs passed.
  • A Colab restart mid-batch: about two and a half minutes later its leases had expired, the new session picked the jobs up, and nothing was lost.
Three drills on one clock, each from its triggerBudget switch, from a real billing notice: notice 0:00, switch fired 0:33, edge answered 403 at 2:18, back to the broker's 404 at 7:00 after a reviewed apply; telemetry flushes answered 204 throughout. Flood switch, from a fake incident whose trigger was at about 20:57:00, so its offsets are approximate: the log said public access removed at about 0:02, the policy lost allUsers at about 1:17 while the edge still answered 404, and the edge answered 403 at about 1:31; 89 seconds between the two logged times. Token revocation with 300 jobs: new registry version 0:00, new revision serving 0:44, the revoked token got 401 at 1:00; 300 of 300 jobs done, none lost.Budget switchreal billing notice0:00 notice published0:33 switch fired2:18 edge answers 4037:00 back, after a reviewed applyFlood switchfake incident0:02 log: “public access removed”1:17 policy changed, edge still 4041:31 edge blocks: 403Token revoked300 jobs, none lost0:00 new registry version0:44 new revision serving1:00 revoked token gets 401flushes: 204 all alongabout 90 s from “removed” to blocked01234567 minThree drills on one clock, each from its triggerBudget switch, from a real billing notice: notice 0:00, switch fired 0:33, edge answered 403 at 2:18, back to the broker's 404 at 7:00 after a reviewed apply; telemetry flushes answered 204 throughout. Flood switch, from a fake incident whose trigger was at about 20:57:00, so its offsets are approximate: the log said public access removed at about 0:02, the policy lost allUsers at about 1:17 while the edge still answered 404, and the edge answered 403 at about 1:31; 89 seconds between the two logged times. Token revocation with 300 jobs: new registry version 0:00, new revision serving 0:44, the revoked token got 401 at 1:00; 300 of 300 jobs done, none lost.Budget switchreal billing notice0:00 notice published0:33 switch fired2:18 edge answers 4037:00 back, after a reviewed applyFlood switchfake incident0:02 log: “public access removed”1:17 policy changed, edge still 4041:31 edge blocks: 403Token revoked300 jobs, none lost0:00 new registry version0:44 new revision serving1:00 revoked token gets 401flushes: 204 all alongabout 90 s from “removed” to blocked01234567minutes from each drill's trigger
The steps and numbers
  • Budget switch (real billing notice, 26 November): notice 0:00, switch fired 0:33, edge 403 at 2:18, the broker's 404 again at 7:00 after a reviewed terraform apply. Telemetry flushes answered 204 throughout.
  • Flood switch (fake incident, 26 November; the trigger was published at about 20:57:00, so these offsets are approximate): the log said “public access removed” at about 0:02; allUsers was gone from the policy at about 1:17 while the edge still answered 404; the edge answered 403 at about 1:31. 89 seconds, from the logged times, between the log line and a blocked edge.
  • Token revocation (300 jobs, two workers, 29 November): new registry version 0:00, new revision serving 0:44, the revoked token's 401 at 1:00. Revocation is “version plus roll”. 300 of 300 jobs done, none lost.
Three drills on one clock, each timed from its trigger. In all three the change was recorded well before it took effect; the flood switch logged “removed” about 90 seconds before the edge blocked anyone. Measure the second moment, not the first.

Smaller numbers: a job across both clouds took about 1.4 seconds from lease to done, cold start included; warm Colab jobs took 1.5 to 3 seconds; a T4 generated about 38 tokens a second once the model had loaded. Every number above is in the learning log.

How it’s checked

Every pull request runs CI: secret scanning, linting, Terraform validation and tflint, Trivy and hadolint for the containers, a dependency audit, the tests and the image builds, with actions pinned to commits. On 5 December the five Python packages held 2,695 tests: broker 1,050, worker 794, review app 596, segmenter 178 and kill switch 77. A small mutation script breaks the code on purpose to check the tests catch it, and it has found real gaps, such as < where the dead-letter check needed <=. Infrastructure on both clouds goes through Terraform, always applied from a saved plan that a reviewer and I read first (ADR 0017). Worker releases publish a signed build attestation. So far: 80 ADRs, 168 recorded design questions and 110 merged pull requests.

Broker and workers send metrics, logs and traces with OpenTelemetry to Grafana Cloud’s free tier. The dashboard, the alerts and the service-level objective (95% of jobs done within 15 minutes) are files in the repo. Colab sends no telemetry, so the broker records when each lease started, and fleet-timeline draws a batch as the swimlane above (ADR 0041).

The life of one alert rule: oldest queued job over 10 minutesA job is queued and nobody claims it, so the age of the oldest queued job grows by one second every second. At 600 seconds, 10 min, it crosses the threshold and the rule goes from normal to pending. The rule holds for 2 minutes, then fires at 12 minutes.age of the oldest queued job600 s0thresholda stuck job's age grows 1 s per secondnormalpendingfiring010 min12 minThe life of one alert rule: oldest queued job over 10 minutesA job is queued and nobody claims it, so the age of the oldest queued job grows by one second every second. At 600 seconds, 10 min, it crosses the threshold and the rule goes from normal to pending. The rule holds for 2 minutes, then fires at 12 minutes.age of the oldest queued job600 s0thresholda stuck job's agegrows 1 s per secondnormalpendingfiring010 min12 min
What goes wrong, and what catches it
FailureSignal, and when it speaks
Jobs finish slowlySLO: 95% of jobs done within 15 min of enqueue
A job never finishesOldest queued job over 10 min, for 2 min (the SLO can't see a job that never finishes)
A job no worker can takeQueued jobs nobody has asked for, for 15 min
A job fails 3 timesDead letters, on the first evaluation (for: 0s)
The broker is unreachableUptime check every 300 s from 6 regions; broker_down after 600 s
The broker is erroringCloud Run 5xx: more than 5 in a 5-minute window
The database is downCloud SQL down: up below 1 for 5 min, or missing for 10
Spend or a request floodKill switch: $20 gross budget, or more than 5 client errors a second for 5 min
AWS spend$5 budget, emails only: a tripwire, not a cap
The kill switch itself firedNot the uptime check: it signs in as Google's monitoring agent, so it keeps passing. The budget or flood email and the IAM-change email say so instead. Not yet proven by a drill with public access off.
The rule's steps and numbers
  1. A job is queued and nobody claims it. Its age grows one second per second.
  2. At 600 s (10 min) the age crosses the threshold: the rule goes pending.
  3. It holds for 2 minutes (for: 2m), then fires at 12 min. In the live check, queue-stuck went pending at 600 s and fired 2 minutes later.
  4. The dead-letters rule has for: 0s and fired on its first evaluation.
  5. The rules are evaluated every minute (interval: 1m).
One rule's life: a job nobody claims ages one second per second, crosses 600 s, waits 2 minutes in pending, then fires. The table below says which signal catches which failure, including the gap I know about.

Since 4 December, alerts reach me by email: on Google Cloud, an uptime check on the broker, a 5xx alert and two Cloud SQL alerts, plus an email contact point in Grafana (ADR 0061). fleet-dash, built the same day, turns one render into both a live page for a batch and a snapshot of it (ADR 0057, PR #128).

The dashboard and a firing alert (local stack, 25 November)
Grafana's Fleet dashboard. Stat panels read Queued 0, Oldest queued job 0 seconds, Dead letters 0, SLO done within 15 minutes 100.0 percent, and Error budget left 100 percent. Below, a Jobs by state graph rises to 40 done, and a Throughput by model graph shows one point for qwen3:8b.
The Fleet dashboard after the GPU runs. The stack had only just started, so the graphs hold a few minutes of data at their right edge.
Grafana's alert rule list with two provisioned rules: Dead letters, marked as firing, and Oldest queued job waiting over 10 minutes, marked normal.
After one job was dead-lettered on purpose (leased by hand three times, each lease left to expire): the Dead letters alert is firing.

Trade-offs

Every ADR now carries a trade-offs table (ADR 0049); these are the ones that shaped the fleet.

  • Pull, not push. No scheduler, and the fast GPU takes more work on its own (ADR 0002). The costthe broker can’t tell a slow worker from a fast one. On chapter 1, with the PC off, the laptop took 20 of 21 pieces simply because it was the worker that was ready.
  • Content-addressed results. “At least once” is enough, and every result doubles as a cache. Turned downrandom result IDs with a “done” flag (duplicates leave orphans), and exactly-once delivery (expensive, and unneeded once duplicates don’t matter).
  • One shot per job. It fits a 16 GB card, and each failure stays small (ADR 0039). The costthe model sees no context across shots. Pass 2 is designed to add scene context (ADR 0053, not built).
  • Short polling with capped, jittered backoff. Ten idle workers polling every second would make about 26 million requests a month, roughly 13 times Cloud Run’s free tier; backing off to at most 60 seconds comes to about 430,000 (ADR 0008). The costan idle worker can take up to about a minute to notice new work.
  • One Cloud SQL instance. Real SQL and SKIP LOCKED, and Cloud Run has no shared disk for SQLite (ADR 0020). The costabout $9 a month fixed, the only thing that doesn’t scale to zero, and it keeps billing through a kill switch. Turned down: Neon, Firestore and DynamoDB.
  • Identity federation, not a stored AWS key. A stolen federated credential is useless after an hour (ADR 0025). Turned downan AWS access key in Secret Manager, a long-lived target.
  • The broker decides clearance, per named token. One device can be revoked without touching the others (ADR 0029). Turned downletting workers declare their own clearance (a boundary the client declares isn’t a boundary), and signed JWTs, which still need a deny list.
  • Rate limits in the app, not a paid edge firewall (ADR 0019). The costa flood takes the broker offline until a reviewed apply: uptime is traded for cost on purpose. Cloud Armor needs a load balancer that would cost more than the rest of the stack.
  • One AWS role signs footage links too, with derived text and every delete out of reach, and its exact permissions pinned in tests (ADR 0043). The costa stolen broker identity could read footage less than 14 days old. A footage-only role comes back before anything beyond my own machines touches the footage path.
  • Attended Colab. Prepaid units, no new bill. The costthe paid plan has no background execution, so a tab stays open for a batch.

For fleet-review, each choice beat an alternative:

Chosen Instead of Why
An append-only log, with the current state derived from it Editing the pipeline’s JSON files History, undo and “the machine changed since you checked” come free
A localhost app, with its data outside the repository A hosted app Copyrighted footage stays on machines I control
Server-rendered HTML and one script A framework and a bundler No build to maintain for a one-person tool
Headless Edge over the DevTools protocol Playwright No new dependency (ADR 0047)
Portfolio images from a demo mode with made-up data Screenshots of the real tool Nothing from the game can appear

Lessons: found by real runs, not by tests

  • The Ctrl+C that “failed” three times. On Windows, Python runs a signal handler only between bytecodes, so a 60-second backoff wait left an idle worker deaf to Ctrl+C. The fix was waiting in 0.5-second slices (worker 0.0.7): Ctrl+C to “stopping” went from up to 60 seconds to at most 0.5, and the tests caught 5 of 5 mutants. Then the re-drill “failed” twice more, and three theories in a row were wrong, each built on a single run. The cause: with text selected in a console window, Ctrl+C copies instead of stopping. Lesson: repeat a surprising result before bisecting it, and list how a person’s hands differ from the test’s.
  • The first trial died on S3 403s. The broker leased all 89 jobs, and every input link was refused. One decision had kept the broker’s AWS role to open data; a later one sent footage through the same broker without widening the role. Presigning is a local computation that always succeeds; only S3 checks the signer’s permission, when the URL is used. Every other check passed. Lesson: when two decisions each look right, test the seam between them with a real request (ADR 0043).
  • An “8 GB” card reporting 8188 MiB was refused. The installer’s minimum was 8 GiB, and the tests had “exactly 8 GB” but nothing just under it. The minimum is now 7.5 GiB (PR #112).
  • The default model tag was a reasoning model. Ollama’s qwen3-vl:8b is the Thinking model and ignores think: false. On the Sintel shots, 11 of 28 spent the whole token budget reasoning and returned nothing; the Instruct model did all 28 at a mean of 8.3 seconds, against 33.4 for the Thinking model’s finished shots (ADR 0042).
  • Plan review caught three bad applies. A stale file of image digests would have rolled the kill switch back; a plan that forgot two feature flags would have destroyed 8 resources (ADR 0032); and on 3 December a plan built without the running image digests planned to destroy the broker.
  • Two stale vault copies in one night. A copy that nothing keeps in sync is wrong eventually; reading the live value removed both traps.
  • Colab bills the runtime, not the process. The worker’s idle exit worked, but the notebook stayed connected, and that’s what uses units. The notebook now releases the runtime.
  • Cloud Run reserves paths ending in “z”. /healthz returned Google’s own 404 on the public URL, so the route is /health, with a test that no route ends in “z”.
  • The unit tests passed and the page was still wrong. My first real fleet-review session found seven faults the reviews had missed, among them frame keys that moved a border instead of the video and a browser extension stealing the keys. A headless-Edge check written afterwards failed 12 of its checks on the old script.
  • A check only counts if it can fail. One broken version of the review script passed every browser check, because a clean browser never swallows a key; a test that simulates the extension made it fail. Now the 43 browser checks catch all 4 broken versions.

Limits

  • Pass 1 sees still frames only, a few per shot, so motion between them is lost.
  • Colab runs are attended, and Cloud SQL keeps billing whatever the kill switch does.
  • The flood trigger needs edge rate limiting before contributors depend on the broker.
  • Only a job’s latest lease is stored, so an expired attempt shows up only as an attempt count above 1, and a batch’s timeline must be saved before its jobs are cleaned up.
  • GPUs in the cloud wait for quota: Google refused an L4, so the Cloud Run job backend runs on CPU.

What’s next

On the pipeline, in order:

  1. The pass 2 runner: the missing link to the first scene card.
  2. The names page: waits on my sign-off on the plan.
  3. One-button pass 1: waits on my review of its IAM plan.
  4. Chapter 1's opening, end to end: the first scene card a player can hear.

On the fleet:

  • Cloud Run jobs on an L4 (waiting for Google to grant quota).
  • The first real contributor, open jobs only (built, waiting for a contributor).