Local Testing — GCP (floci-gcp)
Show the whole prompt
Read https://intentius.io/chant/local-testing/gcp/.
In `examples/local-cloud-trio`, run `npm install` and then `npx chant run gcp --no-record`. The run boots floci-gcp and applies the manifest with `gcpApply`. It checks the bucket and then removes the container, and it needs Docker.
Keep the `endpoint` override on the local floci-gcp port, and show me what the run prints.
Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.Optional: hand this page to your coding agent
Read https://intentius.io/chant/local-testing/gcp/.In `examples/local-cloud-trio`, run `npm install` and then `npx chant run gcp --no-record`. The run boots floci-gcp and applies the manifest with `gcpApply`. It checks the bucket and then removes the container, and it needs Docker.Keep the `endpoint` override on the local floci-gcp port, and show me what the run prints.Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.GCP has no native deployment service — Deployment Manager is retired, and Config Connector needs a cluster running its operator. gcpApply applies chant’s Config Connector output to a local emulator itself: it maps each resource to its underlying Google REST API and drives create, update, and delete itself against floci-gcp.
The resource
Section titled “The resource”A GCS bucket, described as data. It synthesizes to a Config Connector manifest:
export const bucket = new StorageBucket({ metadata: { name: "trio-bucket", labels: { "app.kubernetes.io/managed-by": "chant" }, }, location: "US", storageClass: "STANDARD", uniformBucketLevelAccess: true, versioning: { enabled: true },});The op
Section titled “The op”chant run gcp boots floci-gcp, builds the manifest, applies it with gcpApply, verifies the bucket over the GCS REST API, and removes the container.
export default Op({ name: "gcp", taskQueue: "trio-gcp", phases: [ phase("Emulator", [flociGcpUp()]), phase("Build", [build(".", { script: "build:gcp" })]), phase("Apply", [gcpApply("dist/gcp.yaml", { endpoint: "http://localhost:4588", project: "local-project" })]), phase("Verify", [httpCheck("http://localhost:4588/storage/v1/b/trio-bucket")]), phase("Teardown", [flociGcpDown()]), ],});How gcpApply works
Section titled “How gcpApply works”Config Connector normally reconciles a CRD on a cluster into Google API calls. gcpApply performs that reconciliation directly, no cluster involved:
- Maps each kind to its REST resource via a dispatch table — Storage buckets, PubSub topics and subscriptions, Secret Manager secrets, IAM service accounts, Cloud Run services.
- Orders resources by their references so a dependency applies before its dependent.
- Drives full CRUD, following long-running operations to completion where the API returns one.
- Prunes orphans it owns — resources carrying the
managed-by: chantlabel that are no longer in the manifest — and leaves everything else alone.
Every call is the real GCS/PubSub/IAM shape, pointed at the emulator.
Run it
Section titled “Run it”Requires Docker and curl on PATH.
cd examples/local-cloud-trionpm installchant run gcpFrom local to real cloud
Section titled “From local to real cloud”Drop the endpoint override and gcpApply targets the real Google APIs for the same project. The manifest and the reconciliation logic are unchanged — this is the same code path a live apply takes.