Skip to content

impl(042): increment 3, the rustev-serve image definition - #395

Merged
bartekus merged 1 commit into
mainfrom
impl/042-serve-image
Oct 30, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/042-serve-image

Conversation

@bartekus

@bartekus bartekus commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Spec 042 3.16.1: the rustev-serve image definition.

  • integrations/rustev-serve/image/Dockerfile: builder on the Linux gnu toolchain image of tools/rustev-release/artifacts.sh, runtime on gcr.io/distroless/cc-debian12:nonroot pinned by the index digest of spec 010's binding record; the binary only, user and group 65532, entrypoint /usr/local/bin/rustev-serve --config /etc/rustev/serve.json, no shell, read-only root compatible. Dockerfile.dockerignore sends sources only.
  • integrations/rustev-serve/image/check.sh <image> <platform>: checks a built image (platform, user, entrypoint, no shell, binary starts on a read-only root and exits 3 without its configuration).
  • integrations/rustev-serve/tests/image.rs: static checks that both bases are digest-pinned, the runtime base is the recorded index, the builder is artifacts.sh's, and the runtime stage is exactly copy, user, entrypoint.
  • Spec 042 implementation record: notes that the gRPC transport (3.9) is complete (impl(010): rustev-serve increment 2, the gRPC transport #187, recorded in spec 010) and records this increment. release-set.json: the image stays absent and both serve reasons are updated.

The image acceptance item stays externally blocked: spec 031's candidate workflow does not build images yet (3.16.2 leaves building, SBOM, signing and publication to spec 031).

Local evidence (Docker 29.8.2, Apple silicon, at d15793d): docker buildx build --platform linux/arm64 --load -f integrations/rustev-serve/image/Dockerfile . builds, and check.sh <image> linux/arm64 passes. linux/amd64 is not checked locally; the candidate workflow (spec 031) is where both platforms are built.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the PR, which adds a container image definition for rustev-serve (spec 042 §3.16), a check script, static tests, spec text, and updated release-set.json reasons.

Dockerfile (integrations/rustev-serve/image/Dockerfile)

  • Multi-stage build is correct: only the binary lands in the runtime image.
  • install -D -m 0555 target/release/rustev-serve /out/rustev-serve — the -D flag creates /out/ before the copy, so the missing parent is not an issue.
  • Both FROM lines are pinned by digest. The static test every_base_is_pinned_by_digest verifies this mechanically.
  • COPY --from=build --chown=0:0 then USER 65532:65532: permissions 0555 are world-executable, so the non-root user can run the binary. Correct.
  • ENTRYPOINT is a JSON array, preventing shell-injection through CMD override.

Dockerfile.dockerignore

Named Dockerfile.dockerignore alongside the Dockerfile at integrations/rustev-serve/image/. With -f integrations/rustev-serve/image/Dockerfile ., Docker resolves the companion ignore file at that same path relative to the context root. Placement is correct.

check.sh

  • image=$1 platform=$2 — shell assignment does not word-split, so image refs with colons or @sha256:… are safe.
  • All uses of $image and $platform are properly double-quoted in docker invocations.
  • Platform is validated before use (case "$platform" in linux/amd64|linux/arm64) ;; *)).
  • docker image inspect --format '{{.Os}}/{{.Architecture}}' returns linux/amd64 or linux/arm64, matching the validated platform strings.
  • The no-shell check correctly treats exit 0 from a shell invocation as failure.
  • The missing-config test (exit 3) and usage-string test are runtime contracts on the binary; reasonable for a smoke-check script.

tests/image.rs

  • instructions() correctly skips comment and blank lines and collapses the single backslash continuation in the RUN line.
  • stages() correctly splits on FROM instructions, giving two stages.
  • runtime_stage_holds_the_binary_only_as_non_root compares the parsed runtime stage (indices 1+) against the exact expected slice — values match the Dockerfile.
  • builder_builds_the_locked_binary uses starts_with on the joined continuation line; the joined form is "RUN cargo build … --locked --release && install …", which starts with the expected prefix.
  • runtime_base_is_the_binding_records_distroless_index and builder_is_the_release_tools_linux_gnu_toolchain reference files outside the diff (specs/010-integrations/spec.md, tools/rustev-release/artifacts.sh). Both are repo files that are not changed here; their existence is confirmed by REPO CONTEXT and the spec narrative respectively. No defect.

spec.md (spec 042)

  • The new extends edge (spec: "010-integrations", path: "integrations/rustev-serve/", additive) is consistent with the governance rule "one owning spec per crate" — spec 010 establishes the directory; spec 042 adds to it.
  • Increment 3 narrative matches what the diff actually delivers.

release-set.json

  • Image reason updated to reflect that the definition now exists but the candidate workflow does not build it yet. Consistent with spec text.
  • Crate reason updated to reflect remaining gaps (callback protocol bindings and shared conformance, not gRPC transport). Consistent with spec text ("Not yet delivered: the HTTP binding of the two callback protocols … and the shared conformance surfaces").

No concrete defects found.

{"head": "d15793d01721891dc2168b67de4a640a9a68ed7c", "verdict": "no-findings", "findings": []}

Subject: 99c7b8c...d15793d, diff digest 08f268a29d1c35bc4101ee64e6e7581cc88afb15aa833a1350926eef37c6174b, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit e1e0896 Oct 30, 2026
30 checks passed
@bartekus
bartekus deleted the impl/042-serve-image branch October 30, 2026 01:16
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.

1 participant