diff --git a/scheduler/config/config.go b/scheduler/config/config.go index 7f7527508..66a5ce121 100644 --- a/scheduler/config/config.go +++ b/scheduler/config/config.go @@ -69,6 +69,9 @@ type Config struct { // NetworkTopology configuration. NetworkTopology NetworkTopologyConfig `yaml:"networkTopology" mapstructure:"networkTopology"` + + // Trainer configuration. + Trainer TrainerConfig `yaml:"trainer" mapstructure:"trainer"` } type ServerConfig struct { @@ -320,6 +323,11 @@ type ProbeConfig struct { SyncCount int `mapstructure:"syncCount" yaml:"syncCount"` } +type TrainerConfig struct { + // Enable trainer service. + Enable bool `yaml:"enable" mapstructure:"enable"` +} + // New default configuration. func New() *Config { return &Config{ @@ -399,6 +407,9 @@ func New() *Config { SyncCount: DefaultProbeSyncCount, }, }, + Trainer: TrainerConfig{ + Enable: false, + }, } } diff --git a/scheduler/config/config_test.go b/scheduler/config/config_test.go index a95b5b9b6..76082ccfa 100644 --- a/scheduler/config/config_test.go +++ b/scheduler/config/config_test.go @@ -165,6 +165,9 @@ func TestConfig_Load(t *testing.T) { SyncCount: 50, }, }, + Trainer: TrainerConfig{ + Enable: false, + }, } schedulerConfigYAML := &Config{} diff --git a/scheduler/config/testdata/scheduler.yaml b/scheduler/config/testdata/scheduler.yaml index f239fcbb5..fbaece15e 100644 --- a/scheduler/config/testdata/scheduler.yaml +++ b/scheduler/config/testdata/scheduler.yaml @@ -87,3 +87,6 @@ networkTopology: queueLength: 5 syncInterval: 30s syncCount: 50 + +trainer: + enable: false