Sprint 14: Infrastructure Automation & The Autonomous Factory
With the Node.js Game Engine secured (Sprint 13), Sprint 14 shifts focus to the Python Content Factory. The objective is to deploy the data ingestion pipeline directly into Google Cloud’s serverless infrastructure, ensuring the game autonomously scrapes, analyzes, and stages real-world news stubs on a rigid hourly schedule.🛠Context & Required Rules for AI Agents
- Infrastructure as Code (IaC): Deployments must be driven by
cloudbuild.yaml. No manual Docker builds. - Zero-Trust Networking: The
/tasks/ingest-newsendpoint is secured by aSCHEDULER_SECRET. The Cloud Scheduler cron job must inject this as a Bearer token in theAuthorizationheader. - IAM Least Privilege: The Cloud Run service account must possess
roles/datastore.userto write to the Firestorenews_registrycollection.
🗺 Sprint 14 Roadmap
[x] Phase 1: CI/CD Pipeline Construction (Cloud Build)
- Objective: Automate the delivery of the Python FastAPI microservice.
- Tasks:
- Verify and execute the existing
cloudbuild.yamlpipeline. - Ensure the pipeline builds the OCI-compliant image, stages it in Google Cloud Artifact Registry (
gcr.io), and executes a zero-downtime deployment to Cloud Run (pcmtg-content-factory).
- Verify and execute the existing
[x] Phase 2: The Metronome (Cloud Scheduler)
- Objective: Provision the heartbeat of the Content Factory.
- Tasks:
- Provision a Google Cloud Scheduler job named
pcmtg-news-metronome. - Configure the cron schedule to
0 * * * *(hourly). - Target the live Cloud Run URL with a
POSTpayload to/tasks/ingest-news. - Inject the
SCHEDULER_SECRETinto theAuthorization: Bearerheader.
- Provision a Google Cloud Scheduler job named
[x] Phase 3: IAM & Secret Binding Validation
- Objective: Ensure the deployed container has database clearance and API keys.
- Tasks:
- Bind
roles/datastore.userto the Cloud Run service account. - Verify
GEMINI_API_KEYandSCHEDULER_SECRETare securely bound from GCP Secret Manager to the Cloud Run environment. - Trigger a manual execution of the Metronome to verify End-to-End ingestion into Firestore.
- Bind