From 1571c137bc02dfc57e5e95c74831ae6e76ae6271 Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Wed, 19 Apr 2023 11:54:02 +0100 Subject: [PATCH] build: rework build package to use only a single Build call Signed-off-by: Justin Chadwell --- build/build.go | 551 +++++++----- build/result.go | 157 ++-- commands/build.go | 160 +++- controller/build/build.go | 148 +--- controller/build/print.go | 48 -- controller/control/controller.go | 16 +- controller/local/controller.go | 32 +- controller/pb/controller.pb.go | 808 +++++++++++------- controller/pb/controller.proto | 31 +- controller/remote/client.go | 71 +- controller/remote/controller.go | 5 +- controller/remote/server.go | 110 +-- monitor/monitor.go | 7 +- util/progress/printer.go | 9 +- .../util/progress/progressui/display.go | 15 +- .../util/progress/progresswriter/printer.go | 2 +- 16 files changed, 1181 insertions(+), 989 deletions(-) delete mode 100644 controller/build/print.go diff --git a/build/build.go b/build/build.go index 9d516001..60afda70 100644 --- a/build/build.go +++ b/build/build.go @@ -653,11 +653,166 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op return &so, releaseF, nil } +func build(ctx context.Context, c *client.Client, opt Options, so client.SolveOpt, pw progress.Writer) (*ResultContext, error) { + frontendInputs := make(map[string]*pb.Definition) + for key, st := range so.FrontendInputs { + def, err := st.Marshal(ctx) + if err != nil { + return nil, err + } + frontendInputs[key] = def.ToPB() + } + + req := gateway.SolveRequest{ + Frontend: so.Frontend, + FrontendInputs: frontendInputs, + FrontendOpt: make(map[string]string), + } + for k, v := range so.FrontendAttrs { + req.FrontendOpt[k] = v + } + so.Frontend = "" + so.FrontendInputs = nil + + ch, chdone := progress.NewChannel(pw) + + rcs := make(chan *ResultContext) + + suspend := make(chan struct{}) + suspendDone := make(chan struct{}) + + go func() { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + var rc *ResultContext + + var printRes map[string][]byte + rr, err := c.Build(ctx, so, "buildx", func(ctx context.Context, c gateway.Client) (*gateway.Result, error) { + var isFallback bool + var origErr error + for { + if opt.PrintFunc != nil { + if _, ok := req.FrontendOpt["frontend.caps"]; !ok { + req.FrontendOpt["frontend.caps"] = "moby.buildkit.frontend.subrequests+forward" + } else { + req.FrontendOpt["frontend.caps"] += ",moby.buildkit.frontend.subrequests+forward" + } + req.FrontendOpt["requestid"] = "frontend." + opt.PrintFunc.Name + if isFallback { + req.FrontendOpt["build-arg:BUILDKIT_SYNTAX"] = printFallbackImage + } + } + res, err := c.Solve(ctx, req) + if err != nil { + if origErr != nil { + return nil, err + } + var reqErr *errdefs.UnsupportedSubrequestError + if !isFallback { + if errors.As(err, &reqErr) { + switch reqErr.Name { + case "frontend.outline", "frontend.targets": + isFallback = true + origErr = err + continue + } + return nil, err + } + // buildkit v0.8 vendored in Docker 20.10 does not support typed errors + if strings.Contains(err.Error(), "unsupported request frontend.outline") || strings.Contains(err.Error(), "unsupported request frontend.targets") { + isFallback = true + origErr = err + continue + } + } + } + + // TODO: would we want to compute this on demand instead of blocking? + eg, ctx2 := errgroup.WithContext(ctx) + res.EachRef(func(r gateway.Reference) error { + eg.Go(func() error { + return r.Evaluate(ctx2) + }) + return nil + }) + err = eg.Wait() + + if opt.PrintFunc != nil { + printRes = res.Metadata + } + + rc = &ResultContext{ + gwClient: c, + gwCtx: ctx, + gwDone: cancel, + gwRef: res, + suspend: suspend, + suspendDone: suspendDone, + } + var se *errdefs.SolveError + if errors.As(err, &se) { + rc.gwErr = se + } else if err != nil { + return nil, err + } + rcs <- rc + + <-suspend + return res, err + } + }, ch) + + <-chdone + + if rr != nil { + if rr.ExporterResponse == nil { + rr.ExporterResponse = map[string]string{} + } + for k, v := range printRes { + rr.ExporterResponse[k] = string(v) + } + } + + rc.resp = rr + rc.err = err + close(suspendDone) + }() + + select { + case <-ctx.Done(): + return nil, ctx.Err() + case rc := <-rcs: + return rc, nil + } +} + func Build(ctx context.Context, nodes []builder.Node, opt map[string]Options, docker *dockerutil.Client, configDir string, w progress.Writer) (resp map[string]*client.SolveResponse, err error) { - return BuildWithResultHandler(ctx, nodes, opt, docker, configDir, w, nil) + resp = map[string]*client.SolveResponse{} + + rcs, err := BuildResults(ctx, nodes, opt, docker, configDir, w) + if err != nil { + return nil, err + } + eg, ctx := errgroup.WithContext(ctx) + for k, v := range rcs { + k, v := k, v + eg.Go(func() error { + v2, err := v.Wait(ctx) + if err != nil { + return err + } + resp[k] = v2 + return nil + }) + } + if err := eg.Wait(); err != nil { + return nil, err + } + return resp, nil } -func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[string]Options, docker *dockerutil.Client, configDir string, w progress.Writer, resultHandleFunc func(driverIndex int, rCtx *ResultContext)) (resp map[string]*client.SolveResponse, err error) { +func BuildResults(ctx context.Context, nodes []builder.Node, opt map[string]Options, docker *dockerutil.Client, configDir string, w progress.Writer) (resp map[string]*ResultContext, err error) { if len(nodes) == 0 { return nil, errors.Errorf("driver required for build") } @@ -708,8 +863,6 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s } }() - eg, ctx := errgroup.WithContext(ctx) - for k, opt := range opt { multiDriver := len(m[k]) > 1 hasMobyDriver := false @@ -785,8 +938,9 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s } } - resp = map[string]*client.SolveResponse{} + eg, ctx := errgroup.WithContext(ctx) var respMu sync.Mutex + resp = map[string]*ResultContext{} results := waitmap.New() multiTarget := len(opt) > 1 @@ -801,15 +955,17 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s if multiTarget { span, ctx = tracing.StartSpan(ctx, k) } - baseCtx := ctx - res := make([]*client.SolveResponse, len(dps)) - eg2, ctx := errgroup.WithContext(ctx) + res := make([]*ResultContext, len(dps)) var pushNames string var insecurePush bool + wg := sync.WaitGroup{} + for i, dp := range dps { + wg.Add(1) + i, dp, so := i, dp, *dp.so if multiDriver { for i, e := range so.Exports { @@ -842,263 +998,188 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s pw := progress.WithPrefix(w, k, multiTarget) c := clients[dp.driverIndex] - eg2.Go(func() error { + eg.Go(func() error { pw = progress.ResetTime(pw) if err := waitContextDeps(ctx, dp.driverIndex, results, &so); err != nil { return err } - frontendInputs := make(map[string]*pb.Definition) - for key, st := range so.FrontendInputs { - def, err := st.Marshal(ctx) - if err != nil { - return err - } - frontendInputs[key] = def.ToPB() - } - - req := gateway.SolveRequest{ - Frontend: so.Frontend, - FrontendInputs: frontendInputs, - FrontendOpt: make(map[string]string), - } - for k, v := range so.FrontendAttrs { - req.FrontendOpt[k] = v - } - so.Frontend = "" - so.FrontendInputs = nil - - ch, done := progress.NewChannel(pw) - defer func() { <-done }() - - cc := c - var printRes map[string][]byte - rr, err := c.Build(ctx, so, "buildx", func(ctx context.Context, c gateway.Client) (*gateway.Result, error) { - var isFallback bool - var origErr error - for { - if opt.PrintFunc != nil { - if _, ok := req.FrontendOpt["frontend.caps"]; !ok { - req.FrontendOpt["frontend.caps"] = "moby.buildkit.frontend.subrequests+forward" - } else { - req.FrontendOpt["frontend.caps"] += ",moby.buildkit.frontend.subrequests+forward" - } - req.FrontendOpt["requestid"] = "frontend." + opt.PrintFunc.Name - if isFallback { - req.FrontendOpt["build-arg:BUILDKIT_SYNTAX"] = printFallbackImage - } - } - res, err := c.Solve(ctx, req) - if err != nil { - if origErr != nil { - return nil, err - } - var reqErr *errdefs.UnsupportedSubrequestError - if !isFallback { - if errors.As(err, &reqErr) { - switch reqErr.Name { - case "frontend.outline", "frontend.targets": - isFallback = true - origErr = err - continue - } - return nil, err - } - // buildkit v0.8 vendored in Docker 20.10 does not support typed errors - if strings.Contains(err.Error(), "unsupported request frontend.outline") || strings.Contains(err.Error(), "unsupported request frontend.targets") { - isFallback = true - origErr = err - continue - } - } - return nil, err - } - if opt.PrintFunc != nil { - printRes = res.Metadata - } - results.Set(resultKey(dp.driverIndex, k), res) - if resultHandleFunc != nil { - resultCtx, err := NewResultContext(cc, so, res) - if err == nil { - resultHandleFunc(dp.driverIndex, resultCtx) - } else { - logrus.Warnf("failed to record result: %s", err) - } - } - return res, nil - } - }, ch) + result, err := build(ctx, c, opt, so, pw) if err != nil { return err } - res[i] = rr - - if rr.ExporterResponse == nil { - rr.ExporterResponse = map[string]string{} - } - for k, v := range printRes { - rr.ExporterResponse[k] = string(v) - } - - node := nodes[dp.driverIndex].Driver - if node.IsMobyDriver() { - for _, e := range so.Exports { - if e.Type == "moby" && e.Attrs["push"] != "" { - if ok, _ := strconv.ParseBool(e.Attrs["push"]); ok { - pushNames = e.Attrs["name"] - if pushNames == "" { - return errors.Errorf("tag is needed when pushing to registry") - } - pw := progress.ResetTime(pw) - pushList := strings.Split(pushNames, ",") - for _, name := range pushList { - if err := progress.Wrap(fmt.Sprintf("pushing %s with docker", name), pw.Write, func(l progress.SubLogger) error { - return pushWithMoby(ctx, node, name, l) - }); err != nil { - return err + results.Set(resultKey(dp.driverIndex, k), result.gwRef) + + res[i] = result + resp[k] = result + + result.hook(func(ctx context.Context) error { + defer wg.Done() + + node := nodes[dp.driverIndex].Driver + if node.IsMobyDriver() { + for _, e := range so.Exports { + if e.Type == "moby" && e.Attrs["push"] != "" { + if ok, _ := strconv.ParseBool(e.Attrs["push"]); ok { + pushNames = e.Attrs["name"] + if pushNames == "" { + return errors.Errorf("tag is needed when pushing to registry") } - } - remoteDigest, err := remoteDigestWithMoby(ctx, node, pushList[0]) - if err == nil && remoteDigest != "" { - // old daemons might not have containerimage.config.digest set - // in response so use containerimage.digest value for it if available - if _, ok := rr.ExporterResponse[exptypes.ExporterImageConfigDigestKey]; !ok { - if v, ok := rr.ExporterResponse[exptypes.ExporterImageDigestKey]; ok { - rr.ExporterResponse[exptypes.ExporterImageConfigDigestKey] = v + pw := progress.ResetTime(pw) + pushList := strings.Split(pushNames, ",") + for _, name := range pushList { + if err := progress.Wrap(fmt.Sprintf("pushing %s with docker", name), pw.Write, func(l progress.SubLogger) error { + return pushWithMoby(ctx, node, name, l) + }); err != nil { + return err } } - rr.ExporterResponse[exptypes.ExporterImageDigestKey] = remoteDigest - } else if err != nil { - return err + remoteDigest, err := remoteDigestWithMoby(ctx, node, pushList[0]) + if err == nil && remoteDigest != "" { + // old daemons might not have containerimage.config.digest set + // in response so use containerimage.digest value for it if available + if _, ok := result.resp.ExporterResponse[exptypes.ExporterImageConfigDigestKey]; !ok { + if v, ok := result.resp.ExporterResponse[exptypes.ExporterImageDigestKey]; ok { + result.resp.ExporterResponse[exptypes.ExporterImageConfigDigestKey] = v + } + } + result.resp.ExporterResponse[exptypes.ExporterImageDigestKey] = remoteDigest + } else if err != nil { + return err + } } } } } - } - return nil - }) - } - eg.Go(func() (err error) { - ctx := baseCtx - defer func() { - if span != nil { - tracing.FinishWithError(span, err) - } - }() - pw := progress.WithPrefix(w, "default", false) - if err := eg2.Wait(); err != nil { - return err - } - - respMu.Lock() - resp[k] = res[0] - respMu.Unlock() - if len(res) == 1 { - return nil - } + return nil + }) - if pushNames != "" { - progress.Write(pw, fmt.Sprintf("merging manifest list %s", pushNames), func() error { - descs := make([]specs.Descriptor, 0, len(res)) + if i == 0 { + result.hook(func(ctx context.Context) error { + wg.Wait() - for _, r := range res { - s, ok := r.ExporterResponse[exptypes.ExporterImageDescriptorKey] - if ok { - dt, err := base64.StdEncoding.DecodeString(s) - if err != nil { - return err - } - var desc specs.Descriptor - if err := json.Unmarshal(dt, &desc); err != nil { - return errors.Wrapf(err, "failed to unmarshal descriptor %s", s) + defer func() { + if span != nil { + tracing.FinishWithError(span, err) } - descs = append(descs, desc) - continue - } - // This is fallback for some very old buildkit versions. - // Note that the mediatype isn't really correct as most of the time it is image manifest and - // not manifest list but actually both are handled because for Docker mediatypes the - // mediatype value in the Accpet header does not seem to matter. - s, ok = r.ExporterResponse[exptypes.ExporterImageDigestKey] - if ok { - descs = append(descs, specs.Descriptor{ - Digest: digest.Digest(s), - MediaType: images.MediaTypeDockerSchema2ManifestList, - Size: -1, - }) + }() + + pw := progress.WithPrefix(w, "default", false) + + respMu.Lock() + resp[k] = res[0] + respMu.Unlock() + if len(res) == 1 { + return nil } - } - if len(descs) > 0 { - var imageopt imagetools.Opt - for _, dp := range dps { - imageopt = nodes[dp.driverIndex].ImageOpt - break + if pushNames == "" { + return nil } - names := strings.Split(pushNames, ",") - - if insecurePush { - insecureTrue := true - httpTrue := true - nn, err := reference.ParseNormalizedNamed(names[0]) - if err != nil { - return err - } - imageopt.RegistryConfig = map[string]resolver.RegistryConfig{ - reference.Domain(nn): { - Insecure: &insecureTrue, - PlainHTTP: &httpTrue, - }, + + progress.Write(pw, fmt.Sprintf("merging manifest list %s", pushNames), func() error { + descs := make([]specs.Descriptor, 0, len(res)) + + for _, r := range res { + s, ok := r.resp.ExporterResponse[exptypes.ExporterImageDescriptorKey] + if ok { + dt, err := base64.StdEncoding.DecodeString(s) + if err != nil { + return err + } + var desc specs.Descriptor + if err := json.Unmarshal(dt, &desc); err != nil { + return errors.Wrapf(err, "failed to unmarshal descriptor %s", s) + } + descs = append(descs, desc) + continue + } + // This is fallback for some very old buildkit versions. + // Note that the mediatype isn't really correct as most of the time it is image manifest and + // not manifest list but actually both are handled because for Docker mediatypes the + // mediatype value in the Accpet header does not seem to matter. + s, ok = r.resp.ExporterResponse[exptypes.ExporterImageDigestKey] + if ok { + descs = append(descs, specs.Descriptor{ + Digest: digest.Digest(s), + MediaType: images.MediaTypeDockerSchema2ManifestList, + Size: -1, + }) + } } - } + if len(descs) > 0 { + var imageopt imagetools.Opt + for _, dp := range dps { + imageopt = nodes[dp.driverIndex].ImageOpt + break + } + names := strings.Split(pushNames, ",") - itpull := imagetools.New(imageopt) + if insecurePush { + insecureTrue := true + httpTrue := true + nn, err := reference.ParseNormalizedNamed(names[0]) + if err != nil { + return err + } + imageopt.RegistryConfig = map[string]resolver.RegistryConfig{ + reference.Domain(nn): { + Insecure: &insecureTrue, + PlainHTTP: &httpTrue, + }, + } + } - ref, err := reference.ParseNormalizedNamed(names[0]) - if err != nil { - return err - } - ref = reference.TagNameOnly(ref) + itpull := imagetools.New(imageopt) - srcs := make([]*imagetools.Source, len(descs)) - for i, desc := range descs { - srcs[i] = &imagetools.Source{ - Desc: desc, - Ref: ref, - } - } + ref, err := reference.ParseNormalizedNamed(names[0]) + if err != nil { + return err + } + ref = reference.TagNameOnly(ref) - dt, desc, err := itpull.Combine(ctx, srcs) - if err != nil { - return err - } + srcs := make([]*imagetools.Source, len(descs)) + for i, desc := range descs { + srcs[i] = &imagetools.Source{ + Desc: desc, + Ref: ref, + } + } - itpush := imagetools.New(imageopt) + dt, desc, err := itpull.Combine(ctx, srcs) + if err != nil { + return err + } - for _, n := range names { - nn, err := reference.ParseNormalizedNamed(n) - if err != nil { - return err - } - if err := itpush.Push(ctx, nn, desc, dt); err != nil { - return err - } - } + itpush := imagetools.New(imageopt) - respMu.Lock() - resp[k] = &client.SolveResponse{ - ExporterResponse: map[string]string{ - exptypes.ExporterImageDigestKey: desc.Digest.String(), - }, - } - respMu.Unlock() - } - return nil - }) - } - return nil - }) + for _, n := range names { + nn, err := reference.ParseNormalizedNamed(n) + if err != nil { + return err + } + if err := itpush.Push(ctx, nn, desc, dt); err != nil { + return err + } + } + + respMu.Lock() + resp[k].resp = &client.SolveResponse{ + ExporterResponse: map[string]string{ + exptypes.ExporterImageDigestKey: desc.Digest.String(), + }, + } + respMu.Unlock() + } + return nil + }) + return nil + }) + } + return nil + }) + } } if err := eg.Wait(); err != nil { diff --git a/build/result.go b/build/result.go index 3d394be7..90326a53 100644 --- a/build/result.go +++ b/build/result.go @@ -6,7 +6,6 @@ import ( "encoding/json" "io" "sync" - "sync/atomic" controllerapi "github.com/docker/buildx/controller/pb" "github.com/moby/buildkit/client" @@ -17,110 +16,20 @@ import ( specs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "golang.org/x/sync/errgroup" ) -func NewResultContext(c *client.Client, solveOpt client.SolveOpt, res *gateway.Result) (*ResultContext, error) { - ctx := context.Background() - def, err := getDefinition(ctx, res) - if err != nil { - return nil, err - } - return getResultAt(ctx, c, solveOpt, def, nil) -} - -func getDefinition(ctx context.Context, res *gateway.Result) (*pb.Definition, error) { - ref, err := res.SingleRef() - if err != nil { - return nil, err - } - st, err := ref.ToState() - if err != nil { - return nil, err - } - def, err := st.Marshal(ctx) - if err != nil { - return nil, err - } - return def.ToPB(), nil -} - -func getResultAt(ctx context.Context, c *client.Client, solveOpt client.SolveOpt, target *pb.Definition, statusChan chan *client.SolveStatus) (*ResultContext, error) { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - // forward SolveStatus - done := new(atomic.Bool) - defer done.Store(true) - ch := make(chan *client.SolveStatus) - go func() { - for { - s := <-ch - if s == nil { - return - } - if done.Load() { - // Do not forward if the function returned because statusChan is possibly closed - continue - } - select { - case statusChan <- s: - case <-ctx.Done(): - } - } - }() - - // get result - resultCtxCh := make(chan *ResultContext) - errCh := make(chan error) - go func() { - _, err := c.Build(context.Background(), solveOpt, "buildx", func(ctx context.Context, c gateway.Client) (*gateway.Result, error) { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - resultCtx := ResultContext{} - res2, err := c.Solve(ctx, gateway.SolveRequest{ - Evaluate: true, - Definition: target, - }) - if err != nil { - var se *errdefs.SolveError - if errors.As(err, &se) { - resultCtx.solveErr = se - } else { - return nil, err - } - } - // Record the client and ctx as well so that containers can be created from the SolveError. - resultCtx.res = res2 - resultCtx.gwClient = c - resultCtx.gwCtx = ctx - resultCtx.gwDone = cancel - select { - case resultCtxCh <- &resultCtx: - case <-ctx.Done(): - return nil, ctx.Err() - } - <-ctx.Done() - return nil, nil - }, ch) - if err != nil { - errCh <- err - } - }() - - select { - case resultCtx := <-resultCtxCh: - return resultCtx, nil - case err := <-errCh: - return nil, err - case <-ctx.Done(): - return nil, ctx.Err() - } -} - // ResultContext is a build result with the client that built it. type ResultContext struct { - res *gateway.Result - solveErr *errdefs.SolveError + resp *client.SolveResponse + err error + suspend chan<- struct{} + suspendDone <-chan struct{} + + hooks []func(ctx context.Context) error + + gwRef *gateway.Result + gwErr *errdefs.SolveError gwClient gateway.Client gwCtx context.Context @@ -131,7 +40,39 @@ type ResultContext struct { cleanupsMu sync.Mutex } -func (r *ResultContext) Done() { +func (r *ResultContext) hook(hook func(ctx context.Context) error) { + r.hooks = append(r.hooks, hook) +} + +func (r *ResultContext) Result(ctx context.Context) (*gateway.Result, *errdefs.SolveError) { + return r.gwRef, r.gwErr +} + +func (r *ResultContext) Wait(ctx context.Context) (*client.SolveResponse, error) { + defer r.Close() + + close(r.suspend) + select { + case <-ctx.Done(): + return nil, ctx.Err() + case <-r.suspendDone: + eg, ctx := errgroup.WithContext(ctx) + eg.Go(func() error { + for _, f := range r.hooks { + if err := f(ctx); err != nil { + return err + } + } + return nil + }) + if err := eg.Wait(); err != nil { + return nil, err + } + return r.resp, r.err + } +} + +func (r *ResultContext) Close() { r.gwDoneOnce.Do(func() { r.cleanupsMu.Lock() cleanups := r.cleanups @@ -156,16 +97,16 @@ func (r *ResultContext) build(buildFunc gateway.BuildFunc) (err error) { } func (r *ResultContext) getContainerConfig(ctx context.Context, c gateway.Client, cfg *controllerapi.InvokeConfig) (containerCfg gateway.NewContainerRequest, _ error) { - if r.res != nil && r.solveErr == nil { + if r.gwRef != nil && r.gwErr == nil { logrus.Debugf("creating container from successful build") - ccfg, err := containerConfigFromResult(ctx, r.res, c, *cfg) + ccfg, err := containerConfigFromResult(ctx, r.gwRef, c, *cfg) if err != nil { return containerCfg, err } containerCfg = *ccfg } else { logrus.Debugf("creating container from failed build %+v", cfg) - ccfg, err := containerConfigFromError(r.solveErr, *cfg) + ccfg, err := containerConfigFromError(r.gwErr, *cfg) if err != nil { return containerCfg, errors.Wrapf(err, "no result nor error is available") } @@ -176,14 +117,14 @@ func (r *ResultContext) getContainerConfig(ctx context.Context, c gateway.Client func (r *ResultContext) getProcessConfig(cfg *controllerapi.InvokeConfig, stdin io.ReadCloser, stdout io.WriteCloser, stderr io.WriteCloser) (_ gateway.StartRequest, err error) { processCfg := newStartRequest(stdin, stdout, stderr) - if r.res != nil && r.solveErr == nil { + if r.gwRef != nil && r.gwErr == nil { logrus.Debugf("creating container from successful build") - if err := populateProcessConfigFromResult(&processCfg, r.res, *cfg); err != nil { + if err := populateProcessConfigFromResult(&processCfg, r.gwRef, *cfg); err != nil { return processCfg, err } } else { logrus.Debugf("creating container from failed build %+v", cfg) - if err := populateProcessConfigFromError(&processCfg, r.solveErr, *cfg); err != nil { + if err := populateProcessConfigFromError(&processCfg, r.gwErr, *cfg); err != nil { return processCfg, err } } diff --git a/commands/build.go b/commands/build.go index 12f34a07..f0421c23 100644 --- a/commands/build.go +++ b/commands/build.go @@ -8,11 +8,13 @@ import ( "encoding/json" "fmt" "io" + "log" "os" "path/filepath" "runtime" "strconv" "strings" + "sync" "github.com/containerd/console" "github.com/docker/buildx/build" @@ -33,10 +35,14 @@ import ( "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" dockeropts "github.com/docker/cli/opts" + "github.com/docker/docker/api/types/versions" "github.com/docker/docker/builder/remotecontext/urlutil" "github.com/docker/docker/pkg/ioutils" "github.com/moby/buildkit/client" "github.com/moby/buildkit/exporter/containerimage/exptypes" + "github.com/moby/buildkit/frontend/subrequests" + "github.com/moby/buildkit/frontend/subrequests/outline" + "github.com/moby/buildkit/frontend/subrequests/targets" "github.com/moby/buildkit/solver/errdefs" "github.com/moby/buildkit/util/appcontext" "github.com/moby/buildkit/util/grpcerrors" @@ -106,7 +112,6 @@ func (o *buildOptions) toControllerOptions() (controllerapi.BuildOptions, error) NetworkMode: o.networkMode, NoCacheFilter: o.noCacheFilter, Platforms: o.platforms, - PrintFunc: o.printFunc, ShmSize: int64(o.shmSize), Tags: o.tags, Target: o.target, @@ -153,6 +158,11 @@ func (o *buildOptions) toControllerOptions() (controllerapi.BuildOptions, error) } } + opts.PrintFunc, err = parsePrintFunc(o.printFunc) + if err != nil { + return controllerapi.BuildOptions{}, err + } + opts.CacheFrom, err = buildflags.ParseCacheEntry(o.cacheFrom) if err != nil { return controllerapi.BuildOptions{}, err @@ -231,9 +241,13 @@ func runBuild(dockerCli command.Cli, in buildOptions) error { return errors.Wrap(err, "removing image ID file") } } - resp, _, err := cbuild.RunBuild(ctx, dockerCli, opts, os.Stdin, printer, false) - if err1 := printer.Wait(); err == nil { - err = err1 + res, err := cbuild.RunBuild(ctx, dockerCli, opts, os.Stdin, printer) + resp, err2 := res.Wait(ctx) + if err == nil { + err = err2 + } + if err2 := printer.Wait(); err == nil { + err = err2 } if err != nil { return err @@ -249,6 +263,16 @@ func runBuild(dockerCli command.Cli, in buildOptions) error { } return os.WriteFile(in.imageIDFile, []byte(dgst), 0644) } + if in.metadataFile != "" { + if err := writeMetadataFile(in.metadataFile, decodeExporterResponse(resp.ExporterResponse)); err != nil { + return err + } + } + if opts.PrintFunc != nil { + if err := printResult(opts.PrintFunc, resp.ExporterResponse); err != nil { + return err + } + } return nil } @@ -518,7 +542,7 @@ func updateLastActivity(dockerCli command.Cli, ng *store.NodeGroup) error { return txn.UpdateLastActivity(ng) } -func launchControllerAndRunBuild(dockerCli command.Cli, options buildOptions) error { +func launchControllerAndRunBuild(dockerCli command.Cli, options buildOptions) (err error) { ctx := context.TODO() if options.invoke != nil && (options.dockerfileName == "-" || options.contextPath == "-") { @@ -560,6 +584,14 @@ func launchControllerAndRunBuild(dockerCli command.Cli, options buildOptions) er if err != nil { return err } + printerCloseOnce := sync.Once{} + defer func() { + printerCloseOnce.Do(func() { + if err1 := printer.Wait(); err == nil { + err = err1 + } + }) + }() // NOTE: buildx server has the current working directory different from the client // so we need to resolve paths to abosolute ones in the client. @@ -588,11 +620,7 @@ func launchControllerAndRunBuild(dockerCli command.Cli, options buildOptions) er } } - var resp *client.SolveResponse - ref, resp, err = c.Build(ctx, opts, pr, printer) - if err1 := printer.Wait(); err == nil { - err = err1 - } + ref, err = c.Build(ctx, opts, pr, printer) if err != nil { var be *controllererrors.BuildError if errors.As(err, &be) { @@ -610,22 +638,13 @@ func launchControllerAndRunBuild(dockerCli command.Cli, options buildOptions) er if err := pr.Close(); err != nil { logrus.Debug("failed to close stdin pipe reader") } - - if options.quiet { - fmt.Println(resp.ExporterResponse[exptypes.ExporterImageDigestKey]) - } - if options.imageIDFile != "" { - dgst := resp.ExporterResponse[exptypes.ExporterImageDigestKey] - if v, ok := resp.ExporterResponse[exptypes.ExporterImageConfigDigestKey]; ok { - dgst = v - } - return os.WriteFile(options.imageIDFile, []byte(dgst), 0644) - } - } // post-build operations if options.invoke != nil && options.invoke.needsMonitor(retErr) { + // HACK: pause the printer to prevent interference with monitor + printer.Pause(true) + pr2, pw2 := io.Pipe() f.SetWriter(pw2, func() io.WriteCloser { pw2.Close() // propagate EOF @@ -646,11 +665,40 @@ func launchControllerAndRunBuild(dockerCli command.Cli, options buildOptions) er if err != nil { logrus.Warnf("failed to run monitor: %v", err) } - } else { - if err := c.Disconnect(ctx, ref); err != nil { - logrus.Warnf("disconnect error: %v", err) + + printer.Pause(false) + } + + resp, err := c.Finalize(ctx, ref) + printerCloseOnce.Do(func() { + if err1 := printer.Wait(); err == nil { + err = err1 } + }) + if err != nil { + return err } + if options.quiet { + fmt.Println(resp.ExporterResponse[exptypes.ExporterImageDigestKey]) + } + if options.imageIDFile != "" { + dgst := resp.ExporterResponse[exptypes.ExporterImageDigestKey] + if v, ok := resp.ExporterResponse[exptypes.ExporterImageConfigDigestKey]; ok { + dgst = v + } + return os.WriteFile(options.imageIDFile, []byte(dgst), 0644) + } + if options.metadataFile != "" { + if err := writeMetadataFile(options.metadataFile, decodeExporterResponse(resp.ExporterResponse)); err != nil { + return err + } + } + if opts.PrintFunc != nil { + if err := printResult(opts.PrintFunc, resp.ExporterResponse); err != nil { + return err + } + } + return nil } @@ -964,3 +1012,65 @@ func printWarnings(w io.Writer, warnings []client.VertexWarning, mode string) { } } + +func printResult(f *controllerapi.PrintFunc, res map[string]string) error { + switch f.Name { + case "outline": + return printValue(outline.PrintOutline, outline.SubrequestsOutlineDefinition.Version, f.Format, res) + case "targets": + return printValue(targets.PrintTargets, targets.SubrequestsTargetsDefinition.Version, f.Format, res) + case "subrequests.describe": + return printValue(subrequests.PrintDescribe, subrequests.SubrequestsDescribeDefinition.Version, f.Format, res) + default: + if dt, ok := res["result.txt"]; ok { + fmt.Print(dt) + } else { + log.Printf("%s %+v", f, res) + } + } + return nil +} + +type printFunc func([]byte, io.Writer) error + +func printValue(printer printFunc, version string, format string, res map[string]string) error { + if format == "json" { + fmt.Fprintln(os.Stdout, res["result.json"]) + return nil + } + + if res["version"] != "" && versions.LessThan(version, res["version"]) && res["result.txt"] != "" { + // structure is too new and we don't know how to print it + fmt.Fprint(os.Stdout, res["result.txt"]) + return nil + } + return printer([]byte(res["result.json"]), os.Stdout) +} + +func parsePrintFunc(str string) (*controllerapi.PrintFunc, error) { + if str == "" { + return nil, nil + } + csvReader := csv.NewReader(strings.NewReader(str)) + fields, err := csvReader.Read() + if err != nil { + return nil, err + } + f := &controllerapi.PrintFunc{} + for _, field := range fields { + parts := strings.SplitN(field, "=", 2) + if len(parts) == 2 { + if parts[0] == "format" { + f.Format = parts[1] + } else { + return nil, errors.Errorf("invalid print field: %s", field) + } + } else { + if f.Name != "" { + return nil, errors.Errorf("invalid print value: %s", str) + } + f.Name = field + } + } + return f, nil +} diff --git a/controller/build/build.go b/controller/build/build.go index c519fa99..b4e999f7 100644 --- a/controller/build/build.go +++ b/controller/build/build.go @@ -2,14 +2,10 @@ package build import ( "context" - "encoding/base64" - "encoding/csv" - "encoding/json" "io" "os" "path/filepath" "strings" - "sync" "github.com/docker/buildx/build" "github.com/docker/buildx/builder" @@ -24,7 +20,6 @@ import ( "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/config" dockeropts "github.com/docker/cli/opts" - "github.com/docker/docker/pkg/ioutils" "github.com/docker/go-units" "github.com/moby/buildkit/client" "github.com/moby/buildkit/session/auth/authprovider" @@ -36,13 +31,9 @@ import ( const defaultTargetName = "default" // RunBuild runs the specified build and returns the result. -// -// NOTE: When an error happens during the build and this function acquires the debuggable *build.ResultContext, -// this function returns it in addition to the error (i.e. it does "return nil, res, err"). The caller can -// inspect the result and debug the cause of that error. -func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.BuildOptions, inStream io.Reader, progress progress.Writer, generateResult bool) (*client.SolveResponse, *build.ResultContext, error) { +func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.BuildOptions, inStream io.Reader, progress progress.Writer) (*build.ResultContext, error) { if in.NoCache && len(in.NoCacheFilter) > 0 { - return nil, nil, errors.Errorf("--no-cache and --no-cache-filter cannot currently be used together") + return nil, errors.Errorf("--no-cache and --no-cache-filter cannot currently be used together") } contexts := map[string]build.NamedContext{} @@ -50,11 +41,6 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build contexts[name] = build.NamedContext{Path: path} } - printFunc, err := parsePrintFunc(in.PrintFunc) - if err != nil { - return nil, nil, err - } - opts := build.Options{ Inputs: build.Inputs{ ContextPath: in.ContextPath, @@ -73,12 +59,11 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build Tags: in.Tags, Target: in.Target, Ulimits: controllerUlimitOpt2DockerUlimit(in.Ulimits), - PrintFunc: printFunc, } platforms, err := platformutil.Parse(in.Platforms) if err != nil { - return nil, nil, err + return nil, err } opts.Platforms = platforms @@ -87,7 +72,7 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build secrets, err := controllerapi.CreateSecrets(in.Secrets) if err != nil { - return nil, nil, err + return nil, err } opts.Session = append(opts.Session, secrets) @@ -97,17 +82,17 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build } ssh, err := controllerapi.CreateSSH(sshSpecs) if err != nil { - return nil, nil, err + return nil, err } opts.Session = append(opts.Session, ssh) outputs, err := controllerapi.CreateExports(in.Exports) if err != nil { - return nil, nil, err + return nil, err } if in.ExportPush { if in.ExportLoad { - return nil, nil, errors.Errorf("push and load may not be set together at the moment") + return nil, errors.Errorf("push and load may not be set together at the moment") } if len(outputs) == 0 { outputs = []client.ExportEntry{{ @@ -121,7 +106,7 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build case "image": outputs[0].Attrs["push"] = "true" default: - return nil, nil, errors.Errorf("push and %q output can't be used together", outputs[0].Type) + return nil, errors.Errorf("push and %q output can't be used together", outputs[0].Type) } } } @@ -135,12 +120,19 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build switch outputs[0].Type { case "docker": default: - return nil, nil, errors.Errorf("load and %q output can't be used together", outputs[0].Type) + return nil, errors.Errorf("load and %q output can't be used together", outputs[0].Type) } } } opts.Exports = outputs + if in.PrintFunc != nil { + opts.PrintFunc = &build.PrintFunc{ + Name: in.PrintFunc.Name, + Format: in.PrintFunc.Format, + } + } + opts.CacheFrom = controllerapi.CreateCaches(in.CacheFrom) opts.CacheTo = controllerapi.CreateCaches(in.CacheTo) @@ -148,7 +140,7 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build allow, err := buildflags.ParseEntitlements(in.Allow) if err != nil { - return nil, nil, err + return nil, err } opts.Allow = allow @@ -164,120 +156,32 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build builder.WithContextPathHash(contextPathHash), ) if err != nil { - return nil, nil, err + return nil, err } if err = updateLastActivity(dockerCli, b.NodeGroup); err != nil { - return nil, nil, errors.Wrapf(err, "failed to update builder last activity time") + return nil, errors.Wrapf(err, "failed to update builder last activity time") } nodes, err := b.LoadNodes(ctx, false) if err != nil { - return nil, nil, err + return nil, err } - resp, res, err := buildTargets(ctx, dockerCli, b.NodeGroup, nodes, map[string]build.Options{defaultTargetName: opts}, progress, in.MetadataFile, generateResult) + res, err := buildTargets(ctx, dockerCli, b.NodeGroup, nodes, map[string]build.Options{defaultTargetName: opts}, progress, in.MetadataFile) err = wrapBuildError(err, false) if err != nil { - // NOTE: buildTargets can return *build.ResultContext even on error. - return nil, res, err + return nil, err } - return resp, res, nil + return res[defaultTargetName], nil } // buildTargets runs the specified build and returns the result. -// -// NOTE: When an error happens during the build and this function acquires the debuggable *build.ResultContext, -// this function returns it in addition to the error (i.e. it does "return nil, res, err"). The caller can -// inspect the result and debug the cause of that error. -func buildTargets(ctx context.Context, dockerCli command.Cli, ng *store.NodeGroup, nodes []builder.Node, opts map[string]build.Options, progress progress.Writer, metadataFile string, generateResult bool) (*client.SolveResponse, *build.ResultContext, error) { - var res *build.ResultContext - var resp map[string]*client.SolveResponse - var err error - if generateResult { - var mu sync.Mutex - var idx int - resp, err = build.BuildWithResultHandler(ctx, nodes, opts, dockerutil.NewClient(dockerCli), confutil.ConfigDir(dockerCli), progress, func(driverIndex int, gotRes *build.ResultContext) { - mu.Lock() - defer mu.Unlock() - if res == nil || driverIndex < idx { - idx, res = driverIndex, gotRes - } - }) - } else { - resp, err = build.Build(ctx, nodes, opts, dockerutil.NewClient(dockerCli), confutil.ConfigDir(dockerCli), progress) - } - if err != nil { - return nil, res, err - } - - if len(metadataFile) > 0 && resp != nil { - if err := writeMetadataFile(metadataFile, decodeExporterResponse(resp[defaultTargetName].ExporterResponse)); err != nil { - return nil, nil, err - } - } - - for k := range resp { - if opts[k].PrintFunc != nil { - if err := printResult(opts[k].PrintFunc, resp[k].ExporterResponse); err != nil { - return nil, nil, err - } - } - } - - return resp[defaultTargetName], res, err -} - -func parsePrintFunc(str string) (*build.PrintFunc, error) { - if str == "" { - return nil, nil - } - csvReader := csv.NewReader(strings.NewReader(str)) - fields, err := csvReader.Read() +func buildTargets(ctx context.Context, dockerCli command.Cli, ng *store.NodeGroup, nodes []builder.Node, opts map[string]build.Options, progress progress.Writer, metadataFile string) (map[string]*build.ResultContext, error) { + res, err := build.BuildResults(ctx, nodes, opts, dockerutil.NewClient(dockerCli), confutil.ConfigDir(dockerCli), progress) if err != nil { return nil, err } - f := &build.PrintFunc{} - for _, field := range fields { - parts := strings.SplitN(field, "=", 2) - if len(parts) == 2 { - if parts[0] == "format" { - f.Format = parts[1] - } else { - return nil, errors.Errorf("invalid print field: %s", field) - } - } else { - if f.Name != "" { - return nil, errors.Errorf("invalid print value: %s", str) - } - f.Name = field - } - } - return f, nil -} - -func writeMetadataFile(filename string, dt interface{}) error { - b, err := json.MarshalIndent(dt, "", " ") - if err != nil { - return err - } - return ioutils.AtomicWriteFile(filename, b, 0644) -} -func decodeExporterResponse(exporterResponse map[string]string) map[string]interface{} { - out := make(map[string]interface{}) - for k, v := range exporterResponse { - dt, err := base64.StdEncoding.DecodeString(v) - if err != nil { - out[k] = v - continue - } - var raw map[string]interface{} - if err = json.Unmarshal(dt, &raw); err != nil || len(raw) == 0 { - out[k] = v - continue - } - out[k] = json.RawMessage(dt) - } - return out + return res, err } func wrapBuildError(err error, bake bool) error { diff --git a/controller/build/print.go b/controller/build/print.go deleted file mode 100644 index 6817e5e9..00000000 --- a/controller/build/print.go +++ /dev/null @@ -1,48 +0,0 @@ -package build - -import ( - "fmt" - "io" - "log" - "os" - - "github.com/docker/buildx/build" - "github.com/docker/docker/api/types/versions" - "github.com/moby/buildkit/frontend/subrequests" - "github.com/moby/buildkit/frontend/subrequests/outline" - "github.com/moby/buildkit/frontend/subrequests/targets" -) - -func printResult(f *build.PrintFunc, res map[string]string) error { - switch f.Name { - case "outline": - return printValue(outline.PrintOutline, outline.SubrequestsOutlineDefinition.Version, f.Format, res) - case "targets": - return printValue(targets.PrintTargets, targets.SubrequestsTargetsDefinition.Version, f.Format, res) - case "subrequests.describe": - return printValue(subrequests.PrintDescribe, subrequests.SubrequestsDescribeDefinition.Version, f.Format, res) - default: - if dt, ok := res["result.txt"]; ok { - fmt.Print(dt) - } else { - log.Printf("%s %+v", f, res) - } - } - return nil -} - -type printFunc func([]byte, io.Writer) error - -func printValue(printer printFunc, version string, format string, res map[string]string) error { - if format == "json" { - fmt.Fprintln(os.Stdout, res["result.json"]) - return nil - } - - if res["version"] != "" && versions.LessThan(version, res["version"]) && res["result.txt"] != "" { - // structure is too new and we don't know how to print it - fmt.Fprint(os.Stdout, res["result.txt"]) - return nil - } - return printer([]byte(res["result.json"]), os.Stdout) -} diff --git a/controller/control/controller.go b/controller/control/controller.go index bdc5b7f8..748d9236 100644 --- a/controller/control/controller.go +++ b/controller/control/controller.go @@ -10,19 +10,23 @@ import ( ) type BuildxController interface { - Build(ctx context.Context, options controllerapi.BuildOptions, in io.ReadCloser, progress progress.Writer) (ref string, resp *client.SolveResponse, err error) + Build(ctx context.Context, options controllerapi.BuildOptions, in io.ReadCloser, progress progress.Writer) (string, error) // Invoke starts an IO session into the specified process. // If pid doesn't matche to any running processes, it starts a new process with the specified config. // If there is no container running or InvokeConfig.Rollback is speicfied, the process will start in a newly created container. // NOTE: If needed, in the future, we can split this API into three APIs (NewContainer, NewProcess and Attach). Invoke(ctx context.Context, ref, pid string, options controllerapi.InvokeConfig, ioIn io.ReadCloser, ioOut io.WriteCloser, ioErr io.WriteCloser) error - Kill(ctx context.Context) error - Close() error - List(ctx context.Context) (refs []string, _ error) + Finalize(ctx context.Context, ref string) (*client.SolveResponse, error) Disconnect(ctx context.Context, ref string) error - ListProcesses(ctx context.Context, ref string) (infos []*controllerapi.ProcessInfo, retErr error) - DisconnectProcess(ctx context.Context, ref, pid string) error + Inspect(ctx context.Context, ref string) (*controllerapi.InspectResponse, error) + List(ctx context.Context) ([]string, error) + + ListProcesses(ctx context.Context, ref string) ([]*controllerapi.ProcessInfo, error) + DisconnectProcess(ctx context.Context, ref, pid string) error + + Kill(ctx context.Context) error + Close() error } type ControlOptions struct { diff --git a/controller/local/controller.go b/controller/local/controller.go index 2bce2b28..166b5658 100644 --- a/controller/local/controller.go +++ b/controller/local/controller.go @@ -42,27 +42,27 @@ type localController struct { buildOnGoing atomic.Bool } -func (b *localController) Build(ctx context.Context, options controllerapi.BuildOptions, in io.ReadCloser, progress progress.Writer) (string, *client.SolveResponse, error) { +func (b *localController) Build(ctx context.Context, options controllerapi.BuildOptions, in io.ReadCloser, progress progress.Writer) (string, error) { if !b.buildOnGoing.CompareAndSwap(false, true) { - return "", nil, errors.New("build ongoing") + return "", errors.New("build ongoing") } defer b.buildOnGoing.Store(false) - resp, res, buildErr := cbuild.RunBuild(ctx, b.dockerCli, options, in, progress, true) - // NOTE: RunBuild can return *build.ResultContext even on error. + res, err := cbuild.RunBuild(ctx, b.dockerCli, options, in, progress) + if err != nil { + return "", err + } if res != nil { b.buildConfig = buildConfig{ resultCtx: res, buildOptions: &options, } + _, buildErr := b.buildConfig.resultCtx.Result(ctx) if buildErr != nil { - buildErr = controllererrors.WrapBuild(buildErr, b.ref) + return "", controllererrors.WrapBuild(buildErr, b.ref) } } - if buildErr != nil { - return "", nil, buildErr - } - return b.ref, resp, nil + return b.ref, nil } func (b *localController) ListProcesses(ctx context.Context, ref string) (infos []*controllerapi.ProcessInfo, retErr error) { @@ -123,7 +123,7 @@ func (b *localController) Kill(context.Context) error { func (b *localController) Close() error { b.cancelRunningProcesses() if b.buildConfig.resultCtx != nil { - b.buildConfig.resultCtx.Done() + b.buildConfig.resultCtx.Close() } // TODO: cancel ongoing builds? return nil @@ -133,9 +133,17 @@ func (b *localController) List(ctx context.Context) (res []string, _ error) { return []string{b.ref}, nil } +func (b *localController) Finalize(ctx context.Context, key string) (*client.SolveResponse, error) { + b.cancelRunningProcesses() + + if b.buildConfig.resultCtx != nil { + return b.buildConfig.resultCtx.Wait(ctx) + } + return nil, nil +} + func (b *localController) Disconnect(ctx context.Context, key string) error { - b.Close() - return nil + return b.Close() } func (b *localController) Inspect(ctx context.Context, ref string) (*controllerapi.InspectResponse, error) { diff --git a/controller/pb/controller.pb.go b/controller/pb/controller.pb.go index e9b0969f..f3759e5e 100644 --- a/controller/pb/controller.pb.go +++ b/controller/pb/controller.pb.go @@ -272,7 +272,7 @@ func (m *BuildRequest) GetOptions() *BuildOptions { type BuildOptions struct { ContextPath string `protobuf:"bytes,1,opt,name=ContextPath,proto3" json:"ContextPath,omitempty"` DockerfileName string `protobuf:"bytes,2,opt,name=DockerfileName,proto3" json:"DockerfileName,omitempty"` - PrintFunc string `protobuf:"bytes,3,opt,name=PrintFunc,proto3" json:"PrintFunc,omitempty"` + PrintFunc *PrintFunc `protobuf:"bytes,3,opt,name=PrintFunc,proto3" json:"PrintFunc,omitempty"` NamedContexts map[string]string `protobuf:"bytes,4,rep,name=NamedContexts,proto3" json:"NamedContexts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Allow []string `protobuf:"bytes,5,rep,name=Allow,proto3" json:"Allow,omitempty"` Attests []*Attest `protobuf:"bytes,6,rep,name=Attests,proto3" json:"Attests,omitempty"` @@ -341,11 +341,11 @@ func (m *BuildOptions) GetDockerfileName() string { return "" } -func (m *BuildOptions) GetPrintFunc() string { +func (m *BuildOptions) GetPrintFunc() *PrintFunc { if m != nil { return m.PrintFunc } - return "" + return nil } func (m *BuildOptions) GetNamedContexts() map[string]string { @@ -523,6 +523,128 @@ func (m *BuildOptions) GetExportLoad() bool { return false } +type FinalizeRequest struct { + Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FinalizeRequest) Reset() { *m = FinalizeRequest{} } +func (m *FinalizeRequest) String() string { return proto.CompactTextString(m) } +func (*FinalizeRequest) ProtoMessage() {} +func (*FinalizeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ed7f10298fa1d90f, []int{7} +} +func (m *FinalizeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FinalizeRequest.Unmarshal(m, b) +} +func (m *FinalizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FinalizeRequest.Marshal(b, m, deterministic) +} +func (m *FinalizeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FinalizeRequest.Merge(m, src) +} +func (m *FinalizeRequest) XXX_Size() int { + return xxx_messageInfo_FinalizeRequest.Size(m) +} +func (m *FinalizeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FinalizeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FinalizeRequest proto.InternalMessageInfo + +func (m *FinalizeRequest) GetRef() string { + if m != nil { + return m.Ref + } + return "" +} + +type FinalizeResponse struct { + ExporterResponse map[string]string `protobuf:"bytes,1,rep,name=ExporterResponse,proto3" json:"ExporterResponse,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FinalizeResponse) Reset() { *m = FinalizeResponse{} } +func (m *FinalizeResponse) String() string { return proto.CompactTextString(m) } +func (*FinalizeResponse) ProtoMessage() {} +func (*FinalizeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed7f10298fa1d90f, []int{8} +} +func (m *FinalizeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FinalizeResponse.Unmarshal(m, b) +} +func (m *FinalizeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FinalizeResponse.Marshal(b, m, deterministic) +} +func (m *FinalizeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_FinalizeResponse.Merge(m, src) +} +func (m *FinalizeResponse) XXX_Size() int { + return xxx_messageInfo_FinalizeResponse.Size(m) +} +func (m *FinalizeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_FinalizeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_FinalizeResponse proto.InternalMessageInfo + +func (m *FinalizeResponse) GetExporterResponse() map[string]string { + if m != nil { + return m.ExporterResponse + } + return nil +} + +type PrintFunc struct { + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + Format string `protobuf:"bytes,2,opt,name=Format,proto3" json:"Format,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PrintFunc) Reset() { *m = PrintFunc{} } +func (m *PrintFunc) String() string { return proto.CompactTextString(m) } +func (*PrintFunc) ProtoMessage() {} +func (*PrintFunc) Descriptor() ([]byte, []int) { + return fileDescriptor_ed7f10298fa1d90f, []int{9} +} +func (m *PrintFunc) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PrintFunc.Unmarshal(m, b) +} +func (m *PrintFunc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PrintFunc.Marshal(b, m, deterministic) +} +func (m *PrintFunc) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrintFunc.Merge(m, src) +} +func (m *PrintFunc) XXX_Size() int { + return xxx_messageInfo_PrintFunc.Size(m) +} +func (m *PrintFunc) XXX_DiscardUnknown() { + xxx_messageInfo_PrintFunc.DiscardUnknown(m) +} + +var xxx_messageInfo_PrintFunc proto.InternalMessageInfo + +func (m *PrintFunc) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PrintFunc) GetFormat() string { + if m != nil { + return m.Format + } + return "" +} + type ExportEntry struct { Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` @@ -536,7 +658,7 @@ func (m *ExportEntry) Reset() { *m = ExportEntry{} } func (m *ExportEntry) String() string { return proto.CompactTextString(m) } func (*ExportEntry) ProtoMessage() {} func (*ExportEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{7} + return fileDescriptor_ed7f10298fa1d90f, []int{10} } func (m *ExportEntry) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExportEntry.Unmarshal(m, b) @@ -589,7 +711,7 @@ func (m *CacheOptionsEntry) Reset() { *m = CacheOptionsEntry{} } func (m *CacheOptionsEntry) String() string { return proto.CompactTextString(m) } func (*CacheOptionsEntry) ProtoMessage() {} func (*CacheOptionsEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{8} + return fileDescriptor_ed7f10298fa1d90f, []int{11} } func (m *CacheOptionsEntry) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CacheOptionsEntry.Unmarshal(m, b) @@ -636,7 +758,7 @@ func (m *Attest) Reset() { *m = Attest{} } func (m *Attest) String() string { return proto.CompactTextString(m) } func (*Attest) ProtoMessage() {} func (*Attest) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{9} + return fileDescriptor_ed7f10298fa1d90f, []int{12} } func (m *Attest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Attest.Unmarshal(m, b) @@ -689,7 +811,7 @@ func (m *SSH) Reset() { *m = SSH{} } func (m *SSH) String() string { return proto.CompactTextString(m) } func (*SSH) ProtoMessage() {} func (*SSH) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{10} + return fileDescriptor_ed7f10298fa1d90f, []int{13} } func (m *SSH) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SSH.Unmarshal(m, b) @@ -736,7 +858,7 @@ func (m *Secret) Reset() { *m = Secret{} } func (m *Secret) String() string { return proto.CompactTextString(m) } func (*Secret) ProtoMessage() {} func (*Secret) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{11} + return fileDescriptor_ed7f10298fa1d90f, []int{14} } func (m *Secret) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Secret.Unmarshal(m, b) @@ -788,7 +910,7 @@ func (m *InspectRequest) Reset() { *m = InspectRequest{} } func (m *InspectRequest) String() string { return proto.CompactTextString(m) } func (*InspectRequest) ProtoMessage() {} func (*InspectRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{12} + return fileDescriptor_ed7f10298fa1d90f, []int{15} } func (m *InspectRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InspectRequest.Unmarshal(m, b) @@ -826,7 +948,7 @@ func (m *InspectResponse) Reset() { *m = InspectResponse{} } func (m *InspectResponse) String() string { return proto.CompactTextString(m) } func (*InspectResponse) ProtoMessage() {} func (*InspectResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{13} + return fileDescriptor_ed7f10298fa1d90f, []int{16} } func (m *InspectResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InspectResponse.Unmarshal(m, b) @@ -864,7 +986,7 @@ func (m *UlimitOpt) Reset() { *m = UlimitOpt{} } func (m *UlimitOpt) String() string { return proto.CompactTextString(m) } func (*UlimitOpt) ProtoMessage() {} func (*UlimitOpt) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{14} + return fileDescriptor_ed7f10298fa1d90f, []int{17} } func (m *UlimitOpt) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UlimitOpt.Unmarshal(m, b) @@ -904,7 +1026,7 @@ func (m *Ulimit) Reset() { *m = Ulimit{} } func (m *Ulimit) String() string { return proto.CompactTextString(m) } func (*Ulimit) ProtoMessage() {} func (*Ulimit) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{15} + return fileDescriptor_ed7f10298fa1d90f, []int{18} } func (m *Ulimit) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Ulimit.Unmarshal(m, b) @@ -946,17 +1068,16 @@ func (m *Ulimit) GetSoft() int64 { } type BuildResponse struct { - ExporterResponse map[string]string `protobuf:"bytes,1,rep,name=ExporterResponse,proto3" json:"ExporterResponse,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *BuildResponse) Reset() { *m = BuildResponse{} } func (m *BuildResponse) String() string { return proto.CompactTextString(m) } func (*BuildResponse) ProtoMessage() {} func (*BuildResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{16} + return fileDescriptor_ed7f10298fa1d90f, []int{19} } func (m *BuildResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BuildResponse.Unmarshal(m, b) @@ -976,13 +1097,6 @@ func (m *BuildResponse) XXX_DiscardUnknown() { var xxx_messageInfo_BuildResponse proto.InternalMessageInfo -func (m *BuildResponse) GetExporterResponse() map[string]string { - if m != nil { - return m.ExporterResponse - } - return nil -} - type DisconnectRequest struct { Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -994,7 +1108,7 @@ func (m *DisconnectRequest) Reset() { *m = DisconnectRequest{} } func (m *DisconnectRequest) String() string { return proto.CompactTextString(m) } func (*DisconnectRequest) ProtoMessage() {} func (*DisconnectRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{17} + return fileDescriptor_ed7f10298fa1d90f, []int{20} } func (m *DisconnectRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DisconnectRequest.Unmarshal(m, b) @@ -1031,7 +1145,7 @@ func (m *DisconnectResponse) Reset() { *m = DisconnectResponse{} } func (m *DisconnectResponse) String() string { return proto.CompactTextString(m) } func (*DisconnectResponse) ProtoMessage() {} func (*DisconnectResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{18} + return fileDescriptor_ed7f10298fa1d90f, []int{21} } func (m *DisconnectResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DisconnectResponse.Unmarshal(m, b) @@ -1062,7 +1176,7 @@ func (m *ListRequest) Reset() { *m = ListRequest{} } func (m *ListRequest) String() string { return proto.CompactTextString(m) } func (*ListRequest) ProtoMessage() {} func (*ListRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{19} + return fileDescriptor_ed7f10298fa1d90f, []int{22} } func (m *ListRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListRequest.Unmarshal(m, b) @@ -1100,7 +1214,7 @@ func (m *ListResponse) Reset() { *m = ListResponse{} } func (m *ListResponse) String() string { return proto.CompactTextString(m) } func (*ListResponse) ProtoMessage() {} func (*ListResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{20} + return fileDescriptor_ed7f10298fa1d90f, []int{23} } func (m *ListResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListResponse.Unmarshal(m, b) @@ -1141,7 +1255,7 @@ func (m *InputMessage) Reset() { *m = InputMessage{} } func (m *InputMessage) String() string { return proto.CompactTextString(m) } func (*InputMessage) ProtoMessage() {} func (*InputMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{21} + return fileDescriptor_ed7f10298fa1d90f, []int{24} } func (m *InputMessage) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InputMessage.Unmarshal(m, b) @@ -1215,7 +1329,7 @@ func (m *InputInitMessage) Reset() { *m = InputInitMessage{} } func (m *InputInitMessage) String() string { return proto.CompactTextString(m) } func (*InputInitMessage) ProtoMessage() {} func (*InputInitMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{22} + return fileDescriptor_ed7f10298fa1d90f, []int{25} } func (m *InputInitMessage) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InputInitMessage.Unmarshal(m, b) @@ -1254,7 +1368,7 @@ func (m *DataMessage) Reset() { *m = DataMessage{} } func (m *DataMessage) String() string { return proto.CompactTextString(m) } func (*DataMessage) ProtoMessage() {} func (*DataMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{23} + return fileDescriptor_ed7f10298fa1d90f, []int{26} } func (m *DataMessage) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DataMessage.Unmarshal(m, b) @@ -1298,7 +1412,7 @@ func (m *InputResponse) Reset() { *m = InputResponse{} } func (m *InputResponse) String() string { return proto.CompactTextString(m) } func (*InputResponse) ProtoMessage() {} func (*InputResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{24} + return fileDescriptor_ed7f10298fa1d90f, []int{27} } func (m *InputResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InputResponse.Unmarshal(m, b) @@ -1334,7 +1448,7 @@ func (m *Message) Reset() { *m = Message{} } func (m *Message) String() string { return proto.CompactTextString(m) } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{25} + return fileDescriptor_ed7f10298fa1d90f, []int{28} } func (m *Message) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Message.Unmarshal(m, b) @@ -1436,7 +1550,7 @@ func (m *InitMessage) Reset() { *m = InitMessage{} } func (m *InitMessage) String() string { return proto.CompactTextString(m) } func (*InitMessage) ProtoMessage() {} func (*InitMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{26} + return fileDescriptor_ed7f10298fa1d90f, []int{29} } func (m *InitMessage) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InitMessage.Unmarshal(m, b) @@ -1497,7 +1611,7 @@ func (m *InvokeConfig) Reset() { *m = InvokeConfig{} } func (m *InvokeConfig) String() string { return proto.CompactTextString(m) } func (*InvokeConfig) ProtoMessage() {} func (*InvokeConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{27} + return fileDescriptor_ed7f10298fa1d90f, []int{30} } func (m *InvokeConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InvokeConfig.Unmarshal(m, b) @@ -1600,7 +1714,7 @@ func (m *FdMessage) Reset() { *m = FdMessage{} } func (m *FdMessage) String() string { return proto.CompactTextString(m) } func (*FdMessage) ProtoMessage() {} func (*FdMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{28} + return fileDescriptor_ed7f10298fa1d90f, []int{31} } func (m *FdMessage) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FdMessage.Unmarshal(m, b) @@ -1653,7 +1767,7 @@ func (m *ResizeMessage) Reset() { *m = ResizeMessage{} } func (m *ResizeMessage) String() string { return proto.CompactTextString(m) } func (*ResizeMessage) ProtoMessage() {} func (*ResizeMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{29} + return fileDescriptor_ed7f10298fa1d90f, []int{32} } func (m *ResizeMessage) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResizeMessage.Unmarshal(m, b) @@ -1700,7 +1814,7 @@ func (m *SignalMessage) Reset() { *m = SignalMessage{} } func (m *SignalMessage) String() string { return proto.CompactTextString(m) } func (*SignalMessage) ProtoMessage() {} func (*SignalMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{30} + return fileDescriptor_ed7f10298fa1d90f, []int{33} } func (m *SignalMessage) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalMessage.Unmarshal(m, b) @@ -1738,7 +1852,7 @@ func (m *StatusRequest) Reset() { *m = StatusRequest{} } func (m *StatusRequest) String() string { return proto.CompactTextString(m) } func (*StatusRequest) ProtoMessage() {} func (*StatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{31} + return fileDescriptor_ed7f10298fa1d90f, []int{34} } func (m *StatusRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StatusRequest.Unmarshal(m, b) @@ -1779,7 +1893,7 @@ func (m *StatusResponse) Reset() { *m = StatusResponse{} } func (m *StatusResponse) String() string { return proto.CompactTextString(m) } func (*StatusResponse) ProtoMessage() {} func (*StatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{32} + return fileDescriptor_ed7f10298fa1d90f, []int{35} } func (m *StatusResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StatusResponse.Unmarshal(m, b) @@ -1837,7 +1951,7 @@ func (m *InfoRequest) Reset() { *m = InfoRequest{} } func (m *InfoRequest) String() string { return proto.CompactTextString(m) } func (*InfoRequest) ProtoMessage() {} func (*InfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{33} + return fileDescriptor_ed7f10298fa1d90f, []int{36} } func (m *InfoRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InfoRequest.Unmarshal(m, b) @@ -1868,7 +1982,7 @@ func (m *InfoResponse) Reset() { *m = InfoResponse{} } func (m *InfoResponse) String() string { return proto.CompactTextString(m) } func (*InfoResponse) ProtoMessage() {} func (*InfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{34} + return fileDescriptor_ed7f10298fa1d90f, []int{37} } func (m *InfoResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InfoResponse.Unmarshal(m, b) @@ -1908,7 +2022,7 @@ func (m *BuildxVersion) Reset() { *m = BuildxVersion{} } func (m *BuildxVersion) String() string { return proto.CompactTextString(m) } func (*BuildxVersion) ProtoMessage() {} func (*BuildxVersion) Descriptor() ([]byte, []int) { - return fileDescriptor_ed7f10298fa1d90f, []int{35} + return fileDescriptor_ed7f10298fa1d90f, []int{38} } func (m *BuildxVersion) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BuildxVersion.Unmarshal(m, b) @@ -1960,6 +2074,10 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "buildx.controller.v1.BuildOptions.BuildArgsEntry") proto.RegisterMapType((map[string]string)(nil), "buildx.controller.v1.BuildOptions.LabelsEntry") proto.RegisterMapType((map[string]string)(nil), "buildx.controller.v1.BuildOptions.NamedContextsEntry") + proto.RegisterType((*FinalizeRequest)(nil), "buildx.controller.v1.FinalizeRequest") + proto.RegisterType((*FinalizeResponse)(nil), "buildx.controller.v1.FinalizeResponse") + proto.RegisterMapType((map[string]string)(nil), "buildx.controller.v1.FinalizeResponse.ExporterResponseEntry") + proto.RegisterType((*PrintFunc)(nil), "buildx.controller.v1.PrintFunc") proto.RegisterType((*ExportEntry)(nil), "buildx.controller.v1.ExportEntry") proto.RegisterMapType((map[string]string)(nil), "buildx.controller.v1.ExportEntry.AttrsEntry") proto.RegisterType((*CacheOptionsEntry)(nil), "buildx.controller.v1.CacheOptionsEntry") @@ -1973,7 +2091,6 @@ func init() { proto.RegisterMapType((map[string]*Ulimit)(nil), "buildx.controller.v1.UlimitOpt.ValuesEntry") proto.RegisterType((*Ulimit)(nil), "buildx.controller.v1.Ulimit") proto.RegisterType((*BuildResponse)(nil), "buildx.controller.v1.BuildResponse") - proto.RegisterMapType((map[string]string)(nil), "buildx.controller.v1.BuildResponse.ExporterResponseEntry") proto.RegisterType((*DisconnectRequest)(nil), "buildx.controller.v1.DisconnectRequest") proto.RegisterType((*DisconnectResponse)(nil), "buildx.controller.v1.DisconnectResponse") proto.RegisterType((*ListRequest)(nil), "buildx.controller.v1.ListRequest") @@ -1998,122 +2115,125 @@ func init() { func init() { proto.RegisterFile("controller.proto", fileDescriptor_ed7f10298fa1d90f) } var fileDescriptor_ed7f10298fa1d90f = []byte{ - // 1832 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0x5f, 0x6f, 0xdb, 0xc8, - 0x11, 0x2f, 0x25, 0x59, 0x7f, 0x46, 0x96, 0xe3, 0x6c, 0x9d, 0xeb, 0x86, 0x49, 0x2f, 0x0e, 0x93, - 0xbb, 0x0a, 0x4d, 0x21, 0xdf, 0xf9, 0x7a, 0xcd, 0xe5, 0x72, 0x05, 0x6a, 0xcb, 0x16, 0xec, 0x43, - 0xfc, 0x07, 0x94, 0x93, 0x43, 0x5b, 0xa0, 0x07, 0x4a, 0x5a, 0xcb, 0x84, 0x28, 0xae, 0xca, 0x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 0xac, 0xc9, 0xc3, 0x73, 0xbf, 0x4f, 0x73, 0x9b, 0x56, - 0xbd, 0xba, 0xed, 0x2c, 0xde, 0x2c, 0x8d, 0x74, 0x67, 0x78, 0xce, 0xb7, 0x40, 0xf7, 0x7c, 0xd1, - 0xe5, 0x61, 0xc8, 0xba, 0xb1, 0x33, 0x99, 0x4e, 0xcf, 0x9e, 0x29, 0x77, 0xe3, 0x4c, 0xce, 0x13, - 0x78, 0xbc, 0xc0, 0x96, 0x0e, 0x8b, 0xf3, 0x07, 0x58, 0xdd, 0x55, 0x67, 0xcb, 0x36, 0xfe, 0x0d, - 0x94, 0x4e, 0x46, 0xd2, 0xe7, 0xa1, 0x58, 0xee, 0x0d, 0x9a, 0x31, 0x48, 0x37, 0xa6, 0x38, 0xff, - 0x05, 0xb3, 0x81, 0x51, 0x90, 0x4d, 0xa8, 0x36, 0x79, 0x28, 0xd9, 0xb5, 0x3c, 0xf5, 0xe4, 0x85, - 0xd9, 0x28, 0xad, 0x22, 0x9f, 0xc2, 0xda, 0x1e, 0xef, 0x0e, 0x58, 0x74, 0xee, 0x07, 0xec, 0xd8, - 0x1b, 0x32, 0xe3, 0xd2, 0x0d, 0xad, 0xf6, 0xda, 0x0f, 0x65, 0x6b, 0x1c, 0x76, 0x69, 0x3e, 0xf6, - 0xda, 0x28, 0xc8, 0xef, 0xa1, 0xa6, 0x50, 0x3d, 0x63, 0x59, 0xd0, 0x02, 0xbe, 0xf7, 0x2f, 0x6f, - 0x3f, 0x7c, 0x63, 0x86, 0xb7, 0x1f, 0xca, 0x68, 0xe2, 0xce, 0xda, 0x22, 0x1b, 0xb0, 0xb2, 0x13, - 0x04, 0xfc, 0x8a, 0xae, 0x6c, 0xe6, 0xeb, 0x15, 0x57, 0x0b, 0xe4, 0x57, 0x50, 0xda, 0x91, 0x92, - 0x09, 0x29, 0x68, 0x11, 0x37, 0x7b, 0xba, 0x78, 0x33, 0x0d, 0x72, 0x63, 0x30, 0x39, 0x81, 0x0a,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 0x22, 0xdf, 0x42, 0x51, 0x57, 0x35, 0xf2, 0xd3, 0xc5, 0x84, - 0xd8, 0xde, 0xf2, 0xc7, 0x75, 0xeb, 0x33, 0x8b, 0x1c, 0x41, 0x41, 0xb5, 0x73, 0x92, 0xd1, 0x9b, - 0x52, 0xb3, 0x80, 0xed, 0x2c, 0x83, 0x98, 0x28, 0x7e, 0x0f, 0x30, 0x1d, 0x2a, 0x48, 0xc6, 0x37, - 0x89, 0xb9, 0xe9, 0xc4, 0xae, 0xdf, 0x0e, 0x34, 0x1b, 0x1c, 0xa9, 0x8e, 0x7a, 0xce, 0x49, 0x66, - 0x2f, 0x4d, 0xae, 0x91, 0xed, 0x2c, 0x83, 0x18, 0x73, 0x17, 0x50, 0x9b, 0xf9, 0x24, 0x49, 0x7e, - 0x9e, 0xed, 0xe4, 0xcd, 0x2f, 0x9c, 0xf6, 0xab, 0x3b, 0x61, 0xcd, 0x4e, 0x32, 0x3d, 0x95, 0x99, - 0xc7, 0xa4, 0x71, 0x9b, 0xdf, 0xb3, 0x9f, 0x17, 0xed, 0xad, 0x3b, 0xe3, 0xf5, 0xae, 0xbb, 0x85, - 0xdf, 0xe5, 0x46, 0x9d, 0x4e, 0x11, 0xbf, 0xd4, 0x7e, 0xf1, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xc2, 0xd5, 0x2b, 0x23, 0x10, 0x16, 0x00, 0x00, + // 1887 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0x5f, 0x73, 0x1b, 0xb7, + 0x11, 0xef, 0x91, 0x14, 0xff, 0x2c, 0x45, 0x59, 0x46, 0xe5, 0x14, 0xa6, 0xdd, 0x58, 0x3e, 0xd9, + 0x2e, 0xa7, 0xee, 0x50, 0x89, 0xd2, 0x54, 0x49, 0xec, 0xcc, 0x54, 0xa2, 0xc4, 0x91, 0x32, 0xd6, + 0x9f, 0x39,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9d, 0x57, 0x9f, 0xa6, 0xbf, + 0xf8, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x66, 0x27, 0x0f, 0x01, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2128,14 +2248,15 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ControllerClient interface { + Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) Build(ctx context.Context, in *BuildRequest, opts ...grpc.CallOption) (*BuildResponse, error) - Inspect(ctx context.Context, in *InspectRequest, opts ...grpc.CallOption) (*InspectResponse, error) - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (Controller_StatusClient, error) - Input(ctx context.Context, opts ...grpc.CallOption) (Controller_InputClient, error) + Finalize(ctx context.Context, in *FinalizeRequest, opts ...grpc.CallOption) (*FinalizeResponse, error) Invoke(ctx context.Context, opts ...grpc.CallOption) (Controller_InvokeClient, error) - List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) Disconnect(ctx context.Context, in *DisconnectRequest, opts ...grpc.CallOption) (*DisconnectResponse, error) - Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (Controller_StatusClient, error) + Inspect(ctx context.Context, in *InspectRequest, opts ...grpc.CallOption) (*InspectResponse, error) + List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) + Input(ctx context.Context, opts ...grpc.CallOption) (Controller_InputClient, error) ListProcesses(ctx context.Context, in *ListProcessesRequest, opts ...grpc.CallOption) (*ListProcessesResponse, error) DisconnectProcess(ctx context.Context, in *DisconnectProcessRequest, opts ...grpc.CallOption) (*DisconnectProcessResponse, error) } @@ -2148,6 +2269,15 @@ func NewControllerClient(cc *grpc.ClientConn) ControllerClient { return &controllerClient{cc} } +func (c *controllerClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { + out := new(InfoResponse) + err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/Info", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *controllerClient) Build(ctx context.Context, in *BuildRequest, opts ...grpc.CallOption) (*BuildResponse, error) { out := new(BuildResponse) err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/Build", in, out, opts...) @@ -2157,9 +2287,49 @@ func (c *controllerClient) Build(ctx context.Context, in *BuildRequest, opts ... return out, nil } -func (c *controllerClient) Inspect(ctx context.Context, in *InspectRequest, opts ...grpc.CallOption) (*InspectResponse, error) { - out := new(InspectResponse) - err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/Inspect", in, out, opts...) +func (c *controllerClient) Finalize(ctx context.Context, in *FinalizeRequest, opts ...grpc.CallOption) (*FinalizeResponse, error) { + out := new(FinalizeResponse) + err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/Finalize", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) Invoke(ctx context.Context, opts ...grpc.CallOption) (Controller_InvokeClient, error) { + stream, err := c.cc.NewStream(ctx, &_Controller_serviceDesc.Streams[0], "/buildx.controller.v1.Controller/Invoke", opts...) + if err != nil { + return nil, err + } + x := &controllerInvokeClient{stream} + return x, nil +} + +type Controller_InvokeClient interface { + Send(*Message) error + Recv() (*Message, error) + grpc.ClientStream +} + +type controllerInvokeClient struct { + grpc.ClientStream +} + +func (x *controllerInvokeClient) Send(m *Message) error { + return x.ClientStream.SendMsg(m) +} + +func (x *controllerInvokeClient) Recv() (*Message, error) { + m := new(Message) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *controllerClient) Disconnect(ctx context.Context, in *DisconnectRequest, opts ...grpc.CallOption) (*DisconnectResponse, error) { + out := new(DisconnectResponse) + err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/Disconnect", in, out, opts...) if err != nil { return nil, err } @@ -2167,7 +2337,7 @@ func (c *controllerClient) Inspect(ctx context.Context, in *InspectRequest, opts } func (c *controllerClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (Controller_StatusClient, error) { - stream, err := c.cc.NewStream(ctx, &_Controller_serviceDesc.Streams[0], "/buildx.controller.v1.Controller/Status", opts...) + stream, err := c.cc.NewStream(ctx, &_Controller_serviceDesc.Streams[1], "/buildx.controller.v1.Controller/Status", opts...) if err != nil { return nil, err } @@ -2198,8 +2368,26 @@ func (x *controllerStatusClient) Recv() (*StatusResponse, error) { return m, nil } +func (c *controllerClient) Inspect(ctx context.Context, in *InspectRequest, opts ...grpc.CallOption) (*InspectResponse, error) { + out := new(InspectResponse) + err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/Inspect", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { + out := new(ListResponse) + err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/List", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *controllerClient) Input(ctx context.Context, opts ...grpc.CallOption) (Controller_InputClient, error) { - stream, err := c.cc.NewStream(ctx, &_Controller_serviceDesc.Streams[1], "/buildx.controller.v1.Controller/Input", opts...) + stream, err := c.cc.NewStream(ctx, &_Controller_serviceDesc.Streams[2], "/buildx.controller.v1.Controller/Input", opts...) if err != nil { return nil, err } @@ -2232,64 +2420,6 @@ func (x *controllerInputClient) CloseAndRecv() (*InputResponse, error) { return m, nil } -func (c *controllerClient) Invoke(ctx context.Context, opts ...grpc.CallOption) (Controller_InvokeClient, error) { - stream, err := c.cc.NewStream(ctx, &_Controller_serviceDesc.Streams[2], "/buildx.controller.v1.Controller/Invoke", opts...) - if err != nil { - return nil, err - } - x := &controllerInvokeClient{stream} - return x, nil -} - -type Controller_InvokeClient interface { - Send(*Message) error - Recv() (*Message, error) - grpc.ClientStream -} - -type controllerInvokeClient struct { - grpc.ClientStream -} - -func (x *controllerInvokeClient) Send(m *Message) error { - return x.ClientStream.SendMsg(m) -} - -func (x *controllerInvokeClient) Recv() (*Message, error) { - m := new(Message) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *controllerClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { - out := new(ListResponse) - err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/List", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controllerClient) Disconnect(ctx context.Context, in *DisconnectRequest, opts ...grpc.CallOption) (*DisconnectResponse, error) { - out := new(DisconnectResponse) - err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/Disconnect", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controllerClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { - out := new(InfoResponse) - err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/Info", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *controllerClient) ListProcesses(ctx context.Context, in *ListProcessesRequest, opts ...grpc.CallOption) (*ListProcessesResponse, error) { out := new(ListProcessesResponse) err := c.cc.Invoke(ctx, "/buildx.controller.v1.Controller/ListProcesses", in, out, opts...) @@ -2310,14 +2440,15 @@ func (c *controllerClient) DisconnectProcess(ctx context.Context, in *Disconnect // ControllerServer is the server API for Controller service. type ControllerServer interface { + Info(context.Context, *InfoRequest) (*InfoResponse, error) Build(context.Context, *BuildRequest) (*BuildResponse, error) - Inspect(context.Context, *InspectRequest) (*InspectResponse, error) - Status(*StatusRequest, Controller_StatusServer) error - Input(Controller_InputServer) error + Finalize(context.Context, *FinalizeRequest) (*FinalizeResponse, error) Invoke(Controller_InvokeServer) error - List(context.Context, *ListRequest) (*ListResponse, error) Disconnect(context.Context, *DisconnectRequest) (*DisconnectResponse, error) - Info(context.Context, *InfoRequest) (*InfoResponse, error) + Status(*StatusRequest, Controller_StatusServer) error + Inspect(context.Context, *InspectRequest) (*InspectResponse, error) + List(context.Context, *ListRequest) (*ListResponse, error) + Input(Controller_InputServer) error ListProcesses(context.Context, *ListProcessesRequest) (*ListProcessesResponse, error) DisconnectProcess(context.Context, *DisconnectProcessRequest) (*DisconnectProcessResponse, error) } @@ -2326,29 +2457,32 @@ type ControllerServer interface { type UnimplementedControllerServer struct { } +func (*UnimplementedControllerServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +} func (*UnimplementedControllerServer) Build(ctx context.Context, req *BuildRequest) (*BuildResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Build not implemented") } -func (*UnimplementedControllerServer) Inspect(ctx context.Context, req *InspectRequest) (*InspectResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Inspect not implemented") +func (*UnimplementedControllerServer) Finalize(ctx context.Context, req *FinalizeRequest) (*FinalizeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Finalize not implemented") +} +func (*UnimplementedControllerServer) Invoke(srv Controller_InvokeServer) error { + return status.Errorf(codes.Unimplemented, "method Invoke not implemented") +} +func (*UnimplementedControllerServer) Disconnect(ctx context.Context, req *DisconnectRequest) (*DisconnectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Disconnect not implemented") } func (*UnimplementedControllerServer) Status(req *StatusRequest, srv Controller_StatusServer) error { return status.Errorf(codes.Unimplemented, "method Status not implemented") } -func (*UnimplementedControllerServer) Input(srv Controller_InputServer) error { - return status.Errorf(codes.Unimplemented, "method Input not implemented") -} -func (*UnimplementedControllerServer) Invoke(srv Controller_InvokeServer) error { - return status.Errorf(codes.Unimplemented, "method Invoke not implemented") +func (*UnimplementedControllerServer) Inspect(ctx context.Context, req *InspectRequest) (*InspectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Inspect not implemented") } func (*UnimplementedControllerServer) List(ctx context.Context, req *ListRequest) (*ListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } -func (*UnimplementedControllerServer) Disconnect(ctx context.Context, req *DisconnectRequest) (*DisconnectResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Disconnect not implemented") -} -func (*UnimplementedControllerServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +func (*UnimplementedControllerServer) Input(srv Controller_InputServer) error { + return status.Errorf(codes.Unimplemented, "method Input not implemented") } func (*UnimplementedControllerServer) ListProcesses(ctx context.Context, req *ListProcessesRequest) (*ListProcessesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListProcesses not implemented") @@ -2361,6 +2495,24 @@ func RegisterControllerServer(s *grpc.Server, srv ControllerServer) { s.RegisterService(&_Controller_serviceDesc, srv) } +func _Controller_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).Info(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/buildx.controller.v1.Controller/Info", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).Info(ctx, req.(*InfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Controller_Build_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BuildRequest) if err := dec(in); err != nil { @@ -2379,71 +2531,24 @@ func _Controller_Build_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Controller_Inspect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InspectRequest) +func _Controller_Finalize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FinalizeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ControllerServer).Inspect(ctx, in) + return srv.(ControllerServer).Finalize(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/buildx.controller.v1.Controller/Inspect", + FullMethod: "/buildx.controller.v1.Controller/Finalize", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Inspect(ctx, req.(*InspectRequest)) + return srv.(ControllerServer).Finalize(ctx, req.(*FinalizeRequest)) } return interceptor(ctx, in, info, handler) } -func _Controller_Status_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(StatusRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ControllerServer).Status(m, &controllerStatusServer{stream}) -} - -type Controller_StatusServer interface { - Send(*StatusResponse) error - grpc.ServerStream -} - -type controllerStatusServer struct { - grpc.ServerStream -} - -func (x *controllerStatusServer) Send(m *StatusResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Controller_Input_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ControllerServer).Input(&controllerInputServer{stream}) -} - -type Controller_InputServer interface { - SendAndClose(*InputResponse) error - Recv() (*InputMessage, error) - grpc.ServerStream -} - -type controllerInputServer struct { - grpc.ServerStream -} - -func (x *controllerInputServer) SendAndClose(m *InputResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *controllerInputServer) Recv() (*InputMessage, error) { - m := new(InputMessage) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - func _Controller_Invoke_Handler(srv interface{}, stream grpc.ServerStream) error { return srv.(ControllerServer).Invoke(&controllerInvokeServer{stream}) } @@ -2470,60 +2575,107 @@ func (x *controllerInvokeServer) Recv() (*Message, error) { return m, nil } -func _Controller_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListRequest) +func _Controller_Disconnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DisconnectRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ControllerServer).List(ctx, in) + return srv.(ControllerServer).Disconnect(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/buildx.controller.v1.Controller/List", + FullMethod: "/buildx.controller.v1.Controller/Disconnect", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).List(ctx, req.(*ListRequest)) + return srv.(ControllerServer).Disconnect(ctx, req.(*DisconnectRequest)) } return interceptor(ctx, in, info, handler) } -func _Controller_Disconnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisconnectRequest) +func _Controller_Status_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StatusRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ControllerServer).Status(m, &controllerStatusServer{stream}) +} + +type Controller_StatusServer interface { + Send(*StatusResponse) error + grpc.ServerStream +} + +type controllerStatusServer struct { + grpc.ServerStream +} + +func (x *controllerStatusServer) Send(m *StatusResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Controller_Inspect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InspectRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ControllerServer).Disconnect(ctx, in) + return srv.(ControllerServer).Inspect(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/buildx.controller.v1.Controller/Disconnect", + FullMethod: "/buildx.controller.v1.Controller/Inspect", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Disconnect(ctx, req.(*DisconnectRequest)) + return srv.(ControllerServer).Inspect(ctx, req.(*InspectRequest)) } return interceptor(ctx, in, info, handler) } -func _Controller_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InfoRequest) +func _Controller_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ControllerServer).Info(ctx, in) + return srv.(ControllerServer).List(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/buildx.controller.v1.Controller/Info", + FullMethod: "/buildx.controller.v1.Controller/List", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Info(ctx, req.(*InfoRequest)) + return srv.(ControllerServer).List(ctx, req.(*ListRequest)) } return interceptor(ctx, in, info, handler) } +func _Controller_Input_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ControllerServer).Input(&controllerInputServer{stream}) +} + +type Controller_InputServer interface { + SendAndClose(*InputResponse) error + Recv() (*InputMessage, error) + grpc.ServerStream +} + +type controllerInputServer struct { + grpc.ServerStream +} + +func (x *controllerInputServer) SendAndClose(m *InputResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *controllerInputServer) Recv() (*InputMessage, error) { + m := new(InputMessage) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + func _Controller_ListProcesses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListProcessesRequest) if err := dec(in); err != nil { @@ -2564,25 +2716,29 @@ var _Controller_serviceDesc = grpc.ServiceDesc{ ServiceName: "buildx.controller.v1.Controller", HandlerType: (*ControllerServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "Info", + Handler: _Controller_Info_Handler, + }, { MethodName: "Build", Handler: _Controller_Build_Handler, }, { - MethodName: "Inspect", - Handler: _Controller_Inspect_Handler, - }, - { - MethodName: "List", - Handler: _Controller_List_Handler, + MethodName: "Finalize", + Handler: _Controller_Finalize_Handler, }, { MethodName: "Disconnect", Handler: _Controller_Disconnect_Handler, }, { - MethodName: "Info", - Handler: _Controller_Info_Handler, + MethodName: "Inspect", + Handler: _Controller_Inspect_Handler, + }, + { + MethodName: "List", + Handler: _Controller_List_Handler, }, { MethodName: "ListProcesses", @@ -2594,6 +2750,12 @@ var _Controller_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{ + { + StreamName: "Invoke", + Handler: _Controller_Invoke_Handler, + ServerStreams: true, + ClientStreams: true, + }, { StreamName: "Status", Handler: _Controller_Status_Handler, @@ -2604,12 +2766,6 @@ var _Controller_serviceDesc = grpc.ServiceDesc{ Handler: _Controller_Input_Handler, ClientStreams: true, }, - { - StreamName: "Invoke", - Handler: _Controller_Invoke_Handler, - ServerStreams: true, - ClientStreams: true, - }, }, Metadata: "controller.proto", } diff --git a/controller/pb/controller.proto b/controller/pb/controller.proto index 1d02c385..b141dc6e 100644 --- a/controller/pb/controller.proto +++ b/controller/pb/controller.proto @@ -7,14 +7,19 @@ import "github.com/moby/buildkit/api/services/control/control.proto"; option go_package = "pb"; service Controller { + rpc Info(InfoRequest) returns (InfoResponse); + rpc Build(BuildRequest) returns (BuildResponse); - rpc Inspect(InspectRequest) returns (InspectResponse); - rpc Status(StatusRequest) returns (stream StatusResponse); - rpc Input(stream InputMessage) returns (InputResponse); + rpc Finalize(FinalizeRequest) returns (FinalizeResponse); rpc Invoke(stream Message) returns (stream Message); - rpc List(ListRequest) returns (ListResponse); rpc Disconnect(DisconnectRequest) returns (DisconnectResponse); - rpc Info(InfoRequest) returns (InfoResponse); + rpc Status(StatusRequest) returns (stream StatusResponse); + + rpc Inspect(InspectRequest) returns (InspectResponse); + rpc List(ListRequest) returns (ListResponse); + + rpc Input(stream InputMessage) returns (InputResponse); + rpc ListProcesses(ListProcessesRequest) returns (ListProcessesResponse); rpc DisconnectProcess(DisconnectProcessRequest) returns (DisconnectProcessResponse); } @@ -48,7 +53,7 @@ message BuildRequest { message BuildOptions { string ContextPath = 1; string DockerfileName = 2; - string PrintFunc = 3; + PrintFunc PrintFunc = 3; map NamedContexts = 4; repeated string Allow = 5; @@ -78,6 +83,19 @@ message BuildOptions { bool ExportLoad = 28; } +message FinalizeRequest { + string Ref = 1; +} + +message FinalizeResponse { + map ExporterResponse = 1; +} + +message PrintFunc { + string Name = 1; + string Format = 2; +} + message ExportEntry { string Type = 1; map Attrs = 2; @@ -125,7 +143,6 @@ message Ulimit { } message BuildResponse { - map ExporterResponse = 1; } message DisconnectRequest { diff --git a/controller/remote/client.go b/controller/remote/client.go index b3b6c12b..6a173c97 100644 --- a/controller/remote/client.go +++ b/controller/remote/client.go @@ -113,49 +113,30 @@ func (c *Client) Inspect(ctx context.Context, ref string) (*pb.InspectResponse, return c.client().Inspect(ctx, &pb.InspectRequest{Ref: ref}) } -func (c *Client) Build(ctx context.Context, options pb.BuildOptions, in io.ReadCloser, progress progress.Writer) (string, *client.SolveResponse, error) { +func (c *Client) Build(ctx context.Context, options pb.BuildOptions, in io.ReadCloser, progress progress.Writer) (string, error) { ref := identity.NewID() - statusChan := make(chan *client.SolveStatus) - eg, egCtx := errgroup.WithContext(ctx) - var resp *client.SolveResponse - eg.Go(func() error { - defer close(statusChan) - var err error - resp, err = c.build(egCtx, ref, options, in, statusChan) - return err - }) - eg.Go(func() error { - for s := range statusChan { - st := s - progress.Write(st) - } - return nil - }) - return ref, resp, eg.Wait() + if err := c.build(ctx, ref, options, in, progress); err != nil { + return "", err + } + return ref, nil } -func (c *Client) build(ctx context.Context, ref string, options pb.BuildOptions, in io.ReadCloser, statusChan chan *client.SolveStatus) (*client.SolveResponse, error) { +func (c *Client) Finalize(ctx context.Context, ref string) (*client.SolveResponse, error) { + resp, err := c.client().Finalize(ctx, &pb.FinalizeRequest{Ref: ref}) + if err != nil { + return nil, err + } + return &client.SolveResponse{ + ExporterResponse: resp.ExporterResponse, + }, nil +} + +func (c *Client) build(ctx context.Context, ref string, options pb.BuildOptions, in io.ReadCloser, writer progress.Writer) error { eg, egCtx := errgroup.WithContext(ctx) done := make(chan struct{}) - var resp *client.SolveResponse - - eg.Go(func() error { - defer close(done) - pbResp, err := c.client().Build(egCtx, &pb.BuildRequest{ - Ref: ref, - Options: &options, - }) - if err != nil { - return err - } - resp = &client.SolveResponse{ - ExporterResponse: pbResp.ExporterResponse, - } - return nil - }) - eg.Go(func() error { - stream, err := c.client().Status(egCtx, &pb.StatusRequest{ + go func() error { + stream, err := c.client().Status(ctx, &pb.StatusRequest{ Ref: ref, }) if err != nil { @@ -169,8 +150,20 @@ func (c *Client) build(ctx context.Context, ref string, options pb.BuildOptions, } return errors.Wrap(err, "failed to receive status") } - statusChan <- pb.FromControlStatus(resp) + writer.Write(pb.FromControlStatus(resp)) + } + }() + + eg.Go(func() error { + defer close(done) + _, err := c.client().Build(egCtx, &pb.BuildRequest{ + Ref: ref, + Options: &options, + }) + if err != nil { + return err } + return nil }) if in != nil { eg.Go(func() error { @@ -232,7 +225,7 @@ func (c *Client) build(ctx context.Context, ref string, options pb.BuildOptions, return eg2.Wait() }) } - return resp, eg.Wait() + return eg.Wait() } func (c *Client) client() pb.ControllerClient { diff --git a/controller/remote/controller.go b/controller/remote/controller.go index 60aaa852..0ebdc36e 100644 --- a/controller/remote/controller.go +++ b/controller/remote/controller.go @@ -24,7 +24,6 @@ import ( "github.com/docker/buildx/util/progress" "github.com/docker/buildx/version" "github.com/docker/cli/cli/command" - "github.com/moby/buildkit/client" "github.com/moby/buildkit/util/grpcerrors" "github.com/pelletier/go-toml" "github.com/pkg/errors" @@ -143,8 +142,8 @@ func serveCmd(dockerCli command.Cli) *cobra.Command { }() // prepare server - b := NewServer(func(ctx context.Context, options *controllerapi.BuildOptions, stdin io.Reader, progress progress.Writer) (*client.SolveResponse, *build.ResultContext, error) { - return cbuild.RunBuild(ctx, dockerCli, *options, stdin, progress, true) + b := NewServer(func(ctx context.Context, options *controllerapi.BuildOptions, stdin io.Reader, progress progress.Writer) (*build.ResultContext, error) { + return cbuild.RunBuild(ctx, dockerCli, *options, stdin, progress) }) defer b.Close() diff --git a/controller/remote/server.go b/controller/remote/server.go index d89fc218..9fcfb4a3 100644 --- a/controller/remote/server.go +++ b/controller/remote/server.go @@ -4,7 +4,6 @@ import ( "context" "io" "sync" - "sync/atomic" "time" "github.com/docker/buildx/build" @@ -14,12 +13,11 @@ import ( "github.com/docker/buildx/util/ioset" "github.com/docker/buildx/util/progress" "github.com/docker/buildx/version" - "github.com/moby/buildkit/client" "github.com/pkg/errors" "golang.org/x/sync/errgroup" ) -type BuildFunc func(ctx context.Context, options *pb.BuildOptions, stdin io.Reader, progress progress.Writer) (resp *client.SolveResponse, res *build.ResultContext, err error) +type BuildFunc func(ctx context.Context, options *pb.BuildOptions, stdin io.Reader, progress progress.Writer) (res *build.ResultContext, err error) func NewServer(buildFunc BuildFunc) *Server { return &Server{ @@ -34,7 +32,6 @@ type Server struct { } type session struct { - buildOnGoing atomic.Bool statusChan chan *pb.StatusResponse cancelBuild func() buildOptions *pb.BuildOptions @@ -101,28 +98,6 @@ func (m *Server) List(ctx context.Context, req *pb.ListRequest) (res *pb.ListRes }, nil } -func (m *Server) Disconnect(ctx context.Context, req *pb.DisconnectRequest) (res *pb.DisconnectResponse, err error) { - key := req.Ref - if key == "" { - return nil, errors.New("disconnect: empty key") - } - - m.sessionMu.Lock() - if s, ok := m.session[key]; ok { - if s.cancelBuild != nil { - s.cancelBuild() - } - s.cancelRunningProcesses() - if s.result != nil { - s.result.Done() - } - } - delete(m.session, key) - m.sessionMu.Unlock() - - return &pb.DisconnectResponse{}, nil -} - func (m *Server) Close() error { m.sessionMu.Lock() for k := range m.session { @@ -167,15 +142,10 @@ func (m *Server) Build(ctx context.Context, req *pb.BuildRequest) (*pb.BuildResp } s, ok := m.session[ref] if ok { - if !s.buildOnGoing.CompareAndSwap(false, true) { - m.sessionMu.Unlock() - return &pb.BuildResponse{}, errors.New("build ongoing") - } s.cancelRunningProcesses() s.result = nil } else { s = &session{} - s.buildOnGoing.Store(true) } s.processes = processes.NewManager() @@ -186,33 +156,24 @@ func (m *Server) Build(ctx context.Context, req *pb.BuildRequest) (*pb.BuildResp s.inputPipe = inW m.session[ref] = s m.sessionMu.Unlock() - defer func() { - close(statusChan) - m.sessionMu.Lock() - s, ok := m.session[ref] - if ok { - s.statusChan = nil - s.buildOnGoing.Store(false) - } - m.sessionMu.Unlock() - }() pw := pb.NewProgressWriter(statusChan) // Build the specified request ctx, cancel := context.WithCancel(ctx) defer cancel() - resp, res, buildErr := m.buildFunc(ctx, req.Options, inR, pw) + res, err := m.buildFunc(ctx, req.Options, inR, pw) m.sessionMu.Lock() if s, ok := m.session[ref]; ok { - // NOTE: buildFunc can return *build.ResultContext even on error (e.g. when it's implemented using (github.com/docker/buildx/controller/build).RunBuild). if res != nil { s.result = res s.cancelBuild = cancel s.buildOptions = req.Options m.session[ref] = s + + _, buildErr := s.result.Result(ctx) if buildErr != nil { - buildErr = controllererrors.WrapBuild(buildErr, ref) + err = controllererrors.WrapBuild(buildErr, ref) } } } else { @@ -221,18 +182,69 @@ func (m *Server) Build(ctx context.Context, req *pb.BuildRequest) (*pb.BuildResp } m.sessionMu.Unlock() - if buildErr != nil { - return nil, buildErr + if err != nil { + return nil, err + } + + return &pb.BuildResponse{}, nil +} + +func (m *Server) Finalize(ctx context.Context, req *pb.FinalizeRequest) (*pb.FinalizeResponse, error) { + key := req.Ref + if key == "" { + return nil, errors.New("finalize: empty key") } - if resp == nil { - resp = &client.SolveResponse{} + m.sessionMu.Lock() + defer m.sessionMu.Unlock() + + s, ok := m.session[key] + if !ok { + return nil, errors.Errorf("unknown ref %q", key) + } + if s.result == nil { + return nil, errors.Errorf("no build ongoing for %q", key) + } + resp, err := s.result.Wait(ctx) + if err != nil { + return nil, err + } + if s.cancelBuild != nil { + s.cancelBuild() } - return &pb.BuildResponse{ + s.cancelRunningProcesses() + close(s.statusChan) + delete(m.session, key) + + return &pb.FinalizeResponse{ ExporterResponse: resp.ExporterResponse, }, nil } +func (m *Server) Disconnect(ctx context.Context, req *pb.DisconnectRequest) (res *pb.DisconnectResponse, err error) { + key := req.Ref + if key == "" { + return nil, errors.New("disconnect: empty key") + } + + m.sessionMu.Lock() + defer m.sessionMu.Unlock() + + if s, ok := m.session[key]; ok { + if s.cancelBuild != nil { + s.cancelBuild() + } + close(s.statusChan) + s.cancelRunningProcesses() + if s.result != nil { + s.result.Close() + } + } + delete(m.session, key) + + return &pb.DisconnectResponse{}, nil +} + func (m *Server) Status(req *pb.StatusRequest, stream pb.Controller_StatusServer) error { ref := req.Ref if ref == "" { diff --git a/monitor/monitor.go b/monitor/monitor.go index d727d241..995f16ea 100644 --- a/monitor/monitor.go +++ b/monitor/monitor.go @@ -38,11 +38,6 @@ Available commands are: // RunMonitor provides an interactive session for running and managing containers via specified IO. func RunMonitor(ctx context.Context, curRef string, options *controllerapi.BuildOptions, invokeConfig controllerapi.InvokeConfig, c control.BuildxController, stdin io.ReadCloser, stdout io.WriteCloser, stderr console.File, progress progress.Writer) error { - defer func() { - if err := c.Disconnect(ctx, curRef); err != nil { - logrus.Warnf("disconnect error: %v", err) - } - }() monitorIn, monitorOut := ioset.Pipe() defer func() { monitorIn.Close() @@ -146,7 +141,7 @@ func RunMonitor(ctx context.Context, curRef string, options *controllerapi.Build } } var resultUpdated bool - ref, _, err := c.Build(ctx, *bo, nil, progress) // TODO: support stdin, hold build ref + ref, err := c.Build(ctx, *bo, nil, progress) // TODO: support stdin, hold build ref if err != nil { var be *controllererrors.BuildError if errors.As(err, &be) { diff --git a/util/progress/printer.go b/util/progress/printer.go index 14adfca8..8dbbaaba 100644 --- a/util/progress/printer.go +++ b/util/progress/printer.go @@ -29,6 +29,7 @@ type Printer struct { warnings []client.VertexWarning logMu sync.Mutex logSourceMap map[digest.Digest]interface{} + paused *bool } func (p *Printer) Wait() error { @@ -45,6 +46,10 @@ func (p *Printer) Warnings() []client.VertexWarning { return p.warnings } +func (p *Printer) Pause(v bool) { + *p.paused = v +} + func (p *Printer) ValidateLogSource(dgst digest.Digest, v interface{}) bool { p.logMu.Lock() defer p.logMu.Unlock() @@ -74,10 +79,12 @@ func NewPrinter(ctx context.Context, w io.Writer, out console.File, mode string, statusCh := make(chan *client.SolveStatus) doneCh := make(chan struct{}) + paused := false pw := &Printer{ status: statusCh, done: doneCh, logSourceMap: map[digest.Digest]interface{}{}, + paused: &paused, } if v := os.Getenv("BUILDKIT_PROGRESS"); v != "" && mode == PrinterModeAuto { @@ -101,7 +108,7 @@ func NewPrinter(ctx context.Context, w io.Writer, out console.File, mode string, go func() { resumeLogs := logutil.Pause(logrus.StandardLogger()) // not using shared context to not disrupt display but let is finish reporting errors - pw.warnings, pw.err = progressui.DisplaySolveStatus(ctx, c, w, statusCh, solveStatusOpt...) + pw.warnings, pw.err = progressui.DisplaySolveStatus(ctx, c, w, statusCh, pw.paused, solveStatusOpt...) resumeLogs() close(doneCh) }() diff --git a/vendor/github.com/moby/buildkit/util/progress/progressui/display.go b/vendor/github.com/moby/buildkit/util/progress/progressui/display.go index 5ba588c1..b5adfde4 100644 --- a/vendor/github.com/moby/buildkit/util/progress/progressui/display.go +++ b/vendor/github.com/moby/buildkit/util/progress/progressui/display.go @@ -42,7 +42,7 @@ func WithDesc(text string, console string) DisplaySolveStatusOpt { } } -func DisplaySolveStatus(ctx context.Context, c console.Console, w io.Writer, ch chan *client.SolveStatus, opts ...DisplaySolveStatusOpt) ([]client.VertexWarning, error) { +func DisplaySolveStatus(ctx context.Context, c console.Console, w io.Writer, ch chan *client.SolveStatus, paused *bool, opts ...DisplaySolveStatusOpt) ([]client.VertexWarning, error) { modeConsole := c != nil dsso := &displaySolveStatusOpts{} @@ -78,6 +78,11 @@ func DisplaySolveStatus(ctx context.Context, c console.Console, w io.Writer, ch displayLimiter := rate.NewLimiter(rate.Every(displayTimeout), 1) + ispaused := false + if paused != nil { + ispaused = *paused + } + var height int width, _ := disp.getSize() for { @@ -93,6 +98,10 @@ func DisplaySolveStatus(ctx context.Context, c console.Console, w io.Writer, ch } } + if paused != nil && *paused && ispaused { + continue + } + if modeConsole { width, height = disp.getSize() if done { @@ -115,6 +124,10 @@ func DisplaySolveStatus(ctx context.Context, c console.Console, w io.Writer, ch ticker = time.NewTicker(tickerTimeout) } } + + if paused != nil { + ispaused = *paused + } } } diff --git a/vendor/github.com/moby/buildkit/util/progress/progresswriter/printer.go b/vendor/github.com/moby/buildkit/util/progress/progresswriter/printer.go index c400e412..2b43c450 100644 --- a/vendor/github.com/moby/buildkit/util/progress/progresswriter/printer.go +++ b/vendor/github.com/moby/buildkit/util/progress/progresswriter/printer.go @@ -87,7 +87,7 @@ func NewPrinter(ctx context.Context, out console.File, mode string) (Writer, err go func() { // not using shared context to not disrupt display but let is finish reporting errors - _, pw.err = progressui.DisplaySolveStatus(ctx, c, out, statusCh) + _, pw.err = progressui.DisplaySolveStatus(ctx, c, out, statusCh, nil) close(doneCh) }() return pw, nil