Skip to content
On this page

CodeCollab on GCP

Status

Completed

Completed

Migration downtime

  • Duration target: 3 hours
  • Dates: 9-10th October

Migration steps

  1. Create regional MongoDB clusters in US, EU, SG ✅
  2. Create dedicated MongoDB cluster in US ✅
  3. Create Redis instance
  4. Tag release commit (v0.1.0) on all repositories
    1. Need to cancel deploy job (important)
    2. Done
      1. API Gateway
      2. cc-api
      3. cc-compiler-master
      4. Editor API
      5. Share @Carl Voller
      6. Servant @Qin Guan
      7. HTML Server @Qin Guan
  5. ❓ Change nameservers to Netlify ❓
  6. Update Cloudflare DNS records to CNAME ghs.googlehosted.com.
    1. Everything behind the gateway, I’ll figure it out later
  7. Global Cloud Run services to be planned and applied on Terraform (resource: google_cloud_run_service)
    1. API
    2. Auth
    3. LTI
  8. Regional Kubernetes / Cloud Run services to be planned and applied on Terraform (resource: google_cloud_run_service)
    1. Editor API (GCR)
    2. Servant Master
    3. HTML Server
    4. Share
    5. API Gateway (GCR)
  9. Set MongoDB DE, SG to readonly (start of downtime) - 2PM
    1. Took 20 minutes to dump (including op dbs)
    2. Display maintenance message
  10. Update all Cloudflare DNS records to CNAME ghs.googlehosted.com. (with the period)
    1. Global Routings:
      1. codecollab.io → cc-frontend-old
      2. api.cclb.io → cc-api-gateway-prod-us
    2. Regional Routings:
      1. us.cclb.io → cc-editor-api-prod-us
      2. io.us.cclb.io → cc-compiler-master-prod-us
      3. sh.us.cclb.io → cc-share-prod-us
      4. us.cclb.me → cc-html-server-prod-us
  11. Terraform apply Regional Cloud Run services domain mapping (resource: google_cloud_run_domain_mapping)
  12. Upload MongoDB Regional data to regional databases
    1. Collections:
      1. sg_sharedb -> regional sg sharedb
      2. de_sharedb -> regional eu sharedb
      3. Delete all o_de_sharedb and all revisions
    2. Upload MongoDB global data to US database
      1. Collections
        1. projects
        2. projectfiles
        3. users
        4. folders