Zero to Deployed on a €0 Bill: Teaching Cloud to TU Delft Students

July 2026 · 8 min read

The brief I set myself was simple to state and annoying to satisfy. Take university students who can write Python, and get every one of them to a personal API running in the cloud, deploying automatically on every commit, without a single credit card entering the story.

Most of the design follows from that last constraint. Students don't have corporate accounts. A course that begins with "first, set up billing" has already lost the room, and one that might surprise a student with a €40 bill is irresponsible. So the course I built for TU Delft students treats free tiers as a hard requirement, and that requirement shapes every technical choice.

Nine exercises, one continuous artifact

The course is nine progressive exercises, and the property I care about most is that they build one thing: a single FastAPI service that each exercise makes more real, instead of nine toy examples.

The ordering is doing pedagogical work, so it's worth spelling out. Exercise one is the API itself: three endpoints (root, health, version), Pydantic response models, type hints everywhere, and configuration through pydantic-settings reading environment variables. That last one is planted early on purpose, so that by the time containers arrive, "config comes from the environment" is already muscle memory rather than a new idea arriving at the same time as Dockerfiles. Exercise two is testing with pytest, async support and coverage included. Three introduces uv for dependency management. Four containerizes the app, and students complete a partial Dockerfile rather than copy a finished one. Five wires GitHub Actions to run quality checks on every push. Then the cloud half: six pushes the image to Artifact Registry, seven deploys it to Cloud Run by hand, eight automates the whole path so a push deploys itself, and nine hardens what now exists with security and observability, topics that only make sense once there's something real to protect.

By the end, a student's repository is a small but genuine production setup, and the final state has a property I care about:

flowchart LR
    PUSH["git push"] --> QC["GitHub Actions<br/>ruff lint · ruff format<br/>mypy · pytest"]
    QC -->|all green| BUILD["docker build"]
    BUILD --> AR["Artifact Registry"]
    AR --> CR["Cloud Run<br/>(scale to zero)"]
    CR --> HC["deploy health check<br/>GET /health"]
    QC -.->|red| STOP["pipeline stops:<br/>broken code never ships"]
    WIF["Workload Identity Federation<br/>no service-account keys, anywhere"] -.authenticates.-> AR
  

Every commit they push triggers quality checks, builds a container, ships it, and then curls its own /health endpoint to confirm the thing that deployed actually runs. Without that last small step, you're mostly hoping the deploy worked. The course really lands the moment a student pushes a change and watches their live URL update on its own.

You can lecture about CI/CD for an hour, or you can let someone feel it once.

Teach the tools professionals actually use

I decided early on that there would be no teaching-only technology. Everything in the stack is what they'd meet at a decent engineering shop in 2026: FastAPI, pytest, uv (watching pip users meet uv's install speed is reliable entertainment), ruff and mypy in CI, Docker, GitHub Actions, Cloud Run. My argument for this is respect: students can smell a sandbox.

The lint configuration is itself a tiny syllabus. Ruff runs with rule families beyond the default errors: bugbear for the mistakes that pass tests and fail at 2am, plus comprehension, upgrade and simplification rules. Mypy runs strict. Students meet "the linter is arguing with me" early, in exercise five, on code they wrote themselves, and they rehearse the way out (read the rule, understand why, fix or consciously silence it) as a professional skill rather than an annoyance. The same philosophy runs through the troubleshooting doc, which is a first-class part of the course. Real tools come with real sharp edges, and "read the error, check the docs, fix the config" is what students are practicing in every exercise, whatever the exercise is nominally about.

Exercise two also ships with one test that fails on purpose, so students' first encounter with pytest is a red one. The skill I'm after is reading a failure and reasoning backward from the assertion to the cause. A wall of green only teaches you which button runs the suite. The failing test gets fixed in the first ten minutes and pays for itself for the rest of the course. It's a trick I've now smuggled into every course I write.

Free tiers as an architecture constraint

The budget engineering turned out to be some of the most interesting design work in the course, and it came down to a few choices.

GitHub Codespaces is the standard dev environment. The free tier is 120 core-hours per month, which on a 2-core machine is 60 hours, several times what the course needs. It also deletes the entire "works on my machine" support queue. Everyone gets an identical Linux box with the toolchain pre-installed, and laptop diversity stops being my problem. In a room of thirty students, environment triage alone can turn a teaching session into a tech support shift.

Cloud Run is the deployment target. The free tier is generous, sure: 180,000 vCPU-seconds a month is far more than a student API sipping requests will ever use. But scale-to-zero is also the pedagogically honest choice. An idle student service costs actual zero, and thirty forgotten course deployments in December cost the same. Any always-on option would slowly bill someone for a tutorial they finished months ago. One shared GCP project hosts all the cloud exercises, so the setup ceremony happens once, in exercise six, instead of once per service.

Workload Identity Federation handles the CI-to-GCP handshake. I insisted on it even though it's the fiddliest setup step in the whole course. The alternative, exporting a service-account key and pasting it into GitHub secrets, is easier to teach and exactly the habit I refuse to install in someone's first cloud experience. Long-lived credentials in CI is how universities end up mining someone else's cryptocurrency. Students configure OIDC trust between GitHub and GCP once and never create a key, so their very first pipeline already works the way security teams wish all pipelines did.

What I'd keep

I'd keep the through-line artifact, without question. One growing project builds a momentum that isolated exercises never find, which is the same lesson as the narrative structure in my agent course. I'd keep the free-tier constraint too, and not only for the students' sake. Designing under "this must cost nothing" forced choices (serverless, scale-to-zero, keyless auth, ephemeral dev environments) that are simply good architecture, budget or not. I keep seeing this: a constraint that sounds like austerity pushes you toward choices you'd want to make anyway.

There's a decent chance some of these students will one day inherit a real production pipeline. My quiet hope is that when they meet a service-account key pasted into a CI secret, something in the back of their mind, installed in exercise eight on a free tier years earlier, says: wait, we don't do it like that.

References