39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package config
|
|
|
|
import (
|
|
log "gitlink.org.cn/cloudream/common/pkgs/logger"
|
|
pcmsdk "gitlink.org.cn/cloudream/common/sdks/pcm"
|
|
schsdk "gitlink.org.cn/cloudream/common/sdks/scheduler"
|
|
"gitlink.org.cn/cloudream/common/sdks/storage/cdsapi"
|
|
c "gitlink.org.cn/cloudream/common/utils/config"
|
|
schmod "gitlink.org.cn/cloudream/scheduler/common/models"
|
|
mymq "gitlink.org.cn/cloudream/scheduler/common/pkgs/mq"
|
|
)
|
|
|
|
type Application struct {
|
|
Address string `json:"address"`
|
|
ExecutorID schmod.ExecutorID `json:"executorID"`
|
|
}
|
|
|
|
type Config struct {
|
|
Logger log.Config `json:"logger"`
|
|
ReportIntervalSec int `json:"reportIntervalSec"`
|
|
RabbitMQ mymq.Config `json:"rabbitMQ"`
|
|
CloudreamStorage cdsapi.Config `json:"cloudreamStorage"`
|
|
PCM pcmsdk.Config `json:"pcm"`
|
|
Application Application `json:"application"`
|
|
Rclone schsdk.Rclone `json:"rclone"`
|
|
CloudECS map[string]interface{} `json:"createECS"`
|
|
InferencePlatform schsdk.InferencePlatform `json:"inferencePlatform"`
|
|
}
|
|
|
|
var cfg Config
|
|
|
|
func Init() error {
|
|
return c.DefaultLoad("executor", &cfg)
|
|
}
|
|
|
|
func Cfg() *Config {
|
|
return &cfg
|
|
}
|