ReferenceAsk
Remy Reference/Architecture/Architecture/Portability
35Architecture

Portability

What separates the platform from the substrate it runs on (the sandbox provider, hosts, routing, the capability manifest, and sizing), the compose stack that runs the whole platform on a laptop, and the three deployment profiles of one artifact.

The cloud estate described in the preceding chapters is one deployment of a platform built to run in more than one place. This chapter names two things: what separates the platform from the substrate it runs on, and the local stack that already runs the whole thing on a laptop. It closes with where the platform is going.


#What Is Built

One image with roles. Every platform process is the same image with a --role flag, and a development process runs every role at once. Nothing about the split into Deployments is baked into the code; it is a property of the manifests.

The sandbox provider contract. The orchestrator talks to sandboxes through the contract in Execution Islands: six methods and a warm pool, declarative, with no exec and no file writes. The Kubernetes provider is one implementation. The contract was shaped so that Docker Engine and remote sandbox services can implement it too, and the release manager, the job runners and the dev boxes above it never know which one they are on.

Hosts as configuration. Every hostname the platform reads or emits comes from configuration with development defaults derived in code: the app apex, the sandbox apex, the callback origin sandboxes reach back on, the git host, the platform apexes. No personal or environment-specific hostname exists in code. Four audiences read a hostname: the browser, a sandbox, an external sender, and in-network services. The split between them is a divergence in values only, never in code paths.

The routing contract. The platform reads the app, host, and path from query parameters and never routes on the Host header. Any reverse proxy that maps a hostname to those parameters is a valid edge. See Edge and Custom Domains.

The counterparty registry as a capability manifest. Every external service is a surface that declares where its credential lives. A deployment that sets the key has the capability; a deployment that does not gets a clean answer that the service is not configured, rather than an error at a vendor. The admin surface that renders the registry is the manifest of what this deployment can do.

The compose stack. The repository's docker-compose.yml runs the whole platform locally: Postgres, Redis, a local S3, Qdrant, the API and worker roles, the voice worker, ClamAV and Presidio, and a local edge. The local edge is Caddy terminating TLS for a wildcard development domain and routing by host exactly as the production Workers do, with CoreDNS answering the wildcard. The Caddyfile is the routing contract written down.

Sizing in one place. Every sandbox lifecycle and pool setting lives in one configuration file, and every scaling threshold lives in the manifests and Terraform, so a deployment of a different size changes numbers, not code.


#Three Profiles of One Artifact

ProfileRuns onSubstrateOperated by
CloudThe platform's AWS accountThe Terraform in this repository's sibling: two VPCs, EKS with Kata, Aurora, Valkey, S3 in four regions, CloudflareThe platform team
DedicatedAn AWS account the customer owns, or one the platform team runs for themThe same Terraform, stamped into another accountThe platform team, through a cross-account role
Self-hostedA laptop or a single serverCompose: Postgres, Redis, a local object store, local Qdrant, Docker sandboxes, CaddyThe customer

The cloud profile is the fully built reference deployment this folder documents. The dedicated profile is the same Terraform in another account. The self-hosted profile is the direction: the compose stack runs the platform end to end today, and what remains is making the multi-tenant operational machinery in the cloud, the identity provider, the sandbox provider, and ingress, pluggable, so a single-tenant operator can run plain containers where the cloud runs microVMs.

Moving between profiles is a migration into a deployment someone operates, never an in-place upgrade of a box.

What This Gives a Customer
Confidence that the architecture is not welded to one account or one vendor's edge.
A path to a dedicated deployment on the same code and the same infrastructure definitions.
A platform whose local development environment is the product running whole, which is what makes a self-hosted edition a configuration surface rather than a fork.
DiagramFIG. 35 — PORTABILITY
The platform artifactone image, many rolesworkers, sandbox imagesthe same code everywhereFive pluggable pointssandbox providerhosts as configurationrouting contractcapability manifestsizing in one placeCloudthe platform's AWS accountEKS + Kata, Aurora, Valkey, S3, CloudflareDedicatedan AWS account the customer ownsthe same Terraform, another accountSelf-hosteda laptop or a single serverCompose: Postgres, Redis, Qdrant, Docker, CaddyPORTABILITY · ONE ARTIFACT, THREE PROFILESeach profile plugs into the same pointsthe sandbox contract · Fig 05the direction: pluggable identity, sandbox, ingress
artifact · point · profileone artifact, three profiles
One artifact, three profiles. The platform is one container image launched as many roles, with its workers, its sandbox images, and the same code in every deployment. Five pluggable points separate it from the substrate it runs on: the sandbox provider (six methods and a warm pool), the hostnames it reads and emits (all configuration), the routing contract (the app, host, and path from query parameters, never the Host header), the counterparty registry as a capability manifest (a service with no key configured simply reports that it is not configured), and the sizing that lives in one place. Three profiles implement those points on different substrate: the cloud profile is the fully built reference this material documents, on the platform’s AWS account with EKS, Kata, Aurora, Valkey, S3, and Cloudflare; the dedicated profile is the same Terraform stamped into an account the customer owns; and the self-hosted profile is the compose stack that already runs the whole platform on a laptop, with the remaining multi-tenant machinery (identity, the sandbox provider, and ingress) being made pluggable. That last profile is the direction. No trust boundary is drawn here, so there is no crimson.

Figure 35, "Portability": one artifact, five pluggable points, three profiles. Left: the platform artifact (the heavy node): one image launched as many roles, its workers and sandbox images, the same code everywhere. Center: the five pluggable points that separate the platform from its substrate: the sandbox provider, hosts as configuration, the routing contract, the capability manifest (the counterparty registry), and sizing in one place. A cross-reference points to Figure 5 for the sandbox contract. Right: three profiles, fanned from a bus, each implementing those points on different substrate: Cloud (the platform's AWS account: EKS with Kata, Aurora, Valkey, S3, Cloudflare), Dedicated (the same Terraform in an account the customer owns), and Self-hosted (a laptop or single server on the compose stack: Postgres, Redis, an object store, Qdrant, Docker sandboxes, Caddy). The self-hosted profile is labelled the direction. No trust boundary is drawn in this figure, so there is no crimson.