llbsolver

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 68 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBuildConfig added in v0.12.0

func Load

func Load(ctx context.Context, def *pb.Definition, polEngine SourcePolicyEvaluator, opts ...LoadOpt) (solver.Edge, error)

Types

type Attestation added in v0.11.0

type Attestation = frontend.Attestation

type ExporterRequest

type ExporterRequest struct {
	Type           string
	Attrs          map[string]string
	Exporters      []exporter.ExporterInstance
	CacheExporters []RemoteCacheExporter
}

type HistoryQueue added in v0.11.0

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

func NewHistoryQueue added in v0.11.0

func NewHistoryQueue(opt HistoryQueueOpt) (*HistoryQueue, error)

func (*HistoryQueue) Delete added in v0.11.0

func (h *HistoryQueue) Delete(ctx context.Context, ref string) error

func (*HistoryQueue) ImportStatus added in v0.11.0

func (h *HistoryQueue) ImportStatus(ctx context.Context, ch chan *client.SolveStatus) (_ *StatusImportResult, _ func(), err error)

func (*HistoryQueue) Listen added in v0.11.0

func (*HistoryQueue) OpenBlobWriter added in v0.11.0

func (h *HistoryQueue) OpenBlobWriter(ctx context.Context, mt string) (_ *Writer, err error)

func (*HistoryQueue) Status added in v0.11.0

func (h *HistoryQueue) Status(ctx context.Context, ref string, st chan<- *client.SolveStatus) error

func (*HistoryQueue) Update added in v0.11.0

func (*HistoryQueue) UpdateRef added in v0.11.0

func (h *HistoryQueue) UpdateRef(ctx context.Context, ref string, upt func(r *controlapi.BuildHistoryRecord) error) error

type HistoryQueueOpt added in v0.11.0

type HistoryQueueOpt struct {
	DB           *bolt.DB
	LeaseManager *leaseutil.Manager
	ContentStore *containerdsnapshot.Store
	CleanConfig  *config.HistoryConfig
}

type LoadOpt

type LoadOpt func(*pb.Op, *pb.OpMetadata, *solver.VertexOptions) error

func NormalizeRuntimePlatforms added in v0.8.0

func NormalizeRuntimePlatforms() LoadOpt

func ValidateEntitlements

func ValidateEntitlements(ent entitlements.Set) LoadOpt

func WithCacheSources

func WithCacheSources(cms []solver.CacheManager) LoadOpt

func WithValidateCaps

func WithValidateCaps() LoadOpt

type Opt added in v0.11.0

type Opt struct {
	CacheManager     solver.CacheManager
	CacheResolvers   map[string]remotecache.ResolveCacheImporterFunc
	Entitlements     []string
	Frontends        map[string]frontend.Frontend
	GatewayForwarder *controlgateway.GatewayForwarder
	SessionManager   *session.Manager
	WorkerController *worker.Controller
	HistoryQueue     *HistoryQueue
	ResourceMonitor  *resources.Monitor
}

Opt defines options for new Solver.

type Processor added in v0.11.0

type Processor func(ctx context.Context, result *Result, s *Solver, j *solver.Job, usage *resources.SysSampler) (*Result, error)

Processor defines a processing function to be applied after solving, but before exporting

type ProvenanceCreator added in v0.11.0

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

func NewProvenanceCreator added in v0.11.0

func NewProvenanceCreator(ctx context.Context, cp *provenance.Capture, res solver.ResultProxy, attrs map[string]string, j *solver.Job, usage *resources.SysSampler) (*ProvenanceCreator, error)

func (*ProvenanceCreator) Predicate added in v0.11.0

type RemoteCacheExporter added in v0.11.0

type RemoteCacheExporter struct {
	remotecache.Exporter
	solver.CacheExportMode
	IgnoreError bool
}

type ResolveWorkerFunc

type ResolveWorkerFunc func() (worker.Worker, error)

ResolveWorkerFunc returns default worker for the temporary default non-distributed use cases

type Result added in v0.11.0

type Result struct {
	*frontend.Result
	Provenance *provenance.Result
}

type Solver

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

func New

func New(opt Opt) (*Solver, error)

func (*Solver) Bridge

func (*Solver) Close added in v0.13.0

func (s *Solver) Close() error

func (*Solver) Solve

func (s *Solver) Solve(ctx context.Context, id string, sessionID string, req frontend.SolveRequest, exp ExporterRequest, ent []entitlements.Entitlement, post []Processor, internal bool, srcPol *spb.Policy) (_ *client.SolveResponse, err error)

func (*Solver) Status

func (s *Solver) Status(ctx context.Context, id string, statusChan chan *client.SolveStatus) error

type SourcePolicyEvaluator added in v0.11.0

type SourcePolicyEvaluator interface {
	Evaluate(ctx context.Context, op *pb.SourceOp) (bool, error)
}

type StatusImportResult added in v0.11.0

type StatusImportResult struct {
	Descriptor        ocispecs.Descriptor
	NumCachedSteps    int
	NumCompletedSteps int
	NumTotalSteps     int
}

type Writer added in v0.11.0

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

func (*Writer) Commit added in v0.11.0

func (w *Writer) Commit(ctx context.Context) (*ocispecs.Descriptor, func(), error)

func (*Writer) Discard added in v0.11.0

func (w *Writer) Discard()

func (*Writer) Write added in v0.11.0

func (w *Writer) Write(p []byte) (int, error)

Directories

Path Synopsis
ops

Jump to

Keyboard shortcuts

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