Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ContainerPackagesDir represents the default location of installed BOSH packages ContainerPackagesDir = "/var/vcap/packages" // ContainerSourceDir is the directory in which the source code will reside when we // compile them. We will add a volume mount there in the container to work around // issues with AUFS not emulating a normal filesystem correctly. ContainerSourceDir = "/var/vcap/source" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compilator ¶
type Compilator struct { DockerManager *docker.ImageManager HostWorkDir string RepositoryPrefix string BaseType string FissileVersion string // contains filtered or unexported fields }
Compilator represents the BOSH compiler
func NewCompilator ¶
func NewCompilator( dockerManager *docker.ImageManager, hostWorkDir string, repositoryPrefix string, baseType string, fissileVersion string, keepContainer bool, ui *termui.UI, ) (*Compilator, error)
NewCompilator will create an instance of the Compilator
func (*Compilator) BaseImageName ¶
func (c *Compilator) BaseImageName() string
BaseImageName returns the name of the compilation base image
func (*Compilator) Compile ¶
func (c *Compilator) Compile(workerCount int, release *model.Release, roleManifest *model.RoleManifest) error
Compile concurrency works like this: 1 routine producing (todoCh<-) <=> Compile() itself n workers consuming (<-todoCh) <=> compileJob.Run()'s 1 synchronizer consuming EXACTLY 1 <-doneCh for every <-todoCh <=> Compile() again.
Dependencies:
- Packages with the least dependencies are queued first.
- Workers wait for their dependencies by waiting on a map of broadcasting channels that are closed by the synchronizer when something is done compiling successfully ==> c.packageDone [<name>]
In the event of an error:
- workers will try to bail out of waiting on <-todo or <-c.packageDone[name] early if it finds the killCh has been activated. There is a "race" here to see if the synchronizer will drain <-todoCh or if they will select on <-killCh before <-todoCh. In the worst case, an extra package will be compiled by each active worker.
- synchronizer will greedily drain the <-todoCh to starve the workers out and won't wait for the <-doneCh for the N packages it drained.
func (*Compilator) CreateCompilationBase ¶
func (c *Compilator) CreateCompilationBase(baseImageName string) (image *dockerClient.Image, err error)
CreateCompilationBase will create the compiler container
Click to show internal directories.
Click to hide internal directories.