Documentation ¶
Index ¶
Constants ¶
View Source
const JobTypeChoice = "choice-job"
View Source
const JobTypeKube = "kube-job"
View Source
const JobTypeParallel = "parallel-job"
Variables ¶
View Source
var CompletedTaskStatuses = []TaskStatusType{ TaskSuccess, TaskFailed, }
View Source
var UncompletedTaskStatuses = []TaskStatusType{ TaskRunning, }
View Source
var UncompletedWorkflowStatuses = []WorkflowStatusType{ WfRunning, WfScheduled, }
Functions ¶
This section is empty.
Types ¶
type ExecutionError ¶
type ExecutionError struct {
// contains filtered or unexported fields
}
type JobDef ¶
type JobDef struct {
Tasks []Task
}
func GetJobDefFromString ¶
func (*JobDef) GetCurrentTask ¶
func (jobDef *JobDef) GetCurrentTask(te *TaskExecution) Task
Get te's task definition
func (*JobDef) GetNextTask ¶
func (jobDef *JobDef) GetNextTask(te *TaskExecution) Task
Get next job Next job is decided by tasks' status which belong to the execution
func (*JobDef) GetStartTask ¶
Get first job of this definition
type JobDefProvider ¶
type JobDefProvider interface {
GetJobDef() *JobDef
}
type KubeJobTask ¶
func (*KubeJobTask) GetJobType ¶
func (task *KubeJobTask) GetJobType() string
func (*KubeJobTask) GetName ¶
func (task *KubeJobTask) GetName() string
func (*KubeJobTask) GetNextTaskName ¶
func (task *KubeJobTask) GetNextTaskName() string
type ParallelTask ¶
func (*ParallelTask) GetJobType ¶
func (task *ParallelTask) GetJobType() string
func (*ParallelTask) GetName ¶
func (task *ParallelTask) GetName() string
func (*ParallelTask) GetNextTaskName ¶
func (task *ParallelTask) GetNextTaskName() string
func (*ParallelTask) GetTaskSets ¶
func (task *ParallelTask) GetTaskSets() [][]Task
type TaskExecution ¶
type TaskExecution struct { ID uint `gorm:"primary_key" json:"id"` WorkflowExecution *WorkflowExecution `json:"-"` WorkflowExecutionID uint `gorm:"not null" json:"-"` ParentTaskExecution *TaskExecution `json:"-"` ParentTaskExecutionID uint `json:"parentId"` NextTaskExecution *TaskExecution `json:"-"` NextTaskExecutionID uint `json:"nextId"` PrevTaskExecution *TaskExecution `json:"-"` PrevTaskExecutionID uint `json:"prevId"` ExecutionName string `gorm:"not null" json:"executionName"` TaskName string `gorm:"not null" json:"taskName"` TaskType string `gorm:"not null" json:"taskType"` StartedAt *time.Time `gorm:"not null" json:"startedAt"` EndedAt *time.Time `json:"endedAt"` ElapsedSec uint `json:"elapsedSec"` Status TaskStatusType `gorm:"not null" json:"status"` Input string `gorm:"type:json;not null" json:"input"` Output string `gorm:"type:json;not null" json:"output"` ErrorReason string `json:"errorReason"` ErrorMsg string `json:"errorMsg"` CreatedAt *time.Time `json:"-"` UpdatedAt *time.Time `json:"-"` }
func (*TaskExecution) IsCompleted ¶
func (te *TaskExecution) IsCompleted() bool
func (*TaskExecution) IsFailed ¶
func (te *TaskExecution) IsFailed() bool
func (*TaskExecution) IsSucceeded ¶
func (te *TaskExecution) IsSucceeded() bool
func (*TaskExecution) MarkFailed ¶
func (te *TaskExecution) MarkFailed(endedAt *time.Time, errReason string, errMsg string)
func (*TaskExecution) MarkSuccess ¶
func (te *TaskExecution) MarkSuccess(endedAt *time.Time)
type TaskStatusType ¶
type TaskStatusType int
const ( TaskRunning TaskStatusType = iota TaskSuccess TaskFailed )
type Workflow ¶
type Workflow struct { ID uint `gorm:"primary_key" json:"id"` Name string `gorm:"not null" json:"name"` Definition string `gorm:"type:json;not null" json:"definition"` User *User `gorm:"not null" json:"user"` UserID uint `gorm:"not null" json:"-"` CreatedAt *time.Time `json:"-"` UpdatedAt *time.Time `json:"-"` // contains filtered or unexported fields }
type WorkflowExecution ¶
type WorkflowExecution struct { ID uint `gorm:"primary_key" json:"id"` Workflow *Workflow `json:"workflow"` WorkflowID uint `gorm:"not null" json:"-"` TaskExecutions []TaskExecution `json:"taskExecutions"` Name string `gorm:"not null" json:"name"` StartedAt *time.Time `json:"startedAt"` EndedAt *time.Time `json:"endedAt"` Status WorkflowStatusType `gorm:"not null" json:"status"` Input string `gorm:"type:json;not null" json:"input"` Output string `gorm:"type:json;not null" json:"output"` Definition string `gorm:"type:json;not null" json:"definition"` Attempt int `gorm:"not null;default:1" json:"attempt"` ErrorMsg string `json:"errorMsg"` CreatedAt *time.Time `json:"-"` UpdatedAt *time.Time `json:"-"` // contains filtered or unexported fields }
func (*WorkflowExecution) GetJobDef ¶
func (execution *WorkflowExecution) GetJobDef() *JobDef
type WorkflowStatusType ¶
type WorkflowStatusType int
const ( WfScheduled WorkflowStatusType = iota WfRunning WfSuccess WfFailed )
Click to show internal directories.
Click to hide internal directories.