Documentation ¶
Index ¶
- Constants
- func AggregateSignatures(signatures []string) string
- func FlattenOpinions(opinions map[string]interface{}, total bool) map[string]string
- type CVMap
- type CVType
- type Configuration
- type ConfigurationVariable
- type ConfigurationVariableGenerator
- type ConfigurationVariableSlice
- type FlightStage
- type HealthCheck
- type HealthProbe
- type Job
- func (j *Job) Extract(destination string) (string, error)
- func (j *Job) GetPropertiesForJob(opinions *Opinions) (map[string]interface{}, error)
- func (j *Job) MergeSpec(otherJob *Job)
- func (j *Job) ValidateSHA1() error
- func (j *Job) WriteConfigs(role *Role, lightOpinionsPath, darkOpinionsPath string) ([]byte, error)
- type JobProperty
- type JobTemplate
- type Jobs
- type Opinions
- type Package
- type Packages
- type Release
- type ReleaseConfig
- type ReleaseLicense
- type Role
- func (r *Role) GetRoleDevVersion(opinions *Opinions, fissileVersion string) (string, error)
- func (r *Role) GetScriptPaths() map[string]string
- func (r *Role) GetScriptSignatures() (string, error)
- func (r *Role) GetTemplateSignatures() (string, error)
- func (r *Role) GetVariablesForRole() (ConfigurationVariableSlice, error)
- func (r *Role) HasTag(tag string) bool
- func (r *Role) IsDevRole() bool
- type RoleManifest
- type RoleRun
- type RoleRunExposedPort
- type RoleRunScaling
- type RoleRunVolume
- type RoleType
- type Roles
Constants ¶
const ( RoleTypeBoshTask = RoleType("bosh-task") // A role that is a BOSH task RoleTypeBosh = RoleType("bosh") // A role that is a BOSH job RoleTypeDocker = RoleType("docker") // A role that is a raw Docker image )
These are the types of roles available
const ( FlightStagePreFlight = FlightStage("pre-flight") // A role that runs before the main jobs start FlightStageFlight = FlightStage("flight") // A role that is a main job FlightStagePostFlight = FlightStage("post-flight") // A role that runs after the main jobs are up FlightStageManual = FlightStage("manual") // A role that only runs via user intervention )
These are the flight stages available
const ( // CVTypeUser is for user-specified variables (default) CVTypeUser = CVType("user") // CVTypeEnv is for script-specified variables CVTypeEnv = CVType("environment") )
Variables ¶
This section is empty.
Functions ¶
func AggregateSignatures ¶
AggregateSignatures returns the SHA1 for a slice of strings
func FlattenOpinions ¶
FlattenOpinions converts the incoming nested map of opinions into a flat map of properties to values (strings). When 'total' is set (to true) array values are recursed into and flattened as well.
Types ¶
type CVMap ¶
type CVMap map[string]*ConfigurationVariable
CVMap is a map from variable name to ConfigurationVariable, for various places which require quick access/search/existence check.
func MakeMapOfVariables ¶
func MakeMapOfVariables(rolesManifest *RoleManifest) CVMap
MakeMapOfVariables converts the sequence of configuration variables into a map we can manipulate more directly by name.
type CVType ¶
type CVType string
CVType is the type of the configuration variable; see the constants below
type Configuration ¶
type Configuration struct { Templates map[string]string `yaml:"templates"` Variables ConfigurationVariableSlice `yaml:"variables"` }
Configuration contains information about how to configure the resulting images
type ConfigurationVariable ¶
type ConfigurationVariable struct { Name string `yaml:"name"` Default interface{} `yaml:"default"` Description string `yaml:"description"` Generator *ConfigurationVariableGenerator `yaml:"generator"` Type CVType `yaml:"type"` Internal bool `yaml:"internal,omitempty"` Secret bool `yaml:"secret,omitempty"` }
ConfigurationVariable is a configuration to be exposed to the IaaS
Notes on the fields Type and Internal.
Type's legal values are `user` and `environment`. `user` is default.
A `user` CV is rendered into k8s yml config files, etc. to make it available to roles who need it. - An internal CV is rendered to all roles. - A public CV is rendered only to the roles whose templates refer to the CV.
An `environment` CV comes from a script, not the user. Being internal this way it is not rendered to any configuration files.
- Internal's legal values are all YAML boolean values. A public CV is used in templates An internal CV is not, consumed in a script instead.
type ConfigurationVariableGenerator ¶
type ConfigurationVariableGenerator struct { ID string `yaml:"id"` Type string `yaml:"type"` ValueType string `yaml:"value_type"` }
ConfigurationVariableGenerator describes how to automatically generate values for a configuration variable
type ConfigurationVariableSlice ¶
type ConfigurationVariableSlice []*ConfigurationVariable
ConfigurationVariableSlice is a sortable slice of ConfigurationVariables
func (ConfigurationVariableSlice) Len ¶
func (confVars ConfigurationVariableSlice) Len() int
Len is the number of ConfigurationVariables in the slice
func (ConfigurationVariableSlice) Less ¶
func (confVars ConfigurationVariableSlice) Less(i, j int) bool
Less reports whether config variable at index i sort before the one at index j
func (ConfigurationVariableSlice) Swap ¶
func (confVars ConfigurationVariableSlice) Swap(i, j int)
Swap exchanges configuration variables at index i and index j
type HealthCheck ¶
type HealthCheck struct { Liveness *HealthProbe `yaml:"liveness,omitempty"` // Details of liveness probe configuration Readiness *HealthProbe `yaml:"readiness,omitempty"` // Ditto for readiness probe }
HealthCheck describes a non-standard health check endpoint
type HealthProbe ¶
type HealthProbe struct { URL string `yaml:"url"` // URL for a HTTP GET to return 200~399. Cannot be used with other checks. Headers map[string]string `yaml:"headers"` // Custom headers; only used for URL. Command []string `yaml:"command"` // Custom command. Cannot be used with other checks. Port int32 `yaml:"port"` // Port for a TCP probe. Cannot be used with other checks. InitialDelay int32 `yaml:"initial_delay,omitempty"` // Initial Delay in seconds, default 3, minimum 1 Period int32 `yaml:"period,omitempty"` // Period in seconds, default 10, minimum 1 Timeout int32 `yaml:"timeout,omitempty"` // Timeout in seconds, default 3, minimum 1 SuccessThreshold int32 `yaml:"success_threshold,omitempty"` // Success threshold in seconds, default 1, minimum 1 FailureThreshold int32 `yaml:"failure_threshold,omitempty"` // Failure threshold in seconds, default 3, minimum 1 }
HealthProbe holds the configuration for liveness and readiness probes based on the HealthCheck containing them.
type Job ¶
type Job struct { Name string Description string Templates []*JobTemplate Packages Packages Path string Fingerprint string SHA1 string Properties []*JobProperty Version string Release *Release // contains filtered or unexported fields }
Job represents a BOSH job
func (*Job) Extract ¶
Extract will extract the contents of the job archive to destination It creates a directory with the name of the job Returns the full path of the extracted archive
func (*Job) GetPropertiesForJob ¶
GetPropertiesForJob returns the parameters for the given job, using its specs and opinions
func (*Job) MergeSpec ¶
MergeSpec is used to merge temporary spec patches into each job. otherJob should only be the fissile-compat/patch-properties job. The code assumes package and property objects are immutable, as they're now being shared across jobs. Also, when specified packages or properties are specified in the "other" job, that one takes precedence.
func (*Job) ValidateSHA1 ¶
ValidateSHA1 validates that the SHA1 of the actual job archive is the same as the one from the release manifest
type JobProperty ¶
JobProperty is a generic key-value property referenced by a job
type JobTemplate ¶
JobTemplate represents a BOSH job template
type Jobs ¶
type Jobs []*Job
Jobs is an array of Job*
type Opinions ¶
Opinions holds the light and dark opinions given to fissile
func NewEmptyOpinions ¶
func NewEmptyOpinions() *Opinions
NewEmptyOpinions returns an empty opinions object, used for testing and generating the version of the package layer, that doesn't change if opinions change
func NewOpinions ¶
NewOpinions returns the json opinions for the light and dark opinion files
func (*Opinions) GetOpinionForKey ¶
func (o *Opinions) GetOpinionForKey(opinions map[string]interface{}, keyPieces []string) (result interface{})
GetOpinionForKey pulls an opinion out of the holding container.
type Package ¶
type Package struct { Name string Version string Fingerprint string SHA1 string Release *Release Path string Dependencies Packages // contains filtered or unexported fields }
Package represents a BOSH package
func (*Package) Extract ¶
Extract will extract the contents of the package archive to destination It creates a directory with the name of the package Returns the full path of the extracted archive
func (*Package) GetPackageCompiledDir ¶
GetPackageCompiledDir returns the path to the build result directory of the package, underneath the main cache directory
func (*Package) GetPackageCompiledTempDir ¶
GetPackageCompiledTempDir returns the path to the build temp directory for the package, underneath the main cache directory
func (*Package) GetTargetPackageSourcesDir ¶
GetTargetPackageSourcesDir returns the path to the sources of the package, underneath the main cache directory
func (*Package) ValidateSHA1 ¶
ValidateSHA1 validates that the SHA1 of the actual package archive is the same as the one from the release manifest
type Packages ¶
type Packages []*Package
Packages is an array of *Package
type Release ¶
type Release struct { Jobs Jobs Packages Packages License ReleaseLicense Name string UncommittedChanges bool CommitHash string Version string Path string DevBOSHCacheDir string // contains filtered or unexported fields }
Release represents a BOSH release
func NewDevRelease ¶
NewDevRelease will create an instance of a BOSH development release
func (*Release) GetUniqueConfigs ¶
func (r *Release) GetUniqueConfigs() map[string]*ReleaseConfig
GetUniqueConfigs returns all unique configs available in a release
type ReleaseConfig ¶
ReleaseConfig is a global deployment configuration key
type ReleaseLicense ¶
type ReleaseLicense struct { // Files is a mapping of license file names to contents Files map[string][]byte // Release this license belongs to Release *Release }
ReleaseLicense represents the license of a BOSH release
type Role ¶
type Role struct { Name string `yaml:"name"` Jobs Jobs `yaml:"_,omitempty"` EnvironScripts []string `yaml:"environment_scripts"` Scripts []string `yaml:"scripts"` PostConfigScripts []string `yaml:"post_config_scripts"` Type RoleType `yaml:"type,omitempty"` JobNameList []*roleJob `yaml:"jobs"` Configuration *Configuration `yaml:"configuration"` Run *RoleRun `yaml:"run"` Tags []string `yaml:"tags"` // contains filtered or unexported fields }
Role represents a collection of jobs that are colocated on a container
func (*Role) GetRoleDevVersion ¶
GetRoleDevVersion determines the version hash for the role, using the basic role dev version, and the aggregated spec and opinion information. In this manner opinion changes cause a rebuild of the associated role images.
func (*Role) GetScriptPaths ¶
GetScriptPaths returns the paths to the startup / post configgin scripts for a role
func (*Role) GetScriptSignatures ¶
GetScriptSignatures returns the SHA1 of all of the script file names and contents
func (*Role) GetTemplateSignatures ¶
GetTemplateSignatures returns the SHA1 of all of the templates and contents
func (*Role) GetVariablesForRole ¶
func (r *Role) GetVariablesForRole() (ConfigurationVariableSlice, error)
GetVariablesForRole returns all the environment variables required for calculating all the templates for the role
type RoleManifest ¶
type RoleManifest struct { Roles Roles `yaml:"roles"` Configuration *Configuration `yaml:"configuration"` // contains filtered or unexported fields }
RoleManifest represents a collection of roles
func LoadRoleManifest ¶
func LoadRoleManifest(manifestFilePath string, releases []*Release) (*RoleManifest, error)
LoadRoleManifest loads a yaml manifest that details how jobs get grouped into roles
func (*RoleManifest) GetRoleManifestDevPackageVersion ¶
func (m *RoleManifest) GetRoleManifestDevPackageVersion(roles Roles, opinions *Opinions, fissileVersion, extra string) (string, error)
GetRoleManifestDevPackageVersion gets the aggregate signature of all the packages
func (*RoleManifest) LookupRole ¶
func (m *RoleManifest) LookupRole(roleName string) *Role
LookupRole will find the given role in the role manifest
func (*RoleManifest) SelectRoles ¶
func (m *RoleManifest) SelectRoles(roleNames []string) (Roles, error)
SelectRoles will find only the given roles in the role manifest
type RoleRun ¶
type RoleRun struct { Scaling *RoleRunScaling `yaml:"scaling"` Capabilities []string `yaml:"capabilities"` PersistentVolumes []*RoleRunVolume `yaml:"persistent-volumes"` Memory int `yaml:"memory"` VirtualCPUs int `yaml:"virtual-cpus"` ExposedPorts []*RoleRunExposedPort `yaml:"exposed-ports"` FlightStage FlightStage `yaml:"flight-stage"` HealthCheck *HealthCheck `yaml:"healthcheck,omitempty"` Environment []string `yaml:"env"` }
RoleRun describes how a role should behave at runtime
type RoleRunExposedPort ¶
type RoleRunExposedPort struct { Name string `yaml:"name"` Protocol string `yaml:"protocol"` External string `yaml:"external"` Internal string `yaml:"internal"` Public bool `yaml:"public"` }
RoleRunExposedPort describes a port to be available to other roles, or the outside world
type RoleRunScaling ¶
RoleRunScaling describes how a role should scale out at runtime
type RoleRunVolume ¶
type RoleRunVolume struct { Path string `yaml:"path"` Tag string `yaml:"tag"` Size int `yaml:"size"` }
RoleRunVolume describes a volume to be attached at runtime