Documentation
¶
Index ¶
- Constants
- func CacheID(clusterID, nodeName, CacheDir, fsID string) string
- type ArtifactEvent
- type ClusterInfo
- type FSCache
- type FSCacheConfig
- type FileSystem
- type Flavour
- type Grant
- type Image
- type Job
- type JobLabel
- type JobTask
- type Link
- type Model
- type Pipeline
- type PipelineVersion
- type Queue
- type ResourceLimit
- type User
- type UserInfo
Constants ¶
View Source
const ( CreatedAt = "created_at" UpdatedAt = "updated_at" Type = "type" ID = "id" FsID = "fs_id" UserName = "user_name" FsName = "name" TimeFormat = "2006-01-02 15:04:05" )
View Source
const ( DefaultClusterSource = "OnPremise" ClusterStatusOnLine = "online" ClusterStatusOffLine = "offline" DefaultClusterStatus = ClusterStatusOnLine )
View Source
const (
FileSystemTableName = "filesystem"
)
View Source
const FlavourTableName = "flavour"
View Source
const FsCacheTableName = "fs_cache"
View Source
const (
JobTaskTableName = "job_task"
)
View Source
const (
LinkTableName = "link"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArtifactEvent ¶ added in v0.14.4
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 (*ArtifactEvent) AfterFind ¶ added in v0.14.4
func (a *ArtifactEvent) AfterFind(*gorm.DB) error
func (ArtifactEvent) TableName ¶ added in v0.14.4
func (ArtifactEvent) TableName() string
type ClusterInfo ¶ added in v0.14.4
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 (*ClusterInfo) AfterFind ¶ added in v0.14.4
func (clusterInfo *ClusterInfo) AfterFind(*gorm.DB) error
func (*ClusterInfo) BeforeSave ¶ added in v0.14.4
func (clusterInfo *ClusterInfo) BeforeSave(*gorm.DB) error
func (ClusterInfo) MarshalJSON ¶ added in v0.14.4
func (clusterInfo ClusterInfo) MarshalJSON() ([]byte, error)
func (ClusterInfo) TableName ¶ added in v0.14.4
func (ClusterInfo) TableName() string
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"`
CleanCache bool `json:"cleanCache"`
Resource ResourceLimit `json:"resource" gorm:"-"`
ResourceJson string `json:"-" gorm:"column:resource;type:text"`
NodeAffinityJson string `json:"-" gorm:"column:node_affinity;type:text;default:'{}'"`
NodeAffinity corev1.NodeAffinity `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:"-"`
CreateTime string `json:"createTime" gorm:"-"`
UpdateTime string `json:"updateTime,omitempty" gorm:"-"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
DeletedAt gorm.DeletedAt `json:"-"`
}
func (*FSCacheConfig) BeforeSave ¶
func (s *FSCacheConfig) BeforeSave(*gorm.DB) error
func (*FSCacheConfig) TableName ¶
func (s *FSCacheConfig) TableName() string
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"`
IndependentMountProcess bool `json:"independentMountProcess"`
}
FileSystem defined file system model, which can be used to create file system
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 ¶ added in v0.14.4
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 (*Flavour) BeforeSave ¶ added in v0.14.4
BeforeSave is the callback methods for saving flavour
func (Flavour) MarshalJSON ¶ added in v0.14.4
MarshalJSON decorate format of time
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"`
}
type Image ¶ added in v0.14.4
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 ¶ added in v0.14.4
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 []schema.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"`
}
type JobLabel ¶ added in v0.14.4
type JobTask ¶ added in v0.14.4
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:"-"`
}
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 (*Link) BeforeSave ¶
BeforeSave is the callback methods for saving file system
type Model ¶
type Pipeline ¶ added in v0.14.4
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(128);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:"-"`
}
type PipelineVersion ¶ added in v0.14.4
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 (PipelineVersion) TableName ¶ added in v0.14.4
func (PipelineVersion) TableName() string
type Queue ¶ added in v0.14.4
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 (*Queue) BeforeSave ¶ added in v0.14.4
BeforeSave is the callback methods for saving file system
func (Queue) MarshalJSON ¶ added in v0.14.4
type ResourceLimit ¶ added in v0.14.5
Click to show internal directories.
Click to hide internal directories.