Documentation
¶
Index ¶
- Variables
- func AddKubeConfigFlagSet(fs *pflag.FlagSet, kubeConf *KubeConfig)
- func FileNumsInDir(path string) (int, error)
- func GetServiceAddress() string
- func InitConfigFromYaml(conf interface{}, configPath string) error
- func InitDefaultPV(path string) error
- func InitDefaultPVC(path string) error
- func InitJobTemplate(path string) error
- func InitKubeConfig(kubeConf KubeConfig) *rest.Config
- func InitKubeConfigFromBytes(configBytes []byte) (*rest.Config, error)
- func PathExists(path string) (bool, error)
- func PrettyFormat(data interface{}) []byte
- type ApiServerConfig
- type FsServerConf
- type ImageConfig
- type JobConfig
- type JobLogConfig
- type KubeConfig
- type MetricsConfig
- type PrometheusConfig
- type ReclaimConfig
- type ServerConfig
- type StorageConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GlobalServerConfig *ServerConfig // the global ServerConfig DefaultPV *apiv1.PersistentVolume // the global default pv instance DefaultPVC *apiv1.PersistentVolumeClaim // the global default pvc instance DefaultJobTemplate map[string][]byte // the global default job template DefaultRunYamlPath = "./run.yaml" // DefaultClusterName for default cluster in single cluster DefaultClusterName = "default-cluster" // DefaultQueueName for default queue in single cluster DefaultQueueName = "default-queue" // DefaultNamespace for default namespace of default queue in single cluster DefaultNamespace = "default" )
Functions ¶
func AddKubeConfigFlagSet ¶
func AddKubeConfigFlagSet(fs *pflag.FlagSet, kubeConf *KubeConfig)
func FileNumsInDir ¶
FileNumsInDir caculate files number in path, include dir type
func GetServiceAddress ¶ added in v0.14.3
func GetServiceAddress() string
GetServiceAddress get address of paddleflow's api-server
func InitConfigFromYaml ¶
func InitDefaultPV ¶
InitDefaultPV initialize the default pv instance
func InitDefaultPVC ¶
InitDefaultPVC initialize the default pvc instance
func InitJobTemplate ¶ added in v0.14.5
func InitKubeConfig ¶
func InitKubeConfig(kubeConf KubeConfig) *rest.Config
func InitKubeConfigFromBytes ¶
func PathExists ¶
PathExists indicate path exist or not 1. path exist: return true, nil 2. path not exist: return false, nil 3. unknown error: return false, err
func PrettyFormat ¶
func PrettyFormat(data interface{}) []byte
Types ¶
type ApiServerConfig ¶
type FsServerConf ¶
type FsServerConf struct {
DefaultPVPath string `yaml:"defaultPVPath"`
DefaultPVCPath string `yaml:"defaultPVCPath"`
LinkMetaDirPrefix string `yaml:"linkMetaDirPrefix"`
MountPodExpire time.Duration `yaml:"mountPodExpire"`
MountPodIntervalTime time.Duration `yaml:"mountPodIntervalTime"`
// ServicePort is used to call paddleflow api-server in k8s, the default is the same as ApiServerConfig.Port
ServicePort int `yaml:"servicePort"`
}
type ImageConfig ¶
type JobConfig ¶
type JobConfig struct {
Reclaim ReclaimConfig `yaml:"reclaim"`
SchedulerName string `yaml:"schedulerName"`
// period second for job manager
ClusterSyncPeriod int `yaml:"clusterSyncPeriod"`
QueueExpireTime int `yaml:"queueExpireTime"`
QueueCacheSize int `yaml:"queueCacheSize"`
JobLoopPeriod int `yaml:"jobLoopPeriod"`
// SyncClusterQueue defines whether aware cluster resource or not, such as queue
SyncClusterQueue bool `yaml:"syncClusterQueue"`
// DefaultJobYamlPath defines file path that stores all default templates in one yaml
DefaultJobYamlPath string `yaml:"defaultJobYamlPath"`
IsSingleCluster bool `yaml:"isSingleCluster"`
RuntimeType string `yaml:"runtimeType"`
Log JobLogConfig `yaml:"log"`
}
type JobLogConfig ¶ added in v0.14.6
type KubeConfig ¶
type MetricsConfig ¶ added in v0.14.4
type PrometheusConfig ¶ added in v0.14.3
type ReclaimConfig ¶
type ReclaimConfig struct {
CleanJob bool `yaml:"isCleanJob"`
SkipCleanFailedJob bool `yaml:"isSkipCleanFailedJob"`
FailedJobTTLSeconds int `yaml:"failedJobTTLSeconds,omitempty"`
SucceededJobTTLSeconds int `yaml:"succeededJobTTLSeconds,omitempty"`
PendingJobTTLSeconds int `yaml:"pendingJobTTLSeconds,omitempty"`
}
type ServerConfig ¶
type ServerConfig struct {
Storage StorageConfig `yaml:"database"`
Log logger.LogConfig `yaml:"log"`
TraceLog trace_logger.TraceLoggerConfig `yaml:"traceLog"`
ApiServer ApiServerConfig `yaml:"apiServer"`
Job JobConfig `yaml:"job"`
Fs FsServerConf `yaml:"fs"`
ImageConf ImageConfig `yaml:"imageRepository"`
Monitor PrometheusConfig `yaml:"monitor"`
Metrics MetricsConfig `yaml:"metrics"`
}
type StorageConfig ¶ added in v0.14.3
type StorageConfig struct {
Driver string `yaml:"driver"`
Host string `yaml:"host"`
Port string `yaml:"port"`
User string `yaml:"user"`
Password string `yaml:"password"`
Database string `yaml:"database"`
ConnectTimeoutInSeconds int `yaml:"connectTimeoutInSeconds,omitempty"`
LockTimeoutInMilliseconds int `yaml:"lockTimeoutInMilliseconds,omitempty"`
IdleTransactionTimeoutInMilliseconds int `yaml:"idleTransactionTimeoutInMilliseconds,omitempty"`
MaxIdleConns *int `yaml:"maxIdleConns,omitempty"`
MaxOpenConns *int `yaml:"maxOpenConns,omitempty"`
ConnMaxLifetimeInHours *int `yaml:"connMaxLifetimeInHours,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.