Documentation ¶
Index ¶
- Constants
- func CloseQueue(queueName string) error
- func CountArtifactEvent(logEntry *log.Entry, fsID, artifactPath string) (int64, error)
- func CountPipelineByMd5InFs(md5, fsID string) (int64, error)
- func CountPipelineByNameInFs(name, fsID string) (int64, error)
- func CreatFileSystem(fs *FileSystem) error
- func CreateArtifactEvent(logEntry *log.Entry, artifact ArtifactEvent) error
- func CreateCluster(clusterInfo *ClusterInfo) error
- func CreateFSCacheConfig(logEntry *log.Entry, fsCacheConfig *FSCacheConfig) error
- func CreateFlavour(flavour *Flavour) error
- func CreateGrant(ctx *logger.RequestContext, grant *Grant) error
- func CreateImage(logEntry *log.Entry, image *Image) error
- func CreateJob(job *Job) error
- func CreateLink(link *Link) error
- func CreatePipeline(logEntry *log.Entry, ppl *Pipeline) (string, 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 CreateRunJobs(logEntry *log.Entry, jobs map[string]schema.JobView, runID string) error
- func CreateUser(ctx *logger.RequestContext, user *User) error
- func DeepCopyQueue(queueSrc Queue, queueDesc *Queue)
- func DeleteArtifactEvent(logEntry *log.Entry, username, fsname, runID, artifactPath string) error
- func DeleteCluster(clusterName string) error
- func DeleteFSCacheConfig(logEntry *log.Entry, fsID string) error
- func DeleteFileSystem(id string) error
- func DeleteFlavour(flavourName string) error
- func DeleteGrant(ctx *logger.RequestContext, userName, resourceType, resourceID string) error
- func DeleteGrantByResourceID(ctx *logger.RequestContext, resourceID string) error
- func DeleteGrantByUserName(ctx *logger.RequestContext, userName string) error
- func DeleteJob(jobID string) error
- func DeleteLinkWithFsIDAndFsPath(fsID, fsPath string) error
- func DeleteQueue(queueName string) error
- func DeleteRun(logEntry *log.Entry, runID string) error
- func DeleteRunCache(logEntry *log.Entry, cacheID string) error
- func DeleteUser(ctx *logger.RequestContext, userName string) error
- func GetCacheCount(logEntry *log.Entry, runID string) (int64, error)
- func GetJobStatusByID(jobID string) (schema.JobStatus, error)
- func GetRunCount(logEntry *log.Entry) (int64, error)
- func GetUrlByPFImageID(logEntry *log.Entry, PFImageID string) (string, error)
- func HardDeletePipeline(logEntry *log.Entry, id string) error
- func HasAccessToResource(ctx *logger.RequestContext, resourceType string, resourceID string) bool
- func InitMockDB()
- func IsQueueExist(queueName string) bool
- func IsQueueInUse(queueID string) (bool, map[string]schema.JobStatus)
- func ListImageIDsByFsID(logEntry *log.Entry, fsID string) ([]string, error)
- func ListJobIDByLabels(labels map[string]string) ([]string, error)
- func ListMountNodesByID(fsID string) ([]string, 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 UpdateFSCacheConfig(logEntry *log.Entry, fsCacheConfig FSCacheConfig) error
- func UpdateFlavour(flavour *Flavour) error
- func UpdateImage(logEntry *log.Entry, PFImageID string, image Image) error
- func UpdateJob(jobID string, status schema.JobStatus, info interface{}, message string) (schema.JobStatus, error)
- func UpdateJobConfig(jobId string, conf *schema.Conf) error
- func UpdateJobStatus(jobId, errMessage string, jobStatus schema.JobStatus) error
- func UpdateQueue(queue *Queue) error
- func UpdateQueueStatus(queueName string, queueStatus string) error
- func UpdateRun(logEntry *log.Entry, runID string, run Run) error
- func UpdateRunJob(logEntry *log.Entry, runID string, stepName string, runJob RunJob) error
- func UpdateRunStatus(logEntry *log.Entry, runID, status string) error
- func UpdateTask(task *JobTask) error
- func UpdateUser(ctx *logger.RequestContext, userName, password string) 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 ConcurrentFSCacheMap
- func (cm *ConcurrentFSCacheMap) Delete(key1, key2 string) error
- func (cm *ConcurrentFSCacheMap) Get(key1, key2 string) *FSCache
- func (cm *ConcurrentFSCacheMap) GetBatch(key string) []FSCache
- func (cm *ConcurrentFSCacheMap) Put(key string, value *FSCache)
- func (cm *ConcurrentFSCacheMap) Update(key, value *FSCache) (has bool, err error)
- type DBFSCache
- type FSCache
- type FSCacheConfig
- type FSCacheStore
- type FileSystem
- func GetFileSystemWithFsID(fsID string) (FileSystem, error)
- func GetFileSystemWithFsIDAndUserName(fsID, userName string) (FileSystem, error)
- func GetFsWithIDs(fsID []string) ([]FileSystem, error)
- func GetFsWithNameAndUserName(fsName, userName string) (FileSystem, error)
- func GetSimilarityAddressList(fsType string, ips []string) ([]FileSystem, error)
- func ListFileSystem(limit int, userName, marker, fsName string) ([]FileSystem, error)
- type Flavour
- type FsMount
- type Grant
- 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 ListJob(pk int64, maxKeys int, queue, status, startTime, timestamp, userFilter string, ...) ([]Job, error)
- func ListJobByParentID(parentID string) ([]Job, error)
- func ListJobByUpdateTime(updateTime string) ([]Job, error)
- func ListQueueJob(queueID string, status []schema.JobStatus) []Job
- type JobLabel
- type JobTask
- type Link
- type MemFSCache
- func (mem *MemFSCache) Add(value *FSCache) error
- func (mem *MemFSCache) Delete(fsID, cacheID string) error
- func (mem *MemFSCache) Get(fsID string, cacheID string) (*FSCache, error)
- func (mem *MemFSCache) List(fsID, cacheID string) ([]FSCache, error)
- func (mem *MemFSCache) Update(value *FSCache) (int64, error)
- type Member
- type Model
- type Pipeline
- func GetLastPipeline(logEntry *log.Entry) (Pipeline, error)
- func GetPipelineByID(id string) (Pipeline, error)
- func GetPipelineByMd5AndFs(md5, fsID string) (Pipeline, error)
- func GetPipelineByNameAndFs(fsID, name string) (Pipeline, error)
- func ListPipeline(pk int64, maxKeys int, userFilter, fsFilter, nameFilter []string) ([]Pipeline, error)
- type Queue
- type Run
- 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, step, source string) ([]RunCache, error)
- type RunJob
- type Transaction
- type User
- type UserInfo
Constants ¶
const ( DefaultClusterSource = "OnPremise" ClusterStatusOnLine = "online" ClusterStatusOffLine = "offline" DefaultClusterStatus = ClusterStatusOnLine )
const ( QueryEqualWithParam = " (%s = ?) " QueryLess = " (%s <= %s) " QueryGreater = " (%s >= %d) " QueryLikeWithParam = " (%s LIKE ?) " QueryInWithParam = " (%s IN (?)) " QueryNotInWithParam = " (%s NOT IN (?)) " QueryIsNull = " (%s IS NULL) " QueryAnd = " AND " QueryOr = " OR " CreatedAt = "created_at" UpdatedAt = "updated_at" Type = "type" ServerAddress = "server_address" State = "state" ID = "id" FsID = "fs_id" FsCacheID = "cache_id" FsPath = "fs_path" Address = "address" UserName = "user_name" FsName = "name" GrantFsType = "fs" ASC = "asc" DESC = "desc" MAXListFileSystems = 1000 FsPrefix = "fs-" FsNameNum = 8 TimeFormat = "2006-01-02 15:04:05" )
const (
FileSystemTableName = "filesystem"
)
const FsCacheTableName = "fs_cache"
const FsMountTableName = "fs_mount"
const (
JobTaskTableName = "job_task"
)
const (
LinkTableName = "link"
)
const (
ROOT = "root"
)
Variables ¶
This section is empty.
Functions ¶
func CloseQueue ¶
func CountArtifactEvent ¶
func CountPipelineByMd5InFs ¶
func CountPipelineByNameInFs ¶
func CreatFileSystem ¶
func CreatFileSystem(fs *FileSystem) error
func CreateArtifactEvent ¶
func CreateArtifactEvent(logEntry *log.Entry, artifact ArtifactEvent) error
func CreateCluster ¶
func CreateCluster(clusterInfo *ClusterInfo) error
func CreateFSCacheConfig ¶
func CreateFSCacheConfig(logEntry *log.Entry, fsCacheConfig *FSCacheConfig) error
func CreateGrant ¶
func CreateGrant(ctx *logger.RequestContext, grant *Grant) error
func CreateQueue ¶
func CreateRunJobs ¶
func CreateUser ¶
func CreateUser(ctx *logger.RequestContext, user *User) error
func DeepCopyQueue ¶
DeepCopyQueue returns a deep copy of the queue
func DeleteArtifactEvent ¶
func DeleteCluster ¶
func DeleteFileSystem ¶
func DeleteGrant ¶
func DeleteGrant(ctx *logger.RequestContext, userName, resourceType, resourceID string) error
func DeleteGrantByResourceID ¶
func DeleteGrantByResourceID(ctx *logger.RequestContext, resourceID string) error
func DeleteGrantByUserName ¶
func DeleteGrantByUserName(ctx *logger.RequestContext, userName string) error
func DeleteLinkWithFsIDAndFsPath ¶
DeleteLinkWithFsIDAndFsPath delete a file system link
func DeleteQueue ¶
func DeleteUser ¶
func DeleteUser(ctx *logger.RequestContext, userName string) error
func GetUrlByPFImageID ¶
func HasAccessToResource ¶
func HasAccessToResource(ctx *logger.RequestContext, resourceType string, resourceID string) bool
func InitMockDB ¶
func InitMockDB()
func IsQueueExist ¶
func ListImageIDsByFsID ¶
func ListJobIDByLabels ¶
list job process multi label get and result
func ListMountNodesByID ¶
func UpdateArtifactEvent ¶
func UpdateArtifactEvent(logEntry *log.Entry, fsID, artifactPath string, artifact ArtifactEvent) error
func UpdateCluster ¶
func UpdateCluster(clusterId string, clusterInfo *ClusterInfo) error
func UpdateFSCacheConfig ¶
func UpdateFSCacheConfig(logEntry *log.Entry, fsCacheConfig FSCacheConfig) error
func UpdateJobStatus ¶
func UpdateQueue ¶
func UpdateQueueStatus ¶
func UpdateRunJob ¶
func UpdateTask ¶
func UpdateUser ¶
func UpdateUser(ctx *logger.RequestContext, userName, password string) 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"` 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 ConcurrentFSCacheMap ¶
func (*ConcurrentFSCacheMap) Delete ¶
func (cm *ConcurrentFSCacheMap) Delete(key1, key2 string) error
func (*ConcurrentFSCacheMap) Get ¶
func (cm *ConcurrentFSCacheMap) Get(key1, key2 string) *FSCache
func (*ConcurrentFSCacheMap) GetBatch ¶
func (cm *ConcurrentFSCacheMap) GetBatch(key string) []FSCache
func (*ConcurrentFSCacheMap) Put ¶
func (cm *ConcurrentFSCacheMap) Put(key string, value *FSCache)
type FSCache ¶
type FSCache struct { PK int64 `json:"-" gorm:"primaryKey;autoIncrement"` CacheID string `json:"cacheID" gorm:"type:varchar(36);column:cache_id"` CacheHashID string `json:"cacheHashID" gorm:"type:varchar(36);column:cache_hash_id"` FsID string `json:"fsID" gorm:"type:varchar(36);column:fs_id"` CacheDir string `json:"cacheDir" gorm:"type:varchar(4096);column:cache_dir"` NodeName string `json:"nodename" gorm:"type:varchar(256);column:nodename"` UsedSize int `json:"usedSize" gorm:"type:bigint(20);column:usedsize"` ClusterID string `json:"-" gorm:"column:cluster_id;default:''"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-"` }
type FSCacheConfig ¶
type FSCacheConfig struct { PK int64 `json:"-" gorm:"primaryKey;autoIncrement"` FsID string `json:"fsID" gorm:"type:varchar(36);unique_index"` CacheDir string `json:"cacheDir"` Quota int `json:"quota"` MetaDriver string `json:"metaDriver"` BlockSize int `json:"blockSize"` Debug bool `json:"debug"` NodeAffinityJson string `json:"-" gorm:"column:node_affinity;type:text;default:'{}'"` NodeAffinityMap map[string]interface{} `json:"nodeAffinity" gorm:"-"` NodeTaintTolerationJson string `json:"-" gorm:"column:node_tainttoleration;type:text;default:'{}'"` NodeTaintTolerationMap map[string]interface{} `json:"nodeTaintToleration" gorm:"-"` ExtraConfigJson string `json:"-" gorm:"column:extra_config;type:text;default:'{}'"` ExtraConfigMap map[string]string `json:"extraConfig" gorm:"-"` CreatedAt time.Time `json:"createTime"` UpdatedAt time.Time `json:"updateTime,omitempty"` DeletedAt gorm.DeletedAt `json:"deleteTime,omitempty"` }
func GetFSCacheConfig ¶
func GetFSCacheConfig(logEntry *log.Entry, fsID string) (FSCacheConfig, error)
func (*FSCacheConfig) BeforeSave ¶
func (s *FSCacheConfig) BeforeSave(*gorm.DB) error
func (*FSCacheConfig) TableName ¶
func (s *FSCacheConfig) TableName() string
type FSCacheStore ¶
type FSCacheStore interface { Add(value *FSCache) error Get(fsID string, cacheID string) (*FSCache, error) Delete(fsID, cacheID string) error List(fsID, cacheID string) ([]FSCache, error) Update(value *FSCache) (int64, error) }
func GetFSCacheStore ¶
func GetFSCacheStore() FSCacheStore
type FileSystem ¶
type FileSystem struct { Model Name string `json:"name"` Type string `json:"type"` ServerAddress string `json:"serverAddress"` SubPath string `json:"subPath" gorm:"column:subpath"` PropertiesJson string `json:"-" gorm:"column:properties;type:text;default:'{}'"` PropertiesMap map[string]string `json:"properties" gorm:"-"` UserName string `json:"userName"` }
FileSystem defined file system model, which can be used to create file system
func GetFileSystemWithFsID ¶
func GetFileSystemWithFsID(fsID string) (FileSystem, error)
func GetFileSystemWithFsIDAndUserName ¶
func GetFileSystemWithFsIDAndUserName(fsID, userName string) (FileSystem, error)
func GetFsWithIDs ¶
func GetFsWithIDs(fsID []string) ([]FileSystem, error)
GetFsWithIDs get file system detail from ids
func GetFsWithNameAndUserName ¶
func GetFsWithNameAndUserName(fsName, userName string) (FileSystem, error)
GetFsWithNameAndUserName get file system detail from name and userID
func GetSimilarityAddressList ¶
func GetSimilarityAddressList(fsType string, ips []string) ([]FileSystem, error)
GetSimilarityAddressList find fs where have same type and serverAddress
func ListFileSystem ¶
func ListFileSystem(limit int, userName, marker, fsName string) ([]FileSystem, error)
ListFileSystem get file systems with marker and limit sort by create_at desc
func (*FileSystem) AfterFind ¶
func (s *FileSystem) AfterFind(*gorm.DB) error
AfterFind is the callback methods doing after the find file system
func (*FileSystem) BeforeSave ¶
func (s *FileSystem) BeforeSave(*gorm.DB) error
BeforeSave is the callback methods for saving file system
func (FileSystem) TableName ¶
func (FileSystem) 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 FsMount ¶
type FsMount struct { PK int64 `json:"-" gorm:"primaryKey;autoIncrement"` MountID string `json:"mountID" gorm:"type:varchar(36);column:mount_id"` FsID string `json:"fsID" gorm:"type:varchar(36);column:fs_id"` MountPoint string `json:"mountpoint" gorm:"type:varchar(4096);column:mountpoint"` NodeName string `json:"nodename" gorm:"type:varchar(256);column:nodename"` ClusterID string `json:"-" gorm:"column:cluster_id;default:''"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
FsMount defined file system mount info
func (*FsMount) DeleteMount ¶
type Grant ¶
type Grant struct { Pk int64 `json:"-" gorm:"primaryKey;autoIncrement"` ID string `json:"grantID" gorm:"uniqueIndex"` UserName string `json:"userName"` ResourceType string `json:"resourceType"` ResourceID string `json:"resourceID"` CreatedAt time.Time `json:"createTime"` UpdatedAt time.Time `json:"updateTime,omitempty"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
func GetGrant ¶
func GetGrant(ctx *logger.RequestContext, userName, resourceType, resourceID string) (*Grant, error)
func GetLastGrant ¶
func GetLastGrant(ctx *logger.RequestContext) (Grant, error)
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:"-"` Status schema.JobStatus `json:"status" gorm:"type:varchar(32);"` Message string `json:"message"` ResourceJson string `json:"-" gorm:"column:resource;type:text;default:'{}'"` Resource *schema.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 ListJobByParentID ¶
func ListJobByUpdateTime ¶
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 CreatedAt time.Time `json:"-"` StartedAt sql.NullTime `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt sql.NullTime `json:"-"` }
func GetJobTaskByID ¶
func ListByJobID ¶
type Link ¶
type Link struct { Model FsID string `json:"fsID"` FsPath string `json:"FsPath"` ServerAddress string `json:"serverAddress"` SubPath string `json:"subPath" gorm:"column:subpath"` Type string `json:"type"` PropertiesJson string `json:"-" gorm:"column:properties;type:text;default:'{}'"` PropertiesMap map[string]string `json:"properties" gorm:"-"` UserName string `json:"userName"` }
Link defined file system model, which can be used to create link
func FsNameLinks ¶
func GetLinkWithFsIDAndPath ¶
func LinkWithFsIDAndFsPath ¶
func (*Link) BeforeSave ¶
BeforeSave is the callback methods for saving file system
type MemFSCache ¶
type MemFSCache struct {
// contains filtered or unexported fields
}
func (*MemFSCache) Add ¶
func (mem *MemFSCache) Add(value *FSCache) error
func (*MemFSCache) Delete ¶
func (mem *MemFSCache) Delete(fsID, cacheID string) error
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;uniqueIndex"` Name string `json:"name" gorm:"type:varchar(60);not null;uniqueIndex:idx_fs_name"` FsID string `json:"-" gorm:"type:varchar(60);not null;uniqueIndex:idx_fs_name;uniqueIndex:idx_fs_md5"` FsName string `json:"fsname" gorm:"type:varchar(60);not null"` UserName string `json:"username" gorm:"type:varchar(60);not null"` PipelineYaml string `json:"pipelineYaml" gorm:"type:text;size:65535"` PipelineMd5 string `json:"pipelineMd5" gorm:"type:varchar(32);not null;uniqueIndex:idx_fs_md5"` CreateTime string `json:"createTime,omitempty" gorm:"-"` UpdateTime string `json:"updateTime,omitempty" gorm:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
func GetPipelineByID ¶
func GetPipelineByMd5AndFs ¶
func GetPipelineByNameAndFs ¶
func ListPipeline ¶
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 schema.ResourceInfo `json:"minResources" gorm:"-"` RawMaxResources string `json:"-" gorm:"column:max_resources;default:'{}'"` MaxResources schema.ResourceInfo `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"` }
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"` Description string `gorm:"type:text;size:65535;not null" json:"description"` ParametersJson string `gorm:"type:text;size:65535" json:"-"` Parameters map[string]interface{} `gorm:"-" json:"parameters"` RunYaml string `gorm:"type:text;size:65535" 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)" json:"dockerEnv"` Entry string `gorm:"type:varchar(256)" json:"entry"` Disabled string `gorm:"type:text;size:65535" json:"disabled"` Message string `gorm:"type:text;size:65535" json:"runMsg"` Status string `gorm:"type:varchar(32)" json:"status"` // StatusRun%%% RunCachedIDs string `gorm:"type:text;size:65535" json:"runCachedIDs"` 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 ListRunsByStatus ¶
func (*Run) GetRunCacheIDList ¶
type RunCache ¶
type RunCache struct { Pk int64 `json:"-" gorm:"primaryKey;autoIncrement;not null"` ID string `json:"cacheID" gorm:"type:varchar(60);not null;uniqueIndex"` 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"` Step string `json:"step" gorm:"type:varchar(256);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 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"` 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"` 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:"cache_run_id"` 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
type Transaction ¶
type User ¶
type User struct { Pk int64 `json:"-" gorm:"primaryKey;autoIncrement"` CreatedAt time.Time `json:"createTime"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-"` UserInfo `gorm:"embedded"` }
func GetLastUser ¶
func GetLastUser(ctx *logger.RequestContext) (User, error)
func GetUserByName ¶
func GetUserByName(ctx *logger.RequestContext, userName string) (User, error)