Documentation
¶
Overview ¶
Package flow : API subsystem for flow app
Package flow : This is the main executor for the pipeline sub-system Flow takes the pipeline object, iterates over it and builds the elements contained within it. It also contains handlers for handing status information back to assemble front end, and for delivering commands into the syphon executors via API calls.
Flow can be triggered in single pipeline mode by specifying the pipeline as a command line parameter (-p), and/or in update mode which will cause any containers in the pipeline to be rebuilt - useful for updating Tiyo inside any containers active in the pipeline.
Index ¶
- Constants
- type API
- type DecryptBody
- type Flow
- func (flow *Flow) Cleanup(path string, owd string, err error) error
- func (flow *Flow) CopyTiyoBinary() error
- func (flow *Flow) Create(instance *pipeline.Command) error
- func (flow *Flow) Decrypt(what string) (string, error)
- func (flow *Flow) Destroy()
- func (flow *Flow) Execute()
- func (flow *Flow) Find(name string, config *config.Config) *Flow
- func (flow *Flow) Init()
- func (flow *Flow) LoadPipeline(pipelineName string) bool
- func (flow *Flow) Run() int
- func (flow *Flow) Setup(pipelineName string) bool
- func (flow *Flow) Start()
- func (flow *Flow) Stop()
- func (flow *Flow) WriteConfig() error
- func (flow *Flow) WriteDockerfile(instance *pipeline.Command) error
- type Queue
Constants ¶
const MAXQUEUE = 100000
MAXQUEUE defines how many events should be written into the queue every n seconds
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { // The flow API can hold multiple pipelines but only one copy // of each individual pipeline. // If multiple copies of the same pipeline are required, multiple // flow instances need to be executed although this will lead to // issues with the current queue implementation Instances map[string]Flow // contains filtered or unexported fields }
API Structure for the flow api
func (*API) Register ¶
Register : Endpoint for Syphon executors to register their current status
When the status parameter is sent and is set to ready, if a command is available on the queue, this is sent back to syphon.
If syphon registers busy, no command should be sent back.
func (*API) Serve ¶
Serve the API over HTTP
Flow api offers integrations for the Syphon application to communicate and for assemble to trigger the application deployments.
type DecryptBody ¶
type Flow ¶
type Flow struct { // The real name (non-formatted) of the pipeline used by Flow Name string // The config system used by flow Config *config.Config // The pipeline executed by this instance of flow Pipeline *pipeline.Pipeline // The docker engine Docker *docker.Docker // Kubernetes engine Kubernetes *kube.Kubernetes // Flags expected for execution of Flow Flags *flag.FlagSet // The queue system for managing event handoff from assemble to syphon Queue *Queue // Is the pipeline being executed IsExecuting bool // The API subsystem API *API // contains filtered or unexported fields }
Flow : Main structure of the Flow subsystem
func (*Flow) CopyTiyoBinary ¶
CopyTiyoBinary : Tiyo embeds itself into the containers it build to run in Syphon mode.
func (*Flow) Create ¶
Create : Creates a new docker container image if one is not already found in the library
func (*Flow) Destroy ¶
func (flow *Flow) Destroy()
Destroy : Destroys any infrastructure relating to this flow
func (*Flow) Execute ¶
func (flow *Flow) Execute()
Execute : Triggers the current flow building all components
func (*Flow) Find ¶
Find : Find a pipeline by name and return a new Flow object with the pipeline embedded
func (*Flow) Init ¶
func (flow *Flow) Init()
Init : Parse the command line and any environment variables for configuring Flow
func (*Flow) LoadPipeline ¶
LoadPipeline : Loads a pipeline from a given name returning false if the pipeline fails to load
func (*Flow) Stop ¶
func (flow *Flow) Stop()
Stop : Stop the flow queue from executing - does not stop the build
func (*Flow) WriteConfig ¶
WriteConfig : Create a basic config for Syphon to communicate with the current flow
type Queue ¶
type Queue struct { // The queue bucket to write to QueueBucket string // The files bucket to write to FilesBucket string // A bucket to store pod information in PodBucket string // A bucket to store non-filesystem events in EventsBucket string // The pipeline bucket to assign against PipelineBucket string // Configuration for the queue Config *config.Config // The pipeline used by the queue Pipeline *pipeline.Pipeline // HTTP client Client *http.Client // Is the queue stopped or not Stopped bool }
Queue : Defines the structure of the queue item
func (*Queue) GetQueueItem ¶
GetQueueItem : Get a command to execute