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
builder: clean up builder dependancy interface #32904
Comments
@tonistiigi I wonder if it wouldn't make more sense to look at this slightly differently. Rather than continuing to try to have specialized builder APIs, what if we extended the normal engine APIs such that you could do all builder actions via normal docker APIs/cli commands? Then the build just becomes a user of the normal APIs. It might require some new APIs, or even a new way to achieve the same net result from a "docker build" perspective, but I think in the long run it would make a much cleaner design, and it'll be easier to maintain. Not to mention, it makes it easier for alternative builders to be created. |
@duglin Each component should do what it is designed to do and define the minimum requirements it needs for other components. By defining current builder subfeatures in remote API we just make them a standard forever and freeze development for better builders. It doesn't provide easier alternatives but just defines that you can only build one type of builder. That being said, I don't see why the interface proposed couldn't be implemented with the current remote API. Having safe layer reference can either be ignored(like it is today) or implemented with |
Yes, I think we should be able to accomplish that with the proposal. I expect what we'll get initially is something like this:
The That gives us time to validate the general purpose APIs with other consumers of those APIs while still having a clean API for the builder. Eventually the adaptor may disappear, or it might stick around with some minimal functionality that doesn't make sense in an image or container component, but can be re-used by any builder that requires that same functionality. |
SGTM ( How does this proposal relate to BuildKit proposal (#32550 (comment)) and monolith split #32872 ? |
@AkihiroSuda This is a more short term to fix the current quality issues while Buildkit is for providing customization, extendability and alternative frontends. They should converge in the end. You can already see similarities though, |
superseded by buildkit integration |
|
The builder currently uses an API that was designed more around the existing functions in daemon package.
The main problems with this interface are:
ENV
just change a single value in a configuration struct.docker commit
requires duplicating data.The proposed new interface would be:
releaseableLayer
maps directly to thelayer.Layer
. Builder holds a reference to a layer and snapshot of image config until it runs. That makes sure that if images are deleted it doesn't affect the builder and everything would be cleaned up after the builder has finished.Export is separated from commit so no hacks are needed to make sure that config of a container is in a correct state for committing.
COPY/ADD
would be implemented directly with layer access.This is a big change and would need to be split up into multiple PRs. I propose following intermediate steps(open for discussion of course):
GetImage
and replace current pull methods (PR open [Builder] Expose GetImage interface for builder #33054)Create/Attach/Start/Wait
into same function, don't changeCommit
logic yet. (PR open [Builder] Refactor builder probe cache and container backend #33061)Export
, don’t try to integrate yet (@dnephin [Builder] Move file coping from the daemon to the builder #33454)GetImage
to access image config committed withCommit
so thatExport
andCommit
can be used in parallel (@dnephin [Builder] Move file coping from the daemon to the builder #33454)releasableLayer
into builder. RemoveCopyOnBuild
, commit withExport
(@dnephin [Builder] Move file coping from the daemon to the builder #33454)Export
Exec/Debug
and remove currentCommit
functions@dnephin @vdemeester @duglin @AkihiroSuda
The text was updated successfully, but these errors were encountered: