feat: add trainer config in scheduler (#2214)
Signed-off-by: MinH-09 <2107139596@qq.com>
This commit is contained in:
parent
7a1ae0a2ee
commit
1994765fce
|
|
@ -69,6 +69,9 @@ type Config struct {
|
||||||
|
|
||||||
// NetworkTopology configuration.
|
// NetworkTopology configuration.
|
||||||
NetworkTopology NetworkTopologyConfig `yaml:"networkTopology" mapstructure:"networkTopology"`
|
NetworkTopology NetworkTopologyConfig `yaml:"networkTopology" mapstructure:"networkTopology"`
|
||||||
|
|
||||||
|
// Trainer configuration.
|
||||||
|
Trainer TrainerConfig `yaml:"trainer" mapstructure:"trainer"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ServerConfig struct {
|
type ServerConfig struct {
|
||||||
|
|
@ -320,6 +323,11 @@ type ProbeConfig struct {
|
||||||
SyncCount int `mapstructure:"syncCount" yaml:"syncCount"`
|
SyncCount int `mapstructure:"syncCount" yaml:"syncCount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TrainerConfig struct {
|
||||||
|
// Enable trainer service.
|
||||||
|
Enable bool `yaml:"enable" mapstructure:"enable"`
|
||||||
|
}
|
||||||
|
|
||||||
// New default configuration.
|
// New default configuration.
|
||||||
func New() *Config {
|
func New() *Config {
|
||||||
return &Config{
|
return &Config{
|
||||||
|
|
@ -399,6 +407,9 @@ func New() *Config {
|
||||||
SyncCount: DefaultProbeSyncCount,
|
SyncCount: DefaultProbeSyncCount,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Trainer: TrainerConfig{
|
||||||
|
Enable: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,9 @@ func TestConfig_Load(t *testing.T) {
|
||||||
SyncCount: 50,
|
SyncCount: 50,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Trainer: TrainerConfig{
|
||||||
|
Enable: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
schedulerConfigYAML := &Config{}
|
schedulerConfigYAML := &Config{}
|
||||||
|
|
|
||||||
|
|
@ -87,3 +87,6 @@ networkTopology:
|
||||||
queueLength: 5
|
queueLength: 5
|
||||||
syncInterval: 30s
|
syncInterval: 30s
|
||||||
syncCount: 50
|
syncCount: 50
|
||||||
|
|
||||||
|
trainer:
|
||||||
|
enable: false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue