-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add parameterized CNB_PLATFORM_API to buildpacks strategy #990
Add parameterized CNB_PLATFORM_API to buildpacks strategy #990
Conversation
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.
In Tekton Catalog, the version is also set to 0.4: https://github.com/tektoncd/catalog/blob/f4708d478ee8fac6b5b68347cde087cb7c1d1b1c/task/buildpacks/0.3/buildpacks.yaml#L65-L67
parameters: | ||
- name: platform-api-version | ||
description: The referenced version is the minimum version that all relevant buildpack implementations support. | ||
default: "0.4" |
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.
Have you checked the Heroku buildpacks as well wrt their platform API versions?
From Grooming, @dalbar I think is fine to move here the additional changes you have in downstream. |
Sets the minimum platform api version for all buildpack implementations which is relevant for the lifecycle utility in the buildpack's builder. Relevant for setting the default process for simple go-applications automatically. When the buildpack is not setting a default process, the scripts assign 'web' as default process.
84e4ded
to
37236b0
Compare
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SaschaSchwarze0 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
Buildpacks defines versioned api specification that allows them to bridge the knowledge gap between the lifecycle and the independent buildpack implementations. More specifically it allows the lifecycle utility to enable features based on the known api version and thus staying backward-compatible.
The lifecycle utility receives the api version from the environment variable
CNB_PLATFORM_API
. Whenever this variable is not present, it assumes per default that the version is0.3
. Consequently, the lifecycle’s exporter ignores the default process determined in the build step and sets the entrypoint of the resulting image to the lifecycle’s launcher executable (code reference). The launcher itself is called without an argument and thus assumes that the default process isweb
.The interactions above break simple programs such as https://github.com/IBM/CodeEngine/tree/main/job.
The PR proposes a minimum version of
0.4
based on evaluating the api version of all buildpacks in the paketo organization. The version introduces multicall-launchers and produces non-broken images for the example above.For buildpacks that do not set a default process, the 0.3 version of the api assigned the
web
process as default. This is not producible with the previous approach of usingcreator
and the version0.4
. Thus this PR splits the creator into its subcomponents to achieve a flexible point to inject the default process. As a side-effect, the changes remain compatible with paketo and heroku.Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes
/kind bug