feat: add custom snapshot image baking - #34
Open
douglance wants to merge 12 commits into
Open
Conversation
Promote the release workflow's context-prep + docker-build logic into a reusable, variant-agnostic core function so downstream repos can bake images from their own custom snapshots. Derives l3Enabled from the snapshot's l3node volume archive; keeps the CI prepare script as a standalone no-build path.
- 'snapshot bake' turns a snapshot id into an image (--id/--image-ref/--push). - 'testnode bake' boots the base stack (restore default snapshot, or --rebuild for a full init), runs a host --setup-command with the documented env contract, captures a snapshot, and builds/pushes the image. Non-zero setup-command exit aborts.
Thread an optional image-ref (+ explicit variant) through buildTestnodeState, the start command/config file, and the GitHub Action. When set, it bypasses variant/version tag resolution; ports/env come from the variant, defaulting to l2. Lets consumers boot custom-baked images locally and in CI.
Add OffchainLabs/arbitrum-testnode/bake@<ref>: builds the CLI from the action's own checkout, installs a base snapshot (github-token) or rebuilds, then runs 'testnode bake'. Registry login stays the consumer's job. Document the flow and the setup-command env contract in the README.
- Fix --release-tag flag (was --releaseTag) in the snapshot-install path. - When rebuild=true, provision a pinned token-bridge-contracts checkout (init deploys the bridge via its ts-node) and run init --rebuild with retry until the base snapshot manifest is captured — the init is intermittently flaky on cold runners, so isolate it from the expensive downstream setup-command. - The bake step then restores the locally-captured base snapshot (no --rebuild), so a setup/bake failure re-runs cheaply instead of re-initializing.
Booting nitro from a restored snapshot exceeds the fixed 120s budget on cold CI runners (RPC at :8547 not ready). Add TESTNODE_RPC_TIMEOUT_MS (default 120s) and set it to 300s in the bake Action's bake step.
…up contracts anvil --state only dumps on graceful shutdown; on slow CI runners the base snapshot captured an empty L1 state, so the restored sequencer found no inbox contract code and aborted. --state-interval=1 keeps /state current.
The foundry image runs as uid 1000; the host-created anvil-state bind mount is owned by the runner uid, so anvil couldn't write state.json on Linux CI — the base snapshot captured an empty L1 and the restored sequencer found no rollup contracts. Only surfaced on Linux (macOS Docker Desktop ignores mount owners).
…bake # Conflicts: # docker/docker-compose.yaml
alxdca
reviewed
Jul 30, 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.
Summary
testnode bakecommand that boots a base stack, runs a downstream setup command, captures the customized state, and builds an image.main.Validation
pnpm lintpnpm buildpnpm typecheck