Documentation
¶
Overview ¶
Package orchestration carries the contract↔provider orchestration wire types shared by the DDWS node and provider. Every json tag here is the wire contract (chain queue state, wasm contract schema, provider decode paths) — changes require a coordinated api version bump.
Index ¶
- Constants
- Variables
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- type CommandAckPayload
- type ContainerStatus
- type DeploymentFailedPayload
- type DeploymentReadyPayload
- type ErrorPayload
- type ForwardedPort
- type HealthAlertPayload
- type HealthRequestPayload
- type HealthResponsePayload
- type HealthStatus
- type LeaseIdentifier
- type LogsRequestPayload
- type LogsResponsePayload
- type MetricsRequestPayload
- type MetricsResponsePayload
- type MsgClient
- type MsgServer
- type MsgSubmitOrchestrationResponse
- func (*MsgSubmitOrchestrationResponse) Descriptor() ([]byte, []int)
- func (m *MsgSubmitOrchestrationResponse) GetCorrelationId() string
- func (m *MsgSubmitOrchestrationResponse) GetDseq() uint64
- func (m *MsgSubmitOrchestrationResponse) GetGseq() uint32
- func (m *MsgSubmitOrchestrationResponse) GetMessageType() string
- func (m *MsgSubmitOrchestrationResponse) GetOseq() uint32
- func (m *MsgSubmitOrchestrationResponse) GetOwner() string
- func (m *MsgSubmitOrchestrationResponse) GetPayload() []byte
- func (m *MsgSubmitOrchestrationResponse) GetProvider() string
- func (m MsgSubmitOrchestrationResponse) GetSigners() []sdk.AccAddress
- func (m *MsgSubmitOrchestrationResponse) GetTtlBlocks() uint64
- func (m *MsgSubmitOrchestrationResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgSubmitOrchestrationResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgSubmitOrchestrationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgSubmitOrchestrationResponse) ProtoMessage()
- func (m *MsgSubmitOrchestrationResponse) Reset()
- func (m *MsgSubmitOrchestrationResponse) Size() (n int)
- func (m *MsgSubmitOrchestrationResponse) String() string
- func (m *MsgSubmitOrchestrationResponse) Unmarshal(dAtA []byte) error
- func (m MsgSubmitOrchestrationResponse) ValidateBasic() error
- func (m *MsgSubmitOrchestrationResponse) XXX_DiscardUnknown()
- func (m *MsgSubmitOrchestrationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgSubmitOrchestrationResponse) XXX_Merge(src proto.Message)
- func (m *MsgSubmitOrchestrationResponse) XXX_Size() int
- func (m *MsgSubmitOrchestrationResponse) XXX_Unmarshal(b []byte) error
- type MsgSubmitOrchestrationResponseResponse
- func (*MsgSubmitOrchestrationResponseResponse) Descriptor() ([]byte, []int)
- func (m *MsgSubmitOrchestrationResponseResponse) GetMessageId() string
- func (m *MsgSubmitOrchestrationResponseResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgSubmitOrchestrationResponseResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgSubmitOrchestrationResponseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgSubmitOrchestrationResponseResponse) ProtoMessage()
- func (m *MsgSubmitOrchestrationResponseResponse) Reset()
- func (m *MsgSubmitOrchestrationResponseResponse) Size() (n int)
- func (m *MsgSubmitOrchestrationResponseResponse) String() string
- func (m *MsgSubmitOrchestrationResponseResponse) Unmarshal(dAtA []byte) error
- func (m *MsgSubmitOrchestrationResponseResponse) XXX_DiscardUnknown()
- func (m *MsgSubmitOrchestrationResponseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgSubmitOrchestrationResponseResponse) XXX_Merge(src proto.Message)
- func (m *MsgSubmitOrchestrationResponseResponse) XXX_Size() int
- func (m *MsgSubmitOrchestrationResponseResponse) XXX_Unmarshal(b []byte) error
- type OrchestrationMessage
- type OrchestrationMessageType
- type QueryOrchestrationMessagesRequest
- type QueryOrchestrationMessagesResponse
- type ResourceAlertPayload
- type ResourceUsage
- type RestartRequestPayload
- type ScaleRequestPayload
- type ServiceHealth
- type ServiceMetrics
- type ServiceStatus
- type SetLeaseEnvAckPayload
- type SetLeaseEnvRequestPayload
- type StatusRequestPayload
- type StatusResponsePayload
- type UnimplementedMsgServer
Constants ¶
const ( EventTypeOrchestrationResponseSubmitted = "orchestration_response_submitted" AttrKeyMessageID = "message_id" AttrKeyProvider = "provider" AttrKeyLeaseOwner = "lease_owner" AttrKeyLeaseDSeq = "lease_dseq" AttrKeyMessageType = "message_type" AttrKeyCorrelationID = "correlation_id" AttrKeyPayloadBytes = "payload_bytes" )
Event types emitted by the orchestration module.
const ( // ModuleName is the name of the orchestration module. It doubles as the // registered error codespace (errors.go), so it is part of the ABCI wire // contract and must never change. ModuleName = "orchestration" // QuerierRoute is the module's querier route name. QuerierRoute = ModuleName // RouterKey is the legacy router key (not used in practice because routing // is done by proto type URL via the MsgServiceRouter). RouterKey = ModuleName )
const (
TypeMsgSubmitOrchestrationResponse = "submit-orchestration-response"
)
Route names for legacy amino codec identification.
Variables ¶
var ( ErrInvalidSigner = errors.Register(ModuleName, 2, "signer does not match lease provider") ErrLeaseNotFound = errors.Register(ModuleName, 3, "lease not found") ErrLeaseInactive = errors.Register(ModuleName, 4, "lease is not active") ErrPayloadTooLarge = errors.Register(ModuleName, 5, "orchestration response payload exceeds MaxResponsePayload") ErrRateLimitLease = errors.Register(ModuleName, 6, "per-lease per-block response cap exceeded") ErrRateLimitProvider = errors.Register(ModuleName, 7, "per-provider per-block response byte budget exceeded") ErrUnknownMessageType = errors.Register(ModuleName, 8, "message_type not in allowed list") ErrInvalidMessage = errors.Register(ModuleName, 9, "invalid orchestration response message") ErrQueueSendFailed = errors.Register(ModuleName, 10, "failed to enqueue orchestration message") )
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
var Msg_serviceDesc = _Msg_serviceDesc
Functions ¶
func RegisterInterfaces ¶
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
RegisterInterfaces registers the module's sdk.Msg implementations with the interface registry so that Any-packed txs can resolve the concrete type. The MsgServiceDesc registration is what ties the /akash.orchestration.v1.Msg/ service routes to their proto type URLs in MsgServiceRouter.
func RegisterLegacyAminoCodec ¶
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the module's concrete types on the legacy amino codec so that governance proposals / CLI amino signing keep working. The proto path goes through RegisterInterfaces below.
func RegisterMsgServer ¶
Types ¶
type CommandAckPayload ¶
type CommandAckPayload struct {
CommandID string `json:"command_id"`
Success bool `json:"success"`
Message string `json:"message,omitempty"`
}
CommandAckPayload acknowledges a command
type ContainerStatus ¶
type ContainerStatus struct {
Name string `json:"name"`
Image string `json:"image"`
State string `json:"state"`
Ready bool `json:"ready"`
RestartCount int `json:"restart_count"`
StartedAt int64 `json:"started_at,omitempty"`
}
ContainerStatus represents status of a container
type DeploymentFailedPayload ¶
type DeploymentFailedPayload struct {
LeaseID string `json:"lease_id"`
Reason string `json:"reason"`
Stage string `json:"stage"` // "pull", "create", "start"
Details string `json:"details,omitempty"`
}
DeploymentFailedPayload is sent when deployment fails
type DeploymentReadyPayload ¶
type DeploymentReadyPayload struct {
LeaseID string `json:"lease_id"`
Services []string `json:"services"`
ForwardedPorts []ForwardedPort `json:"forwarded_ports"`
StartupTime int64 `json:"startup_time"` // Seconds to become ready
}
DeploymentReadyPayload is sent when deployment is ready
type ErrorPayload ¶
type ErrorPayload struct {
Code string `json:"code"`
Message string `json:"message"`
Details string `json:"details,omitempty"`
}
ErrorPayload represents an error response
type ForwardedPort ¶
type ForwardedPort struct {
Service string `json:"service"`
ExternalPort uint32 `json:"external_port"`
InternalPort uint32 `json:"internal_port"`
Protocol string `json:"protocol"` // "tcp" or "udp"
Host string `json:"host"`
}
ForwardedPort represents a forwarded port
type HealthAlertPayload ¶
type HealthAlertPayload struct {
LeaseID string `json:"lease_id"`
Service string `json:"service"`
PrevStatus HealthStatus `json:"prev_status"`
NewStatus HealthStatus `json:"new_status"`
Message string `json:"message"`
RestartCount int `json:"restart_count,omitempty"`
}
HealthAlertPayload is sent on health status change
type HealthRequestPayload ¶
type HealthRequestPayload struct {
Services []string `json:"services,omitempty"` // Specific services to check (empty = all)
Detailed bool `json:"detailed"` // Include detailed metrics
}
HealthRequestPayload is sent by contract to request health check
type HealthResponsePayload ¶
type HealthResponsePayload struct {
LeaseID string `json:"lease_id"`
Overall HealthStatus `json:"overall"`
Services []ServiceHealth `json:"services"`
LastChecked int64 `json:"last_checked"`
Message string `json:"message,omitempty"`
// Optional NodePort / workload-facing ports (also surfaced on wasm active_provider_endpoints).
ForwardedPorts []ForwardedPort `json:"forwarded_ports,omitempty"`
}
HealthResponsePayload is the chain-canonical health response shape (the node keeper's CreateHealthResponse emits it). NOTE: the provider daemon currently emits a different, wire-incompatible dialect under the same message_type (lease_id as object, status/timestamp fields) which the wasm contracts consume; that dialect intentionally remains provider-local until a versioned reconciliation (tracked in the split plan, Phase 4).
type HealthStatus ¶
type HealthStatus string
HealthStatus represents health state
const ( HealthStatusHealthy HealthStatus = "healthy" HealthStatusDegraded HealthStatus = "degraded" HealthStatusUnhealthy HealthStatus = "unhealthy" HealthStatusUnknown HealthStatus = "unknown" )
type LeaseIdentifier ¶
type LeaseIdentifier struct {
Owner string `json:"owner"`
DSeq uint64 `json:"dseq"`
GSeq uint32 `json:"gseq"`
OSeq uint32 `json:"oseq"`
Provider string `json:"provider"`
}
LeaseIdentifier uniquely identifies a lease
func (LeaseIdentifier) IsZero ¶
func (l LeaseIdentifier) IsZero() bool
IsZero reports whether the identifier is entirely unset. Consumers use it where the pre-split provider code nil-checked its pointer-typed copy.
func (LeaseIdentifier) String ¶
func (l LeaseIdentifier) String() string
func (LeaseIdentifier) ToMarketLeaseID ¶
func (l LeaseIdentifier) ToMarketLeaseID() mv1.LeaseID
ToMarketLeaseID converts LeaseIdentifier to Akash market LeaseID
type LogsRequestPayload ¶
type LogsRequestPayload struct {
Service string `json:"service"` // Service name (empty = all)
Lines int `json:"lines"` // Number of lines (default 100)
Since int64 `json:"since"` // Unix timestamp (0 = from beginning)
Follow bool `json:"follow"` // Not supported in blockchain context
}
LogsRequestPayload is sent by contract to request logs
type LogsResponsePayload ¶
type LogsResponsePayload struct {
Service string `json:"service"`
Lines []string `json:"lines"`
Truncated bool `json:"truncated"` // If more logs available
}
LogsResponsePayload is sent by provider with logs
type MetricsRequestPayload ¶
type MetricsRequestPayload struct {
Services []string `json:"services,omitempty"` // Specific services (empty = all)
Period string `json:"period"` // "1m", "5m", "1h"
}
MetricsRequestPayload is sent by contract to request metrics
type MetricsResponsePayload ¶
type MetricsResponsePayload struct {
Services []ServiceMetrics `json:"services"`
Period string `json:"period"`
}
MetricsResponsePayload is sent by provider with metrics
type MsgClient ¶
type MsgClient interface {
// SubmitResponse enqueues a provider -> contract orchestration message for a lease.
SubmitResponse(ctx context.Context, in *MsgSubmitOrchestrationResponse, opts ...grpc.CallOption) (*MsgSubmitOrchestrationResponseResponse, error)
}
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type MsgServer ¶
type MsgServer interface {
// SubmitResponse enqueues a provider -> contract orchestration message for a lease.
SubmitResponse(context.Context, *MsgSubmitOrchestrationResponse) (*MsgSubmitOrchestrationResponseResponse, error)
}
MsgServer is the server API for Msg service.
type MsgSubmitOrchestrationResponse ¶
type MsgSubmitOrchestrationResponse struct {
// Lease identifier (fully qualified). Signer address must match `provider`.
Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
Dseq uint64 `protobuf:"varint,2,opt,name=dseq,proto3" json:"dseq,omitempty"`
Gseq uint32 `protobuf:"varint,3,opt,name=gseq,proto3" json:"gseq,omitempty"`
Oseq uint32 `protobuf:"varint,4,opt,name=oseq,proto3" json:"oseq,omitempty"`
Provider string `protobuf:"bytes,5,opt,name=provider,proto3" json:"provider,omitempty"`
// Correlation id (matches a prior Contract -> Provider command). Optional
// for unsolicited events (e.g. resource_alert).
CorrelationId string `protobuf:"bytes,6,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty"`
// One of the allowed message types (see module params).
MessageType string `protobuf:"bytes,7,opt,name=message_type,json=messageType,proto3" json:"message_type,omitempty"`
// JSON-encoded message-specific payload. Size bounded by module params.
Payload []byte `protobuf:"bytes,8,opt,name=payload,proto3" json:"payload,omitempty"`
// Desired TTL in blocks before auto-expiry from the queue. 0 = module default.
TtlBlocks uint64 `protobuf:"varint,9,opt,name=ttl_blocks,json=ttlBlocks,proto3" json:"ttl_blocks,omitempty"`
}
MsgSubmitOrchestrationResponse is the Msg used by a provider to submit a response / event into the on-chain orchestration message queue for a specific lease. The signer MUST be the provider bech32 address on the referenced lease.
Canonical payload shapes (JSON, in `payload`):
message_type = "health_response":
{ "status": "healthy|degraded|failed|unknown", "detail": "optional" }
message_type = "command_ack":
{ "correlation_id": "...", "ok": bool, "detail": "optional" }
message_type = "resource_alert":
{ "severity": "warn|critical", "resource": "cpu|mem|...", "detail": "..." }
All other `message_type` values are rejected unless listed in module params.
func (*MsgSubmitOrchestrationResponse) Descriptor ¶
func (*MsgSubmitOrchestrationResponse) Descriptor() ([]byte, []int)
func (*MsgSubmitOrchestrationResponse) GetCorrelationId ¶
func (m *MsgSubmitOrchestrationResponse) GetCorrelationId() string
func (*MsgSubmitOrchestrationResponse) GetDseq ¶
func (m *MsgSubmitOrchestrationResponse) GetDseq() uint64
func (*MsgSubmitOrchestrationResponse) GetGseq ¶
func (m *MsgSubmitOrchestrationResponse) GetGseq() uint32
func (*MsgSubmitOrchestrationResponse) GetMessageType ¶
func (m *MsgSubmitOrchestrationResponse) GetMessageType() string
func (*MsgSubmitOrchestrationResponse) GetOseq ¶
func (m *MsgSubmitOrchestrationResponse) GetOseq() uint32
func (*MsgSubmitOrchestrationResponse) GetOwner ¶
func (m *MsgSubmitOrchestrationResponse) GetOwner() string
func (*MsgSubmitOrchestrationResponse) GetPayload ¶
func (m *MsgSubmitOrchestrationResponse) GetPayload() []byte
func (*MsgSubmitOrchestrationResponse) GetProvider ¶
func (m *MsgSubmitOrchestrationResponse) GetProvider() string
func (MsgSubmitOrchestrationResponse) GetSigners ¶
func (m MsgSubmitOrchestrationResponse) GetSigners() []sdk.AccAddress
GetSigners returns the provider address; the signer on the tx must match. Required by the `cosmos.msg.v1.signer = "provider"` option in the proto.
func (*MsgSubmitOrchestrationResponse) GetTtlBlocks ¶
func (m *MsgSubmitOrchestrationResponse) GetTtlBlocks() uint64
func (*MsgSubmitOrchestrationResponse) Marshal ¶
func (m *MsgSubmitOrchestrationResponse) Marshal() (dAtA []byte, err error)
func (*MsgSubmitOrchestrationResponse) MarshalTo ¶
func (m *MsgSubmitOrchestrationResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgSubmitOrchestrationResponse) MarshalToSizedBuffer ¶
func (m *MsgSubmitOrchestrationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgSubmitOrchestrationResponse) ProtoMessage ¶
func (*MsgSubmitOrchestrationResponse) ProtoMessage()
func (*MsgSubmitOrchestrationResponse) Reset ¶
func (m *MsgSubmitOrchestrationResponse) Reset()
func (*MsgSubmitOrchestrationResponse) Size ¶
func (m *MsgSubmitOrchestrationResponse) Size() (n int)
func (*MsgSubmitOrchestrationResponse) String ¶
func (m *MsgSubmitOrchestrationResponse) String() string
func (*MsgSubmitOrchestrationResponse) Unmarshal ¶
func (m *MsgSubmitOrchestrationResponse) Unmarshal(dAtA []byte) error
func (MsgSubmitOrchestrationResponse) ValidateBasic ¶
func (m MsgSubmitOrchestrationResponse) ValidateBasic() error
ValidateBasic performs stateless validation. Stateful checks (lease exists, signer matches lease provider, payload size within params, rate limits) live in the keeper's msg_server because they need ctx / params access.
func (*MsgSubmitOrchestrationResponse) XXX_DiscardUnknown ¶
func (m *MsgSubmitOrchestrationResponse) XXX_DiscardUnknown()
func (*MsgSubmitOrchestrationResponse) XXX_Marshal ¶
func (m *MsgSubmitOrchestrationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgSubmitOrchestrationResponse) XXX_Merge ¶
func (m *MsgSubmitOrchestrationResponse) XXX_Merge(src proto.Message)
func (*MsgSubmitOrchestrationResponse) XXX_Size ¶
func (m *MsgSubmitOrchestrationResponse) XXX_Size() int
func (*MsgSubmitOrchestrationResponse) XXX_Unmarshal ¶
func (m *MsgSubmitOrchestrationResponse) XXX_Unmarshal(b []byte) error
type MsgSubmitOrchestrationResponseResponse ¶
type MsgSubmitOrchestrationResponseResponse struct {
MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
}
MsgSubmitOrchestrationResponseResponse is the handler response for MsgSubmitOrchestrationResponse. Contains the queue message id assigned to the new entry.
func (*MsgSubmitOrchestrationResponseResponse) Descriptor ¶
func (*MsgSubmitOrchestrationResponseResponse) Descriptor() ([]byte, []int)
func (*MsgSubmitOrchestrationResponseResponse) GetMessageId ¶
func (m *MsgSubmitOrchestrationResponseResponse) GetMessageId() string
func (*MsgSubmitOrchestrationResponseResponse) Marshal ¶
func (m *MsgSubmitOrchestrationResponseResponse) Marshal() (dAtA []byte, err error)
func (*MsgSubmitOrchestrationResponseResponse) MarshalTo ¶
func (m *MsgSubmitOrchestrationResponseResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgSubmitOrchestrationResponseResponse) MarshalToSizedBuffer ¶
func (m *MsgSubmitOrchestrationResponseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgSubmitOrchestrationResponseResponse) ProtoMessage ¶
func (*MsgSubmitOrchestrationResponseResponse) ProtoMessage()
func (*MsgSubmitOrchestrationResponseResponse) Reset ¶
func (m *MsgSubmitOrchestrationResponseResponse) Reset()
func (*MsgSubmitOrchestrationResponseResponse) Size ¶
func (m *MsgSubmitOrchestrationResponseResponse) Size() (n int)
func (*MsgSubmitOrchestrationResponseResponse) String ¶
func (m *MsgSubmitOrchestrationResponseResponse) String() string
func (*MsgSubmitOrchestrationResponseResponse) Unmarshal ¶
func (m *MsgSubmitOrchestrationResponseResponse) Unmarshal(dAtA []byte) error
func (*MsgSubmitOrchestrationResponseResponse) XXX_DiscardUnknown ¶
func (m *MsgSubmitOrchestrationResponseResponse) XXX_DiscardUnknown()
func (*MsgSubmitOrchestrationResponseResponse) XXX_Marshal ¶
func (m *MsgSubmitOrchestrationResponseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgSubmitOrchestrationResponseResponse) XXX_Merge ¶
func (m *MsgSubmitOrchestrationResponseResponse) XXX_Merge(src proto.Message)
func (*MsgSubmitOrchestrationResponseResponse) XXX_Size ¶
func (m *MsgSubmitOrchestrationResponseResponse) XXX_Size() int
func (*MsgSubmitOrchestrationResponseResponse) XXX_Unmarshal ¶
func (m *MsgSubmitOrchestrationResponseResponse) XXX_Unmarshal(b []byte) error
type OrchestrationMessage ¶
type OrchestrationMessage struct {
ID string `json:"id"`
MessageType OrchestrationMessageType `json:"message_type"`
From string `json:"from"` // Contract address or provider address
To string `json:"to"` // Target (provider address or contract address)
LeaseID LeaseIdentifier `json:"lease_id"` // The lease this message relates to
CorrelationID string `json:"correlation_id"` // For request-response matching
Payload json.RawMessage `json:"payload"` // Message-specific data
CreatedAt int64 `json:"created_at"` // Unix timestamp
BlockHeight uint64 `json:"block_height"` // Block when created
TTL uint64 `json:"ttl"` // Expires after this block height
Processed bool `json:"processed"` // Whether message has been processed
ProcessedAt int64 `json:"processed_at"` // When processed
Signature string `json:"signature,omitempty"` // HMAC-SHA256 signature for authenticity
SignedAt int64 `json:"signed_at,omitempty"` // Timestamp when signed (for replay protection)
}
OrchestrationMessage represents a message between contract and provider
type OrchestrationMessageType ¶
type OrchestrationMessageType string
OrchestrationMessageType defines the type of orchestration message
const ( // Contract → Provider Commands MsgTypeHealthRequest OrchestrationMessageType = "health_request" MsgTypeStatusRequest OrchestrationMessageType = "status_request" MsgTypeLogsRequest OrchestrationMessageType = "logs_request" MsgTypeMetricsRequest OrchestrationMessageType = "metrics_request" MsgTypeScaleRequest OrchestrationMessageType = "scale_request" MsgTypeRestartRequest OrchestrationMessageType = "restart_request" MsgTypeStopRequest OrchestrationMessageType = "stop_request" // SetLeaseEnvRequest pushes per-lease env vars to the provider. // Provider handler persists them in a per-lease k8s ConfigMap; // the builder merges that ConfigMap into pod env on next create. // This is the Phase 2 deliverable that lets a contract update // AKASH_HA_* between deploys without recreating the lease. MsgTypeSetLeaseEnvRequest OrchestrationMessageType = "set_lease_env_request" // Provider → Contract Responses MsgTypeHealthResponse OrchestrationMessageType = "health_response" MsgTypeStatusResponse OrchestrationMessageType = "status_response" MsgTypeLogsResponse OrchestrationMessageType = "logs_response" MsgTypeMetricsResponse OrchestrationMessageType = "metrics_response" MsgTypeCommandAck OrchestrationMessageType = "command_ack" MsgTypeError OrchestrationMessageType = "error" // SetLeaseEnvAck is the provider's ack for MsgTypeSetLeaseEnvRequest. // Payload is SetLeaseEnvAckPayload (configmap name + version + // restart-required flag). Contract correlates via CorrelationID // equal to the request's CorrelationID. MsgTypeSetLeaseEnvAck OrchestrationMessageType = "set_lease_env_ack" // Provider → Contract Events (unprompted) MsgTypeDeploymentReady OrchestrationMessageType = "deployment_ready" MsgTypeDeploymentFailed OrchestrationMessageType = "deployment_failed" MsgTypeHealthAlert OrchestrationMessageType = "health_alert" MsgTypeResourceAlert OrchestrationMessageType = "resource_alert" )
type QueryOrchestrationMessagesRequest ¶
type QueryOrchestrationMessagesRequest struct {
Recipient string `json:"recipient"`
}
QueryOrchestrationMessagesRequest is the wasm smart-query the provider sends to fetch its pending orchestration messages. The JSON shape is the contract's query schema — tags are the wire contract.
type QueryOrchestrationMessagesResponse ¶
type QueryOrchestrationMessagesResponse struct {
Messages []OrchestrationMessage `json:"messages"`
}
QueryOrchestrationMessagesResponse contains pending messages for the recipient.
type ResourceAlertPayload ¶
type ResourceAlertPayload struct {
LeaseID string `json:"lease_id"`
Service string `json:"service"`
ResourceType string `json:"resource_type"` // "cpu", "memory", "storage"
CurrentValue float64 `json:"current_value"`
Threshold float64 `json:"threshold"`
Message string `json:"message"`
}
ResourceAlertPayload is sent on resource threshold breach
type ResourceUsage ¶
type ResourceUsage struct {
CPUUsed uint64 `json:"cpu_used"` // Millicores
CPULimit uint64 `json:"cpu_limit"`
MemoryUsed uint64 `json:"memory_used"` // Bytes
MemoryLimit uint64 `json:"memory_limit"`
StorageUsed uint64 `json:"storage_used"`
StorageLimit uint64 `json:"storage_limit"`
}
ResourceUsage represents resource usage
type RestartRequestPayload ¶
type RestartRequestPayload struct {
Service string `json:"service"` // Service to restart (empty = all)
}
RestartRequestPayload is sent by contract to restart services
type ScaleRequestPayload ¶
type ScaleRequestPayload struct {
Service string `json:"service"` // Service to scale
Replicas uint32 `json:"replicas"` // Target replica count
}
ScaleRequestPayload is sent by contract to scale services
type ServiceHealth ¶
type ServiceHealth struct {
Name string `json:"name"`
Status HealthStatus `json:"status"`
Ready int `json:"ready"` // Ready replicas
Total int `json:"total"` // Total replicas
RestartCount int `json:"restart_count"`
CPUPercent float64 `json:"cpu_percent,omitempty"`
MemoryPercent float64 `json:"memory_percent,omitempty"`
LastError string `json:"last_error,omitempty"`
}
ServiceHealth represents health of a single service
type ServiceMetrics ¶
type ServiceMetrics struct {
Name string `json:"name"`
CPUAvg float64 `json:"cpu_avg"`
CPUMax float64 `json:"cpu_max"`
MemoryAvg uint64 `json:"memory_avg"`
MemoryMax uint64 `json:"memory_max"`
NetworkRxAvg uint64 `json:"network_rx_avg"`
NetworkTxAvg uint64 `json:"network_tx_avg"`
RequestCount uint64 `json:"request_count,omitempty"`
ErrorCount uint64 `json:"error_count,omitempty"`
}
ServiceMetrics represents metrics for a service
type ServiceStatus ¶
type ServiceStatus struct {
Name string `json:"name"`
State string `json:"state"` // "running", "pending", "failed"
Ready int `json:"ready"`
Available int `json:"available"`
Containers []ContainerStatus `json:"containers,omitempty"`
}
ServiceStatus represents status of a single service
type SetLeaseEnvAckPayload ¶
type SetLeaseEnvAckPayload struct {
ConfigMap string `json:"configmap"`
Applied uint64 `json:"applied"`
RestartTriggered bool `json:"restart_triggered"`
Error string `json:"error,omitempty"`
}
SetLeaseEnvAckPayload is sent by the provider after applying a `set_lease_env_request`. `ConfigMap` is the k8s name the provider chose for the per-lease env ConfigMap; `Applied` is the version the provider persisted (echo of request's Version on success; older value if the request was stale).
type SetLeaseEnvRequestPayload ¶
type SetLeaseEnvRequestPayload struct {
Env map[string]string `json:"env"`
Restart bool `json:"restart"`
Version uint64 `json:"version"`
}
SetLeaseEnvRequestPayload is sent by a contract that owns a lease to update the per-lease env vars merged into pods by the builder on next create. `Env` is a flat map; `Restart` asks the provider to roll the deployment so the new env applies immediately (otherwise the new env only takes effect on the next pod create, which is fine for failover replacements where the pod is being recreated anyway).
`Version` is set by the contract and echoed in the ack so the contract can verify the provider applied the latest update (not a stale retry). Providers ignore versions older than the current stored version.
type StatusRequestPayload ¶
type StatusRequestPayload struct {
IncludeContainers bool `json:"include_containers"` // Include container details
IncludeResources bool `json:"include_resources"` // Include resource usage
}
StatusRequestPayload is sent by contract to request deployment status
type StatusResponsePayload ¶
type StatusResponsePayload struct {
LeaseID string `json:"lease_id"`
State string `json:"state"` // "running", "pending", "failed", "stopped"
Services []ServiceStatus `json:"services"`
Resources ResourceUsage `json:"resources,omitempty"`
CreatedAt int64 `json:"created_at"`
ForwardedPorts []ForwardedPort `json:"forwarded_ports,omitempty"`
}
StatusResponsePayload is sent by provider with deployment status
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct {
}
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) SubmitResponse ¶
func (*UnimplementedMsgServer) SubmitResponse(ctx context.Context, req *MsgSubmitOrchestrationResponse) (*MsgSubmitOrchestrationResponseResponse, error)