feat(asm-runner): docker image#115
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
|
Commit: 904c776
|
purusang
left a comment
There was a problem hiding this comment.
Docker file looks good, but I don't think docker.yml workflow is valuable.
Two-stage build: Ubuntu 24.04 with the pinned Rust toolchain compiles the binary, slim Ubuntu 24.04 runtime ships it. ENTRYPOINT/CMD default to /app/config.toml and /app/asm-params.json; no params validation in the entrypoint, so misconfiguration surfaces as a runtime failure from the binary itself (same as launching the runner directly). Native and "no prover" modes are supported out of the box because the NativeHost backend is compiled in unconditionally. SP1 mode needs --features sp1 and the guest ELFs bundled into the image — left as a TODO(prover-sp1) inside the Dockerfile with the concrete steps for adding it.
a067d3a to
9e6ec8b
Compare
The original Dockerfile only built a native/no-prover image and left SP1 support as a TODO. Fold SP1 in now via a second build target so both variants ship from the same Dockerfile. Structure: shared `builder` stage parameterized by a `CARGO_FEATURES` build-arg, a `runtime-base` stage with the binary, then `native` (default, no extras) and `sp1` (copies pre-built guest ELFs into /app/elfs/) targets. Guest ELFs are built outside docker and staged into `docker/asm-runner/artifacts/elfs/` rather than built inside an SP1 image, matching alpen's `docker/strata/Dockerfile` pattern. Building inside would need either docker-in-docker (for sp1-build's docker-build feature) or the full SP1 toolchain in the builder layer — both heavier than just copying ELFs in from the host/CI runner.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb8c49d124
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | Mode | Config | `native` image | `sp1` image | | ||
| | ------ | --------------------------------------------------- | -------------- | ----------- | | ||
| | none | omit `[orchestrator]` | yes | yes | | ||
| | native | `orchestrator.backend.kind = "native"` | yes | yes | |
There was a problem hiding this comment.
Correct native support for SP1 images
This table says a sp1 image can run orchestrator.backend.kind = "native", but the runner code does not support that combination: in bin/asm-runner/src/prover/backend.rs, enabling the sp1 feature makes ProofHost = SP1Host, and the #[cfg(feature = "sp1")] build_native_hosts path immediately bails with native backend requested but binary was built with the sp1 feature. Users following this matrix will build the SP1 image and then get a startup failure for native configs, so the documented support matrix should be corrected or the image should actually include native support.
Useful? React with 👍 / 👎.
MdTeach
left a comment
There was a problem hiding this comment.
Overall looks good.
Also it would be helpful to add sample config/params file
|
NACK. |
Description
Adds a Docker flow for
strata-asm-runner. Single two-stage Dockerfile underdocker/asm-runner/: Ubuntu 24.04 builder with the pinned Rust toolchain (rust-toolchain.toml) compiles the binary, slim Ubuntu 24.04 runtime ships it.ENTRYPOINT/CMDdefault to/app/config.tomland/app/asm-params.json; both are overridable via flags or volume mounts. No params validation in the entrypoint — misconfiguration surfaces as a runtime failure from the binary itself.Native prover and the "no prover" mode work out of the box because the
NativeHostbackend is compiled in unconditionally. SP1 mode is not supported by this image — it's marked asTODO(prover-sp1)in the Dockerfile (with the concrete steps) and will land in a follow-up PR using the alpen pattern (pre-built guest ELFs staged into the build context).No docker CI workflow: the workspace compile is already covered by
unit.yml/functional.yml. Adding a docker-builds-too job duplicated that signal at significant CI cost.Type of Change
Notes to Reviewers
Verified locally:
docker buildx buildsucceeds anddocker run --rm strata-asm-runner:latest --helpprints the expected CLI usage. Final image is ~150 MB total / ~40 MB content.Checklist