Local Development
For a contributor setting up a dev machine: this page owns the first-run
sequence and the cargo xtask dev lifecycle. Tests and the push gate live in
Testing, variables in Configuration Reference,
profiles / databases / health in Deployment Guide, and
fixes in Troubleshooting.
Host dependencies
-
Rust —
rust-toolchain.tomlpins the exact toolchain (1.100.1,rustfmt+clippy, thewasm32-unknown-unknowntarget for the applicant portal);rustupinstalls it on first use.rust-versioninCargo.toml(1.100) is that toolchain's release line: canopy supports the one toolchain it pins. -
Docker Engine with the Compose v2 plugin and BuildKit (the
DockerfileusesRUN --mount=type=cache); daemon running, your user in thedockergroup. Stock-distro compose 2.40.x works — xtask names dependency profiles explicitly oncompose run(xtask/src/cmd/test.rs). -
Required cargo subcommands —
cargo xtask doctorandvalidate'spreflightstage check for them (PREFLIGHT_CARGO_TOOLSinxtask/src/cmd/doctor.rs):cargo install cargo-nextest --locked,cargo install cargo-machete --lockedandcargo install cargo-deny --locked. Validate’sdenystage (cargo deny check) blocks (#2239). -
Optional:
cargo install cargo-mutants --locked, needed only forcargo xtask mutants(Mutation testing). -
Optional:
glab(thevisibilitystage printsSKIPwithout it);git-lfs(design/**images are LFS-tracked in.gitattributes; the pre-push hook’sgit lfs pre-pushstep is a no-op without it). -
Host sizing: the
fullprofile assumes a multi-GB-RAM machine — the shared Postgres runs withshared_buffers=4GB/effective_cache_size=12GB/maintenance_work_mem=256MB(#2197; the rationale is in the compose comments) and the clamav sidecar hasmem_limit: 4g(docker-compose.yml). -
Not needed on the host: Node.js / Playwright (
canopy-e2econtainer),age/sops(canopy-devtoolscontainer),psql/pg_dump(docker exec), k6 (container), Antora (the CIpagesjob).
First run
git clone https://gitlab.com/gadhs/application/eligibility/canopy.git && cd canopy
git config core.hooksPath .githooks && chmod +x .githooks/* # pre-commit, commit-msg, pre-push
git config commit.gpgsign true && git config user.signingkey <KEY> # validate's `signing` stage checks both
cargo xtask secrets init # optional: a dev age keypair — read the secrets note below first
cargo xtask dev start # build the images, start the full profile, wait for health
cargo xtask dev status # compose ps + the URL table (host ports are ephemeral)
cargo xtask test # fmt + clippy + both test lanes
-
cargo xtask test,e2e,validateandcoveragecold-start the devstack themselves when no.devstack/markers exist (devstack_guard::ensure_ready), sodev startis optional on the very first run. With markers present they refresh instead, and the refresh asks docker whether any of the project’s locally-built canopy app containers is running before it trusts the markers (devstack_guard::check_readiness; adocker pson thecom.docker.compose.projectlabel, kept to containers whosecom.docker.compose.servicelabel names a canopy application service —docker::is_fleet_service, the same selection as the anti-latch check, never the image name, #2598): a daemon that lost the containers and images — a moved data-root,docker system prune -a, a fresh clone that copied.devstack/— is brought back up with a plaincompose up -d(which builds any missing image) rather than reported up to date. Pulled infra and the observability pairvalidatelayers in (prometheus,grafana) never count as the stack; a partially missing app fleet is still caught byvalidate'sapi-docsstage, and lost data volumes are not reseeded. -
Secrets.
dev startdecryptssecrets/dev.yamlwith the age key at~/.config/sops/age/keys.txtand passes the values to compose; with no key it prints a warning, skips SOPS injection (xtask/src/cmd/dev.rs), and writes a random 32-byteCANOPY_ENCRYPTION_KEYinto the workspace.envfloor (xtask/src/docker.rs, #3090) when.envdoes not already carry one. A later run with the age key prefers the decrypted secret, and switching keys requirescargo xtask dev restart, because data sealed under the local key cannot be read under the team’s.secrets initmints a new recipient, which cannot decrypt the existing file — an existing recipient must first runcargo xtask secrets add-recipient <age1…>for your public key. All age/sops calls run insidecanopy-devtools(xtask/src/cmd/secrets.rs). -
Signing keys.
dev start/reload/restart,dev refreshand everycargo xtasklane bring-up (devstack_guard::ensure_ready) generate any missing.keys/<program>-{private,public}.pem(and the.envCANOPY_ENCRYPTION_KEYfloor above) before the containers come up (devstack_guard::ensure_signing_keys, called from each of those arms inxtask/src/cmd/dev.rs), so a fresh checkout without the decrypted secrets needs nothing beyondcargo xtask dev start. A program service prefersCANOPY_<SVC>__SIGNING_KEYfrom the decrypted secrets and falls back to.keys/because the devstack setsCANOPY_ENV=development— outside development there is no file fallback (crates/canopy-signing/src/program_signer.rs; loader policy); the orchestrator seeds its verifier fromCANOPY_VERIFY_KEY_<PROGRAM>or the public PEM on disk (crates/canopy-signing/src/verifier.rs,from_secrets) and resolves any other key id through canopy-security’s key history (services/canopy-eligibility/src/key_history.rs,HttpKeyHistoryProvider), where each program service registers its public key at boot (crates/canopy-api/src/signing_registration.rs). No.keys/copying between machines is needed. -
The tests need no
/etc/hostsentry: canopy-test-lib falls back to127.0.0.1whenhost.docker.internaldoes not resolve (crates/canopy-test-lib/src/config.rs), and pins the devstack’s TLS names to their publications itself. A browser on the host does need entries, and the devstack CA trusted, to sign in to canopy-web, which publishes no http port (canopy-web’s origin and the ingress).
The federal and Georgia configuration
The federal and Georgia layers live in their own repositories (canopy-config-federal, canopy-config-georgia). config-sources.lock pins the commit of each that this source tree is tested against, and
cargo xtask config fetch
publishes them under target/config/<layer>/current, each commit verified against the public key in ci/config-trust/. Run it once after cloning and again when a pin moves (cargo xtask config bump moves one: A policy change). The cargo xtask checks that walk the layers, cargo xtask seed, a service run on the host (.cargo/config.toml points CANOPY_POLICY_ROOT there) and the tests of the real packs read that tree; a check that finds none names the command. The unit lane (cargo xtask test --unit) reads fixture packs only and needs neither the fetch nor the network.
Checking a configuration working copy
The fetch publishes only the commits the lock pins. To check a pack you are editing, before any pin moves, clone its repository and the federal one beside it and run canopy config check on the two directories. Until a canopy release ships the binary, run it from this checkout:
git clone https://gitlab.com/gadhs/application/eligibility/canopy-config-<jurisdiction>.git ../canopy-config-<jurisdiction>
git clone https://gitlab.com/gadhs/application/eligibility/canopy-config-federal.git ../canopy-config-federal
cargo run -p canopy-cli -- config check ../canopy-config-<jurisdiction> --federal ../canopy-config-federal
It needs no devstack, login or network. Edit the pack and run it again until it exits 0; 1 means a finding, each printed with its file, and 2 means a directory is not the layer its argument asks for. The first line names the federal commit checked against, so pull the federal clone when it is behind. A clean check proves the pack's own content and not that every service boots on it: the car of the pinned commit is the gate (Offline commands).
Devstack lifecycle
--profile accepts the six values in VALID_PROFILES (xtask/src/cmd/dev.rs), default full.
| Command | What it does | Data |
|---|---|---|
|
Reserve ports, decrypt secrets, build the binaries in the CI image (The devstack’s binaries), a cached |
kept |
|
|
— |
|
Hash source (Rust, Askama templates, every member’s |
kept, unless the guard decides a volume wipe ( |
|
|
kept |
|
|
wiped |
|
|
kept |
|
|
wiped |
|
Follow one compose service; the name is validated against the compose list |
— |
|
Drop leftover |
test schemas |
-
refreshversusreload:refreshmay report "up to date" when its hash misses a change; when services must restart, usereload. -
The refresh’s anti-latch check, and the matching
dev statusnotice, compare image content, not image ids (#2598). An image store that writes BuildKit provenance attestations moves every tag to a new manifest-list digest on each build, even a fully cached one. The image a container was created from may then no longer resolve at all. Under the containerd image store the check therefore compares the platform manifest the container records (ImageManifestDescriptor) with the manifests the tag’s index lists, read from the Engine API’s unix socket withmanifests=1. Under the classic store it compares both images' layers and config. A container whose tag moved to the same content is current, and a container on older content is stale (stale_app_containers,devstack_guard.rs). A container neither way can compare is named in a "could not compare" warning, indev statusand in the refresh; only a confirmed stale container fails the refresh. -
The
.devstack/markers record the tree as it was hashed before the build, not when they are written (TreeSnapshot,devstack_guard.rs, #2594).dev start,reload,restart,dev refreshand the lane bring-up hash first and stamp those values once the stack is healthy, so a file saved while a build runs (an editor save, a branch switch mid-battery) reads stale on the nextdev statusor refresh instead of being recorded as built. -
Never drive the devstack with raw
docker compose: the guard threads.ports.env, the decrypted secrets and--remove-orphansthrough every call (xtask/src/devstack_guard.rs); a barecompose up -dapplies none of them. -
Every rebuild —
dev start,reloadandrestart, and a refresh for any changed input, the dependency manifests, Dockerfiles, CI image, toolchain and feature set included — is the binary build (The devstack’s binaries), then one cachedcompose --profile <p> buildahead of theup(devstack_build_args). The images compile nothing: each copies its binaries fromtarget/car/, so an image build takes seconds. Nothing passes--no-cache(#2593): every input is already part of a BuildKit cache key. -
config/canopy-portal/is baked into the portal image, so an edit there is an image rebuild;refreshandreloadpick it up through thedockerfilemarker (devstack_guard.rs,CONFIG_DIRS). -
An image’s build context holds the git tree of each directory its Dockerfile copies, and nothing git ignores there (#2637). A
.dockerignorepattern matches from the context root, but a.gitignorepattern with no inner slash matches at any depth, so each such pattern has a**/form in.dockerignoreandtests/e2e/.dockerignore. A local-only path, such as the policy-source cache undertarget/policy-cache/<jurisdiction>/, therefore never ships in an image, and a change to it never misses theCOPYlayer cache. A gitignored path that a build needs stays in its context through a!line, such astests/e2e/lib/seed.tsfor the Playwright image. Key material never does (#2639). The in-network test runner reads the devstack’s signing keys from the volumecanopy_integration_keys, whichcargo xtask testfills before each run and the runner mounts read-only at/app/.keys.Dockerfile.integration's whole-context copy once baked them into an image layer. Thebuild_contextunit test (xtask/src/cmd/ci_config_lint/build_context.rs) reads each build’s context from the compose files, its sources from its Dockerfile, and the paths git ignores from the checkout. It fails on any copied path that the build’s ignore file neither excludes nor declares. It also fails on the converse for a build that copies its whole context (#2772): eachinclude_str!orinclude_bytes!path in a Rust file the build ships must stay in its context, so the root.dockerignore, which dropsdocs/, re-includes the two runbooks canopy-web’s session-store tests include, and the canopy-cli reference page its drift test reads at run time, which the guard cannot see. -
After editing
devstack/clamav/*,docker volume rm canopy_clamav_dbre-initialises the baked signature database (docker-compose.yml,clamav). -
A change of PostgreSQL major needs
cargo xtask dev restart: the image refuses a data volume another major wrote (Troubleshooting, "PostgreSQL exits on start after a change of major version"). -
Dev database logins.
devstack/postgres/init.sqlruns only on an empty volume and provisions no login. Thepostgres-rolescompose one-shot appliesdevstack/postgres/roles.sqlas the superuser on everycompose up:dev start,reload,restart, and anyrefreshthat brings the stack up. It runs oncepostgresis healthy, and canopy-reporting and canopy-security start only after it exits 0 (service_completed_successfully). The file creates each least-privilege login when it is absent and otherwise re-assertsLOGINand the dev password, so fresh and existing volumes converge alike. To add a dev login, add its row toroles.sqland runcargo xtask dev refresh: an edit underdevstack/restarts the stack, and nodev cleanis needed. -
The configuration fetcher.
canopy-config-fetchis the stack's other one-shot (Deployment Guide › Fetching configuration): every canopy service waits for its exit 0 and mounts itscanopy_policyvolume read-only at/app/policy. The devstack's sources arepath:working copies, so it finds nothing to fetch and exits at once. Export aCANOPY_CONFIG_SOURCEnaminggit+sources beforecargo xtask dev reload, with their trust roots mounted at/app/config-trust, to boot the stack from fetched, verified trees. -
A failed reconcile exits non-zero, so its dependants never start. The recovery stuck-check exempts a one-shot only when it exited with code 0 (
ONE_SHOT_SERVICES,xtask/src/docker.rs). A one-shot that exited non-zero is not a port conflict, so the bring-up stops at once, without port-recovery rounds, and namespostgres-roles, its exit code andcargo xtask dev logs postgres-roles --no-follow, which prints thepsqlerror. -
A non-zero
compose upstopsdev start,reload,restartandrefreshbefore any marker is written (#2596). The only exception is the host-port casualty the recovery rounds re-sample for: a daemon bind error in compose's output, or a stuck service whose recorded host port another process holds. A recovery re-samples only the ports the error named, or that the scrub found taken. A service stuck with neither is waiting on a dependency's health check, which no re-sample fixes.compose upruns once more with no teardown, and a stack still stuck fails naming the dependencies compose reported unhealthy (#3196). The error names the failedup, and the compose output above it names the cause. Before, a failedupthat left the old containers running read as a healthy bring-up and was stamped current (round_verdict,xtask/src/docker.rs).
The devstack’s binaries
The service, portal and token broker images are COPY-only (#3273, ADR-040 Amendment 7): they package what the devstack build stages under target/car/, the binary sets in bin/release/ and bin/devstack/ and the portal bundle in portal/. The images are Alpine, so the binaries are musl. A host build with --target x86_64-unknown-linux-musl needs a musl C toolchain on a glibc host (aws-lc-sys and ring compile C through x86_64-linux-musl-gcc), so the devstack builds where CI does, inside the CI image:
-
The image.
Dockerfile.ci, built locally ascanopy-ci/ci:<tag>the first time it is missing (about five minutes),<tag>being the pipeline'sCI_IMAGE_TAG, the content address ofDockerfile.ciandrust-toolchain.toml. -
The build.
docker runof that image with the checkout mounted at its own path, as the checkout's owner, running the set'scargo build, the CLI's own and the portal'sdx buildthemselves (no xtask in the container), in thecarprofile, into the checkout'starget/; the host then stages the set intarget/car/bin/<set>/and the bundle intarget/car/portal/. Its CARGO_HOME istarget/car-home/, so it never touches the host's. A from-zero build of one set took about 11 minutes on a 32-core host; an unchanged tree builds in seconds. -
The CLI. The operator CLI
canopyis not in the set'scargo build: cargo unifies features across the packages of one invocation, and the services would switch sqlx on for it. It is built alone,cargo build --locked --timings --profile car -p canopy-cli --bin canopy --target-dir target/car-cli, and read fromtarget/car-cli/car/canopyfor both sets. Staging copies it intotarget/car/bin/<set>/with the rest and then refuses it if its symbols namesqlx_coreorsqlx_postgres(#3414). -
The token broker. The release set's
cargo buildleavescanopy-token-brokerout too, and builds it afterwards on its own (-p canopy-token-broker --bin canopy-token-broker, into the sametarget/car/): the broker links canopy-test-lib, which in one invocation with the services compiled every one of them against thetest-helpersof canopy-auth and canopy-config (#3469). The devstack set keeps it in its one build.cargo xtask shipped-featuresfails if a release build resolves atest-*feature again. -
The set.
CANOPY_CARGO_FEATURESpicks it and compose passes it to the Dockerfiles asCANOPY_BINARY_SET: empty (the first-run default) is the release set,canopy-api/test-clock,canopy-api/test-faultthe devstack set, which the battery's journey and fault lanes need. Any other list is refused. The opt-level-0devstackcargo profile andCANOPY_CARGO_PROFILEare gone: the devstack runs the binaries a car ships. -
Validate.
devstack-warmruns the same build in the background while the gates run, sodevstack-readyfinds the binaries current. -
A build already there. When
target/car/already holds a devstack build of the tree, the devstack set packages it instead of compiling (devstack_binaries::build, #3353): every binary (the CLI read from its own build undertarget/car-cli/) and the portal's dx bundle newer than every file git sees (tracked, or untracked and not ignored), every service binary carrying the test surface (the/test/clockand/test/faultroutes), and no binary naming glibc's loader. The token broker is not judged by the test surface: it registers neither route, and a devstack build of it has held neither string (#3476). A release build writes the same paths without the test surface, and a host build on a glibc machine names a loader the Alpine images lack, so neither is taken for one. A seconddev startwith nothing edited skips the CI-image build; the car compiles once anddev startpackages that build.
Profiles and databases
--profile selects one of snap-only, tanf-only, medicaid-chip, caps-only, wic-only, full; --shared-db puts the five program databases on the shared Postgres instead of their own instances. isolated-db, e2e, integration, observability, devtools and idp-kanidm (the conformance Kanidm’s) are compose profile names, not --profile values. Membership per profile, the database inventory and the health endpoints: Deployment Guide.
Ports
Host ports are ephemeral: dev start reserves a free port per mapping from HOST_PORT_RANGE (21000–31999, below every OS’s dynamic client range — Linux’s starts at 32768, Windows' at 49152 — so a co-running stack’s test clients cannot take it between the reservation and compose’s bind, #3160) and writes .ports.env (CANOPY_PORT_<SVC>_<PORT>=<host>, xtask/src/docker.rs); read them from cargo xtask dev status, never from a page. Container ports are catalogued in the Service Catalog.
The devstack’s upstream
The devstack runs one upstream IdP at a time: Kanidm by default, or Keycloak or ZITADEL, the supported alternatives (ADR-049 Amendment 26; xtask/src/devstack_upstream.rs).
cargo xtask dev start --idp kanidm|keycloak|zitadel # dev reload and dev restart take it too
-
Sticky. The choice is recorded in
.devstack/upstream, and every later bring-up runs it,dev refreshand the battery’s cold start included; with none recorded, Kanidm.dev restartrecords it again after clearing the markers. -
One upstream holds the name. Each upstream’s TLS terminator (
kanidm,keycloak, or ZITADEL’s frontzitadel) is aliasedidm.canopy.testand listens on its reserved port inside the network too (.ports.env'sCANOPY_PORT_KANIDM_8443,CANOPY_PORT_KEYCLOAK_8443,CANOPY_PORT_ZITADEL_8443). So the devstack CA’s leaf, the issuer’s origin and the browser specs' SPKI pin hold whichever upstream runs. Each upstream’s services are in their own compose profile (upstream-kanidm,upstream-keycloak,upstream-zitadel), outside the deployment profiles, and every bring-up removes the other upstreams' containers before it starts the chosen one. -
Order. Kanidm starts alone, with its cast. Keycloak and ZITADEL keep their state in the shared PostgreSQL, in the
keycloakandzitadeldatabases and loginsdevstack/postgres/roles.sqlcreates when absent. That PostgreSQL is 19, a major neither vendor lists as supported yet (Keycloak 26.8.2 and ZITADEL v4.21.0 both list 14 to 18); each one's conformance suite passes on it (#3626). They start after PostgreSQL is healthy and its role reconciliation has run, ZITADEL’s core first, then Login V2, then its front. The upstream is then provisioned, canopy-identity’s upstream profile written from its credentials, and each service’s identity secrets written, all before the stack’sup. -
A switch writes the new upstream’s profile, clears the token broker’s cached sessions, restarts canopy-security and canopy-web on the profile, and links the cast to its seeded subjects under the new issuer (seed links).
-
The CA keeps its name.
.devstack/idp/kanidm-ca.pemis the shared devstack CA, whichever upstream runs. -
Run the battery from Kanidm. A local battery run uses the devstack as it stands, and its e2e projects other than
identity-planeare written against the default:auth.spec.tsexpects canopy-web’s local sign-out, which an upstream with an end-session endpoint replaces.cargo xtask identity matrix --e2erunsidentity-planeon each upstream (Keycloak’s and ZITADEL’s conformance graphs, and the identity matrix).
Upstream IdP: Kanidm
kanidm is Kanidm 1.12.2, the default upstream (ADR-050), built from the release tarball on Alpine by devstack/kanidm/Dockerfile (ADR-049 Amendment 11). canopy-web signs its workers in through it, and so does canopy-test-lib’s token broker (Testing › the token broker). The devstack’s upstream runs Keycloak or ZITADEL in its place.
-
One issuer string everywhere. The origin is
https://idm.canopy.test:<P>, P being the port.ports.envrecords asCANOPY_PORT_KANIDM_8443(8443 only names the mapping). Kanidm listens on P inside the compose network too, and the network resolvesidm.canopy.testto it, so the same URL names it inside the network and on the host. A client outside the network pins the name to the published address, which.ports.envrecords for the host lanes asCANOPY_TEST__UPSTREAM_ADDR(<docker host>:<P>: loopback, or atcp://DOCKER_HOST's host on CI); a test needs no hosts-file entry (curl --resolve idm.canopy.test:<P>:127.0.0.1 --cacert .devstack/idp/kanidm-ca.pem https://idm.canopy.test:<P>/status), though a browser does (canopy-web’s origin and the ingress). It is published on every interface, as most devstack services are, so it is also reachable on CI’s Docker-in-Docker daemon. -
TLS. Before every bring-up xtask generates, when any file is absent or a certificate is within 30 days of expiry, a devstack CA and the two leaves it signs in the same pass (all valid 365 days; the CA key is never written, so a leaf added later needs a new CA,
xtask/src/devstack_tls.rs): Kanidm’s foridm.canopy.test(.devstack/idp/tls/chain.pem,key.pem, 0600) and the ingress’s forweb.canopy.testandweb.canopy-xsite.test(.devstack/web/tls/chain.pem,key.pem, 0600), with the CA alone in.devstack/idp/kanidm-ca.pem. They are built under x509-cert’s CA/Browser Forum root and TLS subscriber profiles: the CA isCN=canopy devstack CA,O=canopy,C=US, and each leaf is for server authentication alone. It copies Kanidm’s chain and key into thekanidm-tlsvolume through a one-offkanidmcontainer, and the ingress’s with its nginx template into theingressvolume through a one-offingresscontainer. A regenerated set restartskanidm, canopy-security, canopy-web and both ingresses once the stack is healthy; a marker (.devstack/idp/tls/restart-pending) keeps that restart owed until it succeeds, so a failed one is retried by the next bring-up. -
State. The database is the
canopy_kanidm_datavolume, so a restart keeps it;dev restartanddev clean --confirmremove it. -
The cast (
devstack/kanidm/migrations/00-canopy.hjson, ADR-049 Amendment 11): 20 persons, the devstack’s worker personas plussec.admin, its first security administrator; applicants have no IdP account. The usernames are the retired Keycloak realm’s, exceptcanopy.adminfor itsadmin, which Kanidm reserves. Roles and programs are groups (11canopy_role_*groups, 6canopy_program_*groups,chipincluded), projected into the id_token by thecanopy-webclient’s claim maps.fti.auditoranddata.stewardhold five programs (canopy-identity refuses a federation with none), andjane.unscopedis programless, the refusal fixture. -
The issuer’s configuration (ADR-049 Amendment 11). The devstack canopy-security’s canopy-identity issuer gets a generated client registry and upstream profile, which the repository never ships. Before every bring-up xtask writes
.devstack/identity/: an ES256 key per confidential client underkeys/(owner-only, generated once and kept),identity-clients.yamlregistering each key’s public half,identity-upstream.yaml(thekanidmprofile for the current Kanidm port) andidentity-upstream-ca.pem(the devstack CA). Compose mounts the last three read-only into canopy-security, which reads them at boot; a port that moves during the bring-up rewrites the profile and restarts canopy-security and canopy-web, and a regenerated CA restarts them with Kanidm. Each confidential client’s service gets its key through.devstack/identity/env/<client>.env(owner-only), which docker-compose.yml names as itsenv_file(required: false); canopy-web’s also carries its Kanidm client secret. A file rather than an interpolated variable, so every compose call, arunthat starts dependencies included, computes the same environment. -
Checking the issuer (ADR-049 Amendment 23). canopy-identity’s deploy gate is
canopy-manage identity check, which has no devstack default: canopy-manage against the devstack gives the command line (IdP integration › Gating a deploy). -
Provisioning. After every bring-up, and on demand with
cargo xtask dev identity, xtask provisions what a migration cannot assert: each person’s random password and TOTP, and thecanopy-webclient secret. They go only into.devstack/idp/kanidm.json(mode 0600), with the SHA-256 of the cast file. Every bring-up also registers thecanopy-webclient’s redirects, each of canopy-web’s public origins'/auth/callbackat the ingresses' ports, over REST asidm_admin, and records them in the file: the cast file declares none, because Kanidm re-applies it at every start and the ports are allocated. Provisioning starts from an empty data volume, because an enrolled person refuses a second TOTP, and runs only when the file is absent or unreadable, records another cast’s digest, or itsidm_adminpassword no longer signs in (adown -vemptied the volume). When only the server’s port moved, the file’s origin and port are rewritten. A steady-state bring-up signsidm_adminin to re-register the redirects (sending nothing when they are in place) and rewrites the file only when its address or redirects changed. From a CI job container xtask reaches the server on the Docker-in-Docker daemon’s host (DOCKER_HOST), not loopback. -
Seed links (ADR-049 §8, Amendment 11). The seed keys its households on fixed worker ids, the retired realm’s (
SeedPerson::realm_subject(): jane.caseworker’s00000000-0000-0000-0000-00000000000a, bob.smith’s…0002), and each cast person’s Kanidm id is that id with the fourth group0001. So provisioning ends by signingsec.adminin through the token broker, stepped up, and, for every other cast person whose Kanidm pair does not already open as its realm id, creating the canopy subject at the realm id and linking the pair to it: two audited security-admin writes each (POST /identity/admin/subjects,POST /identity/admin/links). A cast worker’s delegation token then carries its realm id assub. A linked cast is only read, and a 429 from the admin routes' 60-a-minute limit waits a second before the request is sent again.dev start,reloadandrestartsample new ports, which moves Kanidm’s port and so its issuer, so each links the cast again under the new issuer, and the links under earlier ones stay inert; the battery’s refresh keeps the ports and only reads. Right after canopy-security boots, the first call waits up to a minute for the issuer’s first signing key. -
The device flow (ADR-049 §7, Amendment 21). canopy-security serves RFC 8628’s device authorization and code entry, its
CANOPY_SECURITY__IDENTITY_DEVICE_VERIFICATION_URIset tohttps://web.canopy.test:<W>/device, at canopy-web’s public origin.canopy loginprints that URI and a user code; the worker approves at canopy-web’s/device(services/canopy-web/src/device.rs), signing in again through Kanidm for the step-up. The battery approves through the same grants (Testing › the token broker). -
Bring-ups. These steps run around every
upthat starts or recreates the devstack:dev start,reload,restartandrefresh, and the cold start and refreshcargo xtask test, e2e and CI take (xtask/src/devstack_identity.rs). They are staged: the files first, then Kanidm alone with its cast, canopy-web’s redirects and the services' env files, then the stack’sup, then the restarts, a second redirect check on the ports the stack actually bound, and the seed links. canopy-web needs its Kanidm client secret at boot, and Kanidm mints it only when its migration creates the client, so the stack starts only after it is written; a re-provisioned cast’s new secret changes canopy-web’s env file, and the stack’suprecreates canopy-web on it. An edit underdevstack/kanidm/marks the infrastructure stale, so the next refresh recreates the service. -
The first build compiles Kanidm’s server workspace from source with thin LTO: 11-12 minutes on a 32-thread workstation, with a final link that needs several GB of memory. Later bring-ups reuse the image.
canopy-web’s origin and the ingress
canopy-web’s public origin is https://web.canopy.test:<W>, W being the port .ports.env records as CANOPY_PORT_INGRESS_443, and canopy-identity’s issuer identifier is its /identity (ADR-049 Amendment 22). canopy-web publishes no port of its own: the ingress is its one host entrance, so there is no http://localhost:<port> worker portal and no CANOPY_PORT_CANOPY_WEB_8080.
-
The ingress. The
ingressservice, the upstreamnginx-unprivilegedimage pinned by digest and never built, terminates TLS with the devstack CA’s ingress leaf and proxies to canopy-web. Like Kanidm it listens on its reserved port inside the network too, under the aliasweb.canopy.test, so one origin holds on the host and in the network. It overwritesX-Forwarded-Forwith the peer, never appending (devstack/ingress/default.conf.template), and resolves canopy-web per request, so a recreated canopy-web is reached at once.ingress-xsitedoes the same forweb.canopy-xsite.testin front of canopy-web-xsite, onCANOPY_PORT_INGRESS_XSITE_443, in every profile, so that origin’s port, and its registered redirect, hold when no e2e run is up; without canopy-web-xsite it answers 502. The network aliasweb.canopy-xsite.testisingress-xsite's, so in the network, as on the host, the name reaches the instance only over TLS. -
Moving ports.
dev start,reloadandrestartsample new ports, which moves canopy-web’s origin and so the issuer identifier: services are recreated on the new value, tokens minted under the old one are refused and minted again, and canopy-cli signs in again. -
A browser on the host needs the names and the CA: add
127.0.0.1 web.canopy.test web.canopy-xsite.test idm.canopy.testto the hosts file, and trust.devstack/idp/kanidm-ca.pem(or accept the warning once per name).cargo xtask dev startanddev statusprint both and name the origin. Sign-in goes past the AC-8 notice to the upstream’s own pages; a cast person’s password and TOTP secret are in the upstream’s credentials file,.devstack/idp/kanidm.json,keycloak.jsonorzitadel.json. -
Tests reach it as the test inputs name it:
CANOPY_TESTWEB_ORIGIN,CANOPY_TESTXSITE_ORIGINand, for a client outside the network,CANOPY_TEST__WEB_ADDR(the docker host’s publication, or the ingress in the network), whichcanopy_test_lib::web_origin::web_clientpins the name to, trusting the devstack CA alone;TestConfig.web_urlis the same origin. The Playwright battery reaches both origins fromcanopy-e2ethrough the ingresses' aliases, Node trusting the devstack CA and Chromium pinning the ingress leaf (Testing › Signing the battery in).
The conformance server
The Kanidm conformance suite runs against a disposable server of its own, the kanidm-conformance service in the compose profile idp-kanidm. No --profile value and no CI job starts it; port discovery skips it (OPT_IN_SERVICES, xtask/src/docker.rs). Its files and volume share no name with the devstack kanidm's, so a run leaves the devstack untouched. One command stands it up from nothing:
cargo xtask identity conformance --idp kanidm [--keep]
-
Builds the image, timing the build.
-
Removes the previous run’s container, then its
kanidm-conformance-tlsvolume. -
Runs
kanidmd cert-generatein a one-off container: a fresh CA, and a 5-day leaf whose only SAN isidm.canopy.test. -
Starts the service on a fresh ephemeral loopback port and waits for its health check.
-
Copies the public CA to
.devstack/idp/kanidm-conformance-ca.pem. -
Recovers
idm_admin(kanidmd scripting recover-account). -
Reads every migrated entry back over REST (
devstack/kanidm/migrations/00-canopy.hjson; Kanidm only logs a failed migration), gives each person a random password and a TOTP, and reads thecanopy-webclient secret (canopy_test_lib::upstream::kanidm::admin). -
Writes the origin, CA path, port, client credentials, the
idm_adminpassword and each person’s credentials to.devstack/idp/kanidm-conformance.json, mode 0600. -
Lints the Kanidm conformance suite (
crates/canopy-test-lib/tests/idp_conformance_kanidm.rs, featurecanopy-test-lib/idp-conformance), then runs it alone (--test idp_conformance_kanidm, nextest profileidp-conformance, one test at a time) withCANOPY_IDP_CONFORMANCE__CREDENTIALSnaming the file. Its JUnit,test-results/integration/idp-conformance.xml, holds only this suite. A failure stops the run here and leaves the service up. -
Removes the service’s container unless
--keepis given (then the next run removes it), and prints this run’s build time, the latest cold and warm build times, and the image size.-
It prints no secret: passwords, TOTP seeds and the client secret go only into the 0600 file.
-
A
--keepor failed run leaves the container in the devstack’s compose project (a failed one as the failing step found it);dev start,dev refreshand the health wait ignore it (OPT_IN_SERVICES). -
The database is a tmpfs, so every start is empty.
-
The suite signs in headlessly over Kanidm’s JSON API (
canopy_test_lib::upstream::kanidm::login), and its cases every upstream shares arecrates/canopy-test-lib/tests/idp_conformance/cases.rs. Every battery build compiles it (lanes::BATTERY_FEATURES, #3343), and clippy lints it, but no lane runs it:INTEG_FILTERleaves the conformance suites out. -
dev clean --confirmalso removes thekanidm-conformancecontainer and its TLS volume.
-
Upstream IdP: Keycloak
cargo xtask dev start --idp keycloak runs keycloak: Keycloak 26.8.2 on alpine:3.24 with OpenJDK 21, from the release tarball (devstack/keycloak/Dockerfile; ADR-049 Amendment 26; ADR-050 Amendment 5).
-
The realm is a template with no secrets,
devstack/keycloak/realm.json: realmcanopy, an ES256 key, TOTP (HmacSHA256, 6 digits, 30 s), thecanopy-browserflow whose OTP form every user must pass,CONFIGURE_TOTPdisabled, and thecanopy-webclient with thecanopyscope’srolesandprimary_programsmappers. Only the devstack’s realm accepts a TOTP code more than once a step (otpPolicyCodeReusable), because the harness signs a person in many times a step; a deployment keeps Keycloak’s single-use default. -
Secrets. Keycloak’s bootstrap administrator is generated into
.devstack/identity/env/keycloak.env(0600), which compose names as itsenv_file. Provisioning creates the realm over the admin REST API, then the cast’s users with their passwords and OTP credentials, and reads the client secret. Everything goes only into.devstack/idp/keycloak.json(0600). -
When it provisions. When the credentials file is absent or unreadable, records another cast’s digest, or the realm is gone. When the administrator no longer signs in, Keycloak’s database is emptied first. A steady-state bring-up registers canopy-web’s origins at the ingresses' ports, rewriting the file when they or Keycloak’s address moved.
-
Ids. A cast person’s Keycloak id is its cast UUID with the fourth group
0002, and the seed links map it to its realm id as Kanidm’s are.
Upstream IdP: ZITADEL
cargo xtask dev start --idp zitadel runs three services: zitadel-core (ZITADEL v4.21.0 on alpine:3.24), zitadel-login (Login V2 on node:26-alpine) and the front zitadel (the nginx-unprivileged image, TLS for idm.canopy.test, routing /ui/v2/login to Login V2 and the rest to the core; ADR-049 Amendment 26; ADR-050 Amendment 6).
-
First instance. The core runs
zitadel init zitadel, thenstart-from-setup, as its own database login, and creates its first instance on an empty database with Login V2 and forced MFA (ForceMFALocalOnly, baked into its image). It writes the provisioner’s token into thezitadel-provisionervolume (0700, the core’s alone), and Login V2’s intozitadel-bootstrap(0750, the core’s group), which Login V2 reads throughgroup_add. Login V2’s token is a credential of the IdP (AL4). -
Secrets. The masterkey and first administrator’s password go into
.devstack/identity/env/zitadel-core.env, and Login V2’s cookie secret intozitadel-login.env(each 0600). The masterkey must outlive the database it encrypts:dev restartanddev cleanremove both together. -
Provisioning over the v2 APIs: the project with its role assertion, canopy’s roles and
program_*keys, thecanopy-webapplication with its id_token assertions, redirects and post-logout redirects, the cast’s users with passwords and TOTP seeds, and their grants. The application’s secret is shown once, so an instance holding canopy’s project that.devstack/idp/zitadel.jsondoes not record is reset (its database and token volumes emptied) and provisioned again. A steady-state bring-up registers canopy-web’s origins and Login V2’s base at the current ports. -
Ids. A cast person’s ZITADEL id is its cast UUID with the fourth group
0003.
Keycloak’s and ZITADEL’s conformance graphs, and the identity matrix
cargo xtask identity conformance --idp keycloak|zitadel runs a vendor’s suite against a disposable graph of its own, as Kanidm’s does (ADR-049 Amendment 26). Keycloak’s graph is keycloak-conformance (profile idp-keycloak); ZITADEL’s is zitadel-conformance-core, zitadel-conformance-login and the front zitadel-conformance (profile idp-zitadel). Both use idp-conformance-postgres, whose database is a tmpfs. Each run:
-
removes and recreates the graph, the PostgreSQL container included;
-
issues a throwaway CA and leaf from xtask’s TLS generator (
.devstack/idp/<idp>-conformance/); -
starts the graph on fresh ephemeral ports, published on every interface and reached at the docker host, so a Docker-in-Docker job reaches it;
-
provisions it, writing
.devstack/idp/<idp>-conformance.json(0600); -
runs the suite (
idp_conformance_keycloak.rsoridp_conformance_zitadel.rs, nextest profileidp-conformance); -
removes the graph, pass or fail, unless
--keep.
ZITADEL’s suite takes about five minutes: its driver waits out spent TOTP steps, and one case waits out canopy-web’s 60 s auth_time leeway.
cargo xtask identity matrix runs all three suites (ADR-049 Amendment 26):
-
From a push spec. Without
--allit reads a push spec on stdin, in git's pre-push form (<local ref> <local sha> <remote ref> <remote sha>per line); the pre-push hook no longer runs it. Each pushed ref is ranged from the remote’s sha, or from its merge base withorigin/mainwhen it is new or the remote’s sha is not in the clone. When a range changes a file underIDENTITY_PATHS(xtask/src/cmd/identity/matrix.rs: the upstream profile and harness, the token broker, the upstreams' images and databases,docker-compose.yml, the devstack’s upstream and TLS code, the identity commands and.config/nextest.toml), every suite runs; otherwise none does. -
--allruns them whatever the push. The car's last line feeds a merge request's range (CI_MERGE_REQUEST_DIFF_BASE_SHA..CI_COMMIT_SHA) as a push spec, and runs--allon a pipeline with no merge request. UnderCANOPY_CI=trueeach conformance run joins the job container to the compose network and reaches its upstream by service name. The car passes--cargo-profile car, so each suite runs from the car's one build and compiles nothing (#3358). -
--e2ealso brings the devstack up on each upstream in turn and runs Playwright’sidentity-planeproject, then restores the devstack’s upstream. Runcargo xtask identity matrix --all --e2eon a release commit before tagging (Deployment Guide › Release). -
Every suite runs, pass or fail, and the command fails naming each that failed. Each suite’s JUnit is kept as
test-results/integration/idp-conformance-<idp>.xml.
Feature builds and the battery’s standing requirement
The battery’s bare cargo xtask e2e needs the full profile and the battery’s feature set, canopy-api/test-clock,canopy-api/test-fault: the clock lane (the journey specs and the clock-guarded worker specs) needs the test-clock build and the fault lane the test-fault build, and both are blocking lanes (Testing › The E2E battery and the journey-lane gate). Set it once — the feature set is sticky in .devstack/features across refreshes (xtask/src/devstack_guard.rs):
CANOPY_CARGO_FEATURES=canopy-api/test-clock,canopy-api/test-fault cargo xtask dev reload # opt out: CANOPY_CARGO_FEATURES= cargo xtask dev reload
A battery on a devstack without either feature fails before the suite, naming the feature and this command; a fault or clock-lane spec that still skips fails the battery after it (#2602). An explicit CANOPY_CARGO_FEATURES replaces the sticky set rather than adding to it, so a reload names the whole set.
--profile snap-only remains fine for targeted iteration (cargo xtask e2e --devstack-profile snap-only), just not for the battery.
The cross-site sign-in instance
docker-compose.yml carries canopy-web-xsite, a second canopy-web for the e2e run only (compose profile e2e, #2509). It has canopy-web’s image, environment and database, except CANOPY_WEB__PUBLIC_ORIGIN, its own origin, https://web.canopy-xsite.test:<port>, served by the ingress-xsite TLS proxy, which holds the web.canopy-xsite.test alias.
-
Why. canopy-web’s origin,
web.canopy.test, shares its registrable domain with Kanidm’sidm.canopy.test, so the default sign-in is same-site.canopy-web-xsiteis reached asweb.canopy-xsite.test, another registrable domain, so Kanidm’s return to its callback is cross-site, as a hosted IdP’s is (IdP Integration › Cross-site IdPs).tests/e2e/specs/auth-cross-site.spec.tsand the@identityspec sign in through it. -
Reach. The alias resolves only on the compose network; from the host,
ingress-xsite's published port reaches it. canopy-web-xsite itself publishes no host port. -
Lifecycle.
cargo xtask e2ebuilds it withcanopy-e2e(it shares canopy-web’s build anchor, so the build reuses the devstack build’s layers),canopy-e2e'sdepends_onstarts it and waits for its health check, and the run removes it afterwards, pass or fail. No--profilevalue starts it, anddev startanddev refreshnever build it. A run interrupted mid-suite leaves it running, because compose’sdownandstopact only on services of an active profile:dev stop,dev reload,dev restartand a refresh’sdowntherefore remove it by name first (docker::remove_e2e_only_services,xtask/src/docker.rs),dev clean --confirmactivates thee2eprofile, and the next e2e run replaces it.
The token broker service
docker-compose.yml carries canopy-token-broker, canopy-test-lib’s token broker served over HTTP to the e2e and k6 harnesses (compose profile e2e; ADR-049 Amendment 24). Its image is tools/canopy-token-broker/Dockerfile: Alpine, the broker's binary copied from target/car/bin/<set>/, running as app (uid 1000) with a health check on /healthz, and never built by the root Dockerfile. Its routes are Testing › The token broker service.
-
Reach. It listens on 8099 on the compose network only and publishes no host port. It authenticates no caller, so that network is its boundary.
-
Inputs. It mounts
canopy-integration's volumes:canopy_identity_inputsread-only (the upstream’s credentials, the devstack CA and every confidential client’s key, which xtask installs) andcanopy_identity_broker_cache, the session cache. The in-network runner and the service therefore share one cache’s sessions and sign-in spacing. Its filesystem is otherwise read-only, and it writes no core dump. -
Logs. It installs no log subscriber (an ADR-041 tool, not a deployed service), so nothing it traces is written. Its health is
/healthz, a failed start is its exit, and a failed request’s answer is its response body. -
Lifecycle. Each run that brings it up (every
e2erun, since auth-setup and the given helpers sign in through it, and every k6perfrun) first packages its image from the devstack's binary set (the input install'srun --build; the broker is built with the services, The devstack’s binaries), since the fleet’s refresh never builds it. On CI thebuildjob packages and pushes it with the shared images, and the stack jobs pull it (#3273). An e2e teardown, a devstack teardown anddev cleanremove it with the other e2e-only services.
The transport fault layer
docker-compose.yml carries toxiproxy, a Toxiproxy 2.13.0 server (compose profile fault; chaos plan U3, #1591). It is the devstack's transport lever: a contested-environment test dials one of its standing mirrors in place of the real service, then severs the mirror or poisons it. EvilLayer answers at the HTTP layer and cannot cut a socket or leave one open and silent; this can.
-
Opt-in. No
cargo xtask devprofile starts it, and no canopy service is configured through a mirror.cargo xtask fault-preflight --upstarts it on a running devstack, and so does the fault lane,cargo xtask test --fault --no-refresh, before it runs the tests that use it. -
Mirrors.
rabbitmq(the broker's AMQP port),postgres(the shared instance) andidp(the upstream the devstack runs, The devstack’s upstream). The preflight creates them; they last as long as the container. -
Ports. Fixed, and published on loopback only, because the control API is unauthenticated and can proxy to any address: the API on 18474, the mirrors on 18475 (
rabbitmq), 18476 (postgres) and 18477 (idp). Inside the compose network the same four aretoxiproxy:8474totoxiproxy:8477.canopy_test_lib::toxiproxyholds the numbers, and a test pins them to the compose file. -
The preflight.
cargo xtask fault-preflightholds the server to the pinned version, refuses a toxic or a severance an earlier test left behind, and proves each mirror: the real service answers through it, does not while it is severed, and answers again once restored. A layer that is not running passes with a report;--requiredmakes that a failure (CANNOT-RUN), which is what a lane that needs the layer passes.--uprecreates the container, which clears every fault. -
The client.
canopy_test_lib::toxiproxy:FaultLayer::from_env()gives the control client and each mirror's address (loopback on the host; the name inCANOPY_TEST__TOXIPROXY_HOSTinside the network).poisonandseverreturn a guard released by an awaitedrestore(). A guard dropped unreleased fails the test that dropped it, since the fault would otherwise reach every later test on that mirror. -
Teardown. Every devstack
downorstopremoves the container first:dev stop,reload,restartandclean, adev refreshthat wipes volumes or follows a compose change, and a bring-up's port-conflict recovery. None restarts it; a refresh that only rebuilds images leaves it running.
canopy-manage against the devstack
canopy-manage has no devstack default (canopy-manage Reference): a developer gives it what an operator would. To apply a service’s migrations to its devstack database, from the checkout:
set -a; . ./.ports.env; set +a
CANOPY_ENV=development \
CANOPY_MIGRATE__DATABASE_URL="postgres://canopy:canopy@localhost:${CANOPY_PORT_POSTGRES_5432}/canopy_exchange" \
cargo run -p canopy-manage -- migrate apply --service canopy-exchange
CANOPY_ENV=development admits the devstack’s plaintext connection. A program service with a database instance of its own is on that instance’s port in .ports.env, and a sealing service also needs CANOPY_ENCRYPTION_KEY. Nothing in the devstack needs this: every service applies its own migrations at boot.
To run canopy-identity’s deploy gate against the devstack, as canopy-eligibility:
set -a; . ./.ports.env; set +a
CANOPY_ENV=development \
CANOPY_ELIGIBILITY__IDENTITY_CLIENT_PRIVATE_KEY="$(cat .devstack/identity/keys/canopy-eligibility.pem)" \
cargo run -p canopy-manage -- identity check \
--issuer "https://web.canopy.test:${CANOPY_PORT_INGRESS_443}/identity" \
--internal "http://localhost:${CANOPY_PORT_CANOPY_SECURITY_8012}/identity"
CANOPY_ENV=development admits the plain http internal URL. The key is the one the bring-up wrote for that client; the gate reads it only from the variable.
Seed data
cargo xtask seed [--seed <u64>] [--households <n>] [--jurisdiction <name>] # defaults: random seed, 50, georgia
cargo xtask seed --manifest-only # fresh checkout: write the e2e manifest so `npm run typecheck` works; keeps an existing one
cargo xtask seed-verify # cross-service integrity check
Without --seed the chosen seed is stamped to test-results/seed/last.txt for replay (xtask/src/cmd/seed.rs, DEFAULT_HOUSEHOLDS); there is no --reset flag. --jurisdiction names a pack under target/config/ or fixtures/config/; xtask hands canopy-seed that pack’s layer stack as --config-source with --config-allow-unverified (xtask/src/config_layers.rs). dev refresh reseeds when the seed marker (seed source, anything under fixtures/config/, or a pin in config-sources.lock) is stale. The replay contract: Testing › the canopy-seed harness.
Switching packs
The devstack boots every service on the federal and Georgia configuration repositories at the commits config-sources.lock pins: compose defaults CANOPY_CONFIG_SOURCE to them, the canopy-config-fetch one-shot fetches and verifies them against ci/config-trust/ into the canopy_policy volume, and every service reads that tree (Configuration Reference › Configuration source). rulesets/ is no longer part of this repository. To boot the whole stack on another pack, export CANOPY_CONFIG_SOURCE before cargo xtask dev reload; compose merges it into every service (x-canopy-shared-env in docker-compose.yml). A fixture pack is path: working copies, baked under /app/fixtures/config/, so it also needs CANOPY_CONFIG_ALLOW_UNVERIFIED=true; it ships no notices, so list the neutral notices layer beneath it:
export CANOPY_CONFIG_SOURCE=test-federal=path:fixtures/config/test-federal,notices-neutral=path:fixtures/config/notices-neutral,test-min=path:fixtures/config/test-min
export CANOPY_CONFIG_ALLOW_UNVERIFIED=true
cargo xtask dev reload
cargo xtask seed --jurisdiction test-min
Unset both (or set them empty) and reload to return to Georgia. To try an edit to the federal or Georgia layer, clone its repository and name the clone as a path: source the same way. The seed’s --jurisdiction and cargo xtask e2e --jurisdiction select the pack the seed and the tests read, not the one the services boot on, so keep them in step with the exported source. The scheduled fixture-smoke lane does the same: each of its packs exports its layer stack as CANOPY_CONFIG_SOURCE (a lanes.rs test holds each to config_layers) and passes the pack to e2e --jurisdiction.
Devstack-aggressive worker cadences
docker-compose.yml sets shortened poll and tick intervals for the devstack only (grep it for #1367); production defaults are unchanged. The knob domains are in Configuration Reference; what the in-process test workers receive is Testing › In-process worker cadences. Tune a cadence, never a test tolerance.
Container memory bounds
clamav carries an explicit mem_limit in docker-compose.yml; nothing else does, and that asymmetry is deliberate. A JVM or a signature-database service left unbounded reads the host’s RAM through the container, and its own ergonomics then size against a number the container will never be allowed to use: the retired devstack Keycloak’s JVM claimed a ~65 GiB heap ceiling for a ~1.3 GiB working set on a 94 GiB workstation, and a host with swap enabled paged the cold heap out (#1874). A memswap_limit equal to the mem_limit is the cgroup-v2 spelling of "this container never swaps" (the v1-only mem_swappiness key is ignored under cgroup v2).
Check any container the same way — resident against swapped, from the host:
grep -E 'VmRSS|VmSwap' /proc/$(docker inspect -f '{{.State.Pid}}' canopy-clamav-1)/status
A non-trivial VmSwap on a box with free RAM is the signature; add a bound to that service rather than widening a timeout downstream of it.
Running the car's lines locally
The merge train's car is one job whose script is the commands a developer types (car in .gitlab-ci.yml, #3354): the .lints block (cargo fmt --check, then one cargo xtask verb per gate validate runs before the devstack), one cargo build --locked --profile car --workspace --all-targets --features "$BATTERY_FEATURES", the CLI's own build (The devstack’s binaries) and the portal's dx build, cargo xtask dev start (which packages that build, The devstack’s binaries), then the lanes against the stack. Any line runs the same on your machine; copy it from the file. xtask has no ci verb: the pipeline calls the verbs, and xtask serves the developer (CI vs local).
cargo xtask validate # optional: the fuller local loop (the same gates, then the lanes); nothing requires it
cargo xtask doctor # this machine: tools, repository visibility, commit signing
Docker Hub images come from docker.io unless CANOPY_HUB names another registry prefix (a pull-through proxy or mirror): compose's images, every Dockerfile's Docker Hub FROM (as the CANOPY_HUB build argument), BuildKit and k6 all read it, and CI sets it to GitLab's Dependency Proxy (#3257).
Per-crate test lanes
Run one crate’s tests through the battery’s own path, not a bare cargo nextest run -p against the devstack, which leaves test_* schemas behind until the sweep’s evidence floor (xtask/src/cmd/test.rs):
cargo xtask test --unit -p <crate>
cargo xtask test --integration --host --no-refresh --skip-static -p <crate> # add --run-ignored for #[ignore] tests
Flags, lanes and the schema sweep: Testing.
The battery’s offline gates
cargo xtask validate --offline runs every stage of the battery that needs no devstack, in the battery's order and with its arguments, and stops at the first failure as the battery does (#2481):
-
the preconditions and the static gates;
-
fmt, deny, machete, workspace clippy and the feature builds;
-
the policy, coverage and scenario audits;
-
the test build, the lane-partition check and the unit lane;
-
the rustdoc pass and the doctests.
Each live-only stage is recorded as a skip at its position in test-results/validate-report.json:
-
the port reconcile and the secrets decrypt;
-
the devstack stages and
api-docs; -
the live lane, its schema sweep and the test report;
-
the docker build.
Those stages are listed in xtask/src/validate_report.rs (LIVE_ONLY), beside the battery's inventory, so the two cannot drift.
The run ends by printing the per-crate integration command for the crates the branch touches (against the merge base with origin/main, committed or not), to run against a devstack if you want the live lane locally. --crates a,b names the crates instead.
The offline run needs no docker daemon, so it also runs from a git worktree with no devstack. A green offline run leaves only the live lane, api-docs and e2e for the merge train's pipeline to find once #3245 lands it.
Where a push’s time goes
The pre-push hook ends with each step’s wall time and the total, on stderr under
=== pre-push: step timings ===, whether it passed or failed (#3008). A local cargo xtask validate records each
stage’s duration_ms in test-results/validate-report.json, and cargo xtask e2e prints its five slowest specs under
e2e: slowest specs after Playwright. Detail: Testing › What git push runs.
Next
Testing (lanes, what git push runs, e2e) · Troubleshooting · cargo xtask catalog · Configuration Reference · Developer Guide.