worker

package
v0.0.0-...-3940458 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelExecutor    = labelPrefix + "executor"    // "oci" or "containerd"
	LabelSnapshotter = labelPrefix + "snapshotter" // containerd snapshotter name ("overlay", "native", ...)
	LabelHostname    = labelPrefix + "hostname"
)

Pre-defined label keys

Variables

This section is empty.

Functions

func NewCacheResultStorage

func NewCacheResultStorage(wc *Controller) solver.CacheResultStorage

func NewWorkerRefResult

func NewWorkerRefResult(ref cache.ImmutableRef, worker Worker) solver.Result

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller holds worker instances. Currently, only local workers are supported.

func (*Controller) Add

func (c *Controller) Add(w Worker) error

Add adds a local worker

func (*Controller) Get

func (c *Controller) Get(id string) (Worker, error)

func (*Controller) GetDefault

func (c *Controller) GetDefault() (Worker, error)

GetDefault returns the default local worker

func (*Controller) List

func (c *Controller) List(filterStrings ...string) ([]Worker, error)

List lists workers

func (*Controller) WorkerInfos

func (c *Controller) WorkerInfos() []client.WorkerInfo

type Worker

type Worker interface {
	// ID needs to be unique in the cluster
	ID() string
	Labels() map[string]string
	Platforms() []specs.Platform
	GCPolicy() []client.PruneInfo
	LoadRef(id string, hidden bool) (cache.ImmutableRef, error)
	// ResolveOp resolves Vertex.Sys() to Op implementation.
	ResolveOp(v solver.Vertex, s frontend.FrontendLLBBridge) (solver.Op, error)
	ResolveImageConfig(ctx context.Context, ref string, opt gw.ResolveImageConfigOpt) (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)
	Exporter(name string) (exporter.Exporter, error)
	Prune(ctx context.Context, ch chan client.UsageInfo, opt ...client.PruneInfo) error
	GetRemote(ctx context.Context, ref cache.ImmutableRef, createIfNeeded bool) (*solver.Remote, error)
	FromRemote(ctx context.Context, remote *solver.Remote) (cache.ImmutableRef, error)
}

type WorkerRef

type WorkerRef struct {
	ImmutableRef cache.ImmutableRef
	Worker       Worker
}

func (*WorkerRef) ID

func (wr *WorkerRef) ID() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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