Skip to content
Source
Sign inSign up

Set up Ravion for CI

Site administration

Set up Ravion for CI

The CI jobs of your forge run on Ravion, the runner of the forge, unless a job or its repository picks a runner app. Until you set Ravion up, those jobs fail. Ravion runs each CI job in a fresh Firecracker VM on EC2, in an AWS account of your own. Set it up once, then test it with a push.

14 min read

Until you finish steps 1 to 5, Ravion is off. Each CI job on Ravion then fails at once, and its reason names the missing values.

You need:

  • To be a site admin. Add and remove site admins says who is a site admin.
  • An AWS account, connected to Ravion on the Team plan.
  • The Source repository with its packages (pnpm install), and wrangler signed in to the Cloudflare account of the deploy.

1. Prepare the AWS account

Ravion starts the sandbox hosts in your AWS account. When AWS refuses a host, Ravion shows no error: each job waits in the Placement phase of its Ravion run until the forge stops it.

  1. Put the AWS account on the Paid plan. The Free plan allows only the instance types of the Free Tier, and no sandbox host is one of them. Upgrade it in the AWS console (Upgrade your account), or run:

    aws freetier upgrade-account-plan --account-plan-type PAID --region us-east-1

    You cannot go back to the Free plan. The Paid plan has no fee of its own: AWS charges for what the hosts use.

  2. Raise two EC2 limits in us-east-1, the region of the environment: L-1216C47A (Running On-Demand Standard instances) and L-34B43A08 (All Standard Spot Instance Requests). A new account has 5 vCPUs for each, and one host has at least 4. A large job takes 4 vCPUs, so 128 vCPUs hold about two CI runs of this repository at once:

    aws service-quotas request-service-quota-increase --service-code ec2 --quota-code L-1216C47A --desired-value 128 --region us-east-1
    aws service-quotas request-service-quota-increase --service-code ec2 --quota-code L-34B43A08 --desired-value 128 --region us-east-1

    AWS can take hours or days to raise a limit.

2. Make the execution environment

  1. In Ravion, make an execution environment in us-east-1 of your AWS account, next to the database and Neon object storage.
  2. Give it a sandbox pool for on-demand hosts, and a sandbox pool for spot hosts. Keep 1 host ready in it: the jobs of the repositories that have no environment of their own share it.
  3. Write down the id of the environment.

The pipeline runs Ravion's image ubuntu-24. Every sandbox host has it, with the Docker and the Node 24 that the agent needs.

3. Make the pipeline

  1. In Ravion, make a pipeline from the file apps/web/ravion/pipeline.yaml.
  2. Write down the id of the pipeline. Its one variant is ci.

Each CI job on Ravion is one run of this pipeline. Its one step downloads the agent from the forge, and runs it with the claim of the job.

4. Put the ids in both Worker configs

Set the same values in apps/web/wrangler.runner.jsonc and apps/web/wrangler.jsonc, under vars:

"RAVION_API_URL": "https://api.ravion.com",
"RAVION_PIPELINE_ID": "<pipeline id>",
"RAVION_VARIANT_ID": "ci",
"RAVION_EE_US_EAST": "<US East environment id>",

Commit the change, and merge it to main. The ci/deploy job deploys it. See "Deploying" in README.md.

5. Give the runner Worker the API key

A secret change makes a new version of the runner Worker. ci/deploy stops on a version with no tag, so the new version must keep the tag of the deployed one.

  1. In Ravion, make an API key.

  2. Find the deployed version of the runner Worker, and its tag:

    pnpm -C apps/web exec wrangler deployments status --name gitflare-runner
    pnpm -C apps/web exec wrangler versions view <version id> --name gitflare-runner --json

    The tag is the annotation workers/tag. Go on only when this version is also the newest one in wrangler versions list --name gitflare-runner, because the next command copies the newest version.

  3. Make a version with the key and the same tag. When the command asks for the value, paste the key:

    pnpm -C apps/web exec wrangler versions secret put RAVION_API_KEY --name gitflare-runner --tag <tag> --message "Add RAVION_API_KEY"
  4. Deploy that version:

    pnpm -C apps/web exec wrangler versions deploy <new version id>@100 --name gitflare-runner --message "Add RAVION_API_KEY" --yes

The next ci/deploy reads the tag and goes on. Each later version keeps the secret.

6. Give the web Worker the registry token

The agent on each VM pulls the CI images through the forge, at /_runner/registry. The web Worker reads the container registry for it. (The agent's WebSocket and relay go to the runner Worker, through its routes on the forge's host, and need no secret.)

  1. Make a Cloudflare API token, in the account of the deploy, that can read its container registry (registry.cloudflare.com).

  2. Set it on the web Worker:

    pnpm -C apps/web exec wrangler secret put CI_REGISTRY_TOKEN

A secret change on the web Worker does not stop ci/deploy. Without this token, the agent cannot pull an image, and a job on Ravion does not start.

7. Test it with a push

  1. Pick a repository of your own that has a workflow. Its jobs run on Ravion, unless its CI settings or a runsOn name a runner app.
  2. Push a commit to it.
  3. Open the run on the CI tab. The jobs pass.
  4. In Ravion, the pipeline has a run for each job, with the description Source CI job <job id>.

When a job fails at its start, its reason names the cause:

  • Ravion is not set up on this forge (missing: ...): a value of step 4 or step 5 is missing.
  • Ravion could not create the pipeline run (HTTP <status>): Ravion refused the run with a 4xx status other than 429, for example because of a wrong API key or id. A 401 fails the job only when it comes twice: after the first one, the forge looks for the run, waits 10 s, and starts it once more. Ravion once answered a start with 401 for a valid key, after 10 s with no answer.
  • The job lost its container: Ravion could not create the pipeline run (...): Ravion answered with a server error (5xx), or did not answer in 15 s, and the forge found no run of the job. Or Ravion still answered with its rate limit (429) after the forge waited for up to 4 minutes. The forge runs the cell again, in a new job. A cell gets at most 3 machines in all: when the job on the last one fails the same way, the cell fails.

Ravion limits the rate when many runs start or run at once, for example when several pull requests merge to main together. Then the forge waits, and starts the run again:

  • The first wait is 10 s. Each next wait is two times as long, up to 4 minutes in all.
  • Each wait is up to half as long again, at random, so the jobs of one burst do not start again at the same time.
  • When Ravion sends a Retry-After header, the forge waits at least that long.
  • Before each new start, the forge looks for a run of the job. Ravion cannot tell a new start from a repeated one, so the forge starts a run again only when Ravion has none.
  • The job's object keeps each wait in its storage and wakes at its end, so no request waits.
  • When a deploy restarts the job's object during a wait, the claim of the start is gone, so the job cannot ask for that run again. It looks for the run that Ravion made of the start, and keeps it: the job then uses that VM, or cancels it when it starts its VM again, as after any restart. When Ravion has no run, or the look fails, the job starts its VM again with a new claim. A run that Ravion made of the old start can never take the job, because its claim no longer works.

When a job fails with queued, no runner, it never got a runner before its timeoutMinutes (60 when the job sets none). Open its run in Ravion. If the step waited in Placement, AWS refused the host. Look for RunInstances errors in CloudTrail of the AWS account, in the region of the environment. Step 1 names the usual causes.

Done

The CI jobs of your forge run in fresh VMs in your AWS account. The Billing page of each account counts their minutes on the rows Ravion small, 1 vCPU, Ravion medium, 2 vCPU and Ravion large, 4 vCPU.

How it works

Ravion is the default runner, and no setting of the site changes it. A job or a repository can still pick a runner app. See How the forge picks the runner.

Remote CI jobs per account caps the jobs that one account that pays runs at once on Ravion and on runner apps. It is in the card CI and AI of Admin, then Limits, and the default is 1,000. See CI and AI.

How a job runs:

  • Each CI job is one run of the pipeline. The VM has the vCPU of the size of the job, and 1 GiB more memory than the job, for the agent and Docker.
  • Every job runs in the US East environment. Its run object and its job objects start in eastern North America too (OBJECT_HOME in apps/web/src/server/object-home.ts), so the VM and the objects of a job are next to the database and Neon object storage.
  • A repository with an environment of its own runs its jobs there. See Give a repository its own Ravion hosts.
  • The step can run on spot hosts. When Ravion loses a host, it runs the step again on another host. The claim works once, so only one agent gets the job.
  • When a job ends while its VM can still run, the forge cancels the pipeline run.

What a repository owner sees and pays is in Pick where CI jobs run.

Images

Each CI job runs in the CI image that it asks for: node or browser. A plan or a bundle on a VM runs in node. A factory run on the pass engine runs in the job image, or in node for a run of the CI cache agent. See Turn on the factory pass engine. The pipeline run gets this name in its input image, but its step does not read it.

Each deploy pins the job images by digest (apps/web/scripts/ci-images.ts). It writes the pins into two places of the runner Worker config that it deploys:

  • The images of each container entry.
  • The var JOB_IMAGES: the pinned ref of each job image, by its name. For a job on a VM, the forge reads the refs from this var.

The deploy does not commit the pins, so apps/web/wrangler.runner.jsonc in the repository has no JOB_IMAGES.

Each ref names an image in the container registry of the Cloudflare account of the deploy. The agent on the VM pulls the image of its job through the forge, at /_runner/registry (step 6). It sends the session token of the job, so the VM needs no registry login. The forge refuses any other image: the VM of a CI job or of a plan pulls only node and browser, and the VM of a factory run only job and node.

Factory runs

A factory run on the pass engine is one run of the pipeline too, with the job image, or node for a run of the CI cache agent. See Turn on the factory pass engine.

  • The job container mounts a folder of the VM at /workspace: /var/lib/tanstack-source/workspaces/<job id>. The agent removes it with the container.
  • Each command of the run runs as the user 1000 of the container. Only the forge's own commands run as root.
  • The agent freezes and thaws the container (docker pause), stops the commands of the run, and fingerprints the repository in a container of its own with no network. This is agent protocol version 2: only an agent of version 2 takes a factory run.
  • A checkpoint is a tar of the workspace, compressed with zstd on the VM. It waits in /var/lib/tanstack-source/checkpoints while the agent sends it to the forge in parts of 64 MiB, and is deleted then.
  • A run that loses its VM starts a new run of the pipeline, which restores the run's newest checkpoint: at most 4 VMs for one run. The job of an agent workflow cell starts none: the cell's next job does.
  • It waits for its place in the CI queue of its account, next to the CI jobs on VMs. For an account that pays, Remote CI jobs per account counts both.

Plans

While the site setting plan.runner is ravion, the forge plans the workflows of a commit, and bundles its factory files and agent workflows, on VMs too. See Run plans on Ravion VMs.

  • Each plan or bundle is one run of the pipeline, with a description that starts with Source CI job plan:.
  • Its VM is small, with 1 vCPU, of the node image, and keeps no disk.
  • The forge refuses each request of a plan's VM. The install of a bundle reaches only its commit and the package registries.
  • It runs in the US East environment, or in the environment of its repository when it has one.
  • It takes no place in the CI queue, and Remote CI jobs per account does not count it. The repositories of one account run at most 2 plans on VMs at once.

Room for the factory and the plans

The factory pass engine and the plans on VMs take hosts next to the CI jobs. Turn either one on for every repository only when the AWS account can run at least 64 vCPU: both EC2 limits of step 1 at 64 or more. On 2026-12-01 they were at 48, and the CI jobs alone filled them in busy hours. Turn it on for every repository and How much of Ravion the pass engine takes give the numbers for the factory, and Turn it on for every repository for the plans.

Disks

In a trusted or protected run, each job keeps a disk of its repository, so the CI images stay on it. The workflow and the docker option of the job pick the disk:

WorkflowWithout docker: trueWith docker: true
Not hiddensrc-<repository id>src-<repository id>-docker
Hiddensrc-<repository id>-hiddensrc-<repository id>-hidden-docker

An untrusted run gets a clean disk that Ravion does not keep.

A factory run on the pass engine keeps a disk of its own, src-<repository id>-factory, when the author of its item has write access. Its agent's commands wrote that disk, so it never reaches a CI job. Otherwise the run starts on a clean disk, and keeps none. A plan or a bundle keeps no disk.

  • No disk crosses repositories, and nothing that an untrusted run wrote reaches another run.
  • The disk of a hidden workflow never reaches a job that is not hidden.
  • A job with docker: true runs privileged, so it can write anything on its VM. Its disk never reaches a job without docker: true.

Jobs that run Docker

A job with docker: true starts its own Docker daemon, for example to build and push images. On Ravion, its job container runs privileged, so a step of the job is root on the VM. Such a step can reach:

  • The values on the VM: the job's placeholders, the agent's session for the job and the job's CA. The VM holds no secret value.
  • Any host. The agent still routes each request of the job, but a step that gets control of the VM can send requests without the agent.

The agent cannot control the requests of a step that is root on the VM. So docker: true works only in a protected run, on every runner. See Jobs that run Docker in the CI reference.

Image uploads

A push that uses a secret, like a push to registry.cloudflare.com with CLOUDFLARE_API_TOKEN, goes through the relay of the forge (/_runner/relay). The zone of this deploy is on the Free plan of Cloudflare, which refuses a request body over 100 MB. docker push sends each image layer in one request, and a layer can be larger.

So the agent sends a registry blob upload of more than 64 MiB in parts of 64 MiB. A cache entry of the cache() step and an artifact of the artifact() step can be larger than 100 MB too, so the agent sends a cache save and an artifact in the same parts. Large uploads shows the requests.