Uh oh!
There was an error while loading. Please reload this page.
Proposal: add new --sync-output flag to bake - #1197
Conversation
ciaranmcnulty
commented
Jul 5, 2022
Yes that's exactly what I had in mind 👍 |
449a668 to
0857015Compare| func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, docker DockerAPI, configDir string, w progress.Writer, syncOutputs bool) (resp map[string]*client.SolveResponse, err error) { | ||
| return BuildWithResultHandler(ctx, drivers, opt, docker, configDir, w, nil, syncOutputs, false) | ||
| } | ||
| func BuildWithResultHandler(ctx context.Context, drivers []DriverInfo, opt map[string]Options, docker DockerAPI, configDir string, w progress.Writer, resultHandleFunc func(driverIndex int, rCtx *ResultContext), allowNoOutput bool) (resp map[string]*client.SolveResponse, err error) { | ||
| func BuildWithResultHandler(ctx context.Context, drivers []DriverInfo, opt map[string]Options, docker DockerAPI, configDir string, w progress.Writer, resultHandleFunc func(driverIndex int, rCtx *ResultContext), syncOutputs bool, allowNoOutput bool) (resp map[string]*client.SolveResponse, err error) { |
There was a problem hiding this comment.
We should look at refactoring these funcs in a follow-up
There was a problem hiding this comment.
Yup, have avoided making too many changes since #1296 refactors around this as well.
| | [`--pull`](#pull) | | | Always attempt to pull all referenced images | | ||
| | `--push` | | | Shorthand for `--set=*.output=type=registry` | | ||
| | [`--set`](#set) | `stringArray` | | Override target value (e.g., `targetpattern.key=value`) | | ||
| | `--sync-output` | | | Ensure all builds complete before beginning output | |
There was a problem hiding this comment.
Maybe --sync would be enough? There are some cases where we might not need to output anything but keep build result synced (type=cacheonly)?
| |`--sync-output`||| Ensure all builds complete before beginning output| | |
| |`--sync`||| Ensure all builds complete before returning result| |
Let's also add a simple example here for this flag.
There was a problem hiding this comment.
I think --sync isn't enough, you want to hint it is about synching the 'stuff at the end'
a73a4f9 to
0ac4310Comparejedevc
commented
Oct 17, 2022
Have updated with the new Evaluate API introduced in moby/buildkit#3137. Still not sure about the flag name, but the functionality should be correct now (have tested with buildkit before+after the evaluate API merged to check the StatFile fallback works correctly). |
jedevc
commented
Nov 30, 2022
Adding to the v0.10 milestone, think this would be good to get in there. Revisiting this after a while, I wonder if maybe we might want to make this the default behavior? Or some other way that doesn't involve needing to add lots more flags, IMO not needing a lot of extra flags on the cli is one of the selling points of bake 🤔 |
This patch introduces a new syncable output option, which ensures that all builds finish simultaneously in the solver, so that no outputs are completed independently of each other. This allows bake to easily express the notion that either all builds should succeed and output or none of them should. Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
ec88287 to
048e6acComparePing @tonistiigi@crazy-max any thoughts on the overall approach here? I'm a bit hesitant around adding new flags to the CLI though 🤔 Possible approaches:
|
Nithos
commented
Mar 3, 2023
Does the current action support |
crazy-max
commented
Mar 3, 2023
Having a I'm thinking about another use case now. Should we have a |
jedevc
commented
Mar 3, 2023
Yeah, if we have a sync field, having the ability to sync at different points would be good:
|
PhilippHomann
commented
Sep 12, 2025
Are there any plans on merging this one or implementing the previously mentioned |
Potentially fixes#1089.
Depends on a server that includes that patch here: moby/buildkit#2947This proposal patch introduces a new syncable output option, which ensures that all builds finish simultaneously in the solver, so that no outputs are completed independently of each other. This allows bake to easily express the notion that either all builds should succeed and output or none of them should.
Usage:
Comments and thoughts appreciated 🎉