-
Notifications
You must be signed in to change notification settings - Fork 509
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
Perform solve request in the main gateway call #1804
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.
Thanks!
Signed-off-by: Justin Chadwell <me@jedevc.com>
Subrequests have been included in docker/dockerfile:1.5 labs, so we can update the fallback to point to this release. Signed-off-by: Justin Chadwell <me@jedevc.com>
299bcd0
to
3030beb
Compare
Now, we always perform the full solve request in the main gateway call. This ensures that progress works properly, and makes the lifetime semantics much clearer. NewResultContext abstracts the details of a successful/failed build, to always return a single ResultContext, even though the details of how a gateway is created is different: - For a failed build, we can just keep the gateway open. - For a successful build, we immediately open another gateway and re-evaluate the build definition in that gateway. This should give an instant cache hit (since the build was just successful). Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
A bit more tidying, I've removed one of the nested goroutines which wasn't necessary, and tidied up the calls to I think it might be possible to try and merge the |
In practice, this shouldn't happen, but the check is good to include anyways. Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
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.
Let's get this in for the release 🤞 , but this area needs a follow-up refactoring. We need to take a step back, create a design issue that describes all the cases this code needs to solve and current code paths. Then put together a graph of components and function signatures with their scope description. If needed, we need to wrap or refactor the buildkit client.Build()
signature if it is too complicated to use in these new cases.
Signed-off-by: Justin Chadwell <me@jedevc.com>
🛠️ Replaces #1750. This is a lot neater than the original implementation and doesn't require that we go and change the entire API.
Now, we always perform the full solve request in the main gateway call. This ensures that progress works properly (and doesn't stagger), and makes the lifetime semantics much clearer.
NewResultContext abstracts the details of a successful/failed build, to always return a single ResultContext, even though the details of how a gateway is created is different: