Skip to content
Source
Sign inSign up

Run plans on Ravion VMs

Site administration

Run plans on Ravion VMs

Before CI starts the runs of a commit, the forge plans its workflow files. It also bundles the files of custom agents and agent workflows. Today this work runs in a Cloudflare container of the plan object of the files. The site setting plan.runner moves it to small Ravion VMs. This page turns it on for one repository, then for every repository, and turns it off again.

6 min read

What to know first:

  • The forge keeps each plan by the hash of its files (the table ci_plans). Only a commit whose plan files changed starts a VM. Most pushes start none.
  • A plan runs on a small VM of the node image, with no disk of its own. It has no way out: the forge refuses each request of the VM. A bundle of a factory file or of agent workflows checks out its commit first, and reaches only that commit and the package registries, as in a container.
  • The repositories of one account run at most 2 plans on VMs at once. A third plan waits until one of them ends.
  • A call that needs a plan waits for it for up to 60 seconds. A VM on a new host starts in about 34 to 52 seconds. When the plan is not ready by then, the call says that the plan is pending, and its caller tries again later:
    • The CI trigger of a push or a pull request tries again in 30 seconds. After its last try, the forge keeps it in dead_events, and the cron sends it again.
    • The factory event of an item tries again in 30 seconds.
    • REST and MCP answer 503 with "The forge is still planning the workflows of this commit. Try again in a minute." A page shows the same text.
  • A VM that fails, or that is not ready within 10 minutes, fails its plan. The call that sees it fails, and the next call that needs the plan starts it again on a new VM.
  • Each Worker reads the setting again within 60 seconds.

You need:

  • psql, and neonctl signed in to the Neon organization of the forge.

  • The URL of the database of the forge in PG_URL. The URL holds a password, so keep it in your shell only:

    PG_URL="$(neonctl connection-string main --project-id tiny-unit-38538247 --role-name app --database-name source)"
  • Ravion, set up for CI. See Set up Ravion for CI.

  • A repository to prove it on, with a workflow in .source/workflows/.

1. Turn it on for one repository

Prove the VMs on one repository first, for example a test repository.

Caution

Add the list of repositories before you turn the VMs on. While plan.runner is ravion and there is no list, every repository plans on VMs.

  1. Find the id of the repository:

    psql "$PG_URL" -c "SELECT r.id FROM repos r LEFT JOIN orgs o ON r.owner_kind = 'org' AND o.id = r.owner_id LEFT JOIN users u ON r.owner_kind = 'user' AND u.id = r.owner_id WHERE r.name = '<name>' AND coalesce(o.name, u.username) = '<owner>'"

    Type the owner with the same capital letters as on the forge, for example TanStack. The answer has one row: the id of the repository.

  2. Put the repository in the list:

    psql "$PG_URL" -c "INSERT INTO site_settings (key, value, updated_at) VALUES ('plan.runner_repos', json_build_array('<repository id>')::text, (extract(epoch from now()) * 1000)::bigint) ON CONFLICT (key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at"

    For more repositories, give each id: json_build_array('<id 1>', '<id 2>').

  3. Turn the VMs on:

    psql "$PG_URL" -c "INSERT INTO site_settings (key, value, updated_at) VALUES ('plan.runner', 'ravion', (extract(epoch from now()) * 1000)::bigint) ON CONFLICT (key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at"

Within 60 seconds, the new plans and bundles of the repository run on VMs.

2. Check a plan

  1. Push a commit to a branch of the repository that changes a workflow file, so that its plan is new.
  2. Open the CI tab of the repository. The run of the commit starts after its plan, within about 2 minutes.
  3. In Ravion, make sure that the pipeline has a run for the VM of the plan. Its description starts with Source CI job plan:.
  4. In Workers Logs, find the event ci.plan.vm_answer of the plan. Its outcome is success, or invalid_plan for a workflow file that does not plan.
  5. When the run does not start, open the Ravion run of the plan. A step that failed with exit status 3 means that the agent of the VM was never welcomed. In Workers Logs of the Worker gitflare-runner, the line CI job plan:<hash>: the forge closed the socket of a runner agent says why. Go back to plan containers (step 4) while you look into it.

3. Turn it on for every repository

A plan VM takes no place in the CI queue, and Remote CI jobs per account does not count it. On every repository, the plan VMs take hosts next to the CI jobs, and a plan that waits for a host makes the CI of its commit start later. So turn it on for every repository only when the AWS account of Ravion can run at least 64 vCPU: both EC2 limits of Prepare the AWS account are at 64 or more. On 2026-12-01 they were at 48, and the CI jobs alone filled them in busy hours.

An estimate for every repository, from the plans of the week before 2026-12-01: 17 to 108 new plans a day. Each one takes a VM for about 23 seconds on a host that runs already, or about 1 minute on a new host. That is about 10 to 110 VM minutes a day, at most 2 vCPU at once for each account.

Then delete the list:

psql "$PG_URL" -c "DELETE FROM site_settings WHERE key = 'plan.runner_repos'"

Within 60 seconds, the new plans and bundles of every repository run on VMs.

4. Go back to plan containers

Set the setting to cloudflare:

psql "$PG_URL" -c "UPDATE site_settings SET value = 'cloudflare', updated_at = (extract(epoch from now()) * 1000)::bigint WHERE key = 'plan.runner'"

Within 60 seconds, new plans run in containers again. A plan that waited for a VM then is planned again in a container, at most 2 minutes later (8 minutes for a bundle).

Done

The plans and bundles of every repository run on small Ravion VMs, and no Cloudflare container plans them.

How the setting picks where plans run

Where a new plan or bundle runs comes from two rows of site_settings:

plan.runnerplan.runner_reposWhere a new plan or bundle runs
No row, or a text that is not ravionAnyA Cloudflare container
ravionNo row, or []A Ravion VM, for every repository
ravionA JSON array of repository idsA Ravion VM for these repositories, a Cloudflare container for the others
ravionNot a JSON array of repository idsA Cloudflare container, for every repository