Skip to content

feat(asm-runner): docker image#115

Open
prajwolrg wants to merge 2 commits into
mainfrom
feat-asm-runner-dockerfile
Open

feat(asm-runner): docker image#115
prajwolrg wants to merge 2 commits into
mainfrom
feat-asm-runner-dockerfile

Conversation

@prajwolrg

@prajwolrg prajwolrg commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a Docker flow for strata-asm-runner. Single two-stage Dockerfile under docker/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/CMD default to /app/config.toml and /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 NativeHost backend is compiled in unconditionally. SP1 mode is not supported by this image — it's marked as TODO(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

  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)

Notes to Reviewers

Verified locally: docker buildx build succeeds and docker run --rm strata-asm-runner:latest --help prints the expected CLI usage. Final image is ~150 MB total / ~40 MB content.

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.

@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

Commit: 904c776
SP1 Execution Results

program cycles gas
asm-stf 130,151,149 137,125,257
moho 5,198,665 5,504,458

@prajwolrg prajwolrg requested review from MdTeach and purusang May 27, 2026 03:20
@prajwolrg prajwolrg marked this pull request as ready for review May 27, 2026 03:21

@purusang purusang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker file looks good, but I don't think docker.yml workflow is valuable.

@prajwolrg prajwolrg changed the title feat(asm-runner): docker image + CI build check feat(asm-runner): docker image with native and sp1 build targets May 27, 2026
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.
@prajwolrg prajwolrg force-pushed the feat-asm-runner-dockerfile branch from a067d3a to 9e6ec8b Compare May 27, 2026 06:47
@prajwolrg prajwolrg changed the title feat(asm-runner): docker image with native and sp1 build targets feat(asm-runner): docker image May 27, 2026
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.
@prajwolrg

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread docker/README.md
| Mode | Config | `native` image | `sp1` image |
| ------ | --------------------------------------------------- | -------------- | ----------- |
| none | omit `[orchestrator]` | yes | yes |
| native | `orchestrator.backend.kind = "native"` | yes | yes |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 MdTeach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good.
Also it would be helpful to add sample config/params file

@evgenyzdanovich

Copy link
Copy Markdown
Collaborator

NACK.
I frankly dont see it a worth merging -- IMO binaries / images should be removed outta here once and forever, not added.

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.

4 participants