Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConflict = errors.New("Storage backend conflict")
View Source
var ErrPipelineExists = errors.New("A pipeline already exists with this ID.")
View Source
var ErrPipelineNotExists = errors.New("This pipeline does not exist.")
Functions ¶
func WithZkConnection ¶
func WithZkPrefix ¶
func WithZkPrefix(prefix string) zkStorageOpt
func WithZkServers ¶
func WithZkServers(servers []string) zkStorageOpt
Types ¶
type Pipeline ¶
type Pipeline struct { ID string `json:"id"` Key string `json:"key"` Container struct { Image string `json:"image"` Network string `json:"network"` Parameters []struct { Key string `value:"key"` Value string `json:"value"` } `json:"parameters"` } `json:"container"` Processors map[string]struct { ID string `json:"id"` Shell bool `json:"shell"` Command string `json:"command"` Arguments []string `json:"arguments"` Environment map[string]string `json:"environment"` Resources struct { CPU float64 `json:"cpu"` Mem float64 `json:"mem"` Disk float64 `json:"disk"` } `json:"resources"` PortMapping []struct { HostPort int `json:"host_port"` ContainerPort int `json:"container_port"` Protocol string `json:"protocol"` } `json:"port_mappings"` KillGracePeriod int `json:"kill_grace_period"` } `json:"processes"` Instances int `json:"instances"` Roles []string `json:"roles"` Labels map[string]string `json:"labels"` Environment map[string]string `json:"environment"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` ExecutorResources struct { CPU float64 `json:"cpu"` Mem float64 `json:"mem"` Disk float64 `json:"disk"` } `json:"executor_resources"` Metadata map[string]string `json:"metadata,omitempty"` Tasks []Task `json:"tasks,omitempty"` }
func (*Pipeline) GenerateTasks ¶
func (*Pipeline) RequiredCPU ¶
func (*Pipeline) RequiredMem ¶
func (*Pipeline) SatisfiesOffer ¶
type Storage ¶
type Storage interface { FrameworkID() (string, error) SetFrameworkID(string) error Tasks(bool) ([]string, <-chan zk.Event, error) SaveTasks(map[string]*Task) error TasksInfo() (map[string]*Task, error) Pipelines(bool) (map[string]Pipeline, <-chan zk.Event, error) SavePipeline(Pipeline, bool) error ResizePipeline(string, int) error DeletePipeline(string) error LastAutoscale() (time.Time, error) SetLastAutoscale(time.Time) error }
func NewStorageBackend ¶
func NewZkStorage ¶
type Task ¶
type Task struct { ID TaskID `json:"id"` PipelineID string `json:"pipeline_id"` ProcessorID string `json:"processor_id"` Message string `json:"message,omitempty"` Launching bool `json:"-"` Launched time.Time `json:"launched"` Failures int `json:"failures"` Updated time.Time `json:"updated"` Ok bool `json:"ok"` Failing bool `json:"failing"` Killing bool `json:"killing"` Processes map[string]*TaskProcess `json:"processes"` }
func (*Task) IsRunnable ¶
type TaskID ¶
type TaskID string
func (TaskID) PipelineID ¶
func (TaskID) ProcessorID ¶
func (TaskID) WithProcessID ¶
Click to show internal directories.
Click to hide internal directories.