[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107986":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":27,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":16,"starSnapshotCount":16,"syncStatus":31,"lastSyncTime":32,"discoverSource":33},107986,"runner-up","kunchenguid\u002Frunner-up","kunchenguid","GitHub Actions runners on your own machines, one fresh container or VM per job. Completely eliminate your cloud CI bill.","",null,"Go",365,30,93,13,0,3,18,178,14,69.47,"MIT License",false,"main",true,[],"2026-11-21 19:09:40","2026-11-23 13:32:32","\u003Ch1 align=\"center\">runner-up\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fkunchenguid\u002Frunner-up\u002Factions\u002Fworkflows\u002Fci.yml\">\u003Cimg alt=\"CI\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fkunchenguid\u002Frunner-up\u002Fci.yml?style=flat-square&label=CI\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fkunchenguid\u002Frunner-up\u002Factions\u002Fworkflows\u002Frelease.yml\">\u003Cimg alt=\"Release\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fkunchenguid\u002Frunner-up\u002Frelease.yml?style=flat-square&label=Release\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"#\">\u003Cimg alt=\"Platform\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-macOS%20%7C%20Linux%20%7C%20Windows-blue?style=flat-square\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fx.com\u002Fkunchenguid\">\u003Cimg alt=\"X\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FX-@kunchenguid-black?style=flat-square\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FBW4aJuQhTf\">\u003Cimg alt=\"Discord\" src=\"https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1439901831038763092?style=flat-square&label=discord\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Ch3 align=\"center\">GitHub Actions runners on your own machines, one fresh container or VM per job.\u003C\u002Fh3>\n\nYou have spare machines: a Linux box, a Mac, a Windows PC. Yet your GitHub Actions\njobs wait in line for hosted runners, or burn a hole in your wallet.\n\nrunner-up self-hosts GitHub Actions runners across your machines. Each job gets a \nDocker container or KVM virtual machine on Linux, a fresh tart clone of a\nmacOS image or a fresh Linux guest from Apple's container tool on a Mac, or a\nfresh Windows account or Hyper-V virtual machine on\nWindows, which is removed when the job ends. A place can also run its jobs on\nthe machine itself.\n\nOne coordinator talks to GitHub through runner scale sets and hears of every\nwaiting job. Jobs wait at GitHub without a runner until a place is free. The\nfirst-ranked job waiting only for resources keeps room on one machine. Then\nthe coordinator picks the job its order rules choose, acquires it, and starts a\none-job runner for it. It starts the runner by running the agent on that\nplace's machine over SSH.\n\n- **Places.** Each machine has places. A place runs one job at a time and\n  serves one or more pools, the labels jobs ask for in `runs-on`.\n- **Budgets.** A machine's places share its cores and memory, less the room\n  kept for the machine's owner. A job takes a place only while its pool's\n  size fits; a pool without a size keeps the place's existing share.\n  A Mac runs at most two macOS virtual machines at once, counting ones\n  runner-up did not start (see [Macs](#macs)).\n- **Order.** When a place frees, the order rules pick which waiting job it\n  takes, across repositories (see [Order rules](#order-rules)).\n- **Forks.** Jobs from another repository's pull request are refused by\n  default, on every provider (see [Pull requests from forks](#pull-requests-from-forks)).\n- **Restarts.** A running job keeps its place while the coordinator restarts.\n  A crashed place is cleaned up, and its job gets a new runner.\n- **Setup changes.** A running coordinator applies an edited setup file about\n  a second after it settles, with no restart and without stopping running\n  jobs (see [Changing the setup](#changing-the-setup)).\n- **Down machines.** A machine whose agent cannot be reached rests until its\n  agent answers again, and its job goes to another place (see\n  [When a machine is down](#when-a-machine-is-down)).\n- **Sign-in.** The coordinator uses the GitHub command line's sign-in. It\n  stores no token: it asks `gh auth token` each time it opens a session.\n\n## Quick start\n\n### Tell your agent\n\nPaste this to a coding agent running on the machine that will be the\ncoordinator:\n\n```text\nSet up runner-up (https:\u002F\u002Fgithub.com\u002Fkunchenguid\u002Frunner-up) so my GitHub\nActions jobs run on my own machines. Read its README first and follow it:\nhttps:\u002F\u002Fraw.githubusercontent.com\u002Fkunchenguid\u002Frunner-up\u002Fmain\u002FREADME.md\n\nThis machine is the coordinator. Ask me which repositories or organization\nto serve, each machine to run jobs on (its SSH address and the kind of\nplaces it should have: Docker, KVM or host on Linux; tart, Apple container\nor host on a Mac; account or Hyper-V on Windows), and a pool label for each\nkind of machine. A pool is the label workflows ask for in runs-on; separate\npools keep a Linux job off a Mac or a Windows machine.\n\n1. Install runner-up here. Check that gh is signed in as an admin of each\n   repository (with the admin:org scope for an organization), and that\n   `ssh -o BatchMode=yes USER@MACHINE true` works for every Linux machine\n   and Mac. If it does not, tell me how to fix it.\n2. Over SSH, check that each Linux machine and Mac has what its places\n   need, as \"What you need\" lists. Tell me what is missing and how to add it.\n3. For each Windows machine, tell me exactly what to run there in an\n   administrator PowerShell: the install command, how to put this machine's\n   SSH public key there, and runner-up.exe setup with it. Once I say it is\n   done, check that ssh to it works.\n4. Run runner-up init, then runner-up machine add for each machine (with\n   --install for a machine of another system, as \"Setting up\" says). Then\n   edit the setup file so it lists every pool and each place serves only\n   its own machine's pool. Run runner-up check-config until it passes.\n5. Run runner-up serve as a service, as \"Running as a service\" shows for\n   this machine's system, starting runner-up from where it is installed.\n   Check that runner-up status lists every place.\n6. Show me the runs-on line for each pool.\n\nAsk me before you run anything with sudo.\n```\n\n### By hand\n\nInstall runner-up (see [Install](#install)) and check\n[What you need](#what-you-need), then:\n\n```sh\n# What to serve, and the label Linux jobs ask for.\nrunner-up init --repo you\u002Fapp --pool my-linux\n\n# Add machines. Each gets as many places as its cores and memory fit,\n# less the room kept for its owner (1 core and 1024 MB by default).\nrunner-up machine add box --ssh ci@box\nrunner-up machine add big --ssh ci@big --provider kvm \\\n    --image \u002Fhome\u002Fci\u002Fnoble-server-cloudimg-amd64.img --place-cores 4 --place-memory 8192\n# A Mac: two tart places of 4 cores and 8 GB by default.\nrunner-up machine add mac --ssh you@mac --image ghcr.io\u002Fcirruslabs\u002Fmacos-sequoia-base:latest\n```\n\n`machine add` has each place serve every pool the setup lists, so the Mac's\nplaces now serve `my-linux` too, and a Linux job could run on macOS. Give the\nMac a pool of its own in the setup file (see [Setting up](#setting-up) for\nwhere it is):\n\n1. Add `{\"label\": \"my-mac\"}` to `\"pools\"`.\n2. In each of the Mac's places, `mac-1` and `mac-2`, change `\"pools\"` to\n   `[\"my-mac\"]`.\n\nThen check the setup and start the coordinator:\n\n```sh\nrunner-up check-config\nrunner-up serve\n```\n\nThen ask for a pool in a workflow:\n\n```yaml\njobs:\n  build:\n    runs-on: my-linux\n  build-mac:\n    runs-on: my-mac\n```\n\nA machine you add later serves both pools unless you add it with\n`--pool my-linux` or `--pool my-mac`.\n\n## How it works\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Farchitecture.svg\" width=\"750\" alt=\"GitHub's job queue and runner scale sets talk to one coordinator on Linux or macOS. The coordinator reads the setup file and the GitHub sign-in, and holds scale set sessions, the planner, place runners and the updater. Over SSH, with the registration on standard input, it reaches an agent on each Linux machine (Docker, KVM or host places), Mac (tart, Apple container or host places) and Windows machine (account or Hyper-V places, through the Windows service). Each one-job runner then works with GitHub directly.\" \u002F>\n\u003C\u002Fp>\n\nrunner-up is one program. On the coordinator's machine it holds a scale set\nsession for each repository and pool, plans which waiting job goes to which\nfree place, and starts a place runner for each job. The place runner reaches\nthe place's machine over SSH and runs runner-up there as the agent, which\nmakes the fresh container, virtual machine or account and starts GitHub's\nrunner in it. From then on the runner works with GitHub directly. On Windows\nthe agent asks runner-up's Windows service, which runs as SYSTEM, to make job\naccounts and Hyper-V virtual machines.\n\n**Why the coordinator runs only on Linux and macOS.** It relies on Unix\nprocess features that Windows does not offer in the same form:\n\n- It hands each place's lock to that place's runner process as an open file.\n  A place is busy exactly while some process holds its lock, so a running job\n  keeps its place through a coordinator restart.\n- It updates by replacing itself in the same process, so launchd or systemd\n  keeps supervising it.\n- It stops place runners with a stop signal, and stops a borrow's command\n  with its process group.\n- A borrow passes your terminal to the coordinator over a Unix socket.\n\nThe agent needs none of these, so machines may run Windows.\n\n### Compared with other ways to run your own runners\n\n- **A plain self-hosted runner** stays registered and runs job after job in\n  the same place, keeping each job's leftovers. runner-up starts a one-job\n  runner in a fresh place for every job, and spreads jobs over several\n  machines by their free cores and memory.\n- **Kubernetes-based autoscaling**, such as GitHub's Actions Runner\n  Controller, uses the same runner scale sets but needs a Kubernetes cluster\n  and runs jobs in containers on its nodes. runner-up needs only SSH to each\n  machine, and also runs jobs in virtual machines, in macOS virtual machines\n  on a Mac, and on Windows.\n\n## Words used here\n\n| Word | Meaning |\n| --- | --- |\n| **setup** | the setup file: a JSON file naming the repositories, pools, machines and places to serve. `init` and `machine add` write it, and you may edit it (see [Setup file](#setup-file)) |\n| **place** | where one job runs at a time on a machine: a Docker container, a KVM, tart or Hyper-V virtual machine, an Apple container guest, a Windows account, or the machine itself (a host place). Each job gets a fresh one, except on a host place |\n| **pool** | a label jobs ask for in `runs-on`. Each place serves one or more pools, and a pool may set the cores and memory each of its jobs reserves |\n| **room** | cores and memory set aside. A machine keeps room for its owner (1 core and 1024 MB by default), and the first-ranked job waiting only for cores or memory keeps room on one machine until it fits |\n| **rest** | a machine whose agent cannot be reached rests: its places take no job until the agent answers again (see [When a machine is down](#when-a-machine-is-down)) |\n| **borrow** | reserving a tart place on a Mac for a command of your own for a while, instead of a job (see [Borrowing a virtual Mac](#borrowing-a-virtual-mac)) |\n| **drain** | pausing named places until named jobs have run there with nothing else running (see [Draining places](#draining-places)) |\n\n## Status\n\nrunner-up is young. Read this before you trust it with your jobs.\n\n- **Runner scale sets are in preview.** runner-up talks to GitHub through\n  [`actions\u002Fscaleset`](https:\u002F\u002Fgithub.com\u002Factions\u002Fscaleset), GitHub's client\n  for runner scale sets, which GitHub still calls a preview. A change on\n  GitHub's side can break runner-up until it catches up.\n- **Proven with real jobs:** Docker and KVM places on Linux, tart and host\n  places on a Mac, a job running on through a coordinator restart, and a\n  crashed place's cleanup.\n- **Proven only in part:** Hyper-V places have run only a check's test jobs,\n  not yet anyone's daily work. Apple container places have run the runner\n  with a stand-in registration, not yet a real job. Account places on Windows pass their tests but\n  have not yet run a real job. Changing the setup while the coordinator runs\n  is proven by end-to-end tests with stand-ins for GitHub, ssh and Docker,\n  not yet with real jobs.\n- **Order rules** are proven by tests that replay GitHub's recorded scale set\n  messages. Within one pool of one repository GitHub picks which job a runner\n  takes, so the order there is only close (see [Order rules](#order-rules)).\n- **Experimental:** Hyper-V places, Apple container places, Windows account\n  places, [borrowing a virtual Mac](#borrowing-a-virtual-mac) and\n  [draining places](#draining-places). They may still change between\n  releases.\n\n## Install\n\n**macOS \u002F Linux**\n\n```sh\ncurl -fsSL https:\u002F\u002Fkunchenguid.github.io\u002Frunner-up\u002Finstall.sh | sh\n```\n\n**Windows (PowerShell)**\n\n```powershell\nirm https:\u002F\u002Fkunchenguid.github.io\u002Frunner-up\u002Finstall.ps1 | iex\n```\n\nBoth scripts install the latest release only if its archive matches the\nSHA-256 the release's `checksums.txt` lists. Release binaries are static, so\nthe Linux ones run on any glibc or musl distribution.\n\nA Windows machine then needs one step as administrator (see\n[Windows machines](#windows-machines)).\n\n**Nix**\n\n```sh\nnix run github:kunchenguid\u002Frunner-up -- version\n```\n\nInstall into your Nix profile:\n\n```sh\nnix profile add github:kunchenguid\u002Frunner-up\n```\n\nOr add to your flake inputs:\n\n```nix\nrunner-up.url = \"github:kunchenguid\u002Frunner-up\";\n```\n\nThe flake exposes `#default` and `#runner-up` package outputs, plus `apps` for\n`nix run`, for `aarch64-darwin`, `aarch64-linux` and `x86_64-linux`. It builds\nwith Go 1.27.3, which your own nixpkgs may not have yet, so let it keep its own\nnixpkgs rather than follow yours.\n\n**Go**\n\n```sh\ngo install github.com\u002Fkunchenguid\u002Frunner-up@latest\n```\n\n**From source**\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fkunchenguid\u002Frunner-up.git\ncd runner-up\nmake install\n```\n\n## What you need\n\nOn the coordinator's machine (Linux or macOS):\n\n- [`gh`](https:\u002F\u002Fcli.github.com), signed in with `gh auth login` as an admin of\n  each repository you serve. To serve an organization, the sign-in also needs\n  the `admin:org` scope: `gh auth refresh -h github.com -s admin:org`.\n- SSH access to each machine with a key, without a password prompt\n  (`ssh -o BatchMode=yes ci@box true` must work).\n- runner-up (see [Install](#install)).\n\nOn each machine (Linux on x86-64 or arm64, or a Mac), for the provider its\nplaces use:\n\n- **Docker places:** Docker, with the SSH user in the `docker` group.\n- **KVM places:** `\u002Fdev\u002Fkvm` usable by the SSH user (the `kvm` group),\n  `qemu-system-x86_64` or `qemu-system-aarch64`, `qemu-img`, and on arm64 the\n  UEFI firmware (`qemu-efi-aarch64`). You also need a cloud image with\n  cloud-init on the machine, such as Ubuntu's:\n\n  ```sh\n  curl -LO https:\u002F\u002Fcloud-images.ubuntu.com\u002Fnoble\u002Fcurrent\u002Fnoble-server-cloudimg-amd64.img\n  ```\n\n- **tart places** (a Mac with Apple silicon): [tart](https:\u002F\u002Ftart.run), from\n  its makers (`brew install cirruslabs\u002Fcli\u002Ftart`), and a macOS image pulled on\n  the Mac (see [macOS images](#macos-images)). runner-up runs the tart you\n  install and never bundles it; tart's license is its makers' (FSL-1.1).\n- **Apple container places** (experimental; a Mac with Apple silicon): Apple's\n  [container](https:\u002F\u002Fgithub.com\u002Fapple\u002Fcontainer) tool with its service\n  started (`container system start`), and a Linux image built or pulled on the\n  Mac with `\u002Fusr\u002Fbin\u002Fpython3`, Bash, tar, the Linux libraries GitHub's runner\n  needs, and a user and group named `runner` with `\u002Fhome\u002Frunner` present.\n  GitHub's runner itself need not be in the image; the guest downloads the\n  pinned runner. The runner gets what the image sets in `\u002Fetc\u002Fenvironment`,\n  as on a Hyper-V place.\n- **host places** (Linux or a Mac): nothing more. The job runs as the SSH user\n  (see [Trade-offs](#trade-offs)).\n\n\nOn each Windows machine (Windows 10, 11 or Server 2019 and later, x86-64):\n\n- **Account places** (experimental): nothing more. Each job runs as a fresh standard account\n  that runner-up's Windows service makes, contains to the place's cores and\n  memory, and deletes afterwards.\n- **Hyper-V places** (experimental): Hyper-V, and a base disk for the job VMs: an Ubuntu cloud\n  image converted to VHDX, such as with `qemu-img` on any machine:\n\n  ```sh\n  curl -LO https:\u002F\u002Fcloud-images.ubuntu.com\u002Fnoble\u002Fcurrent\u002Fnoble-server-cloudimg-amd64.img\n  qemu-img convert -O vhdx -o subformat=dynamic noble-server-cloudimg-amd64.img noble.vhdx\n  ```\n\n  Copy `noble.vhdx` to the machine, for example to `C:\\runner-up\\noble.vhdx`.\n  A disk you build with your own tools works too, if cloud-init still runs at\n  its boot. The runner gets the variables the disk sets in `\u002Fetc\u002Fenvironment`,\n  as a login would: set `RUNNER_TOOL_CACHE` there for tools you install in\n  advance, as GitHub's Ubuntu images do.\n\nrunner-up installs itself on each Linux machine and Mac when you add it. A Windows\nmachine needs one step first (see [Windows machines](#windows-machines)).\n\n## Setting up\n\n`init` checks that your sign-in can create runners for each repository.\n`machine add` reaches the machine over SSH. It copies runner-up there (to\n`~\u002F.local\u002Fbin`) when it is missing, reads the machine's cores and memory, and\nchecks that its provider works: Docker by default on Linux, tart on a Mac, or\nthe one `--provider` names (`docker`, `kvm`, `tart`, `host` or, on a Mac,\n`container` with `--image`). For Apple container places it checks that the\ncontainer tool is installed and its service answers, but not the image; see\n[What you need](#what-you-need). It copies itself only to a\nmachine of its own system and architecture; for another,\ndownload runner-up for it from the\n[releases](https:\u002F\u002Fgithub.com\u002Fkunchenguid\u002Frunner-up\u002Freleases) and pass\n`--install FILE`. Both commands write the setup file. By default it is\n`~\u002F.config\u002Frunner-up\u002Fconfig.json` on Linux and\n`~\u002FLibrary\u002FApplication Support\u002Frunner-up\u002Fconfig.json` on a Mac, or\n`runner-up\u002Fconfig.json` under `$XDG_CONFIG_HOME` when that is set; `--config\nFILE` names another. You can edit that file by hand, and it never holds a\ntoken. A running `runner-up serve` applies your edits (see\n[Changing the setup](#changing-the-setup)).\n\n`runner-up status` shows each place, its running reservation and the waiting\nwork. `runner-up usage` shows finished jobs' resource readings beside their\npool sizes (see [Job sizes and readings](#job-sizes-and-readings)); for borrows, see\n[Borrowing a virtual Mac](#borrowing-a-virtual-mac); to let some jobs run on\nplaces with nothing else running, see [Draining places](#draining-places).\n\n### Windows machines\n\n> **Experimental.** Account and Hyper-V places have not yet run anyone's daily\n> work (see [Status](#status)).\n\nOn the Windows machine, in a terminal opened with **Run as administrator**, run\nrunner-up's Windows build (see [Install](#install)) once:\n\n```bat\nrunner-up.exe setup --user ci --ssh --ssh-key C:\\path\\to\\coordinator-key.pub --hyperv\n```\n\n`setup` installs runner-up in `C:\\Program Files\\runner-up` and on the PATH,\nand installs the runner-up service, which makes and deletes the job accounts.\n`--user` names the account the coordinator signs in as; it may be a standard\naccount. `--ssh` turns on Windows' OpenSSH server, and `--ssh-key` lets the\ncoordinator's key sign in as that account. `--hyperv` turns Hyper-V on and lets\nthe account make virtual machines; leave it out for account places only.\nRestart the machine if it says so.\n\nRunning `setup` again is harmless and installs the runner-up it is run with.\nEach version goes in a folder of its own, such as\n`C:\\Program Files\\runner-up\\v0.1.11-1a2dc4c30dbf`, before anything stops, so\na running job keeps its program. `setup` restarts the service only when its\nprogram or account changed, and first waits, up to 30 minutes, for the\nservice's running Windows jobs to end, since a stop ends them; Ctrl+C while it\nwaits changes nothing. Whatever stops `setup` partway, it starts the service\nagain. Once the setup names a `release`, the service also updates itself (see\n[Updating runner-up](#updating-runner-up)).\n\nThen, on the coordinator:\n\n```sh\nrunner-up machine add pc --ssh ci@pc                       # account places\nrunner-up machine add pc --ssh ci@pc --provider hyperv \\\n    --image 'C:\\runner-up\\noble.vhdx' --place-cores 4 --place-memory 8192\n```\n\n`machine add` notices the machine runs Windows. Account places run the jobs of\na pool whose workflows expect Windows (`shell: pwsh`, Git Bash for\n`shell: bash` when Git for Windows is installed). Hyper-V places run Linux\njobs. A Hyper-V place joins Hyper-V's Default Switch; set `--switch` for\nanother.\n\n### Running as a service\n\nFor example, as a systemd user service on the coordinator's machine. With a\n`release` in the setup, run `runner-up update` once and start\n`stateDir\u002Fprogram\u002Fcurrent` instead, so the supervisor starts the version the\ncoordinator updated itself to (see [Updating runner-up](#updating-runner-up)).\n\n```ini\n# ~\u002F.config\u002Fsystemd\u002Fuser\u002Frunner-up.service\n[Unit]\nDescription=runner-up coordinator\nAfter=network-online.target\n\n[Service]\nExecStart=%h\u002Fbin\u002Frunner-up serve\nRestart=on-failure\n# Stop only the coordinator: running jobs' place runners carry on.\nKillMode=process\n\n[Install]\nWantedBy=default.target\n```\n\n```sh\nsystemctl --user enable --now runner-up\nloginctl enable-linger \"$USER\"   # keep it running while you are logged out\n```\n\nOn a Mac, run it as a LaunchAgent, so it runs in your login session and `gh`\ncan read its sign-in from your keychain:\n\n```xml\n\u003C!-- ~\u002FLibrary\u002FLaunchAgents\u002Fcom.github.runner-up.plist -->\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003C!DOCTYPE plist PUBLIC \"-\u002F\u002FApple\u002F\u002FDTD PLIST 1.0\u002F\u002FEN\" \"http:\u002F\u002Fwww.apple.com\u002FDTDs\u002FPropertyList-1.0.dtd\">\n\u003Cplist version=\"1.0\">\n\u003Cdict>\n  \u003Ckey>Label\u003C\u002Fkey>\u003Cstring>com.github.runner-up\u003C\u002Fstring>\n  \u003Ckey>ProgramArguments\u003C\u002Fkey>\n  \u003Carray>\u003Cstring>\u002FUsers\u002Fyou\u002Fbin\u002Frunner-up\u003C\u002Fstring>\u003Cstring>serve\u003C\u002Fstring>\u003C\u002Farray>\n  \u003Ckey>EnvironmentVariables\u003C\u002Fkey>\n  \u003Cdict>\u003Ckey>PATH\u003C\u002Fkey>\u003Cstring>\u002Fopt\u002Fhomebrew\u002Fbin:\u002Fusr\u002Fbin:\u002Fbin:\u002Fusr\u002Fsbin:\u002Fsbin\u003C\u002Fstring>\u003C\u002Fdict>\n  \u003Ckey>RunAtLoad\u003C\u002Fkey>\u003Ctrue\u002F>\n  \u003Ckey>KeepAlive\u003C\u002Fkey>\u003Ctrue\u002F>\n  \u003C!-- Stop only the coordinator: running jobs' place runners carry on. -->\n  \u003Ckey>AbandonProcessGroup\u003C\u002Fkey>\u003Ctrue\u002F>\n  \u003Ckey>StandardOutPath\u003C\u002Fkey>\u003Cstring>\u002FUsers\u002Fyou\u002FLibrary\u002FLogs\u002Frunner-up.log\u003C\u002Fstring>\n  \u003Ckey>StandardErrorPath\u003C\u002Fkey>\u003Cstring>\u002FUsers\u002Fyou\u002FLibrary\u002FLogs\u002Frunner-up.log\u003C\u002Fstring>\n\u003C\u002Fdict>\n\u003C\u002Fplist>\n```\n\n```sh\nlaunchctl bootstrap \"gui\u002F$(id -u)\" ~\u002FLibrary\u002FLaunchAgents\u002Fcom.github.runner-up.plist\n```\n\nWhen the coordinator stops, running jobs carry on. Each place's runner runs in\nits own process, which holds the place until its job ends. A runner still\nwaiting for its job keeps waiting, and can take one, until the coordinator is\nback to give up on it. Waiting jobs stay queued at GitHub, and the next start\npicks them up again.\n\n### When a machine is down\n\nssh to a machine gives up after ten seconds without an answer\n(`ConnectTimeout=10`), unless the machine's own `ssh` options set\n`ConnectTimeout`. When a place's runner cannot reach its machine's agent,\nbecause SSH was refused, timed out or dropped, the machine rests. Its places\ntake no job, so the coordinator acquires no job and registers no runner for\nthem, and the job the runner was started for goes to another place, in line\nfrom where it was. Once a minute the coordinator asks the machine's agent its\nversion, which costs no call to GitHub. Once it answers, the machine's places\ntake jobs again. A machine still resting when the coordinator restarts is\nasked at once. `runner-up status` shows a resting machine's places as resting.\n\n### When GitHub closes a job\n\nWhen GitHub says a job was cancelled before a runner took it, the job's scale\nset has a runner left waiting for nothing. The coordinator removes the newest\nsuch runner from its scale set and stops it once GitHub accepts. A runner\nGitHub says is running a job keeps it, and one whose removal GitHub does not\nanswer is asked about again at the next tick.\n\nGitHub does not always tell the scale set that a job it assigned is gone,\nfor example when a run is cancelled while one of its jobs waits for its next\nassignment, or when the cancellation is lost with a session. GitHub takes an\nassigned job back when no runner takes it in five minutes. So when GitHub has\nsaid nothing for ten minutes about a job it assigned, or for an hour about a\njob it took back, the coordinator reads the job's workflow run. It reads each\nsuch run again every fifteen minutes, or every hour, while the job stays\nquiet, and reads at most ten runs at a time and sixty an hour. If GitHub says\nthe run is completed, the coordinator forgets the run's quiet waiting jobs\nand starts no runner for them. A run GitHub calls open, or a read GitHub does\nnot answer, keeps them waiting. A job with a runner is never read about.\n\n## Setup file\n\nBesides what `init` and `machine add` write, you can set:\n\n| Field | Default | Meaning |\n| --- | --- | --- |\n| `order` | `[\"waited:60m\", \"shortest\"]` | the [order rules](#order-rules) |\n| `allowForkPullRequests` | `false` | let jobs from forks' pull requests run |\n| `startTimeoutSeconds` | 600 | how long a runner may wait for its job. Then the coordinator removes the runner from its scale set and stops it; a runner GitHub says is running a job keeps it |\n| `bootTimeoutSeconds` | 300 | how long a KVM, tart or Hyper-V place may take to boot |\n| `guestCheckSeconds` | 30 | how often a tart place checks its clone has not restarted |\n| `maxJobSeconds` | 21600 | the longest a job may run |\n| `logKeepDays` | 30 | how long place logs are kept |\n| `release` | none | the runner-up the coordinator and its machines run: see [Updating runner-up](#updating-runner-up) |\n\nEach machine's `cores`, `memoryMB`, `roomCores` and `roomMemoryMB` set its\nbudget. Each pool may set `cores` and `memoryMB` together: every job of that\npool reserves that size, whichever place runs it. It replaces the place's\n`cores` and `memoryMB`, including the container or VM limits. A pool without a\nsize keeps the place's existing size. `check-config` rejects partial sizes\nand sizes that never fit a machine serving the pool, after its owner's room.\n\nA host job is not held to its reservation by the operating system. Jobs receive\n`RUNNER_UP_CORES` and `RUNNER_UP_MEMORY_MB`; use them to set worker counts and\nother resource controls. These variables describe reservations, not current\nfree resources. A running job keeps its launch-time reservation through a\ncoordinator restart or a later setup edit.\n\nPlaces may share a machine without all fitting at once. They then take turns:\n`check-config` shows the place defaults and each configured pool override.\nSeveral host places allow small jobs to run together; the machine's budget,\nnot their total fallback sizes, limits the combination.\n\nEach place may also set:\n\n| Field | Default | Meaning |\n| --- | --- | --- |\n| `workFolder` | `_work` | where the runner keeps its jobs' work, relative to the runner's folder or absolute; GitHub's Ubuntu runners use `\u002Fhome\u002Frunner\u002Fwork` |\n| `toolCache` | see meaning | the runner's tool cache (`RUNNER_TOOL_CACHE`). A host place keeps it between jobs, in its folder under the agent's by default, so a tool such as `setup-node`'s Node is downloaded once. For a tart place, a folder inside the clone that the image was set up with; by default the runner's own, which every job starts without |\n| `poolImages` | none | another image for some of the place's pools, by pool label. A job of a named pool runs on that image, any other job on `image` |\n| `priority` | its machine's | the place's [priority level](#priority-levels) |\n\nA place that serves several pools can run each on its own image. For example,\nthe same Hyper-V places can run Ubuntu 24.04 and 26.04 jobs:\n\n```json\n{\"id\": \"pc-1\", \"provider\": \"hyperv\", \"pools\": [\"linux\", \"linux-2604\"], \"cores\": 4, \"memoryMB\": 8192,\n \"image\": \"C:\\\\runner-up\\\\noble.vhdx\", \"poolImages\": {\"linux-2604\": \"C:\\\\runner-up\\\\resolute.vhdx\"}}\n```\n\nA `linux-2604` job boots `resolute.vhdx`, and a `linux` job boots\n`noble.vhdx`. Either way it is one place; its pool's size, or the place's\nfallback size when the pool has none, counts against its machine's budget.\n\n### Priority levels\n\nA job goes to a free place serving its pool on the machine with the fewest\nbusy places, then the first listed. To have some places take a pool's jobs\nonly when others cannot, give places a `priority`: a whole number from 0, the\ndefault. A machine's `priority` is the level of its places that set none. A\njob takes a free place at the lowest level that has one, and tries level 1\nonly once every level-0 place serving its pool is full, then level 2, and so\non; levels need not be consecutive. Within a level, the fewest busy places,\nthen the listed order, decide as before.\n\nA place counts as full while it runs a job or a borrow, while its machine is\nunreachable, cools down after a failed start or is held by a drain, while its\nMac runs as many virtual Macs as macOS allows, and while its machine lacks the\nroom for the job. A job waiting only for room keeps it at the lowest level\nwhere it waits.\n\nFor example, to run a pool's jobs on two small Macs' guests and use a big\nMac's own place only when both are taken, set `\"priority\": 1` on the big\nMac's place and leave the guests unset:\n\n```json\n{\"id\": \"big-real\", \"provider\": \"host\", \"pools\": [\"mac-check\", \"mac-split\"], \"cores\": 6, \"memoryMB\": 16384, \"priority\": 1}\n```\n\n`check-config` shows each place's level when set, and for each pool with\nplaces on different levels, the levels and their places in the order tried.\nIt refuses a negative priority, and priorities that order nothing: levels set\nbut no pool with places on two of them. A setup without `priority` places jobs\nas before; `init` and `machine add` write none. runner-up 0.1.12 and earlier\nrefuse a setup that names `priority`.\n\n### Changing the setup\n\n`runner-up serve` watches its setup file. Once the file has held the same\ncontent for a second, so a `git pull` or an editor that rewrites it in steps\nis read whole, the coordinator checks it as `check-config` does and applies\nit in place:\n\n- Repositories, organizations and pools the change adds get their scale set\n  sessions, and ones it removes have theirs closed. Every other session stays\n  open.\n- Machines, places, sizes, order rules and the other settings apply to the\n  next job the coordinator places.\n- Running jobs run on, each with the setup and reservation it started with.\n  A place the change removes, or moves to another machine, while its job runs\n  takes no new job, and its reservation counts against the machine its job\n  runs on until the job ends, through a coordinator restart too.\n- A job of a pool the change removes waits at GitHub until the pool comes back\n  or GitHub gives up on the job.\n\nThe coordinator logs `applied the changed setup` with what changed, such as\n`pools=+mac-sign places=-box-2`. A file it cannot read, a setup that fails the\ncheck, or one that moves `stateDir` is not applied: the coordinator logs\n`the setup file was not applied; keeping the running setup` with the reason\nand runs on as before. Once you fix the file, it applies. A new `stateDir`\ntakes a restart, since running places hold their locks in the old one.\n\nPlace runners never read the setup file. Each reads the setup the coordinator\nwas running when it started the place, kept under `stateDir\u002Fsetups`, so a\nhalf-written or refused file never reaches a job. `runner-up status` and\n`runner-up usage` read the setup file itself.\n\n### Updating runner-up\n\nThe setup can name the runner-up release the coordinator and its machines run,\nwith the SHA-256 of each platform's archive as the release's `checksums.txt`\nlists it:\n\n```json\n\"release\": {\n  \"version\": \"v0.1.11\",\n  \"sha256\": {\n    \"darwin-arm64\": \"\u003Crunner-up-v0.1.11-darwin-arm64.tar.gz's SHA-256>\",\n    \"linux-amd64\": \"\u003Crunner-up-v0.1.11-linux-amd64.tar.gz's SHA-256>\",\n    \"windows-amd64\": \"\u003Crunner-up-v0.1.11-windows-amd64.zip's SHA-256>\"\n  }\n}\n```\n\nName each platform your coordinator and machines run. `url` may name another\nplace to download releases from, as `\u003Curl>\u002F\u003Cversion>\u002F\u003Carchive>`; by default\nthey come from this repository's GitHub releases.\n\nWhen the setup names another version, the coordinator downloads its archive\nfor its own platform, checks the SHA-256, and asks the new program its version\nand to check the setup. If all holds, it stops as a stop signal would, so\nrunning jobs carry on, and replaces itself with the new version in the same\nprocess, so launchd or systemd keeps supervising it. The new version is on\ntrial for a minute. If it stops sooner, the supervisor starts the version it\nalways starts, which sees the trial left behind, refuses that version and runs\non. A refused version stays refused, in `stateDir\u002Fprogram\u002Frefused.json`, until\nthe setup names another version or SHA-256. Once the new version has run for a\nminute, `stateDir\u002Fprogram\u002Fcurrent` points at it.\n\n`stateDir\u002Fprogram\u002Fcurrent` is what the supervisor should start. To make it\nbefore the coordinator first runs, run `runner-up update`: it downloads and\nchecks the setup's release and points `current` at it.\n\nOnce the coordinator runs the setup's version, it copies it to each machine it\nreaches over SSH, as the machine's agent: into `.local\u002Fshare\u002Frunner-up\u002F\u003Cversion>`\nin the SSH account's home, or `%LOCALAPPDATA%\\runner-up\\\u003Cversion>` on Windows,\nwhere the machine checks the SHA-256 before keeping it. Jobs started after that\nrun with the copy; running jobs keep their agent. `stateDir\u002Fagents.json`\nrecords each machine's copy. A machine that cannot be reached keeps its agent\nand is tried again ten minutes later. On Windows the copy's path must hold no\nspaces, so the SSH account's name may not have any.\n\nA Windows machine's runner-up service runs as SYSTEM, so it takes a release\nonly when the release signing key signed its `checksums.txt`. Whoever holds\nthat key's private half controls every Windows machine running the service:\nit is kept as a secret of this repository's `release` environment, which only\n`main` may use, and the release workflow signs each release with it into\n`checksums.txt.sig`, after checking the signature against the public half\nbuilt into runner-up (`internal\u002Frelease\u002Fkey.go`). To update a machine's service, the coordinator holds its\naccount places from new jobs, waits for their jobs to end, and has the\nmachine's agent hand the service the Windows archive, `checksums.txt` and its\nsignature. The service checks the signature, the archive's SHA-256 and that\nthe release is newer than itself, installs it beside its own program, and\nrestarts as it. A new service that stops within a minute goes back to the\nversion before and refuses that version. An administrator's `runner-up setup`\ninstalls any version. A service that `setup` installed from runner-up v0.1.10\nor earlier cannot take a release: run a newer `setup` once.\n\n### Job sizes and readings\n\nA pool is a job kind. For example, this setup illustrates a large check and\nsmall signing job that together fit a 14-core job budget:\n\n```json\n\"pools\": [\n  {\"label\": \"mac-check\", \"cores\": 12, \"memoryMB\": 32768},\n  {\"label\": \"mac-sign\", \"cores\": 2, \"memoryMB\": 4096}\n]\n```\n\nThese are example sizes, not measurements or recommended defaults. Choose\nseparate labels for jobs with different resource needs: GitHub may give a new\nrunner any job of its pool, so every job within that pool must share one size.\nBorrowed tart places take their pool's size too.\n\nWhen the first-ranked job has a free eligible place but waits for cores or\nmemory, the planner holds its size on one eligible machine. Later work starts\nonly in the remainder. It does not interrupt running jobs, reserve every\nmachine, or hold room for a job whose places are unavailable for another\nreason. Once jobs already running finish, later smaller jobs cannot keep it\nwaiting for room.\n\nUse `runner-up usage` after representative jobs finish. It shows each pool's\ncurrent size, each run's original reservation, and sampled peak cores and\nmemory. The initial readers cover host jobs on macOS and Linux and tart jobs\nin macOS guests. Other providers, interrupted readers and jobs too short to\nmeasure show unavailable or incomplete readings, never invented zero use.\n\nReadings sample once a second over the one-job runner's lifetime, including\nits idle time and overhead. These are observed samples, not hard maxima or a\nguarantee of available resources.\n\n- **Host readings** (`process-group`) cover the runner's process group, not\n  work that detaches from it. CPU comes from changes in sampled process CPU\n  time, so short-lived processes and peaks between samples can be missed.\n  Memory is the sum of process RSS: it can count shared pages more than once\n  and excludes kernel memory.\n- **Tart readings** (`guest`) cover the whole guest, so simulators started by\n  the guest's system services count too. They come from the guest's kernel:\n  CPU is the busy share of the guest's CPUs over each second, as `iostat`\n  reports it, and memory is what the guest has in use (app memory, wired and\n  compressed, as Activity Monitor counts it), so a shared page counts once.\n  Neither can exceed the guest's own CPUs and memory.\n\n`runner-up usage` shows any tart value above its reservation, which is the\nguest's size, as unavailable.\n\nCompare several representative runs on the same machine\u002Fprovider, allow\nheadroom, then edit the pool's size; a running coordinator applies it to the\nnext job of the pool. Runner-up does not automatically reduce a size or treat missing readings as evidence.\nIt retains one record per finished job in the coordinator's `usage` folder\nfor `logKeepDays`, including across restarts. The readings travel with the\nrunner's output and are advisory: a job can falsify its output, but cannot\nchange its configured reservation through a reading.\n\n## Macs\n\nA Mac's places are tart places, a fresh clone of a macOS image per job, Apple\ncontainer places, a fresh Linux guest per job, or a host place that runs jobs\non the Mac itself.\n\nFor each job, a tart place's agent clones the place's image as\n`runner-up-PLACE`, sizes the clone to the job pool's cores and memory (or the\nplace's defaults), and starts it with no window. The clone sees one folder of\nthe Mac, read-only: the runner's release archive and runner-up itself, which\ncollects resource readings and, unless forks are allowed, runs the fork guard. The\nagent then starts the runner through tart's guest agent (`tart exec`), handing\nit the registration on its input. When the job ends, or its place runner lets\ngo, the clone is stopped and deleted.\n\n- **Two macOS VMs at once.** Apple's Virtualization framework runs at most two\n  macOS virtual machines on a Mac at once. The coordinator counts the Mac's\n  busy tart places (including [borrows](#borrowing-a-virtual-mac)), and asks\n  the Mac's agent every 30 seconds which macOS VMs run there, so a VM you\n  start by hand takes one of the two. A tart place waits while two run. The\n  agent also waits for a free one before it clones, in case a VM started since\n  the coordinator looked.\n  Linux VMs do not count. `machine add` gives a Mac at most two tart places;\n  more, added with `--places`, take turns.\n- **A clone that restarts.** A kernel panic restarts the clone's macOS and\n  ends its runner, but `tart exec` can go on waiting. While the job runs, the\n  agent reads the clone's boot session every `guestCheckSeconds`, and ends the\n  job once it changes. A reading that fails counts for nothing.\n\n### Linux guests on a Mac\n\n> **Experimental.** Apple container places have not yet run a real job (see\n> [Status](#status)).\n\nFor each job, an Apple container place's agent starts a guest from the\nplace's image as `runner-up-PLACE`, with the job pool's cores and memory (or\nthe place's defaults), and `--rm`, so the guest is removed when it stops.\nrunner-up's guest program runs in it as root: the agent sends the program on\nthe guest's standard input, then the registration on one more line. The\nregistration is never in the image, a file, an argument or the container\nconfiguration's environment, so `container inspect` never shows it. Inside\nthe guest it reaches the runner through the runner's environment. The program\nchecks the pinned runner's download, runs it as `runner` for one job with the\n[configured fork policy](#pull-requests-from-forks), and ends. When the place\nrunner lets go, the agent deletes the guest; the next job on a place first\ndeletes any guest an agent killed outright left.\n\nApple container guests share the Mac's budget like its other places, and do\nnot count against the two-macOS-VM limit. Linux guests reach the network\nthrough the container tool's own network; block what they should not reach\non the Mac. Apple's tool gives a guest the cores it asks for as its CPU limit,\nbut a guest may list one more processor (`nproc`); jobs should size their\nworkers by `RUNNER_UP_CORES`.\n\nTo prioritize a Mac's own jobs over its Linux guests, see `last:` in\n[Order rules](#order-rules).\n\n### macOS images\n\nA tart place's image is any macOS tart image whose guest agent runs, so\n`tart exec` works. Cirrus Labs' images have one. Pull the image on the Mac\nbefore you add it, since a clone of an image not yet pulled waits for the\ndownload:\n\n```sh\ntart pull ghcr.io\u002Fcirruslabs\u002Fmacos-sequoia-base:latest     # macOS only\ntart pull ghcr.io\u002Fcirruslabs\u002Fmacos-sequoia-xcode:latest    # with Xcode\n```\n\nTo bake your own tools in, clone an image to a local VM, set it up, and use\nthe VM's name as the place's image:\n\n```sh\ntart clone ghcr.io\u002Fcirruslabs\u002Fmacos-sequoia-base:latest ci-base\ntart run ci-base        # sign in as admin \u002F admin, install what jobs need\ntart stop ci-base\nrunner-up machine add mac --ssh you@mac --image ci-base\n```\n\nThe runner runs as the guest agent's user (`admin` in Cirrus Labs' images) in\n`~\u002Factions-runner`, so tools installed for that user are found. Every job\nstarts from the image as it is: nothing a job changes is kept.\n\n## Borrowing a virtual Mac\n\n> **Experimental.** Borrowing may change between releases (see\n> [Status](#status)).\n\nWhile the coordinator is running, borrow a tart place from a pool instead of\nholding a place by hand:\n\n```sh\nrunner-up borrow --pool ru-mac --label \"native check\" --minutes 30 -- sh -c '\n  set -eu\n  tart clone my-local-image \"$BORROWED_VM\"\n  tart set \"$BORROWED_VM\" --cpu \"$BORROWED_CPUS\" --memory \"$BORROWED_MEMORY_MB\"\n  exec tart run --no-graphics \"$BORROWED_VM\"\n'\n```\n\nReplace `my-local-image` with an image already on the Mac. The borrow command\nnever builds or downloads an image and does not start the VM for you. Your\ncommand starts it under `BORROWED_VM`, the name runner-up reserves and cleans.\n\n- `--pool`, `--label`, `--minutes` and a command are required. Minutes must be\n  a positive integer. As with `serve`, use `--config FILE` for another setup.\n- The request waits beside jobs under the same order rules. The declared\n  minutes supply its runtime estimate; the request's queue time breaks ties.\n  It has no repository, pull request labels or workflow, so those rules do\n  not give it a match. While waiting, it prints its rank and why it waits.\n- Only tart places qualify, never host, Docker, KVM or Windows places.\n  The command runs on the coordinator's computer with your working directory,\n  environment and standard input\u002Foutput. For a remote Mac, your command must\n  reach that Mac itself; `BORROWED_VM` names the VM there, not a local VM.\n- The granted command receives `BORROWED_PLACE`, `BORROWED_VM`,\n  `BORROWED_CPUS` and `BORROWED_MEMORY_MB`. Keep the command in the foreground\n  until its work finishes; the borrow itself reserves the place for that VM.\n- From grant through cleanup, the place reserves its share once and one of\n  the Mac's two VM slots. A running VM under `BORROWED_VM` is not counted a\n  second time. VMs under other names still count as outside runner-up.\n- The borrow ends with the command, when the caller stops or disconnects, or\n  after **max(1 hour, declared minutes)** from grant. A coordinator restart\n  leaves it running and counted. Command descendants are stopped and the\n  agent stops and deletes any VM left under the granted name before the place\n  frees. As with jobs, an outright supervisor crash is cleaned at the next\n  use of the place or coordinator startup.\n- The caller returns the command's exit status (`128 + signal` if a signal\n  ends the command), `124` for a time limit, `130` for cancellation, or `1`\n  for a supervisor\u002Fcleanup failure. `status` names\n  active borrows and their labels. Separate `borrow placed` and\n  `borrow completed` log entries include wait time and borrowed minutes;\n  borrowed time is not recorded as a job runtime estimate.\n\n## Draining places\n\n> **Experimental.** Draining may change between releases (see\n> [Status](#status)).\n\nWhen some jobs must run on places with nothing else running there, drain the\nplaces for them while the coordinator keeps running, instead of stopping it\nor waiting for a quiet hour:\n\n```sh\nrunner-up drain --place mac-1 --place mac-2 \\\n    --repo you\u002Fapp --job \"verify \u002F mac\" --job \"verify \u002F phone\" \\\n    --label \"release check\" --minutes 90\n```\n\n- **Draining.** The places take no new job or borrow. Jobs and borrows\n  already running there carry on; a drain never stops one.\n- **Admitting.** Once all the places are free at the same time, they take only\n  the named jobs, one job for each `--job`, by the job's name as GitHub shows\n  it. `--repo` limits the names to one repository. Start the jobs at any\n  time: a named job waits for the drained places while the drain lasts,\n  rather than start elsewhere.\n- **Done.** When each named job has run and its runner has ended, the places\n  take any job again at once, and the command exits 0.\n- Places the drain does not name go on as before. To keep a whole machine\n  quiet, name all its places. On a machine whose places share its cores and\n  memory, the named jobs keep room ahead of other work.\n- The drain ends early, and placement resumes, when its command is stopped\n  (exit `130`) or after `--minutes` (exit `124`). Running jobs, including the\n  named ones, carry on.\n- GitHub picks which of a scale set's jobs a runner takes. A runner started\n  for a named job may take another job of the same pool and repository; the\n  named job is then admitted again once a place frees. A named job GitHub\n  gives a runner outside the drain counts as gone: the drain stops waiting\n  for it.\n- The command prints where the drain stands as it moves on. A coordinator\n  restart keeps the drain. `status` shows drained places and each drain. A\n  place belongs to one drain at a time.\n\n## Order rules\n\nWhen a place frees and several jobs it can take are waiting, the rules decide,\nin order. Each rule puts the jobs it matches first, except `last:`, which\nputs them last. Later rules order jobs tied by earlier rules, and the oldest\njob breaks a final tie.\n\n| Rule | Puts first |\n| --- | --- |\n| `pool:NAME` | jobs asking for the pool NAME, which must be one of the setup's pools |\n| `last:NAME` | jobs not asking for pool NAME, which must be one of the setup's pools |\n| `label:NAME` | jobs from an open pull request labeled NAME, in the same repository (not from forks), including runs on its branch |\n| `waited:DURATION` | jobs that have waited at least DURATION, oldest first |\n| `workflow:GLOB,...` | jobs whose top-level workflow file (without `.yml`) matches, such as `release` or `deploy-*` |\n| `shortest` | jobs with shorter runtimes learned from earlier successful runs; a job never seen counts as 15 minutes |\n\nFor example, `[\"label:urgent\", \"workflow:release\", \"waited:60m\", \"shortest\"]`.\n\nA `pool:` rule matters where places serve several pools. To let short jobs that\na merge waits on go ahead of everything else, give them a pool of their own,\nhave the same places serve it, and list `pool:` first:\n`[\"pool:quick\", \"label:urgent\", \"waited:60m\", \"shortest\"]`.\n\nA `last:` rule matters where places of different pools share a machine's\nbudget. The first-ranked job waiting only for room keeps it, so ranking a pool\nlast lets a waiting job of another pool keep its room before that pool's jobs\ntake what is left. List `last:` first to put the pool behind even jobs that\nwaited an hour; a `pool:` rule listed before it still goes ahead:\n`[\"pool:release\", \"last:linux-mini\", \"waited:60m\", \"shortest\"]`.\n\nGitHub picks which of a scale set's jobs a new runner takes. So the order is\nexact between pools and repositories, but only close within one pool of one\nrepository.\n\n## Pull requests from forks\n\nEvery runner starts with runner-up's fork guard as its job-started hook. The\nguard reads the job's event. It refuses a job from another repository's pull\nrequest, a follow-on run of one (`workflow_run`), and a job whose event it\ncannot read. It allows every other job from the repository itself. Set\n`allowForkPullRequests` to `true` only if you trust every pull request.\n\n## Trade-offs\n\n- **Docker places share the machine's kernel.** A job that escapes its\n  container reaches the machine. Use KVM places for code you trust less.\n- **The runner image needs `\u002Fhome\u002Frunner\u002Frun.sh` and `\u002Fbin\u002Fsh`.** Docker\n  places use GitHub's runner image, `ghcr.io\u002Factions\u002Factions-runner`, by\n  default. Another image must keep the runner at that path and a shell at\n  `\u002Fbin\u002Fsh`: the container's shell reads the registration from its standard\n  input and hands it to the runner, so `docker inspect` never shows it.\n- **KVM places can reach the machine's loopback.** A KVM place uses QEMU's\n  user networking. Through it, a job can reach services the machine listens\n  on at 127.0.0.1, at the address 10.0.2.2. Keep such services behind their\n  own sign-in on machines with KVM places.\n- **Every place but a Docker place downloads the runner.** Each machine\n  downloads the runner release once, checks it against a pinned checksum, and\n  keeps it; a Hyper-V VM or an Apple container guest downloads and checks it\n  afresh for each job. The version is pinned (2.338.1), and runners never\n  update themselves.\n- **Host places are not fresh.** A host place runs its job as the SSH user,\n  in a folder made for the job and removed after it, and ends every process\n  the job started. Its tool cache is kept for the next job. Everything else\n  is the machine's own: the job can read the user's home folder and keychain, change installed programs, and reach the\n  network as the machine does. Use host places only for jobs you trust as\n  you trust yourself, and keep the fork guard on. A machine gets one host\n  place by default.\n- **A tart clone sees runner-up.** A clone's job can read the runner-up\n  program used for resource readings and its fork guard. It holds no secret.\n- **Account places share the machine.** A job account is a standard account\n  with no network access to private addresses, but it runs on the machine\n  itself, beside its owner. Use Hyper-V places for code you trust less.\n- **Account places have only what the machine has.** Jobs see the programs\n  installed on the machine, not GitHub's runner image.\n- **Hyper-V places talk over a serial port.** The registration and the\n  runner's output travel over the VM's second serial port, which Hyper-V\n  joins to a named pipe on the machine. Hyper-V may let only administrators\n  open that pipe; if a Hyper-V place says it could not open the serial port,\n  make the SSH account an administrator.\n- **Apple container guests are lightweight virtual machines.** For their\n  lifecycle, resource limits and network exposure, see\n  [Linux guests on a Mac](#linux-guests-on-a-mac).\n- **The coordinator does not run on Windows.** Run it on Linux or macOS\n  (see [why](#how-it-works)). Agents run on Windows.\n- **One coordinator per pool.** A second coordinator for the same pool waits\n  until the first lets go of the scale set session.\n\n## Development\n\n```sh\nmake build          # Build the binary\nmake test           # Run tests\nmake lint           # Run gofmt + go vet\nmake dist           # Cross-compile for all platforms\nmake install        # Install to $GOPATH\u002Fbin or \u002Fusr\u002Flocal\u002Fbin\nmake clean          # Remove build artifacts\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.\n\n## License\n\n[MIT](LICENSE)\n","runner-up 是一个用于在自有设备上自托管 GitHub Actions 运行器的轻量级工具，为每个 CI 任务动态创建隔离的执行环境（Linux 上使用 Docker 或 KVM、macOS 上使用 tart 或 Apple 容器工具、Windows 上使用 Hyper-V 或独立账户）。其核心特点是按需启动单次任务专用运行器、支持多平台（Linux\u002FmacOS\u002FWindows）、基于资源预算与优先级队列调度任务，并通过协调器统一管理多个物理\u002F虚拟节点。适用于希望降低 GitHub 托管运行器费用、提升构建隐私性与可控性，同时避免传统自托管 runner 长期占用资源和安全风险的中小团队或个人开发者。",2,"2026-11-24 04:33:12","CREATED_QUERY"]