-
Notifications
You must be signed in to change notification settings - Fork 71
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
RFC: Contractual Build Plan #12
Conversation
@nebhale Example for Java: [openjdk, build-system, jvm-app] openjdkprovides: openjdk build-system:requires: openjdk jvm-apprequires: jar, openjdk |
Are |
Each value in the build plan is now a list of requires (note |
I think this would help making build plan detect -> build interfaces a lot! |
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.
I don't think that this is a hard requirement in order to enable buildpacks (we've got dozens of buildpacks that solve these same issues with idiomatic behavior rather than contract), but it doesn't seem to hurt.
Actually, I'm thinking there might be a problem. Let me work through it.
Am I correct that the lifecycle would resolve the requires versus provides? That is, the lifecycle ensures that all required elements have been provided by something else? |
That's correct -- it ensures that all required elements are provided at least once and all provided elements are required at least once. However, if an optional buildpack prevents that from holding true, non-optional buildpacks can still be considered without it. It's worth noting that a buildpack can both provide and require the same element (and I expect this to be very common). |
Oh I was not expected that all provided keys must be required. How would we handle the case where a node-engine-cnb that provides “node” is used on its own? |
In the CF case, node-engine-cnb would always provide node, but only require it if the app explicitly asked for it (via buildpack.yml). That means when the buildpack is non-optional, something (either app or buildpack) has to need node for the group to be considered. When the buildpack is optional, the buildpack is removed from consideration if nothing actually needs node. This removes the current concept of "vacuous pass" (which is confusing and results in misleading metadata). |
Does that mean, in the CF case, that the buildpack needs to inspect the |
|
To clarify: a buildpack can always provide a dependency without another buildpack requiring it by both providing and requiring the dependency. Asserting that required dependencies must be provided and vice-versa provides the most flexibility. |
Reading over this, I think there's still a shortcoming where a single buildpack cannot do an "or" requirement as in, "I'll contribute if either |
I modified the proposal so that dependencies must be provided in the current buildpack or a previous buildpack if they are required. I also addressed Ben's question. |
@nebhale To make it as clear as possible that, in combination with the Distribution RFC, the “requires jvm-app or node” case works with a single buildpack implementation (using a single buildpack.toml: [[buildpacks]]
id = "com.example.myapm"
name = "APM Buildpack"
version = "0.0.9"
[[buildpacks.order]]
group = [
{ id = "com.example.myapm.node", version = "0.0.7" }
]
[[buildpacks.order]]
group = [
{ id = "com.example.myapm.java", version = "0.0.5" }
]
[[buildpacks]]
id = "com.example.myapm.node"
name = "APM Buildpack for Node"
version = "0.0.7"
path = "."
[buildpacks.metadata]
# ...
[[buildpacks.stacks]]
id = "io.buildpacks.stacks.bionic"
[[buildpacks]]
id = "com.example.myapm.java"
name = "APM Buildpack for Java"
version = "0.0.5"
path = "." # same path!
[buildpacks.metadata]
# ...
[[buildpacks.stacks]]
id = "io.buildpacks.stacks.bionic" Repo: buildpack.toml
/bin/detect
/bin/build Where Note that the java and node buildpack definitions are in different groups to take advantage of vertical expansion. |
0000-contractual-build-plan.md
Outdated
|
||
N/A | ||
|
||
# Drawbacks |
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.
afaict this is also a breaking change?
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.
Yes, huge breaking change.
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.
Noted below.
In the Heroku buildpack ecosystem, the common case is that a buildpack would |
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.
From the spec WG meeting today, we're going to add another RFC for the case that a buildpack does requires
and provides
in the buildplan for the same key. Some suggestions was a new [[]]
toml array or a provide = true
key in the release
Array.
Signed-off-by: Stephen Levine <stephen.levine@gmail.com>
Signed-off-by: Stephen Levine <stephen.levine@gmail.com>
Signed-off-by: Stephen Levine <stephen.levine@gmail.com>
7581837
to
b41197f
Compare
Merging with 4/4 approval from project owners. FCP closes today due to unanimous approval. |
Readable.