Skip to content

Feat: Enable CNB image extensions support in BuildStrategy#1262

Draft
SalimKayal wants to merge 1 commit into
mainfrom
feat/buildstrategy-image-extension
Draft

Feat: Enable CNB image extensions support in BuildStrategy#1262
SalimKayal wants to merge 1 commit into
mainfrom
feat/buildstrategy-image-extension

Conversation

@SalimKayal
Copy link
Copy Markdown
Collaborator

@SalimKayal SalimKayal commented Apr 16, 2026

Summary

This PR updates the renku-buildpacks-v3 BuildStrategy to support Cloud Native Buildpacks image extensions, an experimental feature that allows extensions to generate Dockerfiles to customize build and run base images.

What changed

The previous strategy used a single /cnb/lifecycle/creator call to handle the entire build lifecycle. The creator binary does not invoke the extender phase, which is required for image extensions to work. This PR replaces the creator with explicit individual lifecycle phase calls.

Key details

  • CNB_EXPERIMENTAL_MODE=warn is set to unlock experimental features (image extensions).
  • Platform API version bumped from 0.12 to 0.15.
  • Conditional logic determines whether to use extender or builder:
    • If the detector phase produces extension-generated Dockerfiles in <layers>/generated/build/, the extender -kind=build is used (which also runs the build phase internally, per spec).
    • Otherwise, the standard builder is called.
    • Similarly, extender -kind=run is only invoked if run Dockerfiles are found in <layers>/generated/run/.
  • -run-image flag removed from the exporter: it is only passed to the analyzer, which writes the resolved reference to analyzed.toml. The exporter reads from analyzed.toml and picks up extended run image layers from <layers>/extended/run/ when applicable. Passing -run-image explicitly to the exporter would override the extended run image.

Why this approach

  • The CNB spec requires the extender to be called explicitly: it is not part of the creator all-in-one binary.
  • The conditional check ensures backward compatibility: builds that don't use image extensions still work correctly via the standard builder phase.
  • This keeps the strategy as a single step, preserving compatibility with the existing Shipwright Build resources.

References

@SalimKayal SalimKayal requested review from olevski and sgaist April 16, 2026 09:37
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 24503156387

Coverage decreased (-1.2%) to 86.348%

Details

  • Coverage decreased (-1.2%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 332 coverage regressions across 16 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

332 previously-covered lines in 16 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
components/renku_data_services/notebooks/core_sessions.py 79 67.2%
components/renku_data_services/session/db.py 74 78.19%
components/renku_data_services/session/k8s_client.py 72 29.94%
components/renku_data_services/repositories/db.py 27 74.1%
components/renku_data_services/k8s/clients.py 20 71.83%
components/renku_data_services/notebooks/crs.py 15 89.93%
components/renku_data_services/session/config.py 14 74.68%
components/renku_data_services/notifications/core.py 9 30.95%
components/renku_data_services/notebooks/blueprints.py 5 92.5%
components/renku_data_services/capacity_reservation/core.py 4 29.49%

Coverage Stats

Coverage Status
Relevant Lines: 29586
Covered Lines: 25547
Line Coverage: 86.35%
Coverage Strength: 1.51 hits per line

💛 - Coveralls

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