Documentation ¶
Index ¶
- Constants
- func LoadArtifactFromYaml(spec *compilerspec.BhojpurCompilationSpec) (*artifact.PackageArtifact, error)
- type ArtifactIndex
- type BhojpurCompiler
- func (cs *BhojpurCompiler) BuildTree(compilerSpecs compilerspec.BhojpurCompilationspecs) (*BuildTree, error)
- func (cs *BhojpurCompiler) Compile(keepPermissions bool, p *compilerspec.BhojpurCompilationSpec) (*artifact.PackageArtifact, error)
- func (cs *BhojpurCompiler) CompileParallel(keepPermissions bool, ps *compilerspec.BhojpurCompilationspecs) ([]*artifact.PackageArtifact, []error)
- func (cs *BhojpurCompiler) CompileWithReverseDeps(keepPermissions bool, ps *compilerspec.BhojpurCompilationspecs) ([]*artifact.PackageArtifact, []error)
- func (cs *BhojpurCompiler) ComputeDepTree(p *compilerspec.BhojpurCompilationSpec, db types.PackageDatabase) (types.PackagesAssertions, error)
- func (cs *BhojpurCompiler) ComputeMinimumCompilableSet(p ...*compilerspec.BhojpurCompilationSpec) ([]*compilerspec.BhojpurCompilationSpec, error)
- func (cs *BhojpurCompiler) FromDatabase(db types.PackageDatabase, minimum bool, dst string) ([]*compilerspec.BhojpurCompilationSpec, error)
- func (cs *BhojpurCompiler) FromPackage(p *types.Package) (*compilerspec.BhojpurCompilationSpec, error)
- func (cs *BhojpurCompiler) GetBackend() CompilerBackend
- func (cs *BhojpurCompiler) SetBackend(b CompilerBackend)
- type BuildTree
- func (bt *BuildTree) AllInLevel(l int) []string
- func (bt *BuildTree) AllLevels() []int
- func (bt *BuildTree) Increase(s string)
- func (bt *BuildTree) JSON() (string, error)
- func (bt *BuildTree) Level(s string) int
- func (bt *BuildTree) Order(compilationTree map[string]map[string]interface{})
- func (bt *BuildTree) Reset(s string)
- type CompilerBackend
- type ImageHashTree
- type PackageImageHashTree
Constants ¶
const BuildFile = "build.yaml"
const CollectionFile = "collection.yaml"
const DefinitionFile = "definition.yaml"
Variables ¶
This section is empty.
Functions ¶
func LoadArtifactFromYaml ¶
func LoadArtifactFromYaml(spec *compilerspec.BhojpurCompilationSpec) (*artifact.PackageArtifact, error)
Types ¶
type ArtifactIndex ¶
type ArtifactIndex []*artifact.PackageArtifact
func (ArtifactIndex) CleanPath ¶
func (i ArtifactIndex) CleanPath() ArtifactIndex
type BhojpurCompiler ¶
type BhojpurCompiler struct { //*tree.CompilerRecipe Backend CompilerBackend Database types.PackageDatabase Options options.Compiler }
func CompilerFinalImages ¶
func CompilerFinalImages(cs *BhojpurCompiler) (*BhojpurCompiler, error)
func NewBhojpurCompiler ¶
func NewBhojpurCompiler(backend CompilerBackend, db types.PackageDatabase, compilerOpts ...options.Option) *BhojpurCompiler
func NewCompiler ¶
func NewCompiler(p ...options.Option) *BhojpurCompiler
func (*BhojpurCompiler) BuildTree ¶
func (cs *BhojpurCompiler) BuildTree(compilerSpecs compilerspec.BhojpurCompilationspecs) (*BuildTree, error)
BuildTree returns a BuildTree which represent the order in which specs should be compiled. It places specs into levels, and each level can be built in parallel. The root nodes starting from the top. A BuildTree can be marshaled into JSON or walked like:
for _, l := range bt.AllLevels() { fmt.Println(strings.Join(bt.AllInLevel(l), " ")) }
func (*BhojpurCompiler) Compile ¶
func (cs *BhojpurCompiler) Compile(keepPermissions bool, p *compilerspec.BhojpurCompilationSpec) (*artifact.PackageArtifact, error)
Compile is a non-parallel version of CompileParallel. It builds the compilation specs and generates an artifact
func (*BhojpurCompiler) CompileParallel ¶
func (cs *BhojpurCompiler) CompileParallel(keepPermissions bool, ps *compilerspec.BhojpurCompilationspecs) ([]*artifact.PackageArtifact, []error)
CompileParallel compiles the supplied compilationspecs in parallel to note, no specific heuristic is implemented, and the specs are run in parallel as they are.
func (*BhojpurCompiler) CompileWithReverseDeps ¶
func (cs *BhojpurCompiler) CompileWithReverseDeps(keepPermissions bool, ps *compilerspec.BhojpurCompilationspecs) ([]*artifact.PackageArtifact, []error)
CompileWithReverseDeps compiles the supplied compilationspecs and their reverse dependencies
func (*BhojpurCompiler) ComputeDepTree ¶
func (cs *BhojpurCompiler) ComputeDepTree(p *compilerspec.BhojpurCompilationSpec, db types.PackageDatabase) (types.PackagesAssertions, error)
func (*BhojpurCompiler) ComputeMinimumCompilableSet ¶
func (cs *BhojpurCompiler) ComputeMinimumCompilableSet(p ...*compilerspec.BhojpurCompilationSpec) ([]*compilerspec.BhojpurCompilationSpec, error)
ComputeMinimumCompilableSet strips specs that are eventually compiled by leafs
func (*BhojpurCompiler) FromDatabase ¶
func (cs *BhojpurCompiler) FromDatabase(db types.PackageDatabase, minimum bool, dst string) ([]*compilerspec.BhojpurCompilationSpec, error)
FromDatabase returns all the available compilation specs from a database. If the minimum flag is returned it will be computed a minimal subset that will guarantees that all packages are built ( if not targeting a single package explictly )
func (*BhojpurCompiler) FromPackage ¶
func (cs *BhojpurCompiler) FromPackage(p *types.Package) (*compilerspec.BhojpurCompilationSpec, error)
FromPackage returns a compilation spec from a package definition
func (*BhojpurCompiler) GetBackend ¶
func (cs *BhojpurCompiler) GetBackend() CompilerBackend
GetBackend returns the current compilation backend
func (*BhojpurCompiler) SetBackend ¶
func (cs *BhojpurCompiler) SetBackend(b CompilerBackend)
SetBackend sets the compilation backend
type BuildTree ¶
type BuildTree struct {
// contains filtered or unexported fields
}
func (*BuildTree) AllInLevel ¶
type CompilerBackend ¶
type CompilerBackend interface { BuildImage(backend.Options) error ExportImage(backend.Options) error LoadImage(string) error RemoveImage(backend.Options) error ImageDefinitionToTar(backend.Options) error CopyImage(string, string) error DownloadImage(opts backend.Options) error Push(opts backend.Options) error ImageAvailable(string) bool ImageReference(img1 string, ondisk bool) (v1.Image, error) ImageExists(string) bool }
func NewBackend ¶
func NewBackend(ctx types.Context, s string) (CompilerBackend, error)
type ImageHashTree ¶
type ImageHashTree struct { Database types.PackageDatabase SolverOptions types.BhojpurSolverOptions }
ImageHashTree is holding the Database and the options to resolve PackageImageHashTrees for a given specfile It is responsible of returning a concrete result which identifies a Package in a HashTree
func NewHashTree ¶
func NewHashTree(db types.PackageDatabase) *ImageHashTree
func (*ImageHashTree) Query ¶
func (ht *ImageHashTree) Query(cs *BhojpurCompiler, p *compilerspec.BhojpurCompilationSpec) (*PackageImageHashTree, error)
Query takes a compiler and a compilation spec and returns a PackageImageHashTree tied to it. PackageImageHashTree contains all the informations to resolve the spec build images in order to reproducibly re-build images from packages
type PackageImageHashTree ¶
type PackageImageHashTree struct { Target *types.PackageAssert Dependencies types.PackagesAssertions Solution types.PackagesAssertions SourceHash string BuilderImageHash string // contains filtered or unexported fields }
PackageImageHashTree represent the Package into a given image hash tree The hash tree is constructed by a set of images representing the package during its build stage. A Hash is assigned to each image from the package fingerprint, plus the SAT solver assertion result (which is hashed as well) and the specfile signatures. This guarantees that each image of the build stage is unique and can be identified later on.
func (*PackageImageHashTree) DependencyBuildImage ¶
func (ht *PackageImageHashTree) DependencyBuildImage(p *types.Package) (string, error)
func (*PackageImageHashTree) String ¶
func (ht *PackageImageHashTree) String() string