Skip to content

feat(gcp): add GCP Terraform deployment and Orion build execution environment#2

Merged
benjamin-747 merged 1 commit intogitmono-dev:mainfrom
WiedersehenM:feat/gcp-terraform
Feb 5, 2026
Merged

feat(gcp): add GCP Terraform deployment and Orion build execution environment#2
benjamin-747 merged 1 commit intogitmono-dev:mainfrom
WiedersehenM:feat/gcp-terraform

Conversation

@WiedersehenM
Copy link
Contributor

Summary

This PR introduces a GCP Terraform deployment for Mega and provides a GKE-based build execution environment compatible with the existing Mega / Orion-server scheduling model. It adds multi-environment Terraform entrypoints, GCP modules, Orion Worker deployment via Terraform, and E2E validation assets.

Closes/Relates to:

  • #1692 (GCP Terraform deployment)
  • #1841 (GCP build execution environment)

What’s Included

GCP Terraform environments

  • deployment/envs/gcp/dev|staging|prod
    • Standardized entrypoints (main.tf, providers.tf, versions.tf, variables.tf, terraform.tfvars.example)
    • Outputs aligned with existing tooling where applicable (pg_endpoint, valkey_endpoint, alb_dns_name, etc.)
    • Added project_id output for validation tooling

GCP Terraform modules

  • Network: VPC/Subnet, Cloud Router/NAT, firewall rules
  • GKE: Cluster + dedicated node pool for build workloads
  • Artifact Registry, GCS, Cloud SQL, Memorystore Redis, Filestore
  • IAM: service accounts + role bindings + Workload Identity bindings
  • Monitoring/Logging: enable required services and optional alerting primitives

Orion build execution environment (GKE)

  • Orion Worker deployed via Terraform as a DaemonSet on a dedicated node pool
  • Node pool isolation via taints/tolerations and nodeSelector
  • HostPath caches for build workspace/data (/workspace, /data) to support build performance and reuse

E2E / validation

  • deployment/gcp/e2e/README.e2e.md
  • Connectivity validation job (DNS/HTTPS/WS)
  • Task trigger & status polling job (Orion-server API)
  • Minimal validation script for quick environment checks

Key Fixes / Compatibility Notes

  • Updated Kubernetes resources to provider-supported resource types and v1 resources where required.
  • Fixed Terraform heredoc placeholders to avoid HCL interpolation conflicts.
  • Fixed nodepool service account handling to avoid coalesce() empty-args failures when no SA is explicitly provided.
  • Adjusted IAM example naming to comply with GCP service account account_id constraints (no underscores).
  • Updated E2E jobs to avoid hard-coding nodepool names where possible.

…idation

- Add GCP Terraform modules mirroring AWS structure (network, GKE, Cloud SQL, Redis, Filestore, Artifact Registry, IAM, monitoring)
- Implement Orion Worker DaemonSet on dedicated node pool with taints and tolerations
- Add multi-environment support (dev/staging/prod) with variable parity to AWS
- Include e2e validation jobs (connectivity and task execution) and minimal validation script
- Add comprehensive README for GCP deployment and troubleshooting
- Fix Terraform compatibility issues (coalesce, provider versions, deprecated resources)
- Update variable naming to align with AWS deployment (storage_*, db_*, rails_*)
- Enable Workload Identity bindings for GKE service accounts
- Support both public and private cluster configurations with NAT
- Provide outputs compatible with existing tooling (pg_endpoint, valkey_endpoint, alb_dns_name)

Signed-off-by: Hongze Gao <15101764808@163.com>
@benjamin-747 benjamin-747 disabled auto-merge February 5, 2026 02:13
@benjamin-747 benjamin-747 disabled auto-merge February 5, 2026 02:18
@benjamin-747 benjamin-747 merged commit f574e48 into gitmono-dev:main Feb 5, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants