Merged
Conversation
Signed-off-by: Luxian <lux1an@qq.com>
Contributor
Author
|
don't merge before Discussion |
There was a problem hiding this comment.
Pull request overview
Updates the GCP production Orion Client (worker) infrastructure to rely on CI-delivered runtime artifacts/config instead of Terraform copying a bundled orion-config, making first-boot provisioning tolerant of missing binaries/scripts.
Changes:
- Make
startup-orion-client.shresilient on first boot by conditionally chmod’ing deployed artifacts and not failing if the systemd service can’t start yet. - Remove Terraform file provisioning of
orion-configinto/home/orion/orion-runner. - Delete the previously Terraform-managed
orion-configfiles fromenvs/gcp/prod.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| envs/gcp/prod/scripts/startup-orion-client.sh | Avoids hard failures when run.sh/binary aren’t present yet; soft-fails initial service restart. |
| envs/gcp/prod/main.tf | Stops copying orion-config into the VM via a Terraform file provisioner. |
| envs/gcp/prod/orion-config/scorpio.toml | Removes now-obsolete Terraform-managed scorpio config. |
| envs/gcp/prod/orion-config/run.sh | Removes now-obsolete Terraform-managed runner script. |
| envs/gcp/prod/orion-config/.env | Removes now-obsolete Terraform-managed environment file. |
Comments suppressed due to low confidence (1)
envs/gcp/prod/scripts/startup-orion-client.sh:66
- This startup script downloads and executes external tooling (
curl ... https://sh.rustup.rs | shand thebuck2binary from GitHub withBUCK2_VERSION="latest") as root without any integrity verification or pinning to immutable versions. If the remote endpoints or the network are compromised, an attacker can supply malicious code/binaries that run with full privileges on every VM boot and influence all builds that usebuck2. Use pinned versions and verify downloads with checksums or signatures (and avoidcurl | shwhere possible) so that only trusted, immutable artifacts are executed in this environment.
# Install Rust toolchain if missing
if ! command -v rustc >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
export PATH="/root/.cargo/bin:${PATH}"
# Install Buck2
BUCK2_VERSION="latest"
ARCH="x86_64-unknown-linux-musl"
curl -fsSL -o /usr/local/bin/buck2.zst "https://github.com/facebook/buck2/releases/download/${BUCK2_VERSION}/buck2-${ARCH}.zst"
zstd -d /usr/local/bin/buck2.zst -o /usr/local/bin/buck2
chmod +x /usr/local/bin/buck2
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
benjamin-747
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Orion Client 部署文档
概述
Orion Client 是 Mega 构建系统的 Worker 节点,负责从 Orion Server 领取构建任务并执行。它通过 scorpiofs 库集成 FUSE 文件系统,实现远程仓库的本地挂载。
架构
仓库职责
1. deployment 仓库(基础设施)
路径:
envs/gcp/prod/负责 GCP 基础设施的管理:
google_compute_instance.orion_client_vmstartup-orion-client.shTerraform 执行内容:
2. mega 仓库(应用代码)
相关路径:
orion/- 应用代码orion/runner-config/- 生产运行时配置.github/workflows/orion-client-deploy.yml- CI 工作流CI 执行内容:
cargo build --release -p orion)目录结构
VM 运行时目录
源码配置文件
配置文件
scorpio.toml
Scorpio/Dicfuse FUSE 文件系统配置:
.env
环境变量配置:
部署流程
首次部署
后续更新
systemd 服务
服务单元 (orion-runner.service)
常用命令
故障排查
常见问题
FUSE 挂载失败
服务启动失败
网络连接问题
日志位置
/var/log/orion-client-startup.log/var/log/orion-runner.log/home/orion/orion-runner/log/orion.log本地开发
参考 orion/README.md 中的本地开发说明。
本地开发使用独立的配置文件:
orion/.env- 本地环境变量orion/scorpio.toml- 本地 Scorpio 配置orion/run-dev.sh- 本地启动脚本CI/CD 配置
触发条件
Secrets 配置
ORION_DEPLOY_HOSTORION_DEPLOY_SSH_KEYORION_GCP_VM_HOSTORION_GCP_VM_SSH_KEY部署目标
/root/orion-runner//home/orion/orion-runner/配置变更流程
orion/runner-config/下的配置文件注意事项
mega/orion/runner-config/