messages

package
v1.6.0-rc4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AskForBidMessageType       = "AskForBid"
	BidAcceptedMessageType     = "BidAccepted"
	BidRejectedMessageType     = "BidRejected"
	CancelExecutionMessageType = "CancelExecution"

	BidResultMessageType    = "BidResult"
	RunResultMessageType    = "RunResult"
	ComputeErrorMessageType = "ComputeError"

	HandshakeRequestMessageType      = "transport.HandshakeRequest"
	HeartbeatRequestMessageType      = "transport.HeartbeatRequest"
	NodeInfoUpdateRequestMessageType = "transport.UpdateNodeInfoRequest"
	ShutdownNoticeRequestMessageType = "transport.ShutdownNoticeRequest"

	HandshakeResponseType      = "transport.HandshakeResponse"
	HeartbeatResponseType      = "transport.HeartbeatResponse"
	NodeInfoUpdateResponseType = "transport.UpdateNodeInfoResponse"
	ShutdownNoticeResponseType = "transport.ShutdownNoticeResponse"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AskForBidRequest

type AskForBidRequest struct {
	BaseRequest
	// Execution specifies the job to be executed.
	Execution *models.Execution
}

type BaseRequest

type BaseRequest struct {
	Events []*models.Event
}

BaseRequest is the base request model for all requests.

func (BaseRequest) Message

func (r BaseRequest) Message() string

Message returns a request message if available.

type BaseResponse

type BaseResponse struct {
	ExecutionID string
	JobID       string
	JobType     string
	Events      []*models.Event
}

BaseResponse is the base response model for all responses.

func NewBaseResponse

func NewBaseResponse(execution *models.Execution) BaseResponse

func (BaseResponse) Message

func (r BaseResponse) Message() string

Message returns a response message if available.

type BidAcceptedRequest

type BidAcceptedRequest struct {
	BaseRequest
	ExecutionID string
	Accepted    bool
}

type BidRejectedRequest

type BidRejectedRequest struct {
	BaseRequest
	ExecutionID string
}

type BidResult

type BidResult struct {
	BaseResponse
	Accepted bool
}

BidResult is the result of the compute node bidding on a job that is returned to the caller through a Callback.

type CancelExecutionRequest

type CancelExecutionRequest struct {
	BaseRequest
	ExecutionID string
}

type ComputeError

type ComputeError struct {
	BaseResponse
}

func (ComputeError) Error

func (e ComputeError) Error() string

type ExecutionLogsRequest

type ExecutionLogsRequest struct {
	ExecutionID string
	NodeID      string
	Tail        bool
	Follow      bool
}

type ExecutionLogsResponse

type ExecutionLogsResponse struct {
	Address           string
	ExecutionFinished bool
}

type HandshakeRequest added in v1.6.0

type HandshakeRequest struct {
	NodeInfo               models.NodeInfo `json:"NodeInfo"`
	StartTime              time.Time       `json:"StartTime"`
	LastOrchestratorSeqNum uint64          `json:"LastOrchestratorSeqNum"` // Last seq received from orchestrator
}

HandshakeRequest is exchanged during initial connection

type HandshakeResponse added in v1.6.0

type HandshakeResponse struct {
	Accepted                   bool   `json:"accepted"`
	Reason                     string `json:"reason,omitempty"`
	LastComputeSeqNum          uint64 `json:"LastComputeSeqNum"`      // Last seq received from compute node
	StartingOrchestratorSeqNum uint64 `json:"LastOrchestratorSeqNum"` // Seq to start sending to compute node
}

HandshakeResponse is sent in response to handshake requests

type HeartbeatRequest added in v1.6.0

type HeartbeatRequest struct {
	NodeID                 string           `json:"NodeID"`
	AvailableCapacity      models.Resources `json:"AvailableCapacity"`
	QueueUsedCapacity      models.Resources `json:"QueueUsedCapacity"`
	LastOrchestratorSeqNum uint64           `json:"LastOrchestratorSeqNum"` // Last seq received from orchestrator
}

type HeartbeatResponse added in v1.6.0

type HeartbeatResponse struct {
	LastComputeSeqNum uint64 `json:"LastComputeSeqNum"` // Last seq received from compute node
}

type RunResult

type RunResult struct {
	BaseResponse
	PublishResult    *models.SpecConfig
	RunCommandResult *models.RunCommandResult
}

type ShutdownNoticeRequest added in v1.6.0

type ShutdownNoticeRequest struct {
	NodeID                 string `json:"NodeID"`
	Reason                 string `json:"Reason,omitempty"`
	LastOrchestratorSeqNum uint64 `json:"LastOrchestratorSeqNum"` // Last seq received from orchestrator
}

ShutdownNoticeRequest tells the orchestrator that this node is shutting down

type ShutdownNoticeResponse added in v1.6.0

type ShutdownNoticeResponse struct {
	LastComputeSeqNum uint64 `json:"LastComputeSeqNum"` // Last seq received from compute node
}

ShutdownNoticeResponse sends any final instructions back to the shutting-down node

type UpdateNodeInfoRequest added in v1.6.0

type UpdateNodeInfoRequest struct {
	NodeInfo models.NodeInfo `json:"NodeInfo"`
}

UpdateNodeInfoRequest is used to update the node info

type UpdateNodeInfoResponse added in v1.6.0

type UpdateNodeInfoResponse struct {
	Accepted bool   `json:"accepted"`
	Reason   string `json:"reason,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL