Documentation ¶
Index ¶
- Constants
- type BaseRequest
- type CallbackHandler
- type CallbackHandlerParams
- type CallbackProxy
- type CallbackProxyParams
- type ComputeHandler
- type ComputeHandlerParams
- type ComputeProxy
- func (p *ComputeProxy) AskForBid(ctx context.Context, request legacy.AskForBidRequest) (legacy.AskForBidResponse, error)
- func (p *ComputeProxy) BidAccepted(ctx context.Context, request legacy.BidAcceptedRequest) (legacy.BidAcceptedResponse, error)
- func (p *ComputeProxy) BidRejected(ctx context.Context, request legacy.BidRejectedRequest) (legacy.BidRejectedResponse, error)
- func (p *ComputeProxy) CancelExecution(ctx context.Context, request legacy.CancelExecutionRequest) (legacy.CancelExecutionResponse, error)
- type ComputeProxyParams
- type LogStreamHandler
- type LogStreamHandlerParams
- type LogStreamProxy
- type LogStreamProxyParams
- type ManagementHandler
- type ManagementHandlerParams
- type ManagementProxy
- func (p *ManagementProxy) Register(ctx context.Context, request legacy.RegisterRequest) (*legacy.RegisterResponse, error)
- func (p *ManagementProxy) UpdateInfo(ctx context.Context, request legacy.UpdateInfoRequest) (*legacy.UpdateInfoResponse, error)
- func (p *ManagementProxy) UpdateResources(ctx context.Context, request legacy.UpdateResourcesRequest) (*legacy.UpdateResourcesResponse, error)
- type ManagementProxyParams
Constants ¶
const ( ComputeEndpointSubjectPrefix = "node.compute" CallbackSubjectPrefix = "node.orchestrator" ManagementSubjectPrefix = "node.management" AskForBid = "AskForBid/v1" BidAccepted = "BidAccepted/v1" BidRejected = "BidRejected/v1" CancelExecution = "CancelExecution/v1" ExecutionLogs = "ExecutionLogs/v1" OnBidComplete = "OnBidComplete/v1" OnRunComplete = "OnRunComplete/v1" OnComputeFailure = "OnComputeFailure/v1" RegisterNode = "RegisterNode/v1" UpdateNodeInfo = "UpdateNodeInfo/v1" UpdateResources = "UpdateResources/v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseRequest ¶ added in v1.2.2
func (*BaseRequest[T]) ComputeEndpoint ¶ added in v1.2.2
func (r *BaseRequest[T]) ComputeEndpoint() string
ComputeEndpoint return the compute endpoint for the base request.
func (*BaseRequest[T]) OrchestratorEndpoint ¶ added in v1.2.2
func (r *BaseRequest[T]) OrchestratorEndpoint() string
OrchestratorEndpoint return the orchestrator endpoint for the base request.
type CallbackHandler ¶
type CallbackHandler struct {
// contains filtered or unexported fields
}
CallbackHandler is a handler for callback events that registers for incoming nats requests to Bacalhau callback protocol, and delegates the handling of the request to the provided callback.
func NewCallbackHandler ¶
func NewCallbackHandler(params CallbackHandlerParams) (*CallbackHandler, error)
type CallbackHandlerParams ¶
type CallbackProxy ¶
type CallbackProxy struct {
// contains filtered or unexported fields
}
CallbackProxy is a proxy for a compute.Callback that can be used to send compute callbacks to the requester node, such as when the execution is completed or when a failure occurs. The proxy can forward callbacks to a remote requester node, or locally if the node is the requester and a LocalCallback is provided.
func NewCallbackProxy ¶
func NewCallbackProxy(params CallbackProxyParams) *CallbackProxy
func (*CallbackProxy) OnBidComplete ¶
func (p *CallbackProxy) OnBidComplete(ctx context.Context, result legacy.BidResult)
func (*CallbackProxy) OnComputeFailure ¶
func (p *CallbackProxy) OnComputeFailure(ctx context.Context, result legacy.ComputeError)
func (*CallbackProxy) OnRunComplete ¶
func (p *CallbackProxy) OnRunComplete(ctx context.Context, result legacy.RunResult)
type CallbackProxyParams ¶
type CallbackProxyParams struct {
Conn *nats.Conn
}
type ComputeHandler ¶
type ComputeHandler struct {
// contains filtered or unexported fields
}
ComputeHandler handles NATS messages for compute operations.
func NewComputeHandler ¶
func NewComputeHandler(ctx context.Context, params ComputeHandlerParams) (*ComputeHandler, error)
NewComputeHandler creates a new ComputeHandler.
type ComputeHandlerParams ¶
ComputeHandlerParams defines parameters for creating a new ComputeHandler.
type ComputeProxy ¶
type ComputeProxy struct {
// contains filtered or unexported fields
}
ComputeProxy is a proxy to a compute node endpoint that will forward requests to remote compute nodes, or to a local compute node if the target peer ID is the same as the local host, and a LocalEndpoint implementation is provided.
func NewComputeProxy ¶
func NewComputeProxy(params ComputeProxyParams) (*ComputeProxy, error)
func (*ComputeProxy) AskForBid ¶
func (p *ComputeProxy) AskForBid(ctx context.Context, request legacy.AskForBidRequest) (legacy.AskForBidResponse, error)
func (*ComputeProxy) BidAccepted ¶
func (p *ComputeProxy) BidAccepted(ctx context.Context, request legacy.BidAcceptedRequest) (legacy.BidAcceptedResponse, error)
func (*ComputeProxy) BidRejected ¶
func (p *ComputeProxy) BidRejected(ctx context.Context, request legacy.BidRejectedRequest) (legacy.BidRejectedResponse, error)
func (*ComputeProxy) CancelExecution ¶
func (p *ComputeProxy) CancelExecution( ctx context.Context, request legacy.CancelExecutionRequest) (legacy.CancelExecutionResponse, error)
type ComputeProxyParams ¶
type ComputeProxyParams struct {
Conn *nats.Conn
}
type LogStreamHandler ¶ added in v1.5.2
type LogStreamHandler struct {
// contains filtered or unexported fields
}
LogStreamHandler handles NATS messages for compute operations.
func NewLogStreamHandler ¶ added in v1.5.2
func NewLogStreamHandler(ctx context.Context, params LogStreamHandlerParams) (*LogStreamHandler, error)
NewLogStreamHandler creates a new LogStreamHandler.
type LogStreamHandlerParams ¶ added in v1.5.2
type LogStreamHandlerParams struct { Name string Conn *nats.Conn LogstreamServer logstream.Server StreamProducerClientConfig stream.StreamProducerClientConfig }
LogStreamHandlerParams defines parameters for creating a new LogStreamHandler.
type LogStreamProxy ¶ added in v1.5.2
type LogStreamProxy struct {
// contains filtered or unexported fields
}
LogStreamProxy is a proxy to a compute node endpoint that will forward requests to remote compute nodes, or to a local compute node if the target peer ID is the same as the local host, and a LocalEndpoint implementation is provided.
func NewLogStreamProxy ¶ added in v1.5.2
func NewLogStreamProxy(params LogStreamProxyParams) (*LogStreamProxy, error)
func (*LogStreamProxy) GetLogStream ¶ added in v1.5.2
func (p *LogStreamProxy) GetLogStream(ctx context.Context, request messages.ExecutionLogsRequest) ( <-chan *concurrency.AsyncResult[models.ExecutionLog], error)
type LogStreamProxyParams ¶ added in v1.5.2
type LogStreamProxyParams struct {
Conn *nats.Conn
}
type ManagementHandler ¶ added in v1.2.3
type ManagementHandler struct {
// contains filtered or unexported fields
}
Management handles NATS legacy for cluster management
func NewManagementHandler ¶ added in v1.2.3
func NewManagementHandler(params ManagementHandlerParams) (*ManagementHandler, error)
type ManagementHandlerParams ¶ added in v1.2.3
type ManagementHandlerParams struct { Conn *nats.Conn ManagementEndpoint bprotocol.ManagementEndpoint }
type ManagementProxy ¶ added in v1.2.3
type ManagementProxy struct {
// contains filtered or unexported fields
}
type ManagementProxy is a proxy for a compute node to register itself with a requester node.
func NewManagementProxy ¶ added in v1.2.3
func NewManagementProxy(params ManagementProxyParams) *ManagementProxy
NewRegistrationProxy creates a new RegistrationProxy for the local compute node bound to a provided NATS connection.
func (*ManagementProxy) Register ¶ added in v1.2.3
func (p *ManagementProxy) Register(ctx context.Context, request legacy.RegisterRequest) (*legacy.RegisterResponse, error)
Register sends a `requester.RegisterInfoRequest` containing the current compute node's NodeID to the requester node. It uses NATS request-reply to get a response and returns the response to the caller.
func (*ManagementProxy) UpdateInfo ¶ added in v1.2.3
func (p *ManagementProxy) UpdateInfo(ctx context.Context, request legacy.UpdateInfoRequest) (*legacy.UpdateInfoResponse, error)
UpdateInfo sends the latest node info from the current compute node to the server. We will do this even if we are not registered so that we will generate a regular error explaining why the update failed.
func (*ManagementProxy) UpdateResources ¶ added in v1.2.3
func (p *ManagementProxy) UpdateResources(ctx context.Context, request legacy.UpdateResourcesRequest) (*legacy.UpdateResourcesResponse, error)
UpdateResources sends the currently available resources from the current compute node to the server.
type ManagementProxyParams ¶ added in v1.2.3
type ManagementProxyParams struct {
Conn *nats.Conn
}