2017-06-01 22:24:23 +00:00
|
|
|
package worker
|
|
|
|
|
|
|
|
import (
|
2017-12-15 08:06:54 +00:00
|
|
|
"io"
|
|
|
|
|
2017-06-22 20:15:46 +00:00
|
|
|
"github.com/moby/buildkit/cache"
|
2017-11-21 08:08:36 +00:00
|
|
|
"github.com/moby/buildkit/cache/instructioncache"
|
|
|
|
"github.com/moby/buildkit/client"
|
|
|
|
"github.com/moby/buildkit/executor"
|
|
|
|
"github.com/moby/buildkit/exporter"
|
2017-12-15 08:06:54 +00:00
|
|
|
"github.com/moby/buildkit/solver/types"
|
|
|
|
digest "github.com/opencontainers/go-digest"
|
|
|
|
"golang.org/x/net/context"
|
2017-06-01 22:24:23 +00:00
|
|
|
)
|
|
|
|
|
2017-12-15 08:06:54 +00:00
|
|
|
type SubBuilder interface {
|
|
|
|
SubBuild(ctx context.Context, dgst digest.Digest, req types.SolveRequest) (types.Ref, error)
|
2017-07-11 02:07:47 +00:00
|
|
|
}
|
|
|
|
|
2017-12-15 08:06:54 +00:00
|
|
|
type Worker interface {
|
|
|
|
InstructionCache() instructioncache.InstructionCache
|
2017-12-19 04:20:30 +00:00
|
|
|
// ResolveOp resolves Vertex.Sys() to Op implementation. SubBuilder is needed for pb.Op_Build.
|
|
|
|
ResolveOp(v types.Vertex, s SubBuilder) (types.Op, error)
|
2017-12-15 08:06:54 +00:00
|
|
|
ResolveImageConfig(ctx context.Context, ref string) (digest.Digest, []byte, error)
|
2017-12-15 10:51:06 +00:00
|
|
|
// Exec is similar to executor.Exec but without []mount.Mount
|
2017-12-15 08:06:54 +00:00
|
|
|
Exec(ctx context.Context, meta executor.Meta, rootFS cache.ImmutableRef, stdin io.ReadCloser, stdout, stderr io.WriteCloser) error
|
|
|
|
DiskUsage(ctx context.Context, opt client.DiskUsageInfo) ([]*client.UsageInfo, error)
|
|
|
|
Name() string
|
|
|
|
Exporter(name string) (exporter.Exporter, error)
|
2017-06-01 22:24:23 +00:00
|
|
|
}
|