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.
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: Remove Stacks & Mixins #172
RFC: Remove Stacks & Mixins #172
Changes from 4 commits
d16f1a9
1b55b44
5e7d9ff
df7d715
02cb22a
f888612
ce16a04
b876676
891104e
e2587fb
0dd5899
b1f606c
4299b4b
ef6d531
ff4c94a
3fe2b89
e24bcad
85545b5
ad051c4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Are these strings able to be anything? Could I, if I wanted to, create a
JesseOS
OS string to tightly control the buildpacks that have explicitly updated to work on my build/run images?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.
OS and Architecture would be restricted to
GOOS
andGOARCH
values. Distribution and Version could technically be anything, but should match/etc/os-release
for Linux distros.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.
Off-topic: Is there any plan/idea for buildpacks to support building multi-platform images, such that a single image manifest can describe an image for
linux/arm64
andlinux/arm64
andwindows/amd64
, etc.? Or is the intention that someone wanting to build a multi-platform image should use buildpacks to produce multiple platform-specific images, then stitch them together with something likedocker manifest create
?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.
No current RFC, but I definitely agree that we should eventually support exporting multi-platform manifest indexes.
The BuildKit frontend might help us with this, via buildx: buildpacks/pack#768
For non-local builds, we could extend the current exporter to accept a set of layers for each OS/ARCH combination.
In either case, we'd probably want to pass standardized env vars (e.g.,
$CNB_TARGET_ARCH
) to the builder and buildpacks to support cross-compilation.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.
This is hard to do well given that (some exceptions wrt docker-for-mac notwithstanding) the build takes place in a docker container and a given daemon only supports a single os/arch.
You could theoretically have a buildpacks execute on one target while producing launch layers that are valid for a different target but this puts a lot of responsibility on the buildpack author and comes with a lot of gotchas. e.g
build
andlaunch
layersimho this is unlikely to end well
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'm not opposed to this. Cross-compilation seems like a reasonable feature request to me. We would probably want to pass "target" metadata (e.g., from a run image label) to the buildpacks. When multiple run images are provided, buildpacks could produce multiple versions of the same layer for different architectures.
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.
As the goal of
buildpacks
is to build an image from an app's project where severalbuild/detect/
(1 to many) steps are done using aBuild
image and next launched using aRuntime or stack or runtimeStack
image, then I think that it is important to continue to use a wording that everyone will understand.This is the reason why I would like to suggest to keep the
stack
(or maybe to rename it to:runStack
,runtimeStack
, ...) word instead of usingplatform
.Why: to improve the readability of a builder definition with a wording which is more inline with what finally we would like to describe (or what we want to do during a build or when we will launch the image built)
Example of such new definition could be
See gist created: https://gist.github.com/cmoulliard/04999929df0b758b5edbdf19dfc85f45
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'm not sure I understand the proposed example. Some questions:
packages
list work?Would be great to dig into this during the weekly WG meeting.
I'm not attached to
platforms
for the table name, but I would like to remove unnecessary, project-specific terms to make the project more accessible.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.
Haven't thought this through all the way but would it make sense to this in the build plan as well. E.g. a buildpack could specify in
buildpack.toml
that it needs to run on a particular distribution but could express at detect time that the resulting layers could run on any-linux (distroless images).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.
An image without a specified Distribution is compatible with images specifying any Distribution. An image specifying a Distribution without a Version is compatible with images specifying any Versions of that Distribution.
Is this what would replace wildcard stack support, i.e.
stack="*"
.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'm not sure this needs to be dynamic. I wonder if this could be part of the multi-platform interface? See: #172 (comment)
The requirement is just describing the contract between the build and run images. Wildcard stack support is achieved by leaving off Distribution and Version entirely. (There is no wildcard support for OS/Architecture.)
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.
just updating this thread in case someone comes along in two more years, but anyway it turned out while implementing we did make an explicit extension for "*" OS/Architecture.
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.
@ekcasey as requested. Looks very noisy, but I think it meets the requirements.
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.
Could you explain the sample, please? If I have this example in my buildpack's buildpack.toml, what does that mean for the buildpack & compatibility with images? What sort of compatibility guarantees do I get?
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.
Example please :)
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 think we need to address the migration path in this RFC
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.
Addressed, let me know if you think I covered the relevant migration scenarios
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.
Thanks for adding this! Would we also continue to allow
[[stacks]]
inbuildpack.toml
, and ignore it at some point?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.
Definitely, I can add that as well
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.
@jkutner This makes me think
[[stacks]]
and those labels would go away at the same time.