Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

propagate more missing configs #4575

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading