Quickstart →

Upgrade to v3.7

Upgrade to RunsOn v3.7: isolation on by default, narrower EBS permissions, stricter tag keys, and a third zone for CloudFormation stacks.

RunsOn v3.7.0 turns cache isolation and sticky-disk isolation on by default. It also narrows the EBS permissions runners keep when sticky-disk isolation is off, refuses more custom tag keys, and spreads CloudFormation stacks over three Availability Zones. Decide, for each stack, whether both isolation settings stay on before you apply the release.

Before you update#

  1. Find workflows that still use the legacy runs-on/snapshot@v1 ↗ action. They stop working with sticky-disk isolation on. Move them to sticky disks, or keep sticky-disk isolation off on that stack for now.
  2. Find scripts that call the EC2 API with the runner’s instance role to create, tag or delete EBS volumes and snapshots. See EBS permissions with sticky-disk isolation off.
  3. Rename custom tags whose keys start with runs-on- in any case, or with aws:. See Custom tags.
  4. On CloudFormation, check whether the stack can take a third Availability Zone. See A third Availability Zone.
  5. On GitHub Enterprise Server with Fleet, give the Fleet GitHub credential read access to Actions. See GitHub Enterprise Server.
  6. Set both isolation settings explicitly, as below, and review the Terraform plan or CloudFormation change set.

Use the normal upgrade procedure for the deployment itself.

Isolation is on by default#

DeploymentCache isolationSticky-disk isolation
Flex CloudFormationEnableCacheIsolationEnableStickyDiskIsolation
Flex Terraform / OpenTofuenable_cache_isolationenable_stickydisk_isolation
Fleet Terraform / OpenTofuenable_cache_isolationenable_stickydisk_isolation

All four default to true from v3.7.0. Which value an existing stack ends up with depends on how you deploy it:

  • New stacks get both isolations.
  • Terraform and OpenTofu: the next apply turns both on, unless your module block sets them. Set a variable to false to keep the previous behavior.
  • CloudFormation: an update normally keeps each parameter’s current value, because the console and aws cloudformation deploy reuse existing values. On a stack created before v3.7.0, that is false unless you turned isolation on. An update-stack call that leaves the parameter out takes the new default. Set both parameters explicitly: "true" to turn isolation on, or "false" to keep it off.

Cache isolation#

With cache isolation on, each job gets credentials scoped to its repository and branch from the cache broker Lambda. See Scope and isolation. Turning it on changes the following:

  • Caches start cold once. Magic Cache and the git cache move from cache/ to scoped-cache/<ownerID>/<repoID>/<scope hash>/ in the cache bucket, keyed by GitHub’s numeric owner and repository IDs. The first job of each repository and branch starts with an empty cache. Renaming a repository keeps its cache; transferring it to another owner starts a new one.
  • Old entries are not migrated. Entries under cache/ expire with the cache retention, 10 days by default. Git cache entries under cache/git/v1/ stop being readable at once.
  • Direct S3 cache clients are unchanged. runs-on/cache, sccache’s S3 backend, BuildKit type=s3 and GOCACHEPROG helpers that write to S3 keep using the stack-shared cache/* area with the runner role.
  • Each job calls the broker. The agent on the runner invokes the cache broker Lambda when the job starts, once more when the git cache is on, and again when its credentials near expiry. Runners must be able to reach the Lambda API of their region.
  • Magic Cache fails closed. When the broker call fails, cache requests miss and the job logs a warning. They never fall back to the shared cache/ area.
  • The git cache caches less. It caches the job’s own repository and public repositories. Checkouts of other private repositories, such as private submodules, go to GitHub uncached. See the git cache security notes.

GitHub Enterprise Server#

Cache isolation works on GitHub Enterprise Server from v3.7.0, with two differences from github.com, described in Magic Cache on GitHub Enterprise Server:

  • Entries are isolated per repository, not per branch. A GHES job token does not name its repository, so RunsOn takes it from the runner it started for the job.
  • Fleet reads each job’s workflow run to find its repository. Its GitHub credential needs read access to Actions: the Actions permission on a GitHub App, or the repo scope on an enterprise PAT. Without it, jobs run without Magic Cache and Fleet logs a warning.

Sticky-disk isolation#

With sticky-disk isolation on, the runner role has no EBS volume or snapshot permissions: the control plane performs every EBS operation for sticky disks.

  • The runs-on/snapshot@v1 action stops working. Its EC2 calls fail with UnauthorizedOperation. Move its workflows to sticky=, or set EnableStickyDiskIsolation or enable_stickydisk_isolation to false until they have moved.
  • Sticky disks keep their caches. Existing lineages keep restoring after the switch: tags, restore selection and retention do not depend on the setting.
  • Existing snapshots are not vetted. Restore trusts any snapshot of the lineage with matching tags, including snapshots taken while isolation was off, and snapshots planted by jobs of another stack in the same account and region that runs a release before v3.7.0 with sticky-disk isolation off. To start a lineage over, run roc cleanup <job-url> --include-default-branch: it deletes the sticky-disk snapshots and cache entries of the job’s branch and of the default branch.

EBS permissions with sticky-disk isolation off#

From v3.7.0, the EBS permissions that the runner role keeps for the legacy snapshot action, when sticky-disk isolation is off, stop at the stack’s own resources. Job code can still list every volume and snapshot in the region, but it can:

  • create volumes and snapshots only with the runs-on-stack-name tag set to this stack in the same call, and only from this stack’s snapshots and volumes;
  • attach, detach and delete only volumes and snapshots tagged for this stack;
  • add no tag to an existing volume or snapshot, except runs-on-delete-after on this stack’s volumes, and never write runs-on-stickydisk* tags.

The runs-on/snapshot@v1 action keeps working: it tags everything at creation. A script of your own that uses the instance role must do the same, for example with --tag-specifications on aws ec2 create-volume or aws ec2 create-snapshot, and can only work on resources tagged for this stack.

Within the stack, job code can still read, write and delete other repositories’ sticky-disk volumes and snapshots. Keep sticky-disk isolation on unless a stack still runs the v1 action.

A third Availability Zone (CloudFormation)#

From v3.7.0, the VPC of a CloudFormation stack spans three Availability Zones by default, two in us-west-1 (AvailabilityZoneCount), so runners have more EC2 capacity to draw from. Upgrading adds a public and a private subnet in the third zone and leaves the existing subnets, the NAT gateway and the static egress IP as they are. Terraform stacks use the subnets you give them and are unaffected. Before you upgrade:

  • Set AvailabilityZoneCount to 2 if your default VPC has default subnets in only two zones (aws ec2 describe-subnets --filters Name=default-for-az,Values=true lists them): CloudFormation then offers only those two zones, and the update fails on the third zone’s subnets and rolls back. In us-west-1, the default auto already keeps two zones.
  • Runners in the third zone get addresses from new subnet ranges (10.1.32.0/20 public, 10.1.160.0/20 private with the default VpcCidrBlock). If something outside the stack allows RunsOn runners by subnet range, add these ranges, or set AvailabilityZoneCount to 2.
  • The third private subnet shares the first zone’s private route table, so routes you added there yourself (VPC peering, Transit Gateway) apply to it. With NetworkFirewallPolicyArn set, the third public subnet gets its own route table: add such routes to it too. Network ACLs you attached to the existing subnets yourself are not attached to the new ones.
  • With NetworkFirewallPolicyArn set, the third zone gets its own firewall endpoint, which AWS bills by the hour (about $290 a month in us-east-1). Set AvailabilityZoneCount to 2 to stay on two zones.

Going back from three zones to two deletes the third zone’s subnets, which fails while runners or warm pool instances still use them.

Custom tags#

Custom tag keys that start with runs-on- in any case, such as Runs-On-Team, or with aws:, are now refused. RunsOn skips the tag, logs the error, and launches the runner without it, wherever the tag is defined. Before v3.7.0, an aws: key made EC2 refuse the launch. See custom tags.

Verify the rollout#

After deployment, confirm that:

  • The stack has the isolation values you chose: the CloudFormation parameters, or the Terraform plan.
  • Magic Cache and git cache workflows restore after their first cold run.
  • Sticky-disk workflows restore their previous caches.
  • No workflow left on the stack uses runs-on/snapshot@v1 while sticky-disk isolation is on.
  • On CloudFormation, the stack has the subnets you expect: three zones, or two with AvailabilityZoneCount=2 or in us-west-1.
  • On Fleet, the fleet’s runner group in GitHub lists idle runners: hot instances now listen for jobs, and Fleet keeps the existing ones until their replacements are online.