Documentation ¶
Index ¶
- Constants
- Variables
- func CloseQueue(queueName string) error
- func CountActiveRunsForSchedule(logEntry *log.Entry, scheduleID string) (int64, error)
- func CountArtifactEvent(logEntry *log.Entry, fsID, artifactPath string) (int64, error)
- func CountPipelineVersion(pipelineID string) (int64, error)
- func CountRun(logEntry *log.Entry, pk int64, maxKeys int, ...) (count int64, err error)
- func CreateArtifactEvent(logEntry *log.Entry, artifact ArtifactEvent) error
- func CreateCluster(clusterInfo *ClusterInfo) error
- func CreateFlavour(flavour *Flavour) error
- func CreateImage(logEntry *log.Entry, image *Image) error
- func CreateJob(job *Job) error
- func CreateOrUpdateQueue(queue *Queue) error
- func CreatePipeline(logEntry *log.Entry, ppl *Pipeline, pplVersion *PipelineVersion) (pplID string, pplVersionID string, err error)
- func CreateQueue(queue *Queue) 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 DeepCopyQueue(queueSrc Queue, queueDesc *Queue)
- func DeleteArtifactEvent(logEntry *log.Entry, username, fsname, runID, artifactPath string) error
- func DeleteCluster(clusterName string) error
- func DeleteFlavour(flavourName string) error
- func DeleteJob(jobID string) error
- func DeletePipeline(logEntry *log.Entry, id string) error
- func DeletePipelineVersion(logEntry *log.Entry, pipelineID string, pipelineVersionID string) error
- func DeleteQueue(queueName string) 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 GetJobStatusByID(jobID string) (schema.JobStatus, error)
- func GetNextGlobalWakeupTime(logEntry *log.Entry) (*time.Time, error)
- func GetUrlByPFImageID(logEntry *log.Entry, PFImageID string) (string, error)
- func IsLastPipelinePk(logEntry *log.Entry, pk int64, userFilter, nameFilter []string) (bool, error)
- func IsLastPipelineVersionPk(logEntry *log.Entry, pipelineID string, pk int64, fsFilter []string) (bool, error)
- func IsLastSchedulePk(logEntry *log.Entry, pk int64, ...) (bool, error)
- func IsQueueExist(queueName string) bool
- func IsQueueInUse(queueID string) (bool, map[string]schema.JobStatus)
- func IsScheduleFinalStatus(status string) bool
- func ListImageIDsByFsID(logEntry *log.Entry, fsID string) ([]string, error)
- func ListJobIDByLabels(labels map[string]string) ([]string, error)
- func ScheduleUsedFsIDs() (map[string]bool, error)
- func UpdateArtifactEvent(logEntry *log.Entry, fsID, artifactPath string, artifact ArtifactEvent) error
- func UpdateCache(logEntry *log.Entry, cacheID string, cache RunCache) error
- func UpdateCluster(clusterId string, clusterInfo *ClusterInfo) error
- func UpdateFlavour(flavour *Flavour) error
- func UpdateImage(logEntry *log.Entry, PFImageID string, image Image) error
- func UpdateJob(jobID string, status schema.JobStatus, runtimeInfo, runtimeStatus interface{}, ...) (schema.JobStatus, error)
- func UpdateJobConfig(jobId string, conf *schema.Conf) error
- func UpdateJobStatus(jobId, errMessage string, newStatus schema.JobStatus) error
- func UpdatePipeline(logEntry *log.Entry, ppl *Pipeline, pplVersion *PipelineVersion) (pplID string, pplVersionID string, err error)
- func UpdateQueue(queue *Queue) error
- func UpdateQueueInfo(name, status string, max, min *resources.Resource) error
- func UpdateQueueStatus(queueName string, queueStatus string) 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
- func UpdateTask(task *JobTask) error
- func WithTransaction(tdb *gorm.DB, fn Transaction) (err error)
- type ArtifactEvent
- type ClusterInfo
- func ActiveClusters() []ClusterInfo
- func GetClusterById(clusterId string) (ClusterInfo, error)
- func GetClusterByName(clusterName string) (ClusterInfo, error)
- func GetLastCluster() (ClusterInfo, error)
- func ListCluster(pk int64, maxKeys int, clusterNameList []string, clusterStatus string) ([]ClusterInfo, error)
- type Flavour
- type FsConfig
- type Image
- type Job
- func GetJobByID(jobID string) (Job, error)
- func GetJobsByRunID(runID string, jobID string) ([]Job, error)
- func GetLastJob() (Job, error)
- func GetUnscopedJobByID(jobID string) (Job, error)
- func ListClusterJob(clusterID string, status schema.JobStatus) []Job
- func ListJob(pk int64, maxKeys int, queue, status, startTime, timestamp, userFilter string, ...) ([]Job, error)
- func ListJobByParentID(parentID string) ([]Job, error)
- func ListJobByStatus(status schema.JobStatus) []Job
- func ListJobByUpdateTime(updateTime string) ([]Job, error)
- func ListQueueInitJob(queueID string) []Job
- func ListQueueJob(queueID string, status []schema.JobStatus) []Job
- type JobLabel
- type JobTask
- type Member
- type Model
- type Pipeline
- type PipelineVersion
- func GetLastPipelineVersion(pipelineID string) (PipelineVersion, error)
- func GetPipelineVersion(pipelineID string, pipelineVersionID string) (PipelineVersion, error)
- func GetPipelineVersions(pipelineID string) ([]PipelineVersion, error)
- func ListPipelineVersion(pipelineID string, pk int64, maxKeys int, fsFilter []string) ([]PipelineVersion, error)
- type Queue
- 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
- type Transaction
Constants ¶
View Source
const ( DefaultClusterSource = "OnPremise" ClusterStatusOnLine = "online" ClusterStatusOffLine = "offline" DefaultClusterStatus = ClusterStatusOnLine )
View Source
const ( CreatedAt = "created_at" UpdatedAt = "updated_at" Type = "type" ID = "id" FsID = "fs_id" UserName = "user_name" FsName = "name" GrantFsType = "fs" TimeFormat = "2006-01-02 15:04:05" )
View Source
const ( ConcurrencyPolicySuspend = "suspend" ConcurrencyPolicyReplace = "replace" ConcurrencyPolicySkip = "skip" ScheduleStatusSuccess = "success" ScheduleStatusRunning = "running" ScheduleStatusFailed = "failed" ScheduleStatusTerminated = "terminated" )
View Source
const (
JobTaskTableName = "job_task"
)
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 CloseQueue ¶
func CountActiveRunsForSchedule ¶ added in v0.14.3
func CountArtifactEvent ¶
func CountPipelineVersion ¶ added in v0.14.3
func CreateArtifactEvent ¶
func CreateArtifactEvent(logEntry *log.Entry, artifact ArtifactEvent) error
func CreateCluster ¶
func CreateCluster(clusterInfo *ClusterInfo) error
func CreateOrUpdateQueue ¶ added in v0.14.3
func CreatePipeline ¶
func CreateQueue ¶
func CreateRunDag ¶ added in v0.14.3
func CreateRunJob ¶ added in v0.14.3
func CreateSchedule ¶ added in v0.14.3
func DeepCopyQueue ¶
DeepCopyQueue returns a deep copy of the queue
func DeleteArtifactEvent ¶
func DeleteCluster ¶
func DeletePipelineVersion ¶ added in v0.14.3
func DeleteQueue ¶
func DeleteSchedule ¶ added in v0.14.3
func GetNextGlobalWakeupTime ¶ added in v0.14.3
计算timeout先不加事务,虽然select和 CountActiveRunsForSchedule 是非原子性,因为只影响休眠时间的计算结果
func GetUrlByPFImageID ¶
func IsLastPipelinePk ¶ added in v0.14.3
func IsLastPipelineVersionPk ¶ added in v0.14.3
func IsLastSchedulePk ¶ added in v0.14.3
func IsQueueExist ¶
func IsScheduleFinalStatus ¶ added in v0.14.3
func ListImageIDsByFsID ¶
func ListJobIDByLabels ¶
list job process multi label get and result
func ScheduleUsedFsIDs ¶ added in v0.14.3
func UpdateArtifactEvent ¶
func UpdateArtifactEvent(logEntry *log.Entry, fsID, artifactPath string, artifact ArtifactEvent) error
func UpdateCluster ¶
func UpdateCluster(clusterId string, clusterInfo *ClusterInfo) error
func UpdateJobStatus ¶
func UpdatePipeline ¶ added in v0.14.3
func UpdateQueue ¶
func UpdateQueueInfo ¶ added in v0.14.3
func UpdateQueueStatus ¶
func UpdateRunDag ¶ added in v0.14.3
func UpdateScheduleStatus ¶ added in v0.14.3
func UpdateTask ¶
func WithTransaction ¶ added in v0.14.3
func WithTransaction(tdb *gorm.DB, fn Transaction) (err error)
Types ¶
type ArtifactEvent ¶
type ArtifactEvent struct { Pk int64 `json:"-" gorm:"primaryKey;autoIncrement;not null"` Md5 string `json:"-" gorm:"type:varchar(32);not null"` RunID string `json:"runID" 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"` ArtifactPath string `json:"artifactPath" gorm:"type:varchar(256);not null"` Step string `json:"step" gorm:"type:varchar(256);not null"` JobID string `json:"jobID" gorm:"type:varchar(60);not null"` Type string `json:"type" gorm:"type:varchar(16);not null"` ArtifactName string `json:"artifactName" gorm:"type:varchar(32);not null"` Meta string `json:"meta" 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 GetArtifactEvent ¶
func GetArtifactEvent(logEntry *log.Entry, runID, fsID, artifactPath string) (ArtifactEvent, error)
func GetLastArtifactEvent ¶
func GetLastArtifactEvent(logEntry *log.Entry) (ArtifactEvent, error)
func ListArtifactEvent ¶
func (ArtifactEvent) TableName ¶
func (ArtifactEvent) TableName() string
type ClusterInfo ¶
type ClusterInfo struct { Model `gorm:"embedded" json:",inline"` Pk int64 `gorm:"primaryKey;autoIncrement" json:"-"` // 自增主键 Name string `gorm:"column:name" json:"clusterName"` // 集群名字 Description string `gorm:"column:description" json:"description"` // 集群描述 Endpoint string `gorm:"column:endpoint" json:"endpoint"` // 集群endpoint, 比如 http://10.11.11.47:8080 Source string `gorm:"column:source" json:"source"` // 来源, 比如 OnPremise (内部部署)、AWS、CCE ClusterType string `gorm:"column:cluster_type" json:"clusterType"` // 集群类型,比如Kubernetes/Local Version string `gorm:"column:version" json:"version"` // 集群版本,比如v1.16 Status string `gorm:"column:status" json:"status"` // 集群状态,可选值为online, offline Credential string `gorm:"column:credential" json:"credential"` // 用于存储集群的凭证信息,比如k8s的kube_config配置 Setting string `gorm:"column:setting" json:"setting"` // 存储额外配置信息 RawNamespaceList string `gorm:"column:namespace_list" json:"-"` // 命名空间列表,json类型,如["ns1", "ns2"] NamespaceList []string `gorm:"-" json:"namespaceList"` // 命名空间列表,json类型,如["ns1", "ns2"] DeletedAt string `gorm:"column:deleted_at" json:"-"` // 删除标识,非空表示软删除 }
func ActiveClusters ¶
func ActiveClusters() []ClusterInfo
func GetClusterById ¶
func GetClusterById(clusterId string) (ClusterInfo, error)
func GetClusterByName ¶
func GetClusterByName(clusterName string) (ClusterInfo, error)
func GetLastCluster ¶
func GetLastCluster() (ClusterInfo, error)
func ListCluster ¶
func (*ClusterInfo) BeforeSave ¶
func (clusterInfo *ClusterInfo) BeforeSave(*gorm.DB) error
func (ClusterInfo) MarshalJSON ¶
func (clusterInfo ClusterInfo) MarshalJSON() ([]byte, error)
func (ClusterInfo) TableName ¶
func (ClusterInfo) TableName() string
type Flavour ¶
type Flavour struct { Model `gorm:"embedded" json:",inline"` Pk int64 `json:"-" gorm:"primaryKey;autoIncrement"` Name string `json:"name" gorm:"uniqueIndex"` ClusterID string `json:"-" gorm:"column:cluster_id;default:''"` ClusterName string `json:"-" gorm:"column:cluster_name;->"` CPU string `json:"cpu" gorm:"column:cpu"` Mem string `json:"mem" gorm:"column:mem"` RawScalarResources string `json:"-" gorm:"column:scalar_resources;type:text;default:'{}'"` ScalarResources schema.ScalarResourcesType `json:"scalarResources" gorm:"-"` UserName string `json:"-" gorm:"column:user_name"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
Flavour records request resource info for each job
func GetLastFlavour ¶
GetLastFlavour get last flavour that usually be used for indicating last page
func ListFlavour ¶
ListFlavour all params is nullable, and support fuzzy query of flavour's name by queryKey
func (*Flavour) BeforeSave ¶
BeforeSave is the callback methods for saving flavour
func (Flavour) MarshalJSON ¶
MarshalJSON decorate format of time
type FsConfig ¶ added in v0.14.3
type FsConfig struct {
Username string `json:"username"`
}
func DecodeFsConfig ¶ added in v0.14.3
type Image ¶
type Image struct { Pk int64 `json:"-" gorm:"primaryKey;autoIncrement;not null"` ID string `json:"PFImageID" gorm:"type:varchar(128);not null;uniqueIndex"` ImageID string `json:"imageID" gorm:"type:varchar(64)"` FsID string `json:"fsID" gorm:"type:varchar(60);not null"` Source string `json:"source" gorm:"type:varchar(256);not null"` Url string `json:"url" gorm:"type:varchar(256)"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
type Job ¶
type Job struct { Pk int64 `json:"-" gorm:"primaryKey;autoIncrement"` ID string `json:"jobID" gorm:"type:varchar(60);index:idx_id,unique;NOT NULL"` Name string `json:"jobName" gorm:"type:varchar(512);default:''"` UserName string `json:"userName" gorm:"NOT NULL"` QueueID string `json:"queueID" gorm:"NOT NULL"` Type string `json:"type" gorm:"type:varchar(20);NOT NULL"` ConfigJson string `json:"-" gorm:"column:config;type:text"` Config *schema.Conf `json:"config" gorm:"-"` RuntimeInfoJson string `json:"-" gorm:"column:runtime_info;default:'{}'"` RuntimeInfo interface{} `json:"runtimeInfo" gorm:"-"` RuntimeStatusJson string `json:"-" gorm:"column:runtime_status;default:'{}'"` RuntimeStatus interface{} `json:"runtimeStatus" gorm:"-"` Status schema.JobStatus `json:"status" gorm:"type:varchar(32);"` Message string `json:"message"` ResourceJson string `json:"-" gorm:"column:resource;type:text;default:'{}'"` Resource *resources.Resource `json:"resource" gorm:"-"` Framework schema.Framework `json:"framework" gorm:"type:varchar(30)"` MembersJson string `json:"-" gorm:"column:members;type:text"` Members []Member `json:"members" gorm:"-"` ExtensionTemplate string `json:"-" gorm:"type:text"` ParentJob string `json:"-" gorm:"type:varchar(60)"` CreatedAt time.Time `json:"createTime"` ActivatedAt sql.NullTime `json:"activateTime"` UpdatedAt time.Time `json:"updateTime,omitempty"` DeletedAt string `json:"-" gorm:"index:idx_id"` }
func GetJobByID ¶
func GetLastJob ¶
func GetUnscopedJobByID ¶
func ListClusterJob ¶ added in v0.14.3
func ListJobByParentID ¶
func ListJobByStatus ¶ added in v0.14.3
func ListJobByUpdateTime ¶
func ListQueueInitJob ¶ added in v0.14.3
type JobLabel ¶
type JobTask ¶
type JobTask struct { Pk int64 `json:"-" gorm:"primaryKey;autoIncrement"` ID string `json:"id" gorm:"type:varchar(64);uniqueIndex"` // k8s:podID JobID string `json:"jobID" gorm:"type:varchar(60)"` Namespace string `json:"namespace" gorm:"type:varchar(64)"` Name string `json:"name" gorm:"type:varchar(512)"` MemberRole schema.MemberRole `json:"memberRole"` Status schema.TaskStatus `json:"status"` Message string `json:"message"` LogURL string `json:"logURL"` ExtRuntimeStatusJSON string `json:"extRuntimeStatus" gorm:"column:ext_runtime_status;default:'{}'"` ExtRuntimeStatus interface{} `json:"-" gorm:"-"` // k8s:v1.PodStatus NodeName string `json:"nodeName"` CreatedAt time.Time `json:"-"` StartedAt sql.NullTime `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt sql.NullTime `json:"-"` }
func GetJobTaskByID ¶
func ListByJobID ¶
type Model ¶
type Pipeline ¶
type Pipeline struct { Pk int64 `json:"-" gorm:"primaryKey;autoIncrement;not null"` ID string `json:"pipelineID" gorm:"type:varchar(60);not null;index"` Name string `json:"name" gorm:"type:varchar(60);not null;index:idx_fs_name"` Desc string `json:"desc" gorm:"type:varchar(256);not null"` UserName string `json:"username" gorm:"type:varchar(60);not null;index:idx_fs_name"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-"` }
func GetPipeline ¶ added in v0.14.3
func GetPipelineByID ¶
func ListPipeline ¶
type PipelineVersion ¶ added in v0.14.3
type PipelineVersion struct { Pk int64 `json:"-" gorm:"primaryKey;autoIncrement;not null"` ID string `json:"pipelineVersionID" gorm:"type:varchar(60);not null"` PipelineID string `json:"pipelineID" 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"` YamlPath string `json:"yamlPath" gorm:"type:text;size:65535;not null"` PipelineYaml string `json:"pipelineYaml" gorm:"type:text;size:65535;not null"` PipelineMd5 string `json:"pipelineMd5" gorm:"type:varchar(32);not null"` UserName string `json:"username" gorm:"type:varchar(60);not null"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-"` }
func GetLastPipelineVersion ¶ added in v0.14.3
func GetLastPipelineVersion(pipelineID string) (PipelineVersion, error)
func GetPipelineVersion ¶ added in v0.14.3
func GetPipelineVersion(pipelineID string, pipelineVersionID string) (PipelineVersion, error)
func GetPipelineVersions ¶ added in v0.14.3
func GetPipelineVersions(pipelineID string) ([]PipelineVersion, error)
func ListPipelineVersion ¶ added in v0.14.3
func (PipelineVersion) TableName ¶ added in v0.14.3
func (PipelineVersion) TableName() string
type Queue ¶
type Queue struct { Model `gorm:"embedded"` Pk int64 `json:"-" gorm:"primaryKey;autoIncrement"` Name string `json:"name" gorm:"uniqueIndex"` Namespace string `json:"namespace" gorm:"column:"` ClusterId string `json:"-" gorm:"column:cluster_id"` ClusterName string `json:"clusterName" gorm:"column:cluster_name;->"` QuotaType string `json:"quotaType"` RawMinResources string `json:"-" gorm:"column:min_resources;default:'{}'"` MinResources *resources.Resource `json:"minResources" gorm:"-"` RawMaxResources string `json:"-" gorm:"column:max_resources;default:'{}'"` MaxResources *resources.Resource `json:"maxResources" gorm:"-"` RawLocation string `json:"-" gorm:"column:location;type:text;default:'{}'"` Location map[string]string `json:"location" gorm:"-"` // 任务调度策略 RawSchedulingPolicy string `json:"-" gorm:"column:scheduling_policy"` SchedulingPolicy []string `json:"schedulingPolicy,omitempty" gorm:"-"` Status string `json:"status"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` UsedResources *resources.Resource `json:"usedResources,omitempty" gorm:"-"` IdleResources *resources.Resource `json:"idleResources,omitempty" gorm:"-"` }
func GetLastQueue ¶
func GetQueueByID ¶
func GetQueueByName ¶
func ListQueuesByCluster ¶
func (*Queue) BeforeSave ¶
BeforeSave is the callback methods for saving file system
func (Queue) MarshalJSON ¶
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(60);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"` 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,omitempty"` 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
type Transaction ¶
Click to show internal directories.
Click to hide internal directories.