Documentation ¶
Index ¶
- Constants
- Variables
- func CountActiveRunsForSchedule(logEntry *log.Entry, scheduleID string) (int64, error)
- func CountRun(logEntry *log.Entry, pk int64, maxKeys int, ...) (count int64, err error)
- func CreateRun(logEntry *log.Entry, run *Run) (string, error)
- func CreateRunCache(logEntry *log.Entry, cache *RunCache) (string, error)
- func CreateRunDag(logEntry *log.Entry, runDag *RunDag) (int64, error)
- func CreateRunJob(logEntry *log.Entry, runJob *RunJob) (int64, error)
- func CreateSchedule(logEntry *log.Entry, schedule Schedule) (scheduleID string, err error)
- func DeleteRun(logEntry *log.Entry, runID string) error
- func DeleteRunCache(logEntry *log.Entry, cacheID string) error
- func DeleteSchedule(logEntry *log.Entry, scheduleID string) error
- func GetCacheCount(logEntry *log.Entry, runID string) (int64, error)
- func GetNextGlobalWakeupTime(logEntry *log.Entry) (*time.Time, error)
- func IsLastSchedulePk(logEntry *log.Entry, pk int64, ...) (bool, error)
- func IsScheduleFinalStatus(status string) bool
- func ScheduleUsedFsIDs() (map[string]bool, error)
- func UpdateCache(logEntry *log.Entry, cacheID string, cache RunCache) error
- func UpdateRun(logEntry *log.Entry, runID string, run Run) error
- func UpdateRunDag(logEntry *log.Entry, pk int64, runDag RunDag) error
- func UpdateRunJob(logEntry *log.Entry, pk int64, runJob RunJob) error
- func UpdateRunStatus(logEntry *log.Entry, runID, status string) error
- func UpdateScheduleStatus(logEntry *log.Entry, scheduleID, status string) error
- type FsConfig
- type Run
- func (r *Run) Encode() error
- func (r *Run) GetRunCacheIDList() []string
- func (r *Run) InitRuntime(jobs []RunJob, dags []RunDag) error
- func (r *Run) ProcessRuntimeView(componentViews map[string][]schema.ComponentView, ...) error
- func (r *Run) RemoveOuterDagView(runtimeView map[string][]schema.ComponentView) map[string][]schema.ComponentView
- func (Run) TableName() string
- type RunCache
- func GetLastCacheForRun(logEntry *log.Entry, runID string) (RunCache, error)
- func GetLastRunCache(logEntry *log.Entry) (RunCache, error)
- func GetRunCache(logEntry *log.Entry, cacheID string) (RunCache, error)
- func ListRunCache(logEntry *log.Entry, pk int64, maxKeys int, ...) ([]RunCache, error)
- func ListRunCacheByFirstFp(logEntry *log.Entry, firstFp, fsID, source string) ([]RunCache, error)
- type RunDag
- type RunJob
- type Schedule
- func GetSchedule(logEntry *log.Entry, scheduleID string) (Schedule, error)
- func GetScheduleByName(logEntry *log.Entry, name, userName string) (Schedule, error)
- func GetSchedulesByStatus(logEntry *log.Entry, status string) (schedules []Schedule, err error)
- func ListSchedule(logEntry *log.Entry, pk int64, maxKeys int, ...) ([]Schedule, error)
- type ScheduleOptions
Constants ¶
View Source
const ( ConcurrencyPolicySuspend = "suspend" ConcurrencyPolicyReplace = "replace" ConcurrencyPolicySkip = "skip" ScheduleStatusSuccess = "success" ScheduleStatusRunning = "running" ScheduleStatusFailed = "failed" ScheduleStatusTerminated = "terminated" )
Variables ¶
View Source
var ConcurrencyPolicyList = []string{ ConcurrencyPolicySuspend, ConcurrencyPolicyReplace, ConcurrencyPolicySkip, }
View Source
var ScheduleFinalStatusList = []string{ ScheduleStatusSuccess, ScheduleStatusFailed, ScheduleStatusTerminated, }
View Source
var ScheduleNotFinalStatusList = []string{ ScheduleStatusRunning, }
View Source
var ScheduleStatusList = []string{ ScheduleStatusSuccess, ScheduleStatusRunning, ScheduleStatusFailed, ScheduleStatusTerminated, }
Functions ¶
func CountActiveRunsForSchedule ¶ added in v0.14.3
func CreateRunDag ¶ added in v0.14.3
func CreateRunJob ¶ added in v0.14.3
func CreateSchedule ¶ added in v0.14.3
func DeleteSchedule ¶ added in v0.14.3
func GetNextGlobalWakeupTime ¶ added in v0.14.3
计算timeout先不加事务,虽然select和 CountActiveRunsForSchedule 是非原子性,因为只影响休眠时间的计算结果
func IsLastSchedulePk ¶ added in v0.14.3
func IsScheduleFinalStatus ¶ added in v0.14.3
func ScheduleUsedFsIDs ¶ added in v0.14.3
func UpdateRunDag ¶ added in v0.14.3
Types ¶
type FsConfig ¶ added in v0.14.3
type FsConfig struct {
Username string `json:"username"`
}
func DecodeFsConfig ¶ added in v0.14.3
type Run ¶
type Run struct { Pk int64 `gorm:"primaryKey;autoIncrement;not null" json:"-"` ID string `gorm:"type:varchar(60);not null" json:"runID"` Name string `gorm:"type:varchar(128);not null" json:"name"` Source string `gorm:"type:varchar(256);not null" json:"source"` // pipelineID or yamlPath UserName string `gorm:"type:varchar(60);not null" json:"username"` FsID string `gorm:"type:varchar(60);not null" json:"-"` FsName string `gorm:"type:varchar(60);not null" json:"fsName"` FsOptions schema.FsOptions `gorm:"-" json:"fsOptions"` Description string `gorm:"type:text;size:65535;not null" json:"description"` ParametersJson string `gorm:"type:text;size:65535;not null" json:"-"` Parameters map[string]interface{} `gorm:"-" json:"parameters"` RunYaml string `gorm:"type:text;size:65535;not null" json:"runYaml"` WorkflowSource schema.WorkflowSource `gorm:"-" json:"-"` // RunYaml's dynamic struct Runtime schema.RuntimeView `gorm:"-" json:"runtime"` PostProcess schema.PostProcessView `gorm:"-" json:"postProcess"` FailureOptions *schema.FailureOptions `gorm:"-" json:"failureOptions"` FailureOptionsJson string `gorm:"type:text;size:65535;not null" json:"-"` DockerEnv string `gorm:"type:varchar(128);not null" json:"dockerEnv"` Disabled string `gorm:"type:text;size:65535;not null" json:"disabled"` ScheduleID string `gorm:"type:varchar(60);not null" json:"scheduleID"` Message string `gorm:"type:text;size:65535;not null" json:"runMsg"` Status string `gorm:"type:varchar(32);not null" json:"status"` // StatusRun%%% RunOptions schema.RunOptions `gorm:"-" json:"-"` RunOptionsJson string `gorm:"type:text;size:65535;not null" json:"-"` RunCachedIDs string `gorm:"type:text;size:65535;not null" json:"runCachedIDs"` ScheduledAt sql.NullTime ` json:"-"` CreateTime string `gorm:"-" json:"createTime"` ActivateTime string `gorm:"-" json:"activateTime"` UpdateTime string `gorm:"-" json:"updateTime"` CreatedAt time.Time ` json:"-"` ActivatedAt sql.NullTime ` json:"-"` UpdatedAt time.Time ` json:"-"` DeletedAt gorm.DeletedAt ` json:"-"` }
func ListRunsByStatus ¶
func (*Run) GetRunCacheIDList ¶
func (*Run) InitRuntime ¶ added in v0.14.3
func (*Run) ProcessRuntimeView ¶ added in v0.14.3
func (r *Run) ProcessRuntimeView(componentViews map[string][]schema.ComponentView, components map[string]schema.Component) error
补全ComponentView中的Deps
func (*Run) RemoveOuterDagView ¶ added in v0.14.3
func (r *Run) RemoveOuterDagView(runtimeView map[string][]schema.ComponentView) map[string][]schema.ComponentView
type RunCache ¶
type RunCache struct { Pk int64 `json:"-" gorm:"primaryKey;autoIncrement;not null"` ID string `json:"cacheID" gorm:"type:varchar(60);not null;index"` FirstFp string `json:"firstFp" gorm:"type:varchar(256)"` SecondFp string `json:"secondFp" gorm:"type:varchar(256)"` RunID string `json:"runID" gorm:"type:varchar(60);not null"` Source string `json:"source" gorm:"type:varchar(256);not null"` JobID string `json:"jobID" gorm:"type:varchar(60);not null"` FsID string `json:"-" gorm:"type:varchar(60);not null"` FsName string `json:"fsname" gorm:"type:varchar(60);not null"` UserName string `json:"username" gorm:"type:varchar(60);not null"` ExpiredTime string `json:"expiredTime" gorm:"type:varchar(64);default:'-1'"` Strategy string `json:"strategy" gorm:"type:varchar(16);default:'conservative'"` Custom string `json:"custom" gorm:"type:text;size:65535"` CreateTime string `json:"createTime" gorm:"-"` UpdateTime string `json:"updateTime,omitempty" gorm:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
func GetLastCacheForRun ¶
func ListRunCache ¶
func ListRunCacheByFirstFp ¶
type RunDag ¶ added in v0.14.3
type RunDag struct { Pk int64 `gorm:"primaryKey;autoIncrement;not null" json:"-"` ID string `gorm:"type:varchar(60);not null" json:"dagID"` RunID string `gorm:"type:varchar(60);not null" json:"runID"` ParentDagID string `gorm:"type:varchar(60);not null" json:"parentDagID"` Name string `gorm:"type:varchar(60);not null" json:"name"` DagName string `gorm:"type:varchar(60);not null" json:"dag_name"` Parameters map[string]string `gorm:"-" json:"parameters"` ParametersJson string `gorm:"type:text;size:65535;not null" json:"-"` Artifacts schema.Artifacts `gorm:"-" json:"artifacts"` ArtifactsJson string `gorm:"type:text;size:65535;not null" json:"-"` LoopSeq int `gorm:"type:int;not null" json:"-"` Status schema.JobStatus `gorm:"type:varchar(32);not null" json:"status"` Message string `gorm:"type:text;size:65535;not null" json:"message"` CreateTime string `gorm:"-" json:"createTime"` ActivateTime string `gorm:"-" json:"activateTime"` UpdateTime string `gorm:"-" json:"updateTime,omitempty"` CreatedAt time.Time ` json:"-"` ActivatedAt sql.NullTime ` json:"-"` UpdatedAt time.Time ` json:"-"` DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` }
func GetRunDagsOfRun ¶ added in v0.14.3
func ParseRunDag ¶ added in v0.14.3
func (*RunDag) Trans2DagView ¶ added in v0.14.3
type RunJob ¶
type RunJob struct { Pk int64 `gorm:"primaryKey;autoIncrement;not null" json:"-"` ID string `gorm:"type:varchar(60);not null" json:"jobID"` RunID string `gorm:"type:varchar(60);not null" json:"runID"` ParentDagID string `gorm:"type:varchar(60);not null" json:"parentDagID"` Name string `gorm:"type:varchar(60);not null" json:"name"` StepName string `gorm:"type:varchar(60);not null" json:"step_name"` Command string `gorm:"type:text;size:65535;not null" json:"command"` Parameters map[string]string `gorm:"-" json:"parameters"` ParametersJson string `gorm:"type:text;size:65535;not null" json:"-"` Artifacts schema.Artifacts `gorm:"-" json:"artifacts"` ArtifactsJson string `gorm:"type:text;size:65535;not null" json:"-"` Env map[string]string `gorm:"-" json:"env"` EnvJson string `gorm:"type:text;size:65535;not null" json:"-"` DockerEnv string `gorm:"type:varchar(128);not null" json:"docker_env"` LoopSeq int `gorm:"type:int;not null" json:"-"` Status schema.JobStatus `gorm:"type:varchar(32);not null" json:"status"` Message string `gorm:"type:text;size:65535;not null" json:"message"` Cache schema.Cache `gorm:"-" json:"cache"` CacheJson string `gorm:"type:text;size:65535;not null" json:"-"` CacheRunID string `gorm:"type:varchar(60);not null" json:"cacheRunID"` CacheJobID string `gorm:"type:varchar(60);not null" json:"cacheJobID"` ExtraFS []schema.FsMount `gorm:"-" json:"extraFs"` ExtraFSJson string `gorm:"type:text;size:65535;not null" json:"-"` CreateTime string `gorm:"-" json:"createTime"` ActivateTime string `gorm:"-" json:"activateTime"` UpdateTime string `gorm:"-" json:"updateTime,omitempty"` CreatedAt time.Time ` json:"-"` ActivatedAt sql.NullTime ` json:"-"` UpdatedAt time.Time ` json:"-"` DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` }
func ParseRunJob ¶
func (*RunJob) ParseJobView ¶
func (rj *RunJob) ParseJobView(step *schema.WorkflowSourceStep) schema.JobView
func (*RunJob) Trans2JobView ¶ added in v0.14.3
type Schedule ¶ added in v0.14.3
type Schedule struct { Pk int64 `gorm:"primaryKey;autoIncrement;not null" json:"-"` ID string `gorm:"type:varchar(60);not null" json:"scheduleID"` Name string `gorm:"type:varchar(60);not null" json:"name"` Desc string `gorm:"type:varchar(256);not null" json:"desc"` PipelineID string `gorm:"type:varchar(60);not null" json:"pipelineID"` PipelineVersionID string `gorm:"type:varchar(60);not null" json:"pipelineVersionID"` UserName string `gorm:"type:varchar(60);not null" json:"username"` FsConfig string `gorm:"type:varchar(1024);not null" json:"fsConfig"` Crontab string `gorm:"type:varchar(60);not null" json:"crontab"` Options string `gorm:"type:text;size:65535;not null" json:"options"` Message string `gorm:"type:text;size:65535;not null" json:"scheduleMsg"` Status string `gorm:"type:varchar(32);not null" json:"status"` StartAt sql.NullTime ` json:"-"` EndAt sql.NullTime ` json:"-"` NextRunAt time.Time ` json:"-"` CreatedAt time.Time ` json:"-"` UpdatedAt time.Time ` json:"-"` DeletedAt gorm.DeletedAt ` json:"-"` }
func GetSchedule ¶ added in v0.14.3
func GetScheduleByName ¶ added in v0.14.3
func GetSchedulesByStatus ¶ added in v0.14.3
func ListSchedule ¶ added in v0.14.3
type ScheduleOptions ¶ added in v0.14.3
type ScheduleOptions struct { Catchup bool `json:"catchup"` ExpireInterval int `json:"expireInterval"` Concurrency int `json:"concurrency"` ConcurrencyPolicy string `json:"concurrencyPolicy"` }
func DecodeScheduleOptions ¶ added in v0.14.3
func DecodeScheduleOptions(StrOptions string) (so ScheduleOptions, err error)
func NewScheduleOptions ¶ added in v0.14.3
Click to show internal directories.
Click to hide internal directories.