2017-08-25 20:08:18 +00:00
|
|
|
package frontend
|
|
|
|
|
|
|
|
import (
|
2017-10-01 00:58:07 +00:00
|
|
|
"io"
|
2017-10-02 04:59:34 +00:00
|
|
|
|
|
|
|
"github.com/moby/buildkit/cache"
|
|
|
|
"github.com/moby/buildkit/solver/pb"
|
2017-10-01 00:58:07 +00:00
|
|
|
"github.com/moby/buildkit/worker"
|
|
|
|
digest "github.com/opencontainers/go-digest"
|
|
|
|
"golang.org/x/net/context"
|
2017-08-25 20:08:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Frontend interface {
|
2017-10-03 06:33:25 +00:00
|
|
|
Solve(ctx context.Context, llb FrontendLLBBridge, opt map[string]string) (cache.ImmutableRef, map[string][]byte, error)
|
2017-08-25 20:08:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type FrontendLLBBridge interface {
|
2017-10-05 05:31:18 +00:00
|
|
|
Solve(ctx context.Context, req SolveRequest) (cache.ImmutableRef, map[string][]byte, error)
|
2017-09-22 22:49:37 +00:00
|
|
|
ResolveImageConfig(ctx context.Context, ref string) (digest.Digest, []byte, error)
|
2017-10-01 00:58:07 +00:00
|
|
|
Exec(ctx context.Context, meta worker.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 {
|
|
|
|
Definition *pb.Definition
|
|
|
|
Frontend string
|
|
|
|
FrontendOpt map[string]string
|
|
|
|
}
|