Orion Client is the worker node for the Mega build system. It fetches build tasks from the Orion Server and executes them. It integrates with the FUSE filesystem via the scorpiofs library to mount remote repositories locally.
┌─────────────────────────────────────────────────────────────────────────────┐
│ Deployment Architecture │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ deployment │ │ mega │ │
│ │ (Repo) │ │ (Repo) │ │
│ └────────┬─────────┘ └────────┬─────────┘ │
│ │ │ │
│ │ Terraform apply │ git push (Triggers CI) │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Infrastructure │ │ App Deployment │ │
│ │ - Provision VM │ │ - Build rust bin│ │
│ │ - Install deps │ │ - Package config│ │
│ │ - Setup systemd │ │ - SCP transfer │ │
│ │ - Create dirs │ │ - Restart svc │ │
│ └────────┬─────────┘ └────────┬─────────┘ │
│ │ │ │
│ └───────────────┬───────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ GCP VM │ │
│ │ orion-client │ │
│ │ │ │
│ │ systemd: │ │
│ │ orion-runner │ │
│ └──────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
All files are owned by the orion user.
/home/orion/orion-runner/ # Application root
├── orion # Main executable
├── .env # Environment variables
├── scorpio.toml # Scorpio config
├── preflight.sh # Pre-start capability/device checks
├── run.sh # Startup script
└── cleanup.sh # Pre-start cleanup script
/data/scorpio/ # Scorpio data directory
├── store/ # Dicfuse data store
├── tmp_build/ # Temporary Buck2 build dir
└── antares/ # Antares overlay config
/workspace/mount/ # FUSE main mount point
Before the first deployment via CI, the target VM must be initialized with the following steps. (This is generally handled by the Terraform startup script in the deployment repository).
sudo useradd -m -s /bin/bash orion
sudo mkdir -p /data/scorpio/{store,antares/{upper,cl,mnt}}
sudo mkdir -p /workspace/mount
sudo mkdir -p /home/orion/orion-runner
sudo chown -R orion:orion /data/scorpio /workspace/mount /home/orion/orion-runner# Add orion to fuse group
sudo usermod -aG fuse orion
# Allow non-root users to mount with allow_other
echo "user_allow_other" | sudo tee -a /etc/fuse.confThe deployment CI requires passwordless execution of specific commands.
cat <<'EOF' | sudo tee /etc/sudoers.d/orion-runner
orion ALL=(ALL) NOPASSWD: /usr/bin/systemctl start orion-runner.service
orion ALL=(ALL) NOPASSWD: /usr/bin/systemctl stop orion-runner.service
orion ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart orion-runner.service
orion ALL=(ALL) NOPASSWD: /usr/bin/systemctl daemon-reload
orion ALL=(ALL) NOPASSWD: /usr/bin/pkill
orion ALL=(ALL) NOPASSWD: /usr/bin/mkdir
orion ALL=(ALL) NOPASSWD: /usr/bin/chown
orion ALL=(ALL) NOPASSWD: /bin/umount
orion ALL=(ALL) NOPASSWD: /usr/bin/cp /home/orion/orion-runner/orion-runner.service /etc/systemd/system/
EOF
sudo chmod 440 /etc/sudoers.d/orion-runnerTo prevent CI from timing out due to multiple rapid SSH connections:
sudo sed -i 's/^#\?MaxStartups.*/MaxStartups 10:30:60/' /etc/ssh/sshd_config
sudo systemctl restart sshdDeployment is automated via GitHub Actions (.github/workflows/orion-client-deploy.yml).
Automatically triggered by pushes to the main branch when files in orion/** or the workflow file itself change.
| VM | User | Target Path |
|---|---|---|
| Legacy VM | root (legacy compatibility) | /home/orion/orion-runner/ |
| GCP VM | orion (best practice) | /home/orion/orion-runner/ |
Deployment Secrets required in GitHub:
ORION_DEPLOY_HOST/ORION_DEPLOY_SSH_KEY(Legacy VM)ORION_GCP_VM_HOST/ORION_GCP_VM_SSH_KEY(GCP VM)
- Compiles the
orionbinary (cargo build --release -p orion). - Packages configuration files from
orion/runner-config/. - Connects to VMs and stops the existing
orion-runner.service. - Uploads files using
scpto the/home/orion/orion-runner/directory. - Updates the systemd service file if necessary.
- Restarts the service asynchronously using
nohup systemctl start.
# Check service status
sudo systemctl status orion-runner
# Follow service logs
sudo journalctl -u orion-runner -f
# Force unmount if FUSE is stuck
sudo umount -lf /workspace/mountstatus=217/USER: Theorionuser was not created on the target machine. Run the VM Initialization steps.unexplained error (code 255) at io.c: SSH connection rejected by the server. EnsureMaxStartups 10:30:60is set in/etc/ssh/sshd_configandsshdis restarted.- FUSE Mount Fails:
- Ensure
user_allow_otheris enabled in/etc/fuse.conf. - Ensure service keeps
AmbientCapabilities=CAP_SYS_ADMINand/dev/fuseis readable/writable. preflight.shwill now block startup early with explicit errors if capability/device checks fail.
- Ensure
- Buck2
linker_wrapper.shENOENT /event.jsonlEBADF on Antares mount: See FUSE_MOUNT_ISSUES.md.