Ship & operateRunbooks
Runbook: move production onto the API functions
Page actions
- View as Markdown (opens in a new tab)
- Ask ChatGPT (opens in a new tab)
- Ask Claude (opens in a new tab)
ChatGPT and Claude are third-party services. The link gives them this page's public address and a short instruction. This site records nothing.
Preview: the published page may be older or missing.
Moving production onto the per-context API functions, gated on the performance baseline and the data canary.
https://docs.gurbanisoul.com/process/runbooks/services-production/
Staging answers every bounded context with its own Vercel function inside the web project
(ADR-0011). Steps 0 and 1 below are merged on integration and ship with the next release: production
answers /api with all, Git previews are off, and deploy-production checks every function and the
golden contract on the unaliased deployment before promoting it. Render keeps deploying as the
rollback target until step 4. Every production deployment already carries the six functions, so
moving production is a routing change, released through the normal pipeline, with no new hosting.
Prerequisites
- A green staging deploy with every context routed (
deploy-staging→ verify: every function ready at the commit, every probeok, the golden contract PASS through the gateway). - A spending limit on the Vercel team (Settings → Billing → Spend Management) so usage-based function pricing can never surprise the plan.
Steps
- Previews. The committed
frontend/vercel.jsonnames no functions (the deploy adds them with the generated files), so Vercel’s Git preview builds carry none and their/apifollows the production rule. Once production is onvercel, that rule points at a function a Git preview does not have: switch Git previews off (git.deploymentEnabled: falseinfrontend/vercel.json) in the same release, and review web changes on staging. - Move production to the functions, whole API first. In
gateway/routes.jsonsetproduction.api_platformtoverceland dropproduction.api, keepingproduction.servicesempty, so every/apipath is answered byall(the single API’s role, same database, same code). Runpython3 tools/gen_gateway.pyand release it. Verify:curl -sI https://gurbanisoul.com/api/meta | grep -i x-serviceshowsall;make verify-prod;make canary;python3 scripts/ci/verify_functions.py https://gurbanisoul.com --commit <sha> --env production. - Hold the budget. From the same place the baseline was taken:
python3 tools/perf_baseline.py --base https://gurbanisoul.com --from "<same vantage>" --compare docs/perf/baseline-2026-09.jsonmust PASS (p95 within +10 % per context; cold starts excluded by its warm-up). - Split the contexts. Add the contexts to
production.services, regenerate, release, and verify as in step 1: each context’s probe shows its ownX-Service(e.g.knowledge), and step 2’s budget holds per context. Decision 2026-09-26 (owner): under the one-version policy every release is also an App Store update, so all five contexts move in one release (after the app is live) instead of five. Each is still gated on its own:verify_functions --env productionproves every function ready at the commit with exactly its contexts, the golden contract runs through the new rules before promotion, and one context rolls back by removing it (below); the instant lever isvercel rollbackto the previous deployment. - Retire Render after a full release cycle on the functions with the canary green: suspend and
then delete the
sggs-knowledge-baseRender service, removeRENDER_DEPLOY_HOOKand thedeploy-api/verify-apijobs fromdeploy-production.yml, and point the data canary’s and the uptime check’s API origin at the site (the functions have no separate origin).
Roll back
- One context: remove it from
production.services, regenerate, release —allanswers it again. - The whole API: set
production.api_platformback torenderwith itsapiorigin, regenerate, release. The Render service keeps running until step 4, so this is always available until then.
Sri Guru Granth Sahib Ji — Knowledge Base wiki. Generated from commit c3d9360. Updated 25 September 2026. Verified against 4391ce0 on 2026-09-26. This copy may be out of date; the page is at https://docs.gurbanisoul.com/process/runbooks/services-production/