You are reading the docs for v0.0.1-beta-8. Latest (main) →

Three repos on one M5 Mac mini: macOS VMs, Linux containers, and the runs-on label that stuck my jobs

View .mdEdit on GitHub

Tuesday, December 1, 2026 · Alex Rabin

kinhin watches your CI queue and, for each queued job, starts a fresh VM or container on your Apple Silicon Mac, registers a one-job runner, lets it run, then deletes it. This post is a field report, not a release: one Mac mini, three repositories, two runtimes, and the one mistake that cost me an afternoon.

The machine and the layout#

SpecDetail
HostMac mini M5, arm64 (macOS 27 when I wrote this)
CPU18 cores
Memory64 GB
NetworkSoftnet on, VMs cannot reach the LAN

The Mac serves three repositories in one GitHub organization:

RepoRuntimeWhat it builds
kinhin itselfTart (macOS)Swift tests and TSan
A Node, Cloudflare and Supabase appApple containerUnit and Postgres tests, Playwright end-to-end tests, typecheck, deploys
A second Linux workloadApple containerLinux jobs

The second repository is the busiest one: a Node app deployed to Cloudflare, with Supabase behind it. Its pipeline runs the unit tests, the Postgres (pg) tests against a real database, Playwright end-to-end tests in a browser, the typecheck, and the deploy. All of it runs in short-lived Linux containers on the same Mac, one fresh container per job.

Whole repositories are routed to a runtime in config.yaml, and anything unmatched falls back to the default runtime:

runtimes:
  default: appleContainer
  budget: { tart: 0.625, appleContainer: 0.375 }
  routes:
    - { pattern: "your-org/macos-app", runtime: tart }

The Linux side uses two container pools, a small one for cheap checks and a large one, capped at one job at a time, for deploys:

container:
  pools:
    linux-small: { labels: [linux, linux-small], cpus: 2, memory_gb: 4, min_idle: 1 }
    linux-large: { labels: [linux, linux-large], cpus: 4, memory_gb: 8, min_idle: 0, max: 1 }

Apple's terms cap a Mac at two macOS VMs at once, so the Tart side is always small. The Linux containers share whatever budget is left.

The stuck jobs#

A deploy job sat Queued for hours with an empty runner_name. The daemon was healthy. kinhin status showed ready VMs. No [scaleset] error anywhere. Nothing was wrong except that GitHub never handed the job to kinhin.

The cause is how scale-set mode works. GitHub assigns a job to a scale set only when the scale set carries every label the job asks for, and the label that matters is the scale set's name. The names are not the same as the pool names in config.yaml:

runs-on:Result
kinhin-container-linux-largeWorks: the large pool's scale set
kinhin-container-linux-smallWorks: the small pool's scale set
kinhin-xcode-27Works: my Xcode image is named xcode-27
kinhin-xcodeStuck here: I have no image named xcode
[kinhin-container, linux-small]Stuck: linux-small is a pool label, not a scale-set label

The pool is linux-small, but the thing a workflow targets is kinhin-container-linux-small. I had the workflow for kinhin's own CI asking for kinhin-xcode when the image's scale set is kinhin-xcode-27. One word of difference, and the job waits forever with no error.

The fix was to use a single exact label per job. I also split each Linux workflow in two, so cheap checks use the small pool and the deploy uses the large one:

jobs:
  test-and-typecheck:
    runs-on: kinhin-container-linux-small
    steps: # test, typecheck

  deploy:
    needs: test-and-typecheck
    runs-on: kinhin-container-linux-large
    steps: # wrangler deploy

The -27 is my naming, not kinhin's. kinhin names the scale set kinhin-<image> after whatever you called the image entry, so your label may differ, and it follows the image's name rather than its Xcode version.

When Xcode or macOS changes, and what else I learned#

This is the part that will go stale, so I worked out the upgrade path before I needed it. The same label mistake turns up in other forms, and working through it taught me a few more things:

  • Keep the version out of the label. If I rebuild the same image on a newer base, the label stays and no workflow changes. If I rename it to xcode-28, every runs-on: has to change, and jobs left on the old name wait forever without an error. kinhin never deletes a scale set when an image goes, so nothing tells you the old name is dead. Next time I'll name the image xcode and rebuild it in place.
  • A new image needs a restart. kinhin creates scale sets when it starts. Add an image later, such as a beta, and a job on its label matches nothing until you restart. It looks exactly like the label bug above, with the same empty runner name. The check is the listens on scale sets line in the log.
  • Pin before you bake, not after. A :latest tag can be republished at any time. If I pin the digest after the bake, I may record a build I never baked. So the digest goes into base_image first, then I prepare the image.
  • Warm VMs outlive a rebuild. VMs already cloned from the old image stay in a warm pool until they age out, so the first jobs after an upgrade can still run on the old Xcode. I print xcodebuild -version in the first job.
  • Try a beta as its own image. A separate xcode-beta entry that only opted-in jobs use cannot break the main build. kinhin has no beta channel, so it is a registry reference pinned to a digest or a local VM built from the IPSW.

The steps, with the commands, are in Upgrading Xcode or macOS images.

The second problem: a restart#

While chasing this I restarted the daemon, and the log filled with session conflict warnings:

launchctl kickstart -k gui/$(id -u)/com.kinhin.daemon

GitHub allows one live message session per scale set. After a restart, GitHub can still hold the previous session until it lapses, so for a minute or two kinhin warns, then logs established; listening for jobs, and jobs flow again. This is expected, and nothing you do to a workflow run changes it.

I mention it because the restart and the label bug overlapped, and it made the label bug look like a session bug. Fix the label first. A run keeps the workflow file from the commit it started on, so re-running a stuck run asks for the same wrong label. Push the corrected workflow, cancel the stuck run, and start a new one (workflow_dispatch works).

A checklist for the next repo#

  1. Add a routes: entry for the repo, tart for macOS or appleContainer for Linux.
  2. Copy a runs-on: exactly from the scale-set names in the listens on scale sets line of the daemon log. A single exact label is safest. An array works only when the scale set carries every label in it, and pool labels like linux-small are not on it.
  3. Start with workflow_dispatch and watch kinhin pipeline.
  4. If it sticks, check the label before anything else, then look for session conflict in the daemon log. A fixed label needs a new run, not a re-run.
  5. A VM going ready to busy confirms the assignment landed.

The takeaway#

kinhin's scale-set names are the authoritative runs-on: labels. When a job is queued, the runner name is empty, and the daemon looks healthy, a label mismatch is the first thing to check. Nothing errors, because from GitHub's side nothing is wrong: no scale set matched, so no one was asked.

The reference for all of this is Troubleshooting and the GitHub scale-set notes.

Update, December 1, 2026#

Most of the upgrade work above is now something kinhin can do itself. It records the digest each image was baked from, checks the registry once a day, and can warn you (notify, the default), queue the rebuild for your approval (approve), or rebuild when the queue is quiet (auto). An image pinned to a digest is left alone, and kinhin image rollback goes back to the previous one. The pin-before-you-bake step above is no longer something to remember, because the bake clones from the digest it records. The details, and what to know before turning on auto, are in Let kinhin follow the registry.