workflows

package
v2.0.0-beta.12+incompa... Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 46 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Prefix = "tasks"

	Cluster = "Cluster"

	DigitalOceanMaster        = "DigitalOceanMaster"
	DigitalOceanNode          = "DigitalOceanNode"
	DigitalOceanDeleteNode    = "DigitalOceanDeleteNode"
	DigitalOceanDeleteCluster = "DigitalOceanDeleteCluster"
	AWSMaster                 = "AWSMaster"
	AWSNode                   = "AWSNode"
	AWSPreProvision           = "AWSPreProvisionCluster"
	AWSDeleteCluster          = "AWSDeleteCluster"
	AWSDeleteNode             = "AWSDeleteNode"
	GCEMaster                 = "GCEMaster"
	GCENode                   = "GCENode"
	GCEDeleteCluster          = "GCEDeleteCluster"
	GCEDeleteNode             = "GCEDeleteNode"
)

Variables

This section is empty.

Functions

func Init

func Init()

func RegisterWorkFlow

func RegisterWorkFlow(workflowName string, workflow Workflow)

Types

type BuildTaskRequest

type BuildTaskRequest struct {
	StepNames []string     `json:"stepNames"`
	Cfg       steps.Config `json:"config"`
	SshConfig ssh.Config   `json:"sshConfig"`
}

type RunTaskRequest

type RunTaskRequest struct {
	WorkflowName string       `json:"workflowName"`
	Cfg          steps.Config `json:"config"`
}

type StepStatus

type StepStatus struct {
	Status   statuses.Status `json:"status"`
	StepName string          `json:"stepName"`
	ErrMsg   string          `json:"errorMessage"`
}

StepStatus aggregates data that is needed to track progress of step to persistent storage.

type Task

type Task struct {
	ID           string          `json:"id"`
	Type         string          `json:"type"`
	Config       *steps.Config   `json:"config"`
	Status       statuses.Status `json:"status"`
	StepStatuses []StepStatus    `json:"stepsStatuses"`
	// contains filtered or unexported fields
}

Task is an entity that has it own state that can be tracked and written to persistent storage through repository, it executes particular workflow of steps.

func DeserializeTask

func DeserializeTask(data []byte, repository storage.Interface) (*Task, error)

func NewTask

func NewTask(taskType string, repository storage.Interface) (*Task, error)

func (*Task) Restart

func (w *Task) Restart(ctx context.Context, id string, out io.Writer) chan error

Restart executes task from the last failed step

func (*Task) Run

func (w *Task) Run(ctx context.Context, config steps.Config, out io.WriteCloser) chan error

Run executes all steps of workflow and tracks the progress in persistent storage

type TaskHandler

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

func NewTaskHandler

func NewTaskHandler(repository storage.Interface, runnerFactory func(config ssh.Config) (runner.Runner, error), getter cloudAccountGetter) *TaskHandler

func (*TaskHandler) BuildAndRunTask

func (h *TaskHandler) BuildAndRunTask(w http.ResponseWriter, r *http.Request)

func (*TaskHandler) GetLogs

func (h *TaskHandler) GetLogs(w http.ResponseWriter, r *http.Request)

NOTE(stgleb): This is made for testing purposes and example, remove when UI is done.

func (*TaskHandler) GetTask

func (h *TaskHandler) GetTask(w http.ResponseWriter, r *http.Request)

func (*TaskHandler) Register

func (h *TaskHandler) Register(m *mux.Router)

func (*TaskHandler) RestartTask

func (h *TaskHandler) RestartTask(w http.ResponseWriter, r *http.Request)

func (*TaskHandler) RunTask

func (h *TaskHandler) RunTask(w http.ResponseWriter, r *http.Request)

func (*TaskHandler) StreamLogs

func (h *TaskHandler) StreamLogs(w http.ResponseWriter, r *http.Request)

type TaskResponse

type TaskResponse struct {
	ID string `json:"id"`
}

type Workflow

type Workflow []steps.Step

Workflow is a template for doing some actions

func GetWorkflow

func GetWorkflow(workflowName string) Workflow

type WorkflowSet

type WorkflowSet struct {
	ProvisionMaster string
	ProvisionNode   string
	DeleteNode      string
	DeleteCluster   string
}

Jump to

Keyboard shortcuts

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