templatescompiler

package
v0.0.0-...-b9690c5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcreteTemplatesCompiler

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

func NewConcreteTemplatesCompiler

func NewConcreteTemplatesCompiler(
	renderedArchivesCompiler RenderedArchivesCompiler,
	jobReaderFactory bpreljob.ReaderFactory,
	jobsRepo bpjobsrepo.JobsRepository,
	tplToJobRepo bpjobsrepo.TemplateToJobRepository,
	runPkgsRepo bpjobsrepo.RuntimePackagesRepository,
	templatesRepo bptplsrepo.TemplatesRepository,
	blobstore boshblob.Blobstore,
	logger boshlog.Logger,
) ConcreteTemplatesCompiler

func (ConcreteTemplatesCompiler) Compile

func (tc ConcreteTemplatesCompiler) Compile(job bpdep.Job, instance bpdep.Instance) error

Compile populates blobstore with rendered jobs for a given deployment instance.

func (ConcreteTemplatesCompiler) FindPackages

func (tc ConcreteTemplatesCompiler) FindPackages(template bpdep.Template) ([]bprel.Package, error)

FindPackages returns list of packages required to run job template. List of packages is usually specified in release job metadata.

func (ConcreteTemplatesCompiler) FindRenderedArchive

func (tc ConcreteTemplatesCompiler) FindRenderedArchive(job bpdep.Job, instance bpdep.Instance) (RenderedArchiveRecord, error)

FindRenderedArchive returns previously compiled template for a given instance. If such compiled template is not found, error is returned.

func (ConcreteTemplatesCompiler) Precompile

func (tc ConcreteTemplatesCompiler) Precompile(release bprel.Release) error

Precompile prepares release jobs to be later combined with instance properties

type RenderedArchiveRecord

type RenderedArchiveRecord struct {
	SHA1   string
	BlobID string
}

type RenderedArchivesCompiler

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

func NewRenderedArchivesCompiler

func NewRenderedArchivesCompiler(
	fs boshsys.FileSystem,
	runner boshsys.CmdRunner,
	compressor bptar.Compressor,
	logger boshlog.Logger,
) RenderedArchivesCompiler

func (RenderedArchivesCompiler) CleanUp

func (rac RenderedArchivesCompiler) CleanUp(path string) error

CleanUp deletes previously produced rendered templates archive.

func (RenderedArchivesCompiler) Compile

func (rac RenderedArchivesCompiler) Compile(relJobs []bpreljob.Job, instance bpdep.Instance) (string, error)

Compile takes release jobs and instance and produces rendered templates archive. Rendered templates archive contains rendered job templates that can be unpacked by a GoAgent to populate a VM.

type TemplatesCompiler

type TemplatesCompiler interface {
	Precompile(bprel.Release) error
	Compile(bpdep.Job, bpdep.Instance) error
	FindRenderedArchive(bpdep.Job, bpdep.Instance) (RenderedArchiveRecord, error)

	// todo does it belong here?
	FindPackages(template bpdep.Template) ([]bprel.Package, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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