Skip to content
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

Application Mixins (only) #112

Closed
wants to merge 6 commits into from
Closed

Application Mixins (only) #112

wants to merge 6 commits into from

Conversation

jkutner
Copy link
Member

@jkutner jkutner commented Sep 2, 2020

Signed-off-by: Joe Kutner <jpkutner@gmail.com>
@jkutner jkutner marked this pull request as ready for review September 2, 2020 13:25
@jkutner jkutner requested a review from a team as a code owner September 2, 2020 13:25
@jkutner jkutner mentioned this pull request Sep 2, 2020
1. If all mixin names are provided by the stack, no further action is required.
1. If any requested mixin is not provided by the stack, the lifecycle will run the detect phase for all stackpacks defined in the builder.
1. The lifecycle will compare the mixins added to the build plan to see if they match they required mixins.
1. If at least one stackpack passes detect and provides the required mixin(s), the lifecycle will execute the stackpack build phase for all passing stackpack(s). If no stackpacks pass detect, or no stackpacks provide the required mixin, the build will fail with a message that describes the mixins that could not be provided.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me how detect opt-in and buildplan interact. I'm guessing that stackpack_a opts in and provides mixin_a/mixin_b.

But what if stackpack_b opts in and provides mixin_b? Will it also be used, or skipped?

What if a stackpack provides more than what the user wants?

1. If any requested mixin is not provided by the stack, the lifecycle will run the detect phase for all stackpacks defined in the builder.
1. The lifecycle will compare the mixins added to the build plan to see if they match they required mixins.
1. If at least one stackpack passes detect and provides the required mixin(s), the lifecycle will execute the stackpack build phase for all passing stackpack(s). If no stackpacks pass detect, or no stackpacks provide the required mixin, the build will fail with a message that describes the mixins that could not be provided.
1. During the lifecycle's build phase, the stackpacks that passed detection will run against the build and run images accordingly (see details below). All stackpacks will be run before the user's buildpacks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this answers it. So everyone that opts-in will be run, regardless of if they overlap, or provide more mixins than the user needs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest that we resolve this more cleanly. Maybe we could implement a push-forward mechanism, like we have with build plan entries?

If we implemented the protocol for this entirely on top of the build plan mechanism (perhaps with a mixin = true option in each entry), it might reduce some of this complexity.

text/0000-app-mixins.md Outdated Show resolved Hide resolved
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
@nebhale nebhale requested a review from a team September 9, 2020 19:42
1. If any requested mixin is not provided by the stack, the lifecycle will run the detect phase for all stackpacks defined in the builder.
1. The lifecycle will compare the mixins added to the build plan to see if they match they required mixins.
1. If at least one stackpack passes detect and provides the required mixin(s), the lifecycle will execute the stackpack build phase for all passing stackpack(s). If no stackpacks pass detect, or no stackpacks provide the required mixin, the build will fail with a message that describes the mixins that could not be provided.
1. During the lifecycle's build phase, the stackpacks that passed detection will run against the build and run images accordingly (see details below). All stackpacks will be run before the user's buildpacks.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest that we resolve this more cleanly. Maybe we could implement a push-forward mechanism, like we have with build plan entries?

If we implemented the protocol for this entirely on top of the build plan mechanism (perhaps with a mixin = true option in each entry), it might reduce some of this complexity.

text/0000-app-mixins.md Outdated Show resolved Hide resolved

## Rebasing an App

Before a launch image is rebased, the platform must re-run the any stackpacks that were used to build the launch image against the new run-image. Then, the rebase operation can be performed as normal, while including the stackpack layers as part of the stack. This will be made possible by including the stackpack in the run-image, but because the stackpack detect phase is not run, the operation does not need access to the application source.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would the list of mixins used be persisted from pack build to pack rebase? I believe that paketobuildpacks make sure that the application code (if it can be compiled into a binary) isn't on the final image - does this require that the project.toml file be kept? Or will the list of used mixins/stackpacks be persisted through another mechanism?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is addressed in RFC-0069: Stack buildpacks. They will be stored in a LABEL.

Comment on lines +99 to +100
- [Add root buildpack as interface for app image extension RFC](https://github.com/buildpacks/rfcs/pull/77)
- [App Image Extensions (OS packages)](https://github.com/buildpacks/rfcs/pull/23)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind clarifying why these aren't valid alternatives?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wouldn't say they aren't valid approaches. We just don't have support for them.


1. The lifecycle will compare the list of mixins to those provided by the stack using the `io.buildpacks.stack.mixins` label.
1. If all mixin names are provided by the stack, no further action is required.
1. If any requested mixin is not provided by the stack, the lifecycle will run the detect phase for all stackpacks defined in the builder.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused - does this mean that we run detect twice? I thought stack packs were supposed to run before userspace buildpacks...

@jromero jromero marked this pull request as draft December 9, 2020 20:10
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
@jkutner
Copy link
Member Author

jkutner commented Feb 3, 2021

It probably makes sense to hold this proposal until we decide on how the Lifecycle will (or will not) handle project.toml

Signed-off-by: Joe Kutner <jpkutner@gmail.com>

Co-authored-by: David Freilich <dfreilich@vmware.com>
@hone
Copy link
Member

hone commented Jul 28, 2021

@jkutner do you still want to keep this open?

@jkutner jkutner closed this Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants