Skip to content

feat(gcp): support Orion Client deployment on bare-metal VM via Terraform#13

Merged
benjamin-747 merged 3 commits intogitmono-dev:mainfrom
WiedersehenM:feat/gcp-vm-orion-client-native
Feb 25, 2026
Merged

feat(gcp): support Orion Client deployment on bare-metal VM via Terraform#13
benjamin-747 merged 3 commits intogitmono-dev:mainfrom
WiedersehenM:feat/gcp-vm-orion-client-native

Conversation

@WiedersehenM
Copy link
Contributor

Description

This PR updates the GCP deployment configuration to support running the Orion Client directly on a GCE Virtual Machine instead of Cloud Run. This change addresses current issues with the Orion Client Docker image by allowing a bare-metal execution environment.

Key Changes

  1. Infrastructure Refactoring:

    • Commented out standard environment modules (Network, Cloud Run, SQL, Redis, etc.) in deployment/envs/gcp/prod/main.tf to provide a minimal testing environment.
    • Added google_compute_instance resource specifically for the Orion Client.
    • Configured the VM to attach to the existing project network (buck2hub-vpc3 and buck2hub-subnet).
  2. Automated VM Bootstrapping:

    • Implemented a robust metadata_startup_script that installs all required build dependencies (Rust toolchain, LLVM, Protobuf, Fuse3, etc.) and Buck2.
    • Added a systemd service wrapper (orion-worker-wrapper) to manage the lifecycle of the Scorpio FUSE daemon and the Orion Worker.
    • Provided an install_from_tgz.sh script on the VM to automate source extraction, release compilation, and service registration.
  3. Enhanced Configuration:

    • Integrated scorpio.toml configuration handling within the automated setup.
    • Added support for Orion Server connection via Secure WebSockets (WSS) and Mono service integration via Cloud Run URLs.

New Variables (terraform.tfvars)

The following variables are now required for the Orion Client VM:

  • orion_client_scorpio_base_url: The base URL of the Mega Mono service.
  • orion_client_server_ws: The WSS endpoint for the Orion Server.
  • zone: The specific GCP zone for VM deployment (e.g., asia-east1-a).

Verification Results

  • Successfully provisioned the VM in the infra-20250121-20260121-0235 project.
  • Verified that the Orion Worker successfully completes the WebSocket handshake with the server and registers with a valid Worker ID.
  • Verified that Scorpio daemon initializes correctly with the provided configuration.

Usage Instruction

  1. Run terraform apply to create the VM.
  2. Upload the source code as orion.tgz to /opt/orion-client/src.tgz on the VM.
  3. Execute /opt/orion-client/install_from_tgz.sh to compile and start the services.

- Add a GCE VM (e2-standard-4) attached to existing VPC/subnet via data sources
- Install build/runtime deps, rust toolchain and buck2 in startup script
- Provide install_from_tgz.sh to build orion/scorpio from uploaded source tarball
- Disable non-VM modules/outputs via block comments for local testing

Signed-off-by: Hongze Gao <15101764808@163.com>
- Replace Cloud Run with GCE VM for Orion Client execution
- Add comprehensive bootstrapping script in metadata_startup_script
- Implement automated source extraction and cargo build process on VM
- Configure systemd services for Scorpio daemon and Orion Worker
- Update network interface to use existing buck2hub-vpc3 and subnet
- Add required variables for WSS and Mono service endpoints
- Comment out non-essential resources for isolated VM testing

Signed-off-by: Hongze Gao <15101764808@163.com>
@WiedersehenM
Copy link
Contributor Author

正在根据review意见修改代码

- add google_compute_instance.orion_client_vm to run the orion client on a dedicated GCE VM
- switch boot image to debian-cloud/debian-13 and install required runtime deps (rust, buck2, fuse3, etc.)
- factor metadata_startup_script into scripts/startup-orion-client.sh for readability and reuse
- create orion-worker-wrapper on the VM and register a systemd orion-worker.service unit

Signed-off-by: Hongze Gao <15101764808@163.com>
@benjamin-747 benjamin-747 added this pull request to the merge queue Feb 25, 2026
Merged via the queue into gitmono-dev:main with commit d0d94e1 Feb 25, 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