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"
|
2018-06-30 01:35:39 +00:00
|
|
|
"github.com/moby/buildkit/client"
|
2017-11-21 08:08:36 +00:00
|
|
|
"github.com/moby/buildkit/executor"
|
2018-07-05 23:32:01 +00:00
|
|
|
gatewayclient "github.com/moby/buildkit/frontend/gateway/client"
|
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-07-11 23:51:41 +00:00
|
|
|
Solve(ctx context.Context, llb FrontendLLBBridge, opt map[string]string) (*Result, error)
|
2017-08-25 20:08:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type FrontendLLBBridge interface {
|
2018-07-11 23:51:41 +00:00
|
|
|
Solve(ctx context.Context, req SolveRequest) (*Result, 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
|
|
|
|
2018-07-05 23:32:01 +00:00
|
|
|
type SolveRequest = gatewayclient.SolveRequest
|
2018-06-30 01:35:39 +00:00
|
|
|
|
|
|
|
type WorkerInfos interface {
|
|
|
|
WorkerInfos() []client.WorkerInfo
|
|
|
|
}
|