base

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 59 Imported by: 125

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,

Types

type Worker

type Worker struct {
	WorkerOpt
	CacheMgr      cache.Manager
	SourceManager *source.Manager

	ImageSource     *containerimage.Source
	OCILayoutSource *containerimage.Source
	GitSource       *git.Source
	HTTPSource      *http.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) BuildkitVersion added in v0.11.0

func (w *Worker) BuildkitVersion() client.BuildkitVersion

func (*Worker) CDIManager added in v0.20.0

func (w *Worker) CDIManager() *cdidevices.Manager

func (*Worker) CacheManager

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

func (*Worker) Close added in v0.11.0

func (w *Worker) Close() error

func (*Worker) ContentStore added in v0.7.0

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

func (*Worker) DiskUsage

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

func (*Worker) Executor added in v0.8.0

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) GarbageCollect added in v0.18.0

func (w *Worker) GarbageCollect(ctx context.Context) error

func (*Worker) ID

func (w *Worker) ID() string

func (*Worker) Labels

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

func (*Worker) LeaseManager added in v0.11.0

func (w *Worker) LeaseManager() *leaseutil.Manager

func (*Worker) LoadRef

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

func (*Worker) ParseSource added in v0.32.0

func (w *Worker) ParseSource(op *pb.SourceOp, platform *pb.Platform) (source.Identifier, error)

func (*Worker) Platforms

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

func (*Worker) Prune

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

func (*Worker) PruneCacheMounts added in v0.6.0

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

func (*Worker) ResolveOp

func (w *Worker) ResolveOp(v solver.Vertex, s frontend.FrontendLLBBridge, sm *session.Manager, proxyOpt worker.ProxyOpt) (solver.Op, error)

func (*Worker) ResolveSourceMetadata added in v0.13.0

func (w *Worker) ResolveSourceMetadata(ctx context.Context, op *pb.SourceOp, opt sourceresolver.Opt, sm *session.Manager, jobCtx solver.JobContext) (*sourceresolver.MetaResponse, error)

type WorkerOpt

type WorkerOpt struct {
	ID                   string
	Root                 string
	Labels               map[string]string
	Platforms            []ocispecs.Platform
	GCPolicy             []client.PruneInfo
	BuildkitVersion      client.BuildkitVersion
	NetworkProviders     map[pb.NetMode]network.Provider
	ProxyProvider        network.ProxyProvider
	Executor             executor.Executor
	Snapshotter          snapshot.Snapshotter
	ContentStore         *containerdsnapshot.Store
	Applier              diff.Applier
	Differ               diff.Comparer
	ImageStore           images.Store // optional
	RegistryHosts        docker.RegistryHosts
	IdentityMapping      *user.IdentityMapping
	LeaseManager         *leaseutil.Manager
	GarbageCollect       func(context.Context) (gc.Stats, error)
	ParallelismSem       *semaphore.Weighted
	MetadataStore        *metadata.Store
	ContentMetadata      io.Closer
	MountPoolRoot        string
	ResourceMonitor      *resources.Monitor
	CDIManager           *cdidevices.Manager
	UseCommonSnapshotIDs bool
}

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