mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 21:03:05 -07:00
2.3 KiB
2.3 KiB
Architectural Mandate: High-Performance Workspace System
Infrastructure Strategy
- Base OS: Always use Container-Optimized OS (COS) (
cos-stablefamily). It is security-hardened and has Docker pre-installed. - Provisioning: Use the Cloud-Init (
user-data) pattern.- Note: Avoid
gcloud compute instances create-with-containeron standard Linux images as it uses a deprecated startup agent. On COS, use nativeuser-datafor cleanest execution.
- Note: Avoid
- Performance: Provision with a minimum of 200GB PD-Balanced disk to ensure high I/O throughput for Node.js builds and to satisfy GCP disk performance requirements.
Container Isolation
- Image:
us-docker.pkg.dev/gemini-code-dev/gemini-cli/maintainer:latest. - Identity: The container must be named
maintainer-worker. - Mounts: Standardize on these host-to-container mappings:
~/dev->/home/node/dev(Persistence for worktrees)~/.gemini->/home/node/.gemini(Shared credentials)~/.workspace->/home/node/.workspace(Shared scripts/logs)
- Runtime: The container runs as a persistent service (
--restart always) acting as a "Remote Workstation" rather than an ephemeral task.
Orchestration Logic
- Worker Provider Abstraction: Infrastructure is managed via a
WorkerProviderinterface (e.g.,GceCosProvider). This decouples the orchestration logic from the underlying platform. - Robust Connectivity: The system uses a dual-path connectivity strategy:
- Fast-Path SSH: Primary connection via a standard SSH alias (
gcli-worker) for high-performance synchronization and interaction. - IAP Fallback: Automatic fallback to
gcloud compute ssh --tunnel-through-iapfor users off-VPC or when direct DNS resolution fails.
- Fast-Path SSH: Primary connection via a standard SSH alias (
- Context Execution: Use
docker exec -it maintainer-worker ...for interactive tasks andtmuxsessions. This provides persistence against connection drops while keeping the host OS "invisible." - Path Resolution: Both Host and Container must share identical tilde (
~) paths to avoid mapping confusion in automation scripts.
Maintenance
- Rebuilds: If the environment drifts or the image updates, delete the VM and re-run the
provisionaction. - Status: The Mission Control dashboard derives state by scanning host
tmuxsessions and container filesystem logs.