Skip to content

feat(cli): build deployment images on prebuilt base images - #4602

Merged
myftija merged 8 commits into
mainfrom
prebuilt-base-images
Aug 14, 2026
Merged

feat(cli): build deployment images on prebuilt base images#4602
myftija merged 8 commits into
mainfrom
prebuilt-base-images

Conversation

@myftija

@myftija myftija commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

The generated deploy Containerfile now starts from the prebuilt base images published by base-images/ (triggerdotdev/node and triggerdotdev/bun on DockerHub, pinned by digest) instead of installing system packages during every project's build. Uncustomized projects run no apt at all and their base layers are identical across every project, so worker nodes cache one copy fleet-wide. The build stage uses the -build toolchain variant for uncustomized and package-only projects; projects with image instructions build FROM base so instructions and their downloads run exactly once.

Notes

  • User packages install in their own sorted RUN with --allow-downgrades (a pin of a preinstalled package is a downgrade against the prebuilt base), preceded by a dpkg repair whenever instructions came first, since apt-get install refuses to run on state a dpkg -i instruction left broken.
  • Deployed runtime images inherit newer package versions than today's live-archive installs (the published bases upgrade everything to their snapshot), plus the base images' OCI labels. Runtime env, user, workdir, and entrypoint are unchanged.

Every project's build ran apt-get against the live Debian archive,
making the package layer a per-project near-duplicate that worker nodes
each cached separately and adding an installation step to every cold
build. The generated Containerfile now starts from the published
triggerdotdev/node and triggerdotdev/bun images (and their -build
toolchain variants for the build stage), which ship the default packages
prebuilt: no apt runs for uncustomized projects, and the base layers are
identical across all projects by construction. User instructions and
packages apply on top in both stages, with user packages in their own
sorted install that allows downgrading pinned defaults.
apt-get install refuses to run on dpkg state an instruction left broken
(the dpkg -i pattern audioWaveform uses), so repair ahead of the user
package install whenever instructions preceded it. Customized projects
build FROM base with the toolchain installed on top so instructions run
exactly once instead of twice in independent stages, keeping external
downloads single-shot; uncustomized projects keep the prebuilt
toolchain image and zero apt. A test now pins DEFAULT_PACKAGES to the
published images' package list.
…ten repairs

Package-only projects have no instructions to run twice, so they keep
the prebuilt toolchain image and repeat only the small package install
instead of fetching the toolchain from the live archive per build. The
repair steps use --no-install-recommends like every other apt call, the
regression test asserts the composed repair-then-install RUN (the index
comparison was vacuously true when the repair was missing), and the
package-list sync test resolves paths from the test file and also pins
the toolchain list.
@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 044d3d0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
trigger.dev Patch
@internal/dashboard-agent Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/python Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
@trigger.dev/rbac Patch
@trigger.dev/sso Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@internal/metrics-pipeline Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/run-store Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/sdk-compat-tests Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eb778fd2-1af2-44ef-8b85-c56a4848b901

📥 Commits

Reviewing files that changed from the base of the PR and between e54f0ca and 81704be.

📒 Files selected for processing (1)
  • .changeset/prebuilt-base-images.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/prebuilt-base-images.md
📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Analyze (javascript-typescript)

Walkthrough

Container image generation now uses pinned Trigger.dev Node and Bun runtime and build images. Default packages are preinstalled in those images, while custom aptGet packages remain supported. Package handling deduplicates, sorts, excludes preinstalled packages, and repairs broken dpkg state when required. Projects with instructions use toolchain installation from the base image. Package-only projects use the prebuilt build image. Tests cover these paths, and a patch changeset documents the release.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation and behavior, but it omits the required issue reference, checklist, testing, changelog, and screenshots sections. Add the template sections, complete the checklist, document testing steps, provide a changelog entry, and include screenshots or state that they are not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: generating deployment images from prebuilt base images.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch prebuilt-base-images

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as resolved.

@myftija
myftija marked this pull request as ready for review August 13, 2026 11:33
@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@044d3d0

trigger.dev

npm i https://pkg.pr.new/trigger.dev@044d3d0

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@044d3d0

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@044d3d0

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@044d3d0

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@044d3d0

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@044d3d0

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@044d3d0

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@044d3d0

commit: 044d3d0

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@myftija myftija changed the title perf(cli): build deployed images on prebuilt base images feat(cli): build deployment images on prebuilt base images Aug 13, 2026
myftija added a commit that referenced this pull request Aug 13, 2026
Every publish now also pushes an immutable per-publish tag alongside the
mutable one, named after the snapshot date and commit (e.g.
`22-bookworm-20260812-45444a7`), so previously published digests stay
tag-referenced after republishes. Shipped CLI releases pin those
digests, so they must remain resolvable indefinitely.

Merging triggers a republish; the fresh tag-protected digests will then
be pinned by #4602 before it merges.
The publish now pushes an immutable per-publish tag, so these digests
stay tag-referenced permanently regardless of future republishes.
@myftija
myftija merged commit c4b5e27 into main Aug 14, 2026
45 checks passed
@myftija
myftija deleted the prebuilt-base-images branch August 14, 2026 10:27
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.

2 participants