Running CI jobs in sandboxes is in preview.
Requirements
- AutoPilot for CI is set up as described in Requirements.
- An owner of the GitHub organization has approved the CostGraph GitHub App’s
Self-hosted runners organization permission, set to Read and write,
and its Workflow job event. Until then, sandboxes are skipped with reason
github_app_reapproval. - A sandbox provider is connected on Integrations, as described in Connect.
- Jobs run on Linux, on
x64orarm64.
Runner image
Providers that boot a container image, such as Beam, Daytona, Fly, Islo, and Promigence, start the CostGraph CI runner image,ghcr.io/baselinehq/costgraph-ci-runner. It is GitHub’s runner image on
Ubuntu 24.04 with most tools from GitHub’s ubuntu-latest image. It includes
Node.js with pnpm and Yarn, Python, Go, Java 17 and 21 with Maven, and Rust.
It also includes the GitHub CLI, the AWS CLI, kubectl, Helm, Terraform, and
Docker with buildx and compose.
Other providers start from their own default image. CostGraph installs the
GitHub Actions runner, git, curl, jq, Python, build tools, and Node.js when the
sandbox boots, and Docker when the job needs it. These installs need root or
sudo and apt-get in the sandbox.
The job runs as a runner user with passwordless sudo when the sandbox allows
it, and as root otherwise. Install anything else the job needs in the workflow,
with a setup-* action or sudo apt-get install -y <package>.
Send a job to a sandbox
You can send a job to a sandbox in three ways.- Routing job. With the routing job in place, sandboxes become candidates for every job that fits them.
- Pin. Set
pinon the routing job to a sandbox provider, such asbeam, or a size, such asbeam:sandbox-8c-32g. Refer to Pin a workflow to a provider. - CostGraph label. Write a label that starts with
costgraph=inruns-onto run the job in a sandbox without a routing job.
costgraph= and a value unique to the job. The optional
parts after it say what the job needs.
Only sandboxes compete for a job with a CostGraph label. To compare them with a
runner you know, set a baseline runner.
When a runner does not start
- A runner that has not started 60 seconds after its sandbox was requested is tried once on the next best sandbox.
- A job with a CostGraph label that has no runner after 2 minutes gets one on the next best sandbox. After the fallback delay, it goes to the fallback runner, when you set one.
- A sandbox still running after 6 hours is deleted.
Settings
Set these on the Settings tab of AutoPilot for CI, for the organization, a repository, or a workflow, or with the settings API.Run your own dispatcher
CostGraph starts sandboxes for you by default. If you self-host CostGraph, need runners on a private network, or want to keep the provider key out of CostGraph, run your own dispatcher. Install the agent runtime chart with your provider’s credentials and turn on CI runners.dispatcher.concurrency sets
how many jobs the dispatcher runs at once. On providers that build their own
templates, set dispatcher.ciRunner.providerTemplate to a template built from
the runner image, so jobs start faster and have its tools.
Docker
Docker, includingservices: and container: jobs, works where the provider
can run a Docker daemon. Set docker: true on the routing job or docker in
the CostGraph label, so AutoPilot offers only providers that can run Docker.
On Beam, containers on Docker’s default bridge network have no outbound
network. Build images with docker build --network host when the build
downloads anything.
Secrets and forks
Jobs with secrets can run in sandboxes by default. To keep them off a sandbox provider, setallow_secrets: false
for it.
CostGraph never starts a sandbox runner for a pull request from a fork or a
pull_request_target run. It cancels such a run when a job has a CostGraph
label. Use the routing job in workflows that forks trigger, so their jobs keep
their default runners.