Skip to content

Commit

Permalink
revert legacy config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wdbaruni committed Sep 17, 2024
1 parent 81f0f1c commit c6a92a4
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/config_legacy/configenv/production.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ var ProductionComputeConfig = types.ComputeConfig{
InfoUpdateFrequency: types.Duration(60 * time.Second),
ResourceUpdateFrequency: types.Duration(30 * time.Second),
HeartbeatFrequency: types.Duration(15 * time.Second),
HeartbeatTopic: "heartbeat",
},
}

Expand Down Expand Up @@ -173,6 +174,7 @@ var ProductionRequesterConfig = types.RequesterConfig{
},
ControlPlaneSettings: types.RequesterControlPlaneConfig{
HeartbeatCheckFrequency: types.Duration(30 * time.Second),
HeartbeatTopic: "heartbeat",
NodeDisconnectedAfter: types.Duration(30 * time.Second),
},
NodeInfoStoreTTL: types.Duration(10 * time.Minute),
Expand Down
3 changes: 3 additions & 0 deletions pkg/config_legacy/types/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,7 @@ type ComputeControlPlaneConfig struct {
// that the compute node is still alive. This should be less than the requester's configured
// heartbeat timeout to avoid flapping.
HeartbeatFrequency Duration `yaml:"HeartbeatFrequency"`

// This is the pubsub topic that the compute node will use to send heartbeats to the requester node.
HeartbeatTopic string `yaml:"HeartbeatTopic"`
}
2 changes: 2 additions & 0 deletions pkg/config_legacy/types/generated_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const NodeComputeControlPlaneSettings = "node.compute.controlplanesettings"
const NodeComputeControlPlaneSettingsInfoUpdateFrequency = "node.compute.controlplanesettings.infoupdatefrequency"
const NodeComputeControlPlaneSettingsResourceUpdateFrequency = "node.compute.controlplanesettings.resourceupdatefrequency"
const NodeComputeControlPlaneSettingsHeartbeatFrequency = "node.compute.controlplanesettings.heartbeatfrequency"
const NodeComputeControlPlaneSettingsHeartbeatTopic = "node.compute.controlplanesettings.heartbeattopic"
const NodeRequester = "node.requester"
const NodeRequesterJobDefaults = "node.requester.jobdefaults"
const NodeRequesterJobDefaultsTotalTimeout = "node.requester.jobdefaults.totaltimeout"
Expand Down Expand Up @@ -127,6 +128,7 @@ const NodeRequesterTagCacheFrequency = "node.requester.tagcache.frequency"
const NodeRequesterDefaultPublisher = "node.requester.defaultpublisher"
const NodeRequesterControlPlaneSettings = "node.requester.controlplanesettings"
const NodeRequesterControlPlaneSettingsHeartbeatCheckFrequency = "node.requester.controlplanesettings.heartbeatcheckfrequency"
const NodeRequesterControlPlaneSettingsHeartbeatTopic = "node.requester.controlplanesettings.heartbeattopic"
const NodeRequesterControlPlaneSettingsNodeDisconnectedAfter = "node.requester.controlplanesettings.nodedisconnectedafter"
const NodeRequesterNodeInfoStoreTTL = "node.requester.nodeinfostorettl"
const NodeRequesterManualNodeApproval = "node.requester.manualnodeapproval"
Expand Down
2 changes: 2 additions & 0 deletions pkg/config_legacy/types/generated_descriptions.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/config_legacy/types/generated_viper_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func SetDefaults(cfg BacalhauConfig, opts ...SetOption) {
p.Viper.SetDefault(NodeComputeControlPlaneSettingsInfoUpdateFrequency, cfg.Node.Compute.ControlPlaneSettings.InfoUpdateFrequency.AsTimeDuration())
p.Viper.SetDefault(NodeComputeControlPlaneSettingsResourceUpdateFrequency, cfg.Node.Compute.ControlPlaneSettings.ResourceUpdateFrequency.AsTimeDuration())
p.Viper.SetDefault(NodeComputeControlPlaneSettingsHeartbeatFrequency, cfg.Node.Compute.ControlPlaneSettings.HeartbeatFrequency.AsTimeDuration())
p.Viper.SetDefault(NodeComputeControlPlaneSettingsHeartbeatTopic, cfg.Node.Compute.ControlPlaneSettings.HeartbeatTopic)
p.Viper.SetDefault(NodeRequester, cfg.Node.Requester)
p.Viper.SetDefault(NodeRequesterJobDefaults, cfg.Node.Requester.JobDefaults)
p.Viper.SetDefault(NodeRequesterJobDefaultsTotalTimeout, cfg.Node.Requester.JobDefaults.TotalTimeout.AsTimeDuration())
Expand Down Expand Up @@ -149,6 +150,7 @@ func SetDefaults(cfg BacalhauConfig, opts ...SetOption) {
p.Viper.SetDefault(NodeRequesterDefaultPublisher, cfg.Node.Requester.DefaultPublisher)
p.Viper.SetDefault(NodeRequesterControlPlaneSettings, cfg.Node.Requester.ControlPlaneSettings)
p.Viper.SetDefault(NodeRequesterControlPlaneSettingsHeartbeatCheckFrequency, cfg.Node.Requester.ControlPlaneSettings.HeartbeatCheckFrequency.AsTimeDuration())
p.Viper.SetDefault(NodeRequesterControlPlaneSettingsHeartbeatTopic, cfg.Node.Requester.ControlPlaneSettings.HeartbeatTopic)
p.Viper.SetDefault(NodeRequesterControlPlaneSettingsNodeDisconnectedAfter, cfg.Node.Requester.ControlPlaneSettings.NodeDisconnectedAfter.AsTimeDuration())
p.Viper.SetDefault(NodeRequesterNodeInfoStoreTTL, cfg.Node.Requester.NodeInfoStoreTTL.AsTimeDuration())
p.Viper.SetDefault(NodeRequesterManualNodeApproval, cfg.Node.Requester.ManualNodeApproval)
Expand Down Expand Up @@ -283,6 +285,7 @@ func Set(cfg BacalhauConfig, opts ...SetOption) {
p.Viper.Set(NodeComputeControlPlaneSettingsInfoUpdateFrequency, cfg.Node.Compute.ControlPlaneSettings.InfoUpdateFrequency.AsTimeDuration())
p.Viper.Set(NodeComputeControlPlaneSettingsResourceUpdateFrequency, cfg.Node.Compute.ControlPlaneSettings.ResourceUpdateFrequency.AsTimeDuration())
p.Viper.Set(NodeComputeControlPlaneSettingsHeartbeatFrequency, cfg.Node.Compute.ControlPlaneSettings.HeartbeatFrequency.AsTimeDuration())
p.Viper.Set(NodeComputeControlPlaneSettingsHeartbeatTopic, cfg.Node.Compute.ControlPlaneSettings.HeartbeatTopic)
p.Viper.Set(NodeRequester, cfg.Node.Requester)
p.Viper.Set(NodeRequesterJobDefaults, cfg.Node.Requester.JobDefaults)
p.Viper.Set(NodeRequesterJobDefaultsTotalTimeout, cfg.Node.Requester.JobDefaults.TotalTimeout.AsTimeDuration())
Expand Down Expand Up @@ -328,6 +331,7 @@ func Set(cfg BacalhauConfig, opts ...SetOption) {
p.Viper.Set(NodeRequesterDefaultPublisher, cfg.Node.Requester.DefaultPublisher)
p.Viper.Set(NodeRequesterControlPlaneSettings, cfg.Node.Requester.ControlPlaneSettings)
p.Viper.Set(NodeRequesterControlPlaneSettingsHeartbeatCheckFrequency, cfg.Node.Requester.ControlPlaneSettings.HeartbeatCheckFrequency.AsTimeDuration())
p.Viper.Set(NodeRequesterControlPlaneSettingsHeartbeatTopic, cfg.Node.Requester.ControlPlaneSettings.HeartbeatTopic)
p.Viper.Set(NodeRequesterControlPlaneSettingsNodeDisconnectedAfter, cfg.Node.Requester.ControlPlaneSettings.NodeDisconnectedAfter.AsTimeDuration())
p.Viper.Set(NodeRequesterNodeInfoStoreTTL, cfg.Node.Requester.NodeInfoStoreTTL.AsTimeDuration())
p.Viper.Set(NodeRequesterManualNodeApproval, cfg.Node.Requester.ManualNodeApproval)
Expand Down
3 changes: 3 additions & 0 deletions pkg/config_legacy/types/requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ type RequesterControlPlaneConfig struct {
// switching between unknown and active too frequently.
HeartbeatCheckFrequency Duration `yaml:"HeartbeatFrequency"`

// This is the pubsub topic that the compute node will use to send heartbeats to the requester node.
HeartbeatTopic string `yaml:"HeartbeatTopic"`

// This is the time period after which a compute node is considered to be disconnected. If the compute
// node does not deliver a heartbeat every `NodeDisconnectedAfter` then it is considered disconnected.
NodeDisconnectedAfter Duration `yaml:"NodeDisconnectedAfter"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/config_legacy/types/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ var TestingComputeConfig = ComputeConfig{
InfoUpdateFrequency: Duration(60 * time.Second),
ResourceUpdateFrequency: Duration(30 * time.Second),
HeartbeatFrequency: Duration(15 * time.Second),
HeartbeatTopic: "heartbeat",
},
}

Expand Down Expand Up @@ -171,6 +172,7 @@ var TestingRequesterConfig = RequesterConfig{
},
ControlPlaneSettings: RequesterControlPlaneConfig{
HeartbeatCheckFrequency: Duration(30 * time.Second),
HeartbeatTopic: "heartbeat",
NodeDisconnectedAfter: Duration(30 * time.Second),
},
NodeInfoStoreTTL: Duration(10 * time.Minute),
Expand Down

0 comments on commit c6a92a4

Please sign in to comment.