base

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2018 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ID

func ID(root string) (string, error)

ID reads the worker id from the `workerid` file. If not exist, it creates a random one,

func Labels

func Labels(executor, snapshotter string) map[string]string

Labels returns default labels utility function. could be moved to the constructor logic?

Types

type Worker

type Worker struct {
	WorkerOpt
	CacheManager  cache.Manager
	SourceManager *source.Manager
	Exporters     map[string]exporter.Exporter
	ImageSource   source.Source
}

Worker is a local worker instance with dedicated snapshotter, cache, and so on. TODO: s/Worker/OpWorker/g ?

func NewWorker

func NewWorker(opt WorkerOpt) (*Worker, error)

NewWorker instantiates a local worker

func (*Worker) DiskUsage

func (w *Worker) DiskUsage(ctx context.Context, opt client.DiskUsageInfo) ([]*client.UsageInfo, error)

func (*Worker) Exec

func (w *Worker) Exec(ctx context.Context, meta executor.Meta, rootFS cache.ImmutableRef, stdin io.ReadCloser, stdout, stderr io.WriteCloser) error

func (*Worker) Exporter

func (w *Worker) Exporter(name string) (exporter.Exporter, error)

func (*Worker) FromRemote

func (w *Worker) FromRemote(ctx context.Context, remote *solver.Remote) (cache.ImmutableRef, error)

func (*Worker) GCPolicy

func (w *Worker) GCPolicy() []client.PruneInfo

func (*Worker) GetRemote

func (w *Worker) GetRemote(ctx context.Context, ref cache.ImmutableRef, createIfNeeded bool) (*solver.Remote, error)

func (*Worker) ID

func (w *Worker) ID() string

func (*Worker) Labels

func (w *Worker) Labels() map[string]string

func (*Worker) LoadRef

func (w *Worker) LoadRef(id string, hidden bool) (cache.ImmutableRef, error)

func (*Worker) Platforms

func (w *Worker) Platforms() []specs.Platform

func (*Worker) Prune

func (w *Worker) Prune(ctx context.Context, ch chan client.UsageInfo, opt ...client.PruneInfo) error

func (*Worker) ResolveImageConfig

func (w *Worker) ResolveImageConfig(ctx context.Context, ref string, opt gw.ResolveImageConfigOpt) (digest.Digest, []byte, error)

func (*Worker) ResolveOp

func (w *Worker) ResolveOp(v solver.Vertex, s frontend.FrontendLLBBridge) (solver.Op, error)

type WorkerOpt

type WorkerOpt struct {
	ID                 string
	Labels             map[string]string
	Platforms          []specs.Platform
	GCPolicy           []client.PruneInfo
	SessionManager     *session.Manager
	MetadataStore      *metadata.Store
	Executor           executor.Executor
	Snapshotter        snapshot.Snapshotter
	ContentStore       content.Store
	Applier            diff.Applier
	Differ             diff.Comparer
	ImageStore         images.Store // optional
	ResolveOptionsFunc resolver.ResolveOptionsFunc
}

WorkerOpt is specific to a worker. See also CommonOpt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL