-
Notifications
You must be signed in to change notification settings - Fork 76
Create 0316-launcher-decoupling #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Hemant28codes
wants to merge
8
commits into
buildpacks:main
Choose a base branch
from
Hemant28codes:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5b8e126
Create 0316-launcher-decoupling
Hemant28codes ed8dbeb
Update 0316-launcher-decoupling
Hemant28codes 35a8fe7
Update 0316-launcher-decoupling
Hemant28codes 92011ca
Update 0316-launcher-decoupling
Hemant28codes 81c7caa
Rename 0316-launcher-decoupling to 0316-launcher-decoupling.md
Hemant28codes 2a89738
Update 0316-launcher-decoupling.md
Hemant28codes 149864e
Update 0316-launcher-decoupling.md
Hemant28codes 446a230
Update 0316-launcher-decoupling.md
Hemant28codes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| # Meta | ||
| [meta]: #meta | ||
| - Name: Launcher in Run Image | ||
| - Start Date: 2026-04-15 | ||
| - Author(s): Hemant28codes | ||
| - Status: Draft | ||
| - RFC Pull Request: (leave blank) | ||
| - CNB Pull Request: (leave blank) | ||
| - CNB Issue: (leave blank) | ||
| - Supersedes: N/A | ||
|
|
||
| # Summary | ||
| [summary]: #summary | ||
|
|
||
| RFC: Launcher in Run Image | ||
|
|
||
| This RFC proposes a mechanism to allow the launcher binary to be provided by the run image instead of being unconditionally injected by the lifecycle's exporter phase. By introducing a specific flag, the exporter can be instructed to replace the standard launcher binary with a symlink in the "Buildpacks Application Launcher" layer, pointing to a path in the run image. This ensures that the application image structure remains consistent while decoupling the launcher's lifecycle from the application build. | ||
| # Definitions | ||
| [definitions]: #definitions | ||
|
|
||
| - Launcher: The binary that acts as the container entrypoint, responsible for setting up the environment and executing the application process. | ||
| - Exporter: The lifecycle phase responsible for creating the final application image, which currently adds a launcher layer unconditionally. | ||
| - Run Image: The base image used for the final application container. | ||
| - CNB_LAUNCHER_PATH: The path where the platform expects the launcher to reside (e.g., /cnb/lifecycle/launcher). | ||
|
|
||
| # Motivation | ||
| [motivation]: #motivation | ||
|
|
||
| Why should we do this? Currently, the exporter phase replaces any existing file or symlink at the launcher path with a new file-based layer, preventing platforms from providing their own launcher in the base image. | ||
|
|
||
| What use cases does it support? | ||
| - Security Patching via Rebase: This is a critical driver for the proposal. By making the launcher part of the run image, platforms can update the launcher to patch vulnerabilities (e.g., Go CVEs reported by security scanners in the binary) simply by updating the run image and performing a rebase. This eliminates the need to trigger a full build for thousands of applications just to update a shared launcher binary. | ||
| - Customized Launchers: Platforms that require specialized or environment-specific launcher logic can bake it directly into their base image infrastructure. | ||
|
|
||
| What is the expected outcome? Platforms can opt-out of the automatic launcher installation, ensuring that the launcher binary is managed as a run-time dependency that can be updated independently of the application build lifecycle. | ||
|
|
||
| # What it is | ||
| [what-it-is]: #what-it-is | ||
|
|
||
| This feature allows a platform to signal that the run image already contains a valid launcher. | ||
|
|
||
| - Target Persona: Platform implementors and operators. | ||
| - Example: A platform builds a run image with a symlink at /cnb/lifecycle/launcher pointing to a platform-specific binary. During the export phase, the platform passes a flag to skip the launcher installation, preserving the existing symlink. | ||
|
|
||
|
|
||
| # How it Works | ||
| [how-it-works]: #how-it-works | ||
|
|
||
| A new flag (e.g., --launcher-in-run-image) will be added to the exporter phase. | ||
|
|
||
| ### Layer Preservation | ||
| The "Buildpacks Application Launcher" layer must always be present in the application image to maintain OCI artifact compatibility. The difference lies in whether this layer contains the binary itself or a symlink. | ||
|
|
||
| | Feature | Before (Current) | After (Proposed) | | ||
| | :--- | :--- | :--- | | ||
| | **Launcher Path** | `/cnb/lifecycle/launcher` | `/cnb/lifecycle/launcher` | | ||
| | **Content Type** | Self-contained executable (~2.8 MB) | Symlink to run image path | | ||
| | **Dependency** | None (Independent layer) | Explicit dependency on Run Image layer | | ||
|
|
||
| ### Rebaser Responsibilities | ||
| With symlink-based launchers, the rebaser gains a new validation duty. It must verify that the target run image actually contains a valid launcher binary at the expected path. Failure to do so would result in a broken application at runtime. | ||
|
|
||
| #### Metadata Changes | ||
| The `io.buildpacks.lifecycle.metadata` label will be updated to include: | ||
| * `launcher.type`: "binary" or "symlink" | ||
| * `launcher.target`: The absolute path in the run image (only if type is symlink). | ||
|
|
||
| #### Run Image Advertising | ||
| Run images that provide a launcher should advertise this capability via a label: | ||
| `io.buildpacks.run.launcher.path=/usr/local/bin/launcher` | ||
|
|
||
|
|
||
| Just to give an idea of what our usecase is: | ||
|
|
||
| - Current Setup | ||
| Source code + Builder(contains lifecycle) -----(Build)----> Application image(contains launcher from lifecycle in builder + run image) | ||
|
|
||
| - Proposed Setup | ||
| Source code + Builder(contains lifecycle) -----(Build)----> Application image(contains run image), Run image -> will have launcher installed | ||
|
|
||
| # Migration | ||
| [migration]: #migration | ||
|
|
||
| This change requires a Platform API spec update, as the current spec mandates that the exporter install the launcher. | ||
|
|
||
| - Platform Developers: Will need to update their implementations to support and pass the new flag when appropriate. | ||
| - Compatibility: Since this is an opt-in flag, existing platforms and images will continue to function as they do today by default. | ||
|
|
||
| # Drawbacks | ||
| [drawbacks]: #drawbacks | ||
|
|
||
| - Validation Risk: If the flag is set but the run image does not actually contain a valid launcher, the resulting application image will fail at runtime. | ||
| - Complexity: Adds a conditional path to the exporter's image construction logic. | ||
|
|
||
| # Unresolved Questions | ||
| [unresolved-questions]: #unresolved-questions | ||
|
|
||
| - Should the exporter perform a check to verify the existence of the launcher at CNB_LAUNCHER_PATH before completing the export? | ||
| - What should the exact naming of the flag be to ensure clarity across different platform implementations? | ||
| - Can we have a custom launcher or do we need to depend on the launcher provided by buildpacks, or maybe add on top of the buildpacks launcher? | ||
| - Will the launcher going to be a seperate binary which doesn't depend on spec - buildpack API, platform API, lifecycle version, libcnb version and will be decoupled from these? | ||
|
|
||
| # Spec. Changes (OPTIONAL) | ||
| [spec-changes]: #spec-changes | ||
| The Platform API specification must be updated to include the new flag and define the behavior where the launcher binary layer is skipped if the platform asserts its presence in the run image. | ||
|
|
||
| # History | ||
| [history]: #history | ||
|
|
||
| - 2026-04-15: Initial draft proposed by Hemant Goyal based on community discussion. | ||
| - 2026-04-20: Updated based on RFC discussions. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a boolean or is it better to pass in a path to the launcher? It shouldn't matter whether its in the Run image or Build image as long the users of the pack/lifecycle decide to create that launcher at some point. So in effect is it better to have
--launcher-path=<my_launcher>pathand the equivalentCNB_LAUNCHER_PATH? @dmikusa FYIThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually yes this makes sense.