fix(genvm): download GenVM releases instead of building from source - #1712
Conversation
…1706) * fix(genvm): acquire GenVM by release download instead of nix build Studio always built GenVM from source because the pin file held a floating "main". That nix build fails nondeterministically on a fixed-output derivation, so add explicit prebuilt/source/release modes and default to downloading a pinned genvm-manager release. * fix(ci): precompile GenVM before starting the stack The genvm-manager bundle carries two executor lines, so precompiling both on a cold cache overruns the healthcheck window and the container is reported unhealthy. Precompile in a one-off container first and cache the result across runs.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/run-e2e studio |
|


Re-lands #1706, which was merged into #1697's branch after #1697 had already merged, so it never reached
v0.123-dev. Identical change, cherry-picked cleanly onto the current base.v0.123-devtoday still carries the bug described below.Problem
third_party/genvm/versioncurrently holds the literal stringmain. The pin router sends anything not matching a release tag down the nix path, so every build compiles GenVM from source against a floating ref — the build input moves on its own (it resolved to02741163when this was first investigated,12f85fc0later).That nix build fails nondeterministically: a fixed-output-derivation mismatch on
genvm-bz2-1.0.8wherespecified:is constant butgot:differs across jobs, because the sandbox is disabled and host state leaks in. Bumping the hash does not fix it.02741163is exactly thev0.6.0-rc0tag, and that release ships a self-contained prebuilt bundle — Studio was compiling from source something that already exists as a download.Change
Three explicit acquisition modes, precedence prebuilt > source > release:
prebuilt.e2e-genvm-prebuilt/tree presentsourceGENVM_SOURCE_MODE=source, or<branch>:<commit>inGENVM_REFreleasegenvm-managerreleasemain→v0.6.0-rc0download_genvm.shrather than writing a third implementation — keeps the tree-based split-layout probe (rc1 movedrunners/into a separategenvm-universal.tar.xz; the probe checks the tree, never the tag),chmod -R u+wfor rc0's read-onlydata/, thepost-install.py/genvm-post-installrename handling, and the pinned-runner assertiongenvm-runner-pinstage collapses contract pins to a small normalized file, so the ~330MB GenVM layer no longer invalidates on every backend editGENVM_TAG/GENVM_REFmutual-exclusion guardGENVM_ARTIFACT_URL— half-wired, with a hardcoded amd64-only default that silently fetched the wrong architecture on arm64-devbranch pins now rejected with an actionable message instead of 404ing.dockerignore:!docker/scripts/is load-bearing — without it the newCOPYfails and every build breaks in all three modesGENVM_TAG's ENV is deliberately retained: dead at build time, but load-bearing at runtime as the precompile cache-key fallback.Also: precompile moved out of the healthcheck window
Once the image built, a second failure surfaced —
container jsonrpc is unhealthyat 208s. The genvm-manager bundle ships two executor lines (v0.2.17legacy +v0.3.0-rc7) and the entrypoint precompiles every executor version in the manifest at startup; each cpython wasm compile is 15–20s. Two hard caps made it unfixable by raising retries: the CI healthcheck budget is ~210s (start_period: 30s+interval: 5s×retries: 36), and the compose step hastimeout-minutes: 5.Precompile now runs in its own step before
compose upwith a 30-minute budget, and the result is cached across runs keyed by GenVM binding + arch. It invokes the real entrypoint withtrueas the command, so the existing cache-marker logic is reused rather than duplicated.Verification
Built locally on arm64. Release mode green; the image carries
/genvm/version=v0.6.0-rc0, executorsv0.2.17+v0.3.0-rc7, and the pinned runner9b/8kjyda…tar— the tarball whose absence caused the original lint failure. Architecture resolved to arm64 correctly, where the old hardcoded URL would have fetched amd64.Negative cases: explicit
prebuiltwith an unusable tree fails with an actionable message; auto-detect with an empty tree falls through to release;GENVM_TAG+GENVM_REFtogether fail;GENVM_TAG=v0.6-devis rejected before any download.On #1697's branch this took all four previously-failing jobs green —
test31m8s,Load Tests15m56s,test-gasless8m46s,db-integration-test1m24s.Source mode is untested — it is the known-broken nix path, now opt-in precisely so nobody hits it accidentally.
Pairs with genlayerlabs/genlayer-e2e#667.
Depends-On: genlayerlabs/genlayer-e2e@fix/studio-genvm-source-mode