Home

๐Ÿš€ From Prototype to Production: Deploying Your AI App on Google Cloud Startup School 5๐Ÿš€

This weekโ€™s Startup School session, โ€From Prototype to Production, deploying your AI app on Google Cloud,โ€ was a masterclass in turning a local machine project into a scalable, production-ready application.

Our speakers, Amit and Jeff, guided us through two powerful deployment paths: the streamlined, managed approach with Firebase App Hosting, and the highly customizable solution with Cloud Run.


๐Ÿ› ๏ธ Part 1: Firebase App Hosting (The Managed Path)

Jeff showed how the complexity of deploying a modern web app like a Next.js application, which requires server-side rendering, can be drastically simplified.

The Challenge ๐Ÿคฏ

To deploy a scalable web app, you need a lot of moving parts:

  • A server (trusted compute environment).
  • A global Content Delivery Network (CDN) for speed and good Core Web Vitals.
  • Continuous Deployment (CI/CD).
  • Secure secrets management (e.g., for the Gemini API key).
  • Comprehensive logging and monitoring.

The App Hosting Solution ๐Ÿ’ก

Firebase App Hosting acts as a single platform for rapid app development, wiring together all the necessary Google Cloud products like Cloud Run, Cloud CDN, Cloud Build, and Secret Manager.

  • โšก๏ธ Seamless CI/CD: Connect your GitHub repo, and App Hosting handles the build and auto-deployment on every push to your branch.
  • ๐Ÿ”‘ Secure Secrets: Use the CLI command app hosting secret set to securely store API keys in Cloud Secret Manager. The key is referenced by name in your apphosting.yaml config file, ensuring it is never accidentally leaked.
  • ๐Ÿ“ˆ Built-in Observability: Get immediate feedback with a monitoring dashboard showing requests (200s, 400s, 500s), runtime logs, CDN logs, and metrics like CPU utilization.
  • โš™๏ธ Customization: While managed, the apphosting.yaml file allows you to tune underlying Cloud Run settings, such as max instances, concurrency, CPU, and memory.
  • โ†ฉ๏ธ Easy Rollbacks: Instantly revert to a previous working version from the console.

โ˜๏ธ Part 2: Cloud Run (The Custom Path)

Amit then showcased Cloud Run, the fully managed, serverless platform for deploying custom applications and services.

Serverless Power & Flexibility ๐Ÿ’ช

Cloud Run is an event-driven system, meaning you only pay when your service is actively running or โ€œinvoked.โ€

Feature Description
Containers & Source Deploy any OCI compliant container or directly deploy source code (Next.js, Python, Go, etc.).
Services For running APIs, web applications, or background services that interact with others.
Jobs For back-end tasks that run periodically or on demand, like retraining ML models, data migrations, or generating dynamic reports. Scheduling is done using standard cron job syntax.
Traffic Management Manage traffic distribution between different revisions for A/B testing or gradual rollouts (e.g., 50% to old, 50% to new).

๐Ÿฅถ Solving the โ€œCold Startโ€ Problem

While serverless saves money, it can lead to โ€œcold startsโ€ where the service takes a moment to load. Amit shared a brilliant cost-effective solution:

  • Solution: Configure a simple health check to hit your service every three minutes.
  • Cost: This method is estimated to cost as low as 60 cents per month to keep your full service running and warm.

Published Nov 11, 2025