Skip to content

Commit

Permalink
propagate more missing configs
Browse files Browse the repository at this point in the history
  • Loading branch information
wdbaruni committed Oct 1, 2024
1 parent 56eb93a commit 5d9a6d6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/cli/serve/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func GetComputeConfig(
ProbeHTTP: cfg.JobAdmissionControl.ProbeHTTP,
ProbeExec: cfg.JobAdmissionControl.ProbeExec,
},
ControlPlaneSettings: legacy_types.ComputeControlPlaneConfig{
InfoUpdateFrequency: legacy_types.Duration(cfg.Compute.Heartbeat.InfoUpdateInterval),
ResourceUpdateFrequency: legacy_types.Duration(cfg.Compute.Heartbeat.ResourceUpdateInterval),
HeartbeatFrequency: legacy_types.Duration(cfg.Compute.Heartbeat.Interval),
}
}

// if the local publisher is enabled and installed, populate params.
Expand Down Expand Up @@ -148,6 +153,7 @@ func getNetworkConfig(cfg types.Bacalhau) (node.NetworkConfig, error) {
return node.NetworkConfig{}, err
}
return node.NetworkConfig{
Host : cfg.Orchestrator.Host,
Port: cfg.Orchestrator.Port,
AdvertisedAddress: cfg.Orchestrator.Advertise,
Orchestrators: cfg.Compute.Orchestrators,
Expand Down
2 changes: 2 additions & 0 deletions pkg/nats/transport/nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const reservedChars = ".*>"

type NATSTransportConfig struct {
NodeID string
Host string
Port int
AdvertisedAddress string
Orchestrators []string
Expand Down Expand Up @@ -102,6 +103,7 @@ func NewNATSTransport(ctx context.Context,
// create nats server with servers acting as its cluster peers
serverOpts := &server.Options{
ServerName: config.NodeID,
Host: config.Host,
Port: config.Port,
ClientAdvertise: config.AdvertisedAddress,
Authorization: config.AuthSecret,
Expand Down
1 change: 1 addition & 0 deletions pkg/node/config_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package node

type NetworkConfig struct {
// NATS config for requesters to be reachable by compute nodes
Host string
Port int
AdvertisedAddress string
Orchestrators []string
Expand Down
1 change: 1 addition & 0 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ func createAPIServer(config NodeConfig, userKey *baccrypto.UserKey) (*publicapi.
func createTransport(ctx context.Context, config NodeConfig) (*nats_transport.NATSTransport, error) {
transportLayer, err := nats_transport.NewNATSTransport(ctx, &nats_transport.NATSTransportConfig{
NodeID: config.NodeID,
Host: config.NetworkConfig.Host,
Port: config.NetworkConfig.Port,
AdvertisedAddress: config.NetworkConfig.AdvertisedAddress,
AuthSecret: config.NetworkConfig.AuthSecret,
Expand Down

0 comments on commit 5d9a6d6

Please sign in to comment.