Migrate Primer from Railway to dry-dock (GKE) after INC-248

Open
#103 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
8/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Quiet
Tech stack
docker, gcp, helm, kubernetes, postgresql

Research direction

This is a tracking issue for platform work across several repos, not a code change in primer. The checklist spans polygon-infrastructure (Cloud SQL, GCS, Workload Identity, Secret Manager) and dry-dock (applications/web-apps/primer.yaml and related stage and Kargo files), with Okta and Mailgun steps. Start by reading the linked primer sub-issues and the platform team's access requirements. Done means the service runs on the new URL, the cutover smoke tests pass, and the Railway project is decommissioned.

Written by the indexing model from the issue text.

Description

enhancement P1

Tracking issue. Railway was compromised (INC-248, 2026-10-21); all Railway env vars are presumed exposed. Primer's data has been extracted and verified off Railway, and the service is stopped there. Primer moves to the platform team's GKE clusters via 0xPolygon/dry-dock, served at https://primer.polygon.tools.

Target architecture

  • Deploy: dry-dock web-apps/common chart, Argo CD ApplicationSet (production), Kargo promotion from Artifact Registry.
  • Ingress: polygon-tools Envoy gateway (*.polygon.tools, Cloudflare-proxied, Cloud Armor restrict-to-cloudflare). Primer keeps its own Okta OIDC; external share links, /mcp and bearer API stay reachable.
  • DB: Cloud SQL Postgres 18 (backup is pg 18.6).
  • Storage: GCS bucket via Workload Identity.
  • Secrets: GCP Secret Manager via ESO (secretsFrom). Fresh OKTA_CLIENT_SECRET, MAILGUN_API_KEY, DB password — never reused from Railway.

Work

Primer repo (sub-issues)
  • Container image + Artifact Registry release workflow
  • GCS storage backend
  • Readiness endpoint that checks the DB
  • Cutover runbook + post-restore credential purge
Platform / other repos (platform team)
  • polygon-infrastructure: add 0xPolygon/primer to the shared-prod WIF push allowlist
  • polygon-infrastructure: Cloud SQL PG18 instance + db/user, GCS bucket, GSA with cloudsql.client + bucket object admin, Workload Identity binding for KSA primer/primer, Secret Manager entries
  • dry-dock: applications/web-apps/primer.yaml, source/web-apps/common/stages/production/primer.yaml, kargo/projects/web-apps/primer.yaml; HTTPRoute request timeout disabled/raised for SSE (/api/events)
  • Okta: new OIDC client, redirect https://primer.polygon.tools/auth/callback
  • Mailgun: revoke old key, issue new one into Secret Manager
Cutover
  • Restore DB + storage, run post-restore purge, verify
  • Smoke test (login, view doc, comment, SSE, MCP OAuth, external share link)
  • Announce new URL; old primer-polygon.up.railway.app links will not redirect
  • Decommission Railway project with platform team (keep domain reserved until then), remove registered SSH key, revoke CLI token

🤖 Generated with Claude Code

Dominant language
TypeScript
Stars
2
Forks
1
Avg merge
13h 38m
Merged PRs (30d)
24

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 0xPolygon/primer

All issues in 0xPolygon/primer

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.