Skip to main content

Metabase Deployment Readiness Summary

Date: 2025-01-22
Status: ✅ Ready for Deployment

✅ Completed Preparations

Infrastructure (Phase 1) ✅

  • Cloud SQL instances created for both environments
  • Databases and users configured
  • Connection details documented

Code & Configuration (Phase 2) ✅

  • ✅ Dockerfile created and tested (deploy/gcp/metabase.Dockerfile)

    • Build verified: ✅ Success
    • Health check configured
    • Handles multiple base image types
  • ✅ GitHub Actions workflow created (.github/workflows/deploy-metabase.yml)

    • PR-based deployment triggers
    • Environment detection (staging/production)
    • Cloud SQL connections configured
    • VPC connector configuration
    • Artifact Registry repository auto-creation
    • Resource allocation (2Gi memory, 2 CPU)
    • Environment variables from Doppler
  • ✅ Backend integration complete

    • Metabase config module
    • Embedding service with JWT signing
    • Controller with authentication
    • Module exported
  • ✅ Frontend components created

    • PWA component
    • Web App component
    • Service hooks

Deployment Tools & Scripts ✅

  • scripts/verify-metabase-deployment.sh - Verify deployment
  • scripts/get-metabase-db-connection.sh - Get DB connection details
  • scripts/setup-metabase-doppler-secrets.sh - Configure secrets (optional)

Documentation ✅

  • docs/metabase/deployment-guide.md - Comprehensive deployment guide
  • docs/metabase/phase4-quick-reference.md - Quick reference commands
  • docs/metabase/pre-deployment-checklist.md - Pre-deployment checklist
  • docs/metabase/implementation-plan.md - Updated with Phase 4 details

⚠️ Pending: Manual Configuration

Phase 3: Secrets & Configuration

Action Required: Configure GitHub Secrets manually

Staging Secrets Needed:

  • METABASE_DB_TYPE=postgres
  • METABASE_DB_NAME=metabase
  • METABASE_DB_USER=metabase_user
  • METABASE_DB_PASS=<password>
  • METABASE_DB_CONNECTION=barto-dev:us-central1:metabase-db-staging
  • METABASE_DB_CONNECTION_URI=<connection-uri>
  • METABASE_SITE_URL=<placeholder> (update after deployment)
  • METABASE_EMBED_SECRET_KEY=<jwt-secret>
  • MB_ANON_TRACKING_ENABLED=false
  • MB_ENABLE_PUBLIC_SHARING=false
  • Backend: METABASE_SITE_URL and METABASE_EMBED_SECRET_KEY

Production Secrets Needed:

  • Same as staging (with production values)

Reference:

  • docs/metabase/github-secrets-reference.md (GitHub Secrets)
  • secrets/METABASE_SECRETS_REFERENCE.md (Doppler reference - for your local use)

🚀 Next Steps

1. Configure GitHub Secrets

  1. Go to: SettingsSecrets and variablesActions
  2. Select staging environment (or create it)
  3. Add all required secrets (see docs/metabase/github-secrets-reference.md)
  4. Repeat for production environment

Reference: docs/metabase/github-secrets-reference.md

2. Deploy to Staging

# Create and merge PR to develop branch
# Workflow will auto-deploy on merge

# After deployment, verify:
./scripts/verify-metabase-deployment.sh staging

# Update METABASE_SITE_URL with actual URL

3. Connect to App Database (Staging)

# Get connection details
./scripts/get-metabase-db-connection.sh staging

# Use in Metabase UI: Settings → Admin → Databases → Add Database

4. Deploy to Production

# After staging is verified, create and merge PR to main branch
# Workflow will auto-deploy on merge

# After deployment, verify:
./scripts/verify-metabase-deployment.sh production

📋 Deployment Checklist

Use docs/metabase/pre-deployment-checklist.md for detailed checklist.

Quick Checklist:

  • GitHub Secrets configured (staging & production environments)
  • PR created and merged to develop (staging)
  • Deployment verified
  • METABASE_SITE_URL updated in Doppler
  • Metabase UI accessible
  • Admin user created
  • App database connected
  • PR created and merged to main (production)
  • Production deployment verified

🔧 Workflow Details

Trigger: PR merge to develop (staging) or main (production)

Path Filters:

  • deploy/gcp/metabase.Dockerfile
  • .github/workflows/deploy-metabase.yml

Deployment Steps:

  1. Setup environment detection
  2. Authenticate to GCP
  3. Configure Docker for Artifact Registry
  4. Ensure Artifact Registry repository exists
  5. Install Doppler CLI
  6. Fetch secrets from Doppler
  7. Build and push Docker image
  8. Deploy to Cloud Run
  9. Display service URL

Resource Allocation:

  • Memory: 2Gi
  • CPU: 2
  • Timeout: 300s
  • Min instances: 1
  • Max instances: 10
  • Deployment Guide: docs/metabase/deployment-guide.md
  • Quick Reference: docs/metabase/phase4-quick-reference.md
  • Pre-Deployment Checklist: docs/metabase/pre-deployment-checklist.md
  • Implementation Plan: docs/metabase/implementation-plan.md
  • Secrets Reference: secrets/METABASE_SECRETS_REFERENCE.md

🎯 Success Criteria

Deployment is successful when:

  • ✅ Cloud Run service is running
  • ✅ Health endpoint responds: /api/health
  • ✅ Metabase UI is accessible
  • ✅ Can create admin user
  • ✅ Can connect to app database
  • ✅ Database sync completes
  • ✅ Tables are visible in Metabase UI

Ready to proceed once GitHub Secrets are configured!