This directory contains a sanitized Terraform blueprint for deploying the VersoVector public portfolio architecture to Google Cloud Run.
It is intentionally not a production deployment.
infra/
└── gcp-cloud-run-blueprint/
├── README.md
├── main.tf
├── variables.tf
├── outputs.tf
├── terraform.tfvars.example
└── versions.tf
This blueprint documents how the public VersoVector architecture could be deployed without exposing real production infrastructure.
It demonstrates:
- an Artifact Registry Docker repository;
- a Cloud Run API service;
- a Cloud Run frontend service;
- separate runtime service accounts;
- conceptual API and frontend IAM boundaries;
- generic variables and outputs;
- a safe public/private repository separation.
The public repository may include:
- architecture diagrams;
- local services;
- Docker packaging;
- sanitized Terraform blueprints;
- generic variables;
- non-production examples.
A private repository should contain:
- real GCP project IDs;
- Terraform remote state backend configuration;
- production
terraform.tfvarsfiles; - real IAM bindings;
- secrets;
- private Cloud Run settings;
- authentication and billing logic;
- premium feature gating;
- private datasets and model artifact locations;
- production monitoring and analytics.
Browser
|
v
Cloud Run Frontend
|
| HTTP request to API service
v
Cloud Run API
|
| Future remote model bundle retrieval
v
Model Artifact Store
- GCS
- MLflow artifact store
- other controlled artifact location
Artifact Registry
- versovector-api image
- versovector-frontend image
This blueprint defines:
google_artifact_registry_repository.servicesgoogle_service_account.api_runtimegoogle_service_account.frontend_runtimegoogle_cloud_run_v2_service.apigoogle_cloud_run_v2_service.frontend- optional public invoker binding for the frontend
- optional public invoker binding for the API
- private API invoker binding for the frontend runtime service account
This blueprint does not build or push Docker images.
Build and push images before running terraform apply.
Example image format:
REGION-docker.pkg.dev/PROJECT_ID/REPOSITORY/versovector-api:TAG
REGION-docker.pkg.dev/PROJECT_ID/REPOSITORY/versovector-frontend:TAG
The public Docker image should package application code, not generated model artifacts.
Generated model artifacts such as .joblib files, local MLflow runs, and artifacts/model_bundle/ should not be committed to Git.
This blueprint includes model_bundle_uri as a placeholder for a future controlled artifact location.
By default:
allow_public_frontend_access = true
allow_public_api_access = false
This expresses the target architecture:
Browser -> Frontend Cloud Run -> Private API Cloud Run
However, the current public Gradio frontend does not yet implement authenticated service-to-service ID token calls.
For local or temporary public demo experiments, either:
- set
allow_public_api_access = true, or - extend the frontend API client to call private Cloud Run services with identity-aware authentication.
Production authentication details belong in a private deployment repository.
From the repository root:
cd infra/gcp-cloud-run-blueprint
cp terraform.tfvars.example terraform.tfvarsEdit terraform.tfvars with sandbox values only.
Then run:
terraform init
terraform fmt -recursive
terraform validate
terraform plan -var-file=terraform.tfvarsApply only in a controlled sandbox project:
terraform apply -var-file=terraform.tfvarsThis public blueprint intentionally excludes:
- production project IDs;
- production remote state backend;
- private domains;
- secret manager values;
- service account keys;
- billing/subscription logic;
- real customer data;
- production observability;
- private dataset/model artifact paths;
- environment-specific dev/staging/prod folders.
Public repository:
This is how the architecture could be deployed.
Private repository:
This is the actual deployment.
A future private repository such as VersoVector-Platform should own production Terraform, IAM, secrets, billing, auth, premium features, analytics, and real deployment configuration.