Skip to content

feat: add custom snapshot image baking - #34

Open
douglance wants to merge 12 commits into
mainfrom
feat/custom-snapshot-bake
Open

feat: add custom snapshot image baking#34
douglance wants to merge 12 commits into
mainfrom
feat/custom-snapshot-bake

Conversation

@douglance

@douglance douglance commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a one-shot testnode bake command that boots a base stack, runs a downstream setup command, captures the customized state, and builds an image.
  • Add a reusable composite action for the same custom-image workflow, with optional registry push support.
  • Allow the CLI and action to boot a full custom image reference while preserving the existing runtime configuration.
  • Share validated build-context preparation between local and CI workflows.
  • Make snapshot replacement transactional so a failed bake restores the prior snapshot.
  • Integrate the latest changes from main.

Validation

  • pnpm lint
  • pnpm build
  • pnpm typecheck
  • Full test suite: 212 tests passing

dlance and others added 11 commits July 22, 2026 10:06
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
Comment thread bake/action.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants