Skip to content

Cache infrastructure ​

Tuist operates a globally distributed cache that holds build artifacts close to the developers reading them. Latency is the whole point, so the service runs on bare metal in several regions rather than in one place.

The fleet is mid-migration between two generations. Kura, a Rust cache mesh, runs on nodes that are ordinary members of our Kubernetes clusters. It is replacing an older Elixir cache service that runs on separately managed hosts. This page describes the current model first, because that is what new work targets, and the fleet being retired second.

How cache nodes work today ​

A Kura node is a bare-metal box running Ubuntu that has joined one of our Kubernetes clusters as a worker. There is no separate configuration system for it. It gets its configuration the same way every other node does, and Kura itself is scheduled onto it as a workload.

That is the substantive change. The old fleet had its own operating system, its own deployment tool, its own secret delivery mechanism, its own reverse proxy, and its own telemetry agent, none of which were the ones the rest of the platform used. A cache host was a different kind of machine that happened to be ours. Now it is the same kind of machine as everything else, which means one way to grant access, one way to deliver secrets, one way to ship telemetry, and one place to look when something is wrong.

ConcernHow it is handled
Operating systemUbuntu, installed once during preparation
Cluster membershipCluster API, with an operator-minted kubelet identity and secure shell self-join
ApplicationKura, a Rust service, deployed by Helm and reconciled from KuraInstance resources
StorageLocal disk: a metadata store for manifests and replication state, append-only segment files for artifact bodies
Ingress and certificatesRegional ingress controllers with certificates issued through cert-manager
Secrets1Password, synchronized into the cluster by the External Secrets Operator
ObservabilityThe environment's Pulse, fed by the in-cluster telemetry agent that covers every workload, and read by Grafana Cloud

Regions ​

RegionProviderLocation
eu-westOVHcloudGravelines, France
us-eastOVHcloudVint Hill, Virginia
us-westOVHcloudHillsboro, Oregon

These serve customers. Each rack site also has a private region (<site>-runners) on the site's storage node, which serves the build cache of the macOS runners racked there over the site's network.

Customers do not choose among them. An account is placed in the region its cache traffic comes from, and the placement follows that traffic when it durably moves; what an account states is where its data may live (the storage region setting), which is a compliance boundary rather than a placement. Each account also has a cache hostname without a region in it, so a client that writes the endpoint down keeps working when its cache moves.

EU-West runs on three OVH boxes. A region's capacity grows by adding boxes; each account's cache pods are kept together on a single box.

How an instance is sized ​

An account's cache instance is bounded on four dimensions: memory, CPU, disk, and egress. Each is a pair, a floor the instance is guaranteed and a ceiling it may reach at peak, and the two are deliberately unequal. Floors decide how many accounts fit on a box, because the scheduler places pods against the sum of their floors and nothing else. Ceilings decide how large a burst an account absorbs before it is shed, and they oversubscribe the box on purpose: headroom above a floor costs nothing until someone uses it.

What differs between the dimensions is where the number comes from.

DimensionFloorCeiling
MemoryGranted per planGranted per plan
CPUMeasured per instanceGranted per plan
DiskGranted per plan, then grown from measured sheddingThe same value: the claim is the quota
EgressGranted per region, overridable per accountGranted per region

CPU is the one we measure. Every other floor is a number we choose in advance, which works when a plan predicts the need. For CPU it does not: instances on the same plan differ from each other by nearly two orders of magnitude, and the two replicas of one instance differ by around ten times, because one serves traffic while the other stands by. No value chosen per plan can see either. So the controller watches each instance's actual usage, keeps a week of it, and asks for what that instance has been observed to need. A flat reservation is what it replaced, and that reservation, not real load, is what once filled a region to the point that new accounts could not be placed in it while the box ran at under a tenth of its capacity.

The ceiling is still granted per plan, because how much an account may take is an entitlement while how much it needs is an observation.

Compressible and incompressible dimensions behave differently at the ceiling, and that is why the ceilings are not set alike. Exceeding a memory ceiling kills the process, so the ceiling has to be far enough above real use that a normal burst never reaches it. CPU is compressible: exceeding the reservation only means being slowed down, and only while the box is contended. But the mechanism that enforces a CPU ceiling is not proportional the way the one for bandwidth is. It hands out a budget every tenth of a second and stops the container dead once that budget is spent, even on a machine that is otherwise idle, so a ceiling set close to real use produces stalls that look like the service being slow rather than being limited. The CPU ceilings are therefore set several times above observed use: high enough to bound a runaway instance, far enough away that ordinary work never meets them.

The values themselves live in server/lib/tuist/kura/regions.ex, which is where to change them. They are not repeated here, because a number in two places is a number that will disagree with itself.

Bringing a node into the fleet ​

The controllers never order hardware. A box is ordered by hand, prepared, and then adopted.

  1. Order the box in the provider console. OVHcloud for EU-West and the US regions.

  2. Prepare it. One task starts the Ubuntu installation with the fleet's secure shell key, then sets the adoption marker as its final step:

    bash
    PREP_NAMESPACE=tuist-production mise run baremetal:prep-ovh <service-name> <fleet-name>

    The install runs asynchronously and takes roughly twenty to forty minutes. PREP_NAMESPACE selects the environment, which selects both the 1Password vault and the values file the marker is read from. Pass PREP_SKIP_MARK=1 to stage capacity without releasing it into the pool yet.

  3. Declare the fleet at the new box count in infra/helm/tuist/values-managed-<env>.yaml and deploy. The controller claims the marked box and self-joins it in two to five minutes. Adoption is a claim plus a self-join; the operating system install never runs on this path, which is what keeps it fast.

Scaling afterwards is kubectl scale machinedeployment.

Deploying ​

Kura is a mesh, and it is deployed with rolling updates, so nodes running different versions serve traffic side by side during a rollout. Every change has to be safe under that overlap: compatible across one version of skew in both directions, no change to the on-disk or replication formats that an older peer cannot read, and no local optimization that alters the bytes a client receives. The detail lives in kura/AGENTS.md and is worth reading before changing anything on the replication path.

Operating ​

Access. Cache nodes are cluster nodes, so they are reached through the same read-only-by-default path as any other workload, with writes going through the just-in-time elevation flow. There is no separate secure shell path for routine work; the fleet key exists for provisioning and recovery.

Secrets. Held in 1Password and synchronized by the External Secrets Operator. Rotating one means updating the item and letting the operator resynchronize.

Observability. Metrics, logs, and traces reach the environment's Pulse through the in-cluster agent, and Grafana Cloud reads them for dashboards and alerts. Dashboards are version-controlled in infra/grafana-dashboards/ and synchronized with Grafana Cloud.

Release. Releasing an OVHcloud or Scaleway Elastic Metal box wipes and reinstalls it before it can be re-adopted. This does not cancel its provider subscription. The Dedibox fleet has been retired and its provisioning support removed.

The retired fleet ​

The older cache service was an Elixir application in a container, fronted by nginx, running on NixOS hosts deployed with Colmena and Kamal. Its hosted fleet (cache-*.tuist.dev) was retired on 2026-12-02: every client was routed to Kura, and the servers, volumes, DNS records and deployment configuration were deleted. The application itself remains in cache/ as the image the self-hosted Helm chart can run.

NixOS is no longer used for cache nodes.

  • kura/AGENTS.md and kura/docs/architecture.md for the mesh itself
  • infra/cluster-api-provider-tuist/AGENTS.md for the machine kinds and the adoption flow
  • infra/AGENTS.md for how the clusters fit together