Skip to content

chore(engine): publish engine bases in ci#4649

Open
NathanFlurry wants to merge 2 commits into04-13-chore_lockfile_lefthookfrom
04-14-chore_engine_publish_engine_bases_in_ci
Open

chore(engine): publish engine bases in ci#4649
NathanFlurry wants to merge 2 commits into04-13-chore_lockfile_lefthookfrom
04-14-chore_engine_publish_engine_bases_in_ci

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented Apr 14, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@NathanFlurry NathanFlurry mentioned this pull request Apr 14, 2026
11 tasks
@claude
Copy link
Copy Markdown

claude bot commented Apr 14, 2026

PR Review: Publish Engine Bases in CI

Good architectural direction — moving the build environment out of the main Dockerfile and into pre-baked GHCR bases is the right call for improving CI iteration speed. A few issues worth addressing before merging:


Issues

1. Runtime base images use devcontainers instead of debian:slim

engine-runtime-full.Dockerfile and engine-runtime-slim.Dockerfile both use mcr.microsoft.com/devcontainers/base:debian as their base. Devcontainers images include development tooling (sudo, non-root vscode user, shell configs, locale data) that inflates production runtime images versus the original debian:13.1-slim. For runtime images, use debian:bookworm-slim (or trixie-slim) instead:

-FROM mcr.microsoft.com/devcontainers/base:debian
+FROM debian:bookworm-slim

2. Builder base installs Rust on top of a devcontainers/rust image

engine-builder.Dockerfile uses FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm and then immediately does rustup toolchain install 1.91.0 && rustup default 1.91.0. The Rust installation already present in the devcontainers image is wasted, and the devcontainers tooling (zsh, oh-my-zsh, vscode user, etc.) adds unnecessary size to the builder. Consider:

-FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm
+FROM mcr.microsoft.com/devcontainers/base:bookworm

(or debian:bookworm + rustup from scratch, without the devcontainers extras at all)

3. Race condition in build-push.sh parallel builds

When all is passed, build_one runs for every base in parallel (via &). Three engine bases will concurrently call ensure_multiarch_builder, which has a TOCTOU race: if two processes both fail the docker buildx inspect check before either runs docker buildx create, the second create fails with "builder already exists". Fix by serializing the create step or using a file lock.

4. docker-images job lacks explicit packages: read permission

The engine-base-images job correctly declares packages: write, but docker-images — which pulls from GHCR via the docker-setup action — has no permissions block at all. The other jobs in this workflow (build, publish) both declare explicit permissions. Add:

docker-images:
  permissions:
    contents: read
    packages: read

5. build_one for engine bases only builds linux/amd64 locally

build_one uses --platform linux/amd64 --load (single-arch, loads to local Docker daemon), while push_one rebuilds both linux/amd64,linux/arm64 from scratch with --push. If someone does build-push.sh engine-builder (no --push) to test locally, they get a misleading result — the arm64 path is never exercised. A comment in build_one noting this limitation would prevent confusion.


Minor

  • No FDB library checksum validation: the curl -Lf download of libfdb_c.so from GitHub releases has no SHA-256 check. This is a pre-existing pattern, but now it's baked into cached base images that last for each commit's lifetime. Worth adding sha256sum verification.
  • GHCR image accumulation: every non-fork CI run (including PRs) pushes 3 new images tagged with the commit SHA and nothing deletes them. Consider a GHCR retention/cleanup policy or restricting base pushes to main/release triggers only.
  • Unused variable in push_one: local dockerfile is declared but never used in the push_one function in build-push.sh.
  • Trailing newline: engine-runtime-full.Dockerfile and engine-runtime-slim.Dockerfile are missing a trailing newline after the last fi.

What's good

  • Clean separation of builder/runtime bases from the main Dockerfile.
  • Correct needs: [context, engine-base-images] dependency on docker-images.
  • fail-fast: false on the base matrix is correct.
  • TAG_OVERRIDE env var is an elegant mechanism for CI tagging.
  • packages: write scoped to only the job that needs it.
  • The fix(publish): exclude sqlite-wasm from publish flow follow-up commit is correct — the three-file change consistently removes @rivetkit/sqlite-wasm from the build filter, the publish exclusion list, and the install instructions.

@github-actions
Copy link
Copy Markdown
Contributor

Preview packages published to npm

Install with:

npm install rivetkit@pr-4649

All packages published as 0.0.0-pr.4649.a36b881 with tag pr-4649.

Engine binary is shipped via @rivetkit/engine-cli on linux-x64-musl, linux-arm64-musl, darwin-x64, and darwin-arm64. Windows users should use the release installer or set RIVET_ENGINE_BINARY.

Docker images:

docker pull rivetdev/engine:slim-a36b881
docker pull rivetdev/engine:full-a36b881
Individual packages
npm install rivetkit@pr-4649
npm install @rivetkit/react@pr-4649
npm install @rivetkit/rivetkit-native@pr-4649
npm install @rivetkit/workflow-engine@pr-4649

@NathanFlurry NathanFlurry mentioned this pull request Apr 14, 2026
11 tasks
@NathanFlurry NathanFlurry marked this pull request as ready for review April 14, 2026 21:33
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