2017-08-25 20:08:18 +00:00
|
|
|
package frontend
|
|
|
|
|
|
|
|
import (
|
2018-01-16 22:30:10 +00:00
|
|
|
"context"
|
2017-10-01 00:58:07 +00:00
|
|
|
"io"
|
2017-10-02 04:59:34 +00:00
|
|
|
|
|
|
|
"github.com/moby/buildkit/cache"
|
2017-11-21 08:08:36 +00:00
|
|
|
"github.com/moby/buildkit/executor"
|
2018-05-11 05:58:41 +00:00
|
|
|
"github.com/moby/buildkit/solver"
|
2017-10-02 04:59:34 +00:00
|
|
|
"github.com/moby/buildkit/solver/pb"
|
2017-10-01 00:58:07 +00:00
|
|
|
digest "github.com/opencontainers/go-digest"
|
2018-06-24 05:52:19 +00:00
|
|
|
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
2017-08-25 20:08:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Frontend interface {
|
2018-04-13 21:13:48 +00:00
|
|
|
Solve(ctx context.Context, llb FrontendLLBBridge, opt map[string]string) (solver.CachedResult, map[string][]byte, error)
|
2017-08-25 20:08:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type FrontendLLBBridge interface {
|
2018-04-13 21:13:48 +00:00
|
|
|
Solve(ctx context.Context, req SolveRequest) (solver.CachedResult, map[string][]byte, error)
|
2018-06-24 05:52:19 +00:00
|
|
|
ResolveImageConfig(ctx context.Context, ref string, platform *specs.Platform) (digest.Digest, []byte, error)
|
2017-11-21 08:08:36 +00:00
|
|
|
Exec(ctx context.Context, meta executor.Meta, rootfs cache.ImmutableRef, stdin io.ReadCloser, stdout, stderr io.WriteCloser) error
|
2017-08-25 20:08:18 +00:00
|
|
|
}
|
2017-10-05 05:31:18 +00:00
|
|
|
|
|
|
|
type SolveRequest struct {
|
2018-04-25 17:49:15 +00:00
|
|
|
Definition *pb.Definition
|
|
|
|
Frontend string
|
|
|
|
FrontendOpt map[string]string
|
2018-07-03 09:59:33 +00:00
|
|
|
ImportCacheRefs []string // TODO: map[string]string for supporting non-registry ref?
|
2017-10-05 05:31:18 +00:00
|
|
|
}
|