All work

Dogfood Studios · Fontys semester 6

Game build platform

A push-to-arcade build platform for game students. I built the Kubernetes side: database-driven autoscaling of one-shot build workers, the GitLab/GitHub integration, the data model and the CI.

Kubernetes, backend and CITeam of 4, Fontys semester 6Feb – Jun 2026.NET 8, EF Core, PostgreSQL, Kubernetes, KEDA, MinIO, GitLab CIFinished: handed over to the next student team

architecture: from push to arcade
  1. Student pushesto GitLab or GitHub
  2. Webhook → API.NET 8, one endpoint per provider(my part)
  3. Build is queueda row in PostgreSQL(my part)
  4. KEDA ScaledJobpolls the queue every 5 s(my part)
  5. Worker claims the buildone pod per build, with the right Unity version(my part)
  6. Game is builtUnity or Godot, inside the pod
  7. Build is storedzip in MinIO(my part)
  8. Arcade cabinetdownloads the new build
Highlighted steps are the parts I built. Building the games themselves, the dashboard and the client on the arcade cabinets were done by teammates.

The problem

Game students at Fontys make their projects in Unity or Godot. Dogfood Studios has physical arcade cabinets in the Demolab, and the students’ games should end up on them. The platform had to turn every git push into a build and put that build on the cabinets.

We were the third student group on the project. The Go backend we inherited didn’t work, so the team restarted: a new .NET backend and a new frontend. I defended that plan to the stakeholder.

How it works

A push triggers a webhook. The API stores the build as a row in PostgreSQL. KEDA watches that table and starts one worker pod per build. The worker claims the build, installs the right Unity version, builds the game, uploads a zip to MinIO and reports every status change. The dashboard shows progress live, and the cabinet downloads the new build. When the build is done, the pod stops itself.

Decisions

A database instead of a message broker

I first set up KEDA with RabbitMQ. Unity builds can take hours, and RabbitMQ has a consumer timeout of 30 minutes. Long builds went back into the queue and workers crashed. In the last four weeks of the project I moved the queue into PostgreSQL: KEDA now counts rows in the Builds table, and RabbitMQ is gone. Without a broker, the workers became simple background services that pull their next build over HTTP.

k8s/apps/workers/unity.yaml
minReplicaCount: 0
maxReplicaCount: 2
pollingInterval: 5
triggers:
  - type: postgresql
    metadata:
      query: >-
        SELECT COUNT(*) FROM "Builds" b
        INNER JOIN "CiProjects" p
          ON b."CiProjectId" = p."Id"
        WHERE b."Status" IN (0, 1, 2, 3)
          AND p."Engine" = 0
          AND b."IsFailed" = FALSE
      targetQueryValue: "1"
The query also counts builds that are still running (status 0–3). Without that, KEDA scales down while a build is in progress.

One pod per build

I used a KEDA ScaledJob instead of a long-running Deployment. Every build gets a fresh pod that stops itself when it’s done. There are no idle workers, every build starts from a clean state, and each build can use its own Unity version.

Let the database decide who wins

KEDA can start two pods for one build. Both pods then try to claim the oldest waiting build. UpdatedAt is a concurrency token, so only one save succeeds. The other pod gets a concurrency exception and tries again.

GameBuildPlatform.Dal/Repositories/BuildRepository.cs
var oldestBuild = await db.Builds
    .Include(b => b.CiProject)
    .Where(b => b.Status == BuildStatus.NotStarted
             && b.CiProject.Engine == engine)
    .OrderBy(b => b.AddedAt)
    .FirstOrDefaultAsync();

if (oldestBuild == null)
{
    return null;
}

oldestBuild.Status = BuildStatus.Building;
oldestBuild.StartedAt = DateTime.UtcNow;
oldestBuild.UpdatedAt = DateTime.UtcNow;

try
{
    await db.SaveChangesAsync();
    return oldestBuild.Id;
}
catch (DbUpdateConcurrencyException)
{
    // another pod claimed this build first
    retryCount++;
    db.Entry(oldestBuild).State = EntityState.Detached;
}
KEDA may start two pods for one build. The database decides who wins.

Builds that take hours

Each worker sends a heartbeat every two minutes. The backend marks a build as failed after 15 minutes of silence. A crashed pod can’t leave a build stuck on “Building” forever.

Unity in containers

  • Headless Unity in a bare container failed on DBus and X11 errors, so the worker image is based on unityci/hub with the .NET 8 runtime added (about 500 MB).
  • Every pod has a new hostname, so Unity saw a new machine each time and ran into the licence seat limit. The worker now always returns its licence in a finally block.
  • The Unity version comes from the project’s ProjectVersion.txt. Each version is installed once on a shared disk, behind a file lock, so two pods never install the same editor at the same time.

Smaller decisions

  • Database migrations run as a Kubernetes Job before the rollout, not at app start, so several replicas never migrate at once.
  • Each arcade cabinet gets an API key that is bound to its hardware ID on first use. A copied key doesn’t work on another machine.

What went wrong

  • The node ran out of disk. It had 40 GB, and a single Unity Library folder can be over 10 GB, so pods got evicted. The cluster on Fontys EduCloud had no storage driver, so I formatted extra disks by hand and used hostPath volumes pinned to the node.
  • Testing was thin. Backend coverage was 20%. CI only ran tests, on a runner on my own laptop. Fontys had no room for a runner, so the pipeline only ran when my laptop was on. Deploys were a manual script with :latest tags.
  • The user test taught us about real projects. Several students’ own games didn’t compile, and the webhook only listened to main, which most students left empty.
  • Unreal Engine support never got further than a start.

My part and the team’s

Mine: the Kubernetes setup and KEDA autoscaling, the PostgreSQL queue and the claim logic, the worker side around each build (claiming it and installing the right Unity version), build storage, the GitLab/GitHub integration (tokens, repository lists for GitHub, GitLab.com and Fontys’ own GitLab, engine detection, automatic webhooks), the EF Core data model (8 of the 10 migrations), the backend for the arcade cabinets, the CI pipeline and deployment. I was the contact for the stakeholder for the whole project, and at the start also for the previous group. I set up Jira and rewrote the user stories.

In numbers: nearly all of the Kubernetes configuration is mine, and I merged 45 of the 76 merge requests.

The team’s: the build step itself (running Unity or Godot on the student’s project), the React frontend and dashboard, the client on the arcade cabinets, the Godot installer, HTTPS with cert-manager and the encryption of stored tokens.

* An earlier student group had experimented with KEDA on RabbitMQ. That code was removed when our team restarted the project, and I set up KEDA again from scratch.

Status

Finished in June 2026 and handed over. I wrote the Kubernetes part of the handover document. A new student group has continued with the platform; according to the project supervisor, there was little left to do.