worker

package
v1.4.2-0...-d912e94 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2018 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt struct {
	ID                string
	Labels            map[string]string
	SessionManager    *session.Manager
	MetadataStore     *metadata.Store
	Executor          executor.Executor
	Snapshotter       snapshot.Snapshotter
	ContentStore      content.Store
	CacheManager      cache.Manager
	ImageSource       source.Source
	Exporters         map[string]exporter.Exporter
	DownloadManager   distribution.RootFSDownloadManager
	V2MetadataService distmetadata.V2MetadataService
	Transport         nethttp.RoundTripper
}

Opt defines a structure for creating a worker.

type Worker

type Worker struct {
	Opt
	SourceManager *source.Manager
}

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

func NewWorker

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

NewWorker instantiates a local worker

func (*Worker) DiskUsage

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

DiskUsage returns disk usage report

func (*Worker) Exec

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

Exec executes a process directly on a worker

func (*Worker) Exporter

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

Exporter returns exporter by name

func (*Worker) FromRemote

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

FromRemote converts a remote snapshot reference to a local one

func (*Worker) GetRemote

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

GetRemote returns a remote snapshot reference for a local one

func (*Worker) ID

func (w *Worker) ID() string

ID returns worker ID

func (*Worker) Labels

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

Labels returns map of all worker labels

func (*Worker) LoadRef

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

LoadRef loads a reference by ID

func (*Worker) Platforms

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

Platforms returns one or more platforms supported by the image.

func (*Worker) Prune

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

Prune deletes reclaimable build cache

func (*Worker) ResolveImageConfig

func (w *Worker) ResolveImageConfig(ctx context.Context, ref string, platform *ocispec.Platform) (digest.Digest, []byte, error)

ResolveImageConfig returns image config for an image

func (*Worker) ResolveOp

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

ResolveOp converts a LLB vertex into a LLB operation

Jump to

Keyboard shortcuts

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