D3 — VM-deploy adapter (OpenTofu fallback + hero_compute primary) #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
D3 — VM-deploy adapter (OpenTofu fallback + hero_compute primary)
Sub-issue of
#?(v0.1 scope). Abstracts the VM lifecycle behind a trait so the deployer can speak to either backend transparently.What this does
Today's s132 work proved the OpenTofu path end-to-end:
make deploy ENV=herolabinhero_demo/deploy/single-vm/provisions a fresh TFGrid VM in ~60s, captures mycelium_ip + gateway_fqdn, supportsmake destroy ENV=herolabfor teardown.Mahmoud's
hero_computeexposes the same surface via OpenRPC (seehero_compute#? (deployer integration)).We want both available behind a single Rust trait so the deployer doesn't depend on which one is wired up.
Selection via config:
Why both
deploy_vm+deploy_webgatewayare production-stable on TFGrid mainnet, we flip the default config + retire OpenTofu eventually.This decouples deployer-arc progress from hero_compute-arc progress. Neither blocks the other.
OpenTofuBackend implementation notes
tofu -chdir=<hero_demo_path>/deploy/single-vm/tf applywith environment-templated tfvarstofu output -raw <name>mechanic, just done in Rustenvs/u_<user_id>/with templated app.env + tfvars (overrides node_id + ssh_key + gateway_name based on user)tofu destroyHeroComputeBackend implementation notes
hero_compute_sdkfor typed RPC calls (ComputeService.deploy_vm, etc.)wait_vm_readypollsget_vmfor mycelium_ip + open TCP on its rpc.sock dir (later: replaced byComputeService.wait_vm_readyif Mahmoud adds it per G1 in the integration issue)Acceptance criteria
OpenTofuBackendproduces an end-to-end VM identical to what s132'smake deploy ENV=herolabproduces, in under 90sHeroComputeBackendproduces an equivalent VM via Mahmoud'sComputeService.deploy_vm, in under 90s (or stays gated on hero_compute readiness — the test is conditional)deployer.deploy_vm(the deployer's own RPC) returns identical state to its caller regardless of backendReferences
hero_demo/deploy/single-vm/crates/my_compute_zos_server/src/cloud/openrpc.jsonin hero_computehero_compute#? (deployer integration)#?(v0.1 scope)