package base

import "github.com/moby/buildkit/worker/base"

Index

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
	CacheMgr      cache.Manager
	SourceManager *source.Manager

	ImageSource *containerimage.Source
	// contains filtered or unexported fields
}

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

func NewWorker

func NewWorker(ctx context.Context, opt WorkerOpt) (*Worker, error)

NewWorker instantiates a local worker

func (*Worker) CacheManager

func (w *Worker) CacheManager() cache.Manager

func (*Worker) ContentStore

func (w *Worker) ContentStore() content.Store

func (*Worker) DiskUsage

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

func (*Worker) Executor

func (w *Worker) Executor() executor.Executor

func (*Worker) Exporter

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

func (*Worker) FromRemote

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

func (*Worker) GCPolicy

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

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(ctx context.Context, id string, hidden bool) (cache.ImmutableRef, error)

func (*Worker) MetadataStore

func (w *Worker) MetadataStore() *metadata.Store

func (*Worker) Platforms

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

func (*Worker) Prune

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

func (*Worker) PruneCacheMounts

func (w *Worker) PruneCacheMounts(ctx context.Context, ids []string) error

func (*Worker) ResolveImageConfig

func (w *Worker) ResolveImageConfig(ctx context.Context, ref string, opt llb.ResolveImageConfigOpt, sm *session.Manager, g session.Group) (digest.Digest, []byte, error)

func (*Worker) ResolveOp

type WorkerOpt

type WorkerOpt struct {
	ID              string
	Labels          map[string]string
	Platforms       []specs.Platform
	GCPolicy        []client.PruneInfo
	MetadataStore   *metadata.Store
	Executor        executor.Executor
	Snapshotter     snapshot.Snapshotter
	ContentStore    content.Store
	Applier         diff.Applier
	Differ          diff.Comparer
	ImageStore      images.Store // optional
	RegistryHosts   docker.RegistryHosts
	IdentityMapping *idtools.IdentityMapping
	LeaseManager    leases.Manager
	GarbageCollect  func(context.Context) (gc.Stats, error)
	ParallelismSem  *semaphore.Weighted
}

WorkerOpt is specific to a worker. See also CommonOpt.

Source Files

worker.go

Version
v0.9.3
Published
Nov 18, 2021
Platform
js/wasm
Imports
50 packages
Last checked
1 minute ago

Tools for package owners.