solver

package
v0.0.0-...-b35638e Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheExporter

type CacheExporter interface {
	Export(context.Context) ([]cacheimport.CacheRecord, error)
}

type Index

type Index int

type Input

type Input struct {
	Index  Index
	Vertex Vertex
}

Input is an pointer to a single reference from a vertex by an index.

type InstructionCache

type InstructionCache interface {
	Probe(ctx context.Context, key digest.Digest) (bool, error)
	Lookup(ctx context.Context, key digest.Digest, msg string) (interface{}, error) // TODO: regular ref
	Set(key digest.Digest, ref interface{}) error
	SetContentMapping(contentKey, key digest.Digest) error
	GetContentMapping(dgst digest.Digest) ([]digest.Digest, error)
}

type LLBOpt

type LLBOpt struct {
	SourceManager    *source.Manager
	CacheManager     cache.Manager
	Worker           worker.Worker
	InstructionCache InstructionCache
	ImageSource      source.Source
	Frontends        map[string]frontend.Frontend // used by nested invocations
	CacheExporter    *cacheimport.CacheExporter
	CacheImporter    *cacheimport.CacheImporter
}

type Metadata

type Metadata interface {
	GetIgnoreCache() bool
}

Metadata is per-vertex metadata, implemented by *pb.OpMetadata

type Op

type Op interface {
	// CacheKey returns a persistent cache key for operation.
	CacheKey(context.Context) (digest.Digest, error)
	// ContentMask returns a partial cache checksum with content paths to the
	// inputs. User can combine the content checksum of these paths to get a valid
	// content based cache key.
	ContentMask(context.Context) (digest.Digest, [][]string, error)
	// Run runs an operation and returns the output references.
	Run(ctx context.Context, inputs []Reference) (outputs []Reference, err error)
}

Op is an implementation for running a vertex

type Reference

type Reference interface {
	Release(context.Context) error
}

Reference is a reference to the object passed through the build steps.

type ResolveOpFunc

type ResolveOpFunc func(Vertex) (Op, error)

ResolveOpFunc finds an Op implementation for a vertex

type SolveRequest

type SolveRequest struct {
	Definition     *pb.Definition
	Frontend       frontend.Frontend
	Exporter       exporter.ExporterInstance
	FrontendOpt    map[string]string
	ExportCacheRef string
	ImportCacheRef string
}

type Solver

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

func NewLLBSolver

func NewLLBSolver(opt LLBOpt) *Solver

func (*Solver) Solve

func (s *Solver) Solve(ctx context.Context, id string, req SolveRequest) error

func (*Solver) Status

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

type Vertex

type Vertex interface {
	// Digest is a content-addressable vertex identifier
	Digest() digest.Digest
	// Sys returns an internal value that is used to execute the vertex. Usually
	// this is capured by the operation resolver method during solve.
	Sys() interface{}
	Metadata() Metadata
	// Array of vertexes current vertex depends on.
	Inputs() []Input
	Name() string // change this to general metadata
}

Vertex is one node in the build graph

type VertexEvaluator

type VertexEvaluator interface {
	Next(context.Context) (*VertexResult, error)
	Cancel() error
}

type VertexResult

type VertexResult struct {
	CacheKey  digest.Digest
	Reference Reference
}

type VertexSolver

type VertexSolver interface {
	CacheKey(ctx context.Context, index Index) (digest.Digest, error)
	OutputEvaluator(Index) (VertexEvaluator, error)
	Release() error
	Cache(Index, Reference) CacheExporter
}

Directories

Path Synopsis
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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