solver, worker: minor cleanup
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>docker-18.09
parent
efde4f2340
commit
21bebaea80
|
@ -29,7 +29,7 @@ func NewLLBOpSolver(opt LLBOpt) *Solver {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return w.Resolve(v, s)
|
||||
return w.ResolveVertex(v, s)
|
||||
}, opt.WorkerController, determineVertexWorker, opt.Frontends, opt.CacheExporter, opt.CacheImporter)
|
||||
return s
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ func NewWorker(opt WorkerOpt) (*Worker, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (w *Worker) Resolve(v solver.Vertex, s worker.SubBuilder) (solver.Op, error) {
|
||||
func (w *Worker) ResolveVertex(v solver.Vertex, s worker.SubBuilder) (solver.Op, error) {
|
||||
switch op := v.Sys().(type) {
|
||||
case *pb.Op_Source:
|
||||
return llbop.NewSourceOp(v, op, w.SourceManager)
|
||||
|
|
|
@ -13,30 +13,16 @@ import (
|
|||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// Worker is a local worker instance with dedicated snapshotter, cache, and so on.
|
||||
// TODO: s/Worker/OpWorker/g ?
|
||||
// FIXME: Worker should be rather an interface
|
||||
// type Worker struct {
|
||||
// WorkerOpt
|
||||
// Snapshotter ctdsnapshot.Snapshotter // blobmapping snapshotter
|
||||
// CacheManager cache.Manager
|
||||
// SourceManager *source.Manager
|
||||
// InstructionCache instructioncache.InstructionCache
|
||||
// Exporters map[string]exporter.Exporter
|
||||
// ImageSource source.Source
|
||||
// CacheExporter *cacheimport.CacheExporter
|
||||
// CacheImporter *cacheimport.CacheImporter
|
||||
// // no frontend here
|
||||
// }
|
||||
|
||||
type SubBuilder interface {
|
||||
SubBuild(ctx context.Context, dgst digest.Digest, req types.SolveRequest) (types.Ref, error)
|
||||
}
|
||||
|
||||
type Worker interface {
|
||||
InstructionCache() instructioncache.InstructionCache
|
||||
Resolve(v types.Vertex, s SubBuilder) (types.Op, error)
|
||||
// ResolveVertex resolves Vertex.Sys() to Op implementation. SubBuilder is needed for pb.Op_Build.
|
||||
ResolveVertex(v types.Vertex, s SubBuilder) (types.Op, error)
|
||||
ResolveImageConfig(ctx context.Context, ref string) (digest.Digest, []byte, error)
|
||||
// Exec is similar to executor.Exec but without []mount.Mount
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue