Documentation ¶
Overview ¶
Package remoteworkers contains protos for RBE Reservations API.
Protos are copied from http://shortn/_mcfgni4dHh at revision 549920528.
Changes:
1. Remove unsupported protoc options. 2. Change `go_package` to match the new location. 3. Change `worker.proto` import path to match the new location. 4. Some comments stripped.
Index ¶
- Constants
- Variables
- func RegisterBotsServer(s grpc.ServiceRegistrar, srv BotsServer)
- func RegisterReservationsServer(s grpc.ServiceRegistrar, srv ReservationsServer)
- type AdminTemp
- type AdminTemp_Command
- func (AdminTemp_Command) Descriptor() protoreflect.EnumDescriptor
- func (x AdminTemp_Command) Enum() *AdminTemp_Command
- func (AdminTemp_Command) EnumDescriptor() ([]byte, []int)deprecated
- func (x AdminTemp_Command) Number() protoreflect.EnumNumber
- func (x AdminTemp_Command) String() string
- func (AdminTemp_Command) Type() protoreflect.EnumType
- type BotSession
- func (*BotSession) Descriptor() ([]byte, []int)deprecated
- func (x *BotSession) GetBotId() string
- func (x *BotSession) GetExpireTime() *timestamppb.Timestamp
- func (x *BotSession) GetLeases() []*Lease
- func (x *BotSession) GetName() string
- func (x *BotSession) GetStatus() BotStatus
- func (x *BotSession) GetVersion() string
- func (x *BotSession) GetWorker() *Worker
- func (*BotSession) ProtoMessage()
- func (x *BotSession) ProtoReflect() protoreflect.Message
- func (x *BotSession) Reset()
- func (x *BotSession) String() string
- type BotStatus
- type BotsClient
- type BotsServer
- type CancelReservationIntent
- func (CancelReservationIntent) Descriptor() protoreflect.EnumDescriptor
- func (x CancelReservationIntent) Enum() *CancelReservationIntent
- func (CancelReservationIntent) EnumDescriptor() ([]byte, []int)deprecated
- func (x CancelReservationIntent) Number() protoreflect.EnumNumber
- func (x CancelReservationIntent) String() string
- func (CancelReservationIntent) Type() protoreflect.EnumType
- type CancelReservationRequest
- func (*CancelReservationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CancelReservationRequest) GetIntent() CancelReservationIntent
- func (x *CancelReservationRequest) GetName() string
- func (*CancelReservationRequest) ProtoMessage()
- func (x *CancelReservationRequest) ProtoReflect() protoreflect.Message
- func (x *CancelReservationRequest) Reset()
- func (x *CancelReservationRequest) String() string
- type CancelReservationResponse
- func (*CancelReservationResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CancelReservationResponse) GetResult() CancelResult
- func (*CancelReservationResponse) ProtoMessage()
- func (x *CancelReservationResponse) ProtoReflect() protoreflect.Message
- func (x *CancelReservationResponse) Reset()
- func (x *CancelReservationResponse) String() string
- type CancelResult
- func (CancelResult) Descriptor() protoreflect.EnumDescriptor
- func (x CancelResult) Enum() *CancelResult
- func (CancelResult) EnumDescriptor() ([]byte, []int)deprecated
- func (x CancelResult) Number() protoreflect.EnumNumber
- func (x CancelResult) String() string
- func (CancelResult) Type() protoreflect.EnumType
- type Constraint
- func (*Constraint) Descriptor() ([]byte, []int)deprecated
- func (x *Constraint) GetAllowedValues() []string
- func (x *Constraint) GetKey() string
- func (*Constraint) ProtoMessage()
- func (x *Constraint) ProtoReflect() protoreflect.Message
- func (x *Constraint) Reset()
- func (x *Constraint) String() string
- type CreateBotSessionRequest
- func (*CreateBotSessionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateBotSessionRequest) GetBotSession() *BotSession
- func (x *CreateBotSessionRequest) GetParent() string
- func (*CreateBotSessionRequest) ProtoMessage()
- func (x *CreateBotSessionRequest) ProtoReflect() protoreflect.Message
- func (x *CreateBotSessionRequest) Reset()
- func (x *CreateBotSessionRequest) String() string
- type CreateReservationRequest
- func (*CreateReservationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateReservationRequest) GetParent() string
- func (x *CreateReservationRequest) GetReservation() *Reservation
- func (*CreateReservationRequest) ProtoMessage()
- func (x *CreateReservationRequest) ProtoReflect() protoreflect.Message
- func (x *CreateReservationRequest) Reset()
- func (x *CreateReservationRequest) String() string
- type Device
- type Device_Property
- func (*Device_Property) Descriptor() ([]byte, []int)deprecated
- func (x *Device_Property) GetKey() string
- func (x *Device_Property) GetValue() string
- func (*Device_Property) ProtoMessage()
- func (x *Device_Property) ProtoReflect() protoreflect.Message
- func (x *Device_Property) Reset()
- func (x *Device_Property) String() string
- type GetReservationRequest
- func (*GetReservationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetReservationRequest) GetName() string
- func (x *GetReservationRequest) GetWaitSeconds() int64
- func (*GetReservationRequest) ProtoMessage()
- func (x *GetReservationRequest) ProtoReflect() protoreflect.Message
- func (x *GetReservationRequest) Reset()
- func (x *GetReservationRequest) String() string
- type Lease
- func (*Lease) Descriptor() ([]byte, []int)deprecated
- func (x *Lease) GetAssignment() stringdeprecated
- func (x *Lease) GetExpireTime() *timestamppb.Timestamp
- func (x *Lease) GetId() string
- func (x *Lease) GetInlineAssignment() *anypb.Anydeprecated
- func (x *Lease) GetPayload() *anypb.Any
- func (x *Lease) GetRequirements() *Worker
- func (x *Lease) GetResult() *anypb.Any
- func (x *Lease) GetState() LeaseState
- func (x *Lease) GetStatus() *status.Status
- func (*Lease) ProtoMessage()
- func (x *Lease) ProtoReflect() protoreflect.Message
- func (x *Lease) Reset()
- func (x *Lease) String() string
- type LeaseState
- type PubSubMetadata
- func (*PubSubMetadata) Descriptor() ([]byte, []int)deprecated
- func (x *PubSubMetadata) GetPublisherId() string
- func (x *PubSubMetadata) GetTopicId() string
- func (*PubSubMetadata) ProtoMessage()
- func (x *PubSubMetadata) ProtoReflect() protoreflect.Message
- func (x *PubSubMetadata) Reset()
- func (x *PubSubMetadata) String() string
- type Reservation
- func (*Reservation) Descriptor() ([]byte, []int)deprecated
- func (x *Reservation) GetAssignedBotId() string
- func (x *Reservation) GetConstraints() []*Constraint
- func (x *Reservation) GetExecutionTimeout() *durationpb.Duration
- func (x *Reservation) GetExpireTime() *timestamppb.Timestamp
- func (x *Reservation) GetGroupId() string
- func (x *Reservation) GetName() string
- func (x *Reservation) GetPayload() *anypb.Any
- func (x *Reservation) GetPriority() int32
- func (x *Reservation) GetPubsubMetadata() *PubSubMetadata
- func (x *Reservation) GetQueuingTimeout() *durationpb.Duration
- func (x *Reservation) GetRequestedBotId() string
- func (x *Reservation) GetResult() *anypb.Any
- func (x *Reservation) GetState() ReservationState
- func (x *Reservation) GetStatus() *status.Status
- func (*Reservation) ProtoMessage()
- func (x *Reservation) ProtoReflect() protoreflect.Message
- func (x *Reservation) Reset()
- func (x *Reservation) String() string
- type ReservationState
- func (ReservationState) Descriptor() protoreflect.EnumDescriptor
- func (x ReservationState) Enum() *ReservationState
- func (ReservationState) EnumDescriptor() ([]byte, []int)deprecated
- func (x ReservationState) Number() protoreflect.EnumNumber
- func (x ReservationState) String() string
- func (ReservationState) Type() protoreflect.EnumType
- type ReservationsClient
- type ReservationsServer
- type UnimplementedBotsServer
- type UnimplementedReservationsServer
- func (UnimplementedReservationsServer) CancelReservation(context.Context, *CancelReservationRequest) (*CancelReservationResponse, error)
- func (UnimplementedReservationsServer) CreateReservation(context.Context, *CreateReservationRequest) (*Reservation, error)
- func (UnimplementedReservationsServer) GetReservation(context.Context, *GetReservationRequest) (*Reservation, error)
- type UnsafeBotsServer
- type UnsafeReservationsServer
- type UpdateBotSessionRequest
- func (*UpdateBotSessionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateBotSessionRequest) GetBotSession() *BotSession
- func (x *UpdateBotSessionRequest) GetName() string
- func (x *UpdateBotSessionRequest) GetUpdateMask() *fieldmaskpb.FieldMask
- func (*UpdateBotSessionRequest) ProtoMessage()
- func (x *UpdateBotSessionRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateBotSessionRequest) Reset()
- func (x *UpdateBotSessionRequest) String() string
- type Worker
- func (*Worker) Descriptor() ([]byte, []int)deprecated
- func (x *Worker) GetConfigs() []*Worker_Config
- func (x *Worker) GetDevices() []*Device
- func (x *Worker) GetMetadata() []*anypb.Any
- func (x *Worker) GetProperties() []*Worker_Property
- func (*Worker) ProtoMessage()
- func (x *Worker) ProtoReflect() protoreflect.Message
- func (x *Worker) Reset()
- func (x *Worker) String() string
- type Worker_Config
- func (*Worker_Config) Descriptor() ([]byte, []int)deprecated
- func (x *Worker_Config) GetKey() string
- func (x *Worker_Config) GetValue() string
- func (*Worker_Config) ProtoMessage()
- func (x *Worker_Config) ProtoReflect() protoreflect.Message
- func (x *Worker_Config) Reset()
- func (x *Worker_Config) String() string
- type Worker_Property
- func (*Worker_Property) Descriptor() ([]byte, []int)deprecated
- func (x *Worker_Property) GetKey() string
- func (x *Worker_Property) GetValue() string
- func (*Worker_Property) ProtoMessage()
- func (x *Worker_Property) ProtoReflect() protoreflect.Message
- func (x *Worker_Property) Reset()
- func (x *Worker_Property) String() string
Constants ¶
const ( Bots_CreateBotSession_FullMethodName = "/google.devtools.remoteworkers.v1test2.Bots/CreateBotSession" Bots_UpdateBotSession_FullMethodName = "/google.devtools.remoteworkers.v1test2.Bots/UpdateBotSession" )
const ( Reservations_CreateReservation_FullMethodName = "/google.devtools.remoteworkers.v1test2.Reservations/CreateReservation" Reservations_GetReservation_FullMethodName = "/google.devtools.remoteworkers.v1test2.Reservations/GetReservation" Reservations_CancelReservation_FullMethodName = "/google.devtools.remoteworkers.v1test2.Reservations/CancelReservation" )
Variables ¶
var ( BotStatus_name = map[int32]string{ 0: "BOT_STATUS_UNSPECIFIED", 1: "OK", 2: "UNHEALTHY", 3: "HOST_REBOOTING", 4: "BOT_TERMINATING", 5: "INITIALIZING", 6: "MAINTENANCE", } BotStatus_value = map[string]int32{ "BOT_STATUS_UNSPECIFIED": 0, "OK": 1, "UNHEALTHY": 2, "HOST_REBOOTING": 3, "BOT_TERMINATING": 4, "INITIALIZING": 5, "MAINTENANCE": 6, } )
Enum value maps for BotStatus.
var ( LeaseState_name = map[int32]string{ 0: "LEASE_STATE_UNSPECIFIED", 1: "PENDING", 2: "ACTIVE", 4: "COMPLETED", 5: "CANCELLED", } LeaseState_value = map[string]int32{ "LEASE_STATE_UNSPECIFIED": 0, "PENDING": 1, "ACTIVE": 2, "COMPLETED": 4, "CANCELLED": 5, } )
Enum value maps for LeaseState.
var ( AdminTemp_Command_name = map[int32]string{ 0: "UNSPECIFIED", 1: "BOT_UPDATE", 2: "BOT_RESTART", 3: "BOT_TERMINATE", 4: "HOST_RESTART", } AdminTemp_Command_value = map[string]int32{ "UNSPECIFIED": 0, "BOT_UPDATE": 1, "BOT_RESTART": 2, "BOT_TERMINATE": 3, "HOST_RESTART": 4, } )
Enum value maps for AdminTemp_Command.
var ( ReservationState_name = map[int32]string{ 0: "RESERVATION_STATE_UNSPECIFIED", 1: "RESERVATION_PENDING", 2: "RESERVATION_ASSIGNED", 3: "RESERVATION_ACTIVE", 4: "RESERVATION_COMPLETED", 5: "RESERVATION_CANCELLED", } ReservationState_value = map[string]int32{ "RESERVATION_STATE_UNSPECIFIED": 0, "RESERVATION_PENDING": 1, "RESERVATION_ASSIGNED": 2, "RESERVATION_ACTIVE": 3, "RESERVATION_COMPLETED": 4, "RESERVATION_CANCELLED": 5, } )
Enum value maps for ReservationState.
var ( CancelReservationIntent_name = map[int32]string{ 0: "CANCEL_RESERVATION_INTENT_UNSPECIFIED", 1: "ONLY_IF_PENDING", 2: "ANY", } CancelReservationIntent_value = map[string]int32{ "CANCEL_RESERVATION_INTENT_UNSPECIFIED": 0, "ONLY_IF_PENDING": 1, "ANY": 2, } )
Enum value maps for CancelReservationIntent.
var ( CancelResult_name = map[int32]string{ 0: "CANCEL_STATE_UNSPECIFIED", 1: "CANCELED", 2: "TASK_ALREADY_ASSIGNED", 3: "TASK_ALREADY_FINISHED", 4: "CANCELLING", } CancelResult_value = map[string]int32{ "CANCEL_STATE_UNSPECIFIED": 0, "CANCELED": 1, "TASK_ALREADY_ASSIGNED": 2, "TASK_ALREADY_FINISHED": 3, "CANCELLING": 4, } )
Enum value maps for CancelResult.
var Bots_ServiceDesc = grpc.ServiceDesc{ ServiceName: "google.devtools.remoteworkers.v1test2.Bots", HandlerType: (*BotsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateBotSession", Handler: _Bots_CreateBotSession_Handler, }, { MethodName: "UpdateBotSession", Handler: _Bots_UpdateBotSession_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "go.chromium.org/luci/swarming/internal/remoteworkers/bots.proto", }
Bots_ServiceDesc is the grpc.ServiceDesc for Bots service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_go_chromium_org_luci_swarming_internal_remoteworkers_bots_proto protoreflect.FileDescriptor
var File_go_chromium_org_luci_swarming_internal_remoteworkers_reservations_proto protoreflect.FileDescriptor
var File_go_chromium_org_luci_swarming_internal_remoteworkers_worker_proto protoreflect.FileDescriptor
var Reservations_ServiceDesc = grpc.ServiceDesc{ ServiceName: "google.devtools.remoteworkers.v1test2.Reservations", HandlerType: (*ReservationsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateReservation", Handler: _Reservations_CreateReservation_Handler, }, { MethodName: "GetReservation", Handler: _Reservations_GetReservation_Handler, }, { MethodName: "CancelReservation", Handler: _Reservations_CancelReservation_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "go.chromium.org/luci/swarming/internal/remoteworkers/reservations.proto", }
Reservations_ServiceDesc is the grpc.ServiceDesc for Reservations service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterBotsServer ¶
func RegisterBotsServer(s grpc.ServiceRegistrar, srv BotsServer)
func RegisterReservationsServer ¶
func RegisterReservationsServer(s grpc.ServiceRegistrar, srv ReservationsServer)
Types ¶
type AdminTemp ¶
type AdminTemp struct { // The admin action; see `Command` for legal values. Command AdminTemp_Command `` /* 129-byte string literal not displayed */ // The argument to the admin action; see `Command` for semantics. Arg string `protobuf:"bytes,2,opt,name=arg,proto3" json:"arg,omitempty"` // contains filtered or unexported fields }
AdminTemp is a prelimiary set of administration tasks. It's called "Temp" because we do not yet know the best way to represent admin tasks; it's possible that this will be entirely replaced in later versions of this API. If this message proves to be sufficient, it will be renamed in the alpha or beta release of this API.
This message (suitably marshalled into a protobuf.Any) can be used as the inline_assignment field in a lease; the lease assignment field should simply be `"admin"` in these cases.
This message is heavily based on Swarming administration tasks from the LUCI project (http://github.com/luci/luci-py/appengine/swarming).
func (*AdminTemp) Descriptor
deprecated
func (*AdminTemp) GetCommand ¶
func (x *AdminTemp) GetCommand() AdminTemp_Command
func (*AdminTemp) ProtoMessage ¶
func (*AdminTemp) ProtoMessage()
func (*AdminTemp) ProtoReflect ¶
func (x *AdminTemp) ProtoReflect() protoreflect.Message
type AdminTemp_Command ¶
type AdminTemp_Command int32
Possible administration actions.
const ( // Illegal value. AdminTemp_UNSPECIFIED AdminTemp_Command = 0 // Download and run a new version of the bot. `arg` will be a resource // accessible via `ByteStream.Read` to obtain the new bot code. AdminTemp_BOT_UPDATE AdminTemp_Command = 1 // Restart the bot without downloading a new version. `arg` will be a // message to log. AdminTemp_BOT_RESTART AdminTemp_Command = 2 // Shut down the bot. `arg` will be a task resource name (similar to those // in tasks.proto) that the bot can use to tell the server that it is // terminating. AdminTemp_BOT_TERMINATE AdminTemp_Command = 3 // Restart the host computer. `arg` will be a message to log. AdminTemp_HOST_RESTART AdminTemp_Command = 4 )
func (AdminTemp_Command) Descriptor ¶
func (AdminTemp_Command) Descriptor() protoreflect.EnumDescriptor
func (AdminTemp_Command) Enum ¶
func (x AdminTemp_Command) Enum() *AdminTemp_Command
func (AdminTemp_Command) EnumDescriptor
deprecated
func (AdminTemp_Command) EnumDescriptor() ([]byte, []int)
Deprecated: Use AdminTemp_Command.Descriptor instead.
func (AdminTemp_Command) Number ¶
func (x AdminTemp_Command) Number() protoreflect.EnumNumber
func (AdminTemp_Command) String ¶
func (x AdminTemp_Command) String() string
func (AdminTemp_Command) Type ¶
func (AdminTemp_Command) Type() protoreflect.EnumType
type BotSession ¶
type BotSession struct { // The bot session name, as selected by the server. Output only during a call // to CreateBotSession. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // A unique bot ID within the farm used to persistently identify this bot over // time (i.e., over multiple sessions). This ID must be unique within a // farm. Typically, the bot ID will be the same as the name of the primary // device in the worker (e.g., what you'd get from typing `uname -n` on *nix), // but this is not required since a single device may allow multiple bots to // run on it, each with access to different resources. What is important is // that this ID is meaningful to humans, who might need to hunt a physical // machine down to fix it. // // When CreateBotSession is successfully called with a bot_id, all prior // sessions with the same ID are invalidated. If a bot attempts to update an // invalid session, the server must reject that request, and may also // quarantine the other bot with the same bot IDs (ie, stop sending it new // leases and alert an admin). BotId string `protobuf:"bytes,2,opt,name=bot_id,json=botId,proto3" json:"bot_id,omitempty"` // The status of the bot. This must be populated in every call to // UpdateBotSession. Status BotStatus `protobuf:"varint,3,opt,name=status,proto3,enum=google.devtools.remoteworkers.v1test2.BotStatus" json:"status,omitempty"` // A description of the worker hosting this bot. The Worker message is used // here in the Status context (see Worker for more information). If multiple // bots are running on the worker, this field should only describe the // resources accessible from this bot. // // During the call to CreateBotSession, the server may make arbitrary changes // to the worker's `server_properties` field (see that field for more // information). Otherwise, this field is input-only. Worker *Worker `protobuf:"bytes,4,opt,name=worker,proto3" json:"worker,omitempty"` // A list of all leases that are a part of this session. See the Lease message // for details. Leases []*Lease `protobuf:"bytes,5,rep,name=leases,proto3" json:"leases,omitempty"` // The time at which this bot session will expire, unless the bot calls // UpdateBotSession again. Output only. ExpireTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` // The version of the bot code currently running. The server may use this // information to issue an admin action to tell the bot to update itself. Version string `protobuf:"bytes,7,opt,name=version,proto3" json:"version,omitempty"` // contains filtered or unexported fields }
A bot session represents the state of a bot while in continuous contact with the server for a period of time. The session includes information about the worker - that is, the *worker* (the physical or virtual hardware) is considered to be a property of the bot (the software agent running on that hardware), which is the reverse of real life, but more natural from the point of the view of this API, which communicates solely with the bot and not directly with the underlying worker.
func (*BotSession) Descriptor
deprecated
func (*BotSession) Descriptor() ([]byte, []int)
Deprecated: Use BotSession.ProtoReflect.Descriptor instead.
func (*BotSession) GetBotId ¶
func (x *BotSession) GetBotId() string
func (*BotSession) GetExpireTime ¶
func (x *BotSession) GetExpireTime() *timestamppb.Timestamp
func (*BotSession) GetLeases ¶
func (x *BotSession) GetLeases() []*Lease
func (*BotSession) GetName ¶
func (x *BotSession) GetName() string
func (*BotSession) GetStatus ¶
func (x *BotSession) GetStatus() BotStatus
func (*BotSession) GetVersion ¶
func (x *BotSession) GetVersion() string
func (*BotSession) GetWorker ¶
func (x *BotSession) GetWorker() *Worker
func (*BotSession) ProtoMessage ¶
func (*BotSession) ProtoMessage()
func (*BotSession) ProtoReflect ¶
func (x *BotSession) ProtoReflect() protoreflect.Message
func (*BotSession) Reset ¶
func (x *BotSession) Reset()
func (*BotSession) String ¶
func (x *BotSession) String() string
type BotStatus ¶
type BotStatus int32
A coarse description of the status of the bot that the server uses to determine whether to assign the bot new leases.
const ( // Default value; do not use. BotStatus_BOT_STATUS_UNSPECIFIED BotStatus = 0 // The bot is healthy, and will accept leases as normal. BotStatus_OK BotStatus = 1 // The bot is unhealthy and will not accept new leases. For example, the bot // may have detected that available disk space is too low. This situation may // resolve itself, but will typically require human intervention. BotStatus_UNHEALTHY BotStatus = 2 // The bot has been asked to reboot the host. The bot will not accept new // leases; once all leases are complete, this session will no longer be // updated but the bot will be expected to establish a new session after the // reboot completes. BotStatus_HOST_REBOOTING BotStatus = 3 // The bot has been asked to shut down. As with HOST_REBOOTING, once all // leases are completed, the session will no longer be updated and the bot // will not be expected to establish a new session. // // Bots are typically only asked to shut down if its host computer will be // modified in some way, such as deleting a VM. BotStatus_BOT_TERMINATING BotStatus = 4 // The bot is initializing and is not ready to accept leases. BotStatus_INITIALIZING BotStatus = 5 // The bot is in maintenance status. In this state, the bot will continue to // be treated as online, but will not accept new leases. BotStatus_MAINTENANCE BotStatus = 6 )
func (BotStatus) Descriptor ¶
func (BotStatus) Descriptor() protoreflect.EnumDescriptor
func (BotStatus) EnumDescriptor
deprecated
func (BotStatus) Number ¶
func (x BotStatus) Number() protoreflect.EnumNumber
func (BotStatus) Type ¶
func (BotStatus) Type() protoreflect.EnumType
type BotsClient ¶
type BotsClient interface { // CreateBotSession is called when the bot first joins the farm, and // establishes a session ID to ensure that multiple machines do not register // using the same name accidentally. CreateBotSession(ctx context.Context, in *CreateBotSessionRequest, opts ...grpc.CallOption) (*BotSession, error) // UpdateBotSession must be called periodically by the bot (on a schedule // determined by the server) to let the server know about its status, and to // pick up new lease requests from the server. UpdateBotSession(ctx context.Context, in *UpdateBotSessionRequest, opts ...grpc.CallOption) (*BotSession, error) }
BotsClient is the client API for Bots service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
Design doc: https://goo.gl/oojM5H
Loosely speaking, the Bots interface monitors a collection of workers (think of them as "computers" for a moment). This collection is known as a "farm," and its purpose is to perform work on behalf of a client.
Each worker runs a small program known as a "bot" that allows it to be controlled by the server. This interface contains only methods that are called by the bots themselves; admin functionality is out of scope for this interface.
More precisely, we use the term "worker" to refer to the physical "thing" running the bot. We use the term "worker," and not "machine" or "computer," since a worker may consist of more than one machine - e.g., a computer with multiple attached devices, or even a cluster of computers, with only one of them running the bot. Conversely, a single machine may host several bots, in which case each bot has a "worker" corresponding to the slice of the machine being managed by that bot.
The main resource in the Bots interface is not, surprisingly, a Bot - it is a BotSession, which represents a period of time in which a bot is in continuous contact with the server (see the BotSession message for more information). The parent of a bot session can be thought of as an instance of a farm. That is, one endpoint may be able to manage many farms for many users. For example, for a farm managed through GCP, the parent resource will typically take the form "projects/{project_id}". This is referred to below as "the farm resource."
func NewBotsClient ¶
func NewBotsClient(cc grpc.ClientConnInterface) BotsClient
type BotsServer ¶
type BotsServer interface { // CreateBotSession is called when the bot first joins the farm, and // establishes a session ID to ensure that multiple machines do not register // using the same name accidentally. CreateBotSession(context.Context, *CreateBotSessionRequest) (*BotSession, error) // UpdateBotSession must be called periodically by the bot (on a schedule // determined by the server) to let the server know about its status, and to // pick up new lease requests from the server. UpdateBotSession(context.Context, *UpdateBotSessionRequest) (*BotSession, error) // contains filtered or unexported methods }
BotsServer is the server API for Bots service. All implementations must embed UnimplementedBotsServer for forward compatibility.
Design doc: https://goo.gl/oojM5H
Loosely speaking, the Bots interface monitors a collection of workers (think of them as "computers" for a moment). This collection is known as a "farm," and its purpose is to perform work on behalf of a client.
Each worker runs a small program known as a "bot" that allows it to be controlled by the server. This interface contains only methods that are called by the bots themselves; admin functionality is out of scope for this interface.
More precisely, we use the term "worker" to refer to the physical "thing" running the bot. We use the term "worker," and not "machine" or "computer," since a worker may consist of more than one machine - e.g., a computer with multiple attached devices, or even a cluster of computers, with only one of them running the bot. Conversely, a single machine may host several bots, in which case each bot has a "worker" corresponding to the slice of the machine being managed by that bot.
The main resource in the Bots interface is not, surprisingly, a Bot - it is a BotSession, which represents a period of time in which a bot is in continuous contact with the server (see the BotSession message for more information). The parent of a bot session can be thought of as an instance of a farm. That is, one endpoint may be able to manage many farms for many users. For example, for a farm managed through GCP, the parent resource will typically take the form "projects/{project_id}". This is referred to below as "the farm resource."
type CancelReservationIntent ¶
type CancelReservationIntent int32
The intent of the cancellation request.
const ( // Default intent. CancelReservationIntent_CANCEL_RESERVATION_INTENT_UNSPECIFIED CancelReservationIntent = 0 // The reservation should only be cancelled if it is in pending state. CancelReservationIntent_ONLY_IF_PENDING CancelReservationIntent = 1 // The reservation should be cancelled no matter its state. CancelReservationIntent_ANY CancelReservationIntent = 2 )
func (CancelReservationIntent) Descriptor ¶
func (CancelReservationIntent) Descriptor() protoreflect.EnumDescriptor
func (CancelReservationIntent) Enum ¶
func (x CancelReservationIntent) Enum() *CancelReservationIntent
func (CancelReservationIntent) EnumDescriptor
deprecated
func (CancelReservationIntent) EnumDescriptor() ([]byte, []int)
Deprecated: Use CancelReservationIntent.Descriptor instead.
func (CancelReservationIntent) Number ¶
func (x CancelReservationIntent) Number() protoreflect.EnumNumber
func (CancelReservationIntent) String ¶
func (x CancelReservationIntent) String() string
func (CancelReservationIntent) Type ¶
func (CancelReservationIntent) Type() protoreflect.EnumType
type CancelReservationRequest ¶
type CancelReservationRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The intent indicates if a task can be cancelled based on its state. If set // to ANY then assigned tasks may be cancelled. Otherwise, the task must be // pending. Intent CancelReservationIntent `` /* 133-byte string literal not displayed */ // contains filtered or unexported fields }
func (*CancelReservationRequest) Descriptor
deprecated
func (*CancelReservationRequest) Descriptor() ([]byte, []int)
Deprecated: Use CancelReservationRequest.ProtoReflect.Descriptor instead.
func (*CancelReservationRequest) GetIntent ¶
func (x *CancelReservationRequest) GetIntent() CancelReservationIntent
func (*CancelReservationRequest) GetName ¶
func (x *CancelReservationRequest) GetName() string
func (*CancelReservationRequest) ProtoMessage ¶
func (*CancelReservationRequest) ProtoMessage()
func (*CancelReservationRequest) ProtoReflect ¶
func (x *CancelReservationRequest) ProtoReflect() protoreflect.Message
func (*CancelReservationRequest) Reset ¶
func (x *CancelReservationRequest) Reset()
func (*CancelReservationRequest) String ¶
func (x *CancelReservationRequest) String() string
type CancelReservationResponse ¶
type CancelReservationResponse struct { Result CancelResult `protobuf:"varint,1,opt,name=result,proto3,enum=google.devtools.remoteworkers.v1test2.CancelResult" json:"result,omitempty"` // contains filtered or unexported fields }
func (*CancelReservationResponse) Descriptor
deprecated
func (*CancelReservationResponse) Descriptor() ([]byte, []int)
Deprecated: Use CancelReservationResponse.ProtoReflect.Descriptor instead.
func (*CancelReservationResponse) GetResult ¶
func (x *CancelReservationResponse) GetResult() CancelResult
func (*CancelReservationResponse) ProtoMessage ¶
func (*CancelReservationResponse) ProtoMessage()
func (*CancelReservationResponse) ProtoReflect ¶
func (x *CancelReservationResponse) ProtoReflect() protoreflect.Message
func (*CancelReservationResponse) Reset ¶
func (x *CancelReservationResponse) Reset()
func (*CancelReservationResponse) String ¶
func (x *CancelReservationResponse) String() string
type CancelResult ¶
type CancelResult int32
The result of canceling the reservation.
const ( CancelResult_CANCEL_STATE_UNSPECIFIED CancelResult = 0 // The Reservation was canceled successfully. CancelResult_CANCELED CancelResult = 1 // The Reservation was not canceled because the task is assigned. CancelResult_TASK_ALREADY_ASSIGNED CancelResult = 2 // The Reservation was not canceled because the task is finished. CancelResult_TASK_ALREADY_FINISHED CancelResult = 3 // The Reservation is cancelling. CancelResult_CANCELLING CancelResult = 4 )
func (CancelResult) Descriptor ¶
func (CancelResult) Descriptor() protoreflect.EnumDescriptor
func (CancelResult) Enum ¶
func (x CancelResult) Enum() *CancelResult
func (CancelResult) EnumDescriptor
deprecated
func (CancelResult) EnumDescriptor() ([]byte, []int)
Deprecated: Use CancelResult.Descriptor instead.
func (CancelResult) Number ¶
func (x CancelResult) Number() protoreflect.EnumNumber
func (CancelResult) String ¶
func (x CancelResult) String() string
func (CancelResult) Type ¶
func (CancelResult) Type() protoreflect.EnumType
type Constraint ¶
type Constraint struct { // The name of the property to which this constraint applies. Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The set of values, at least one of which must be reported by the worker to // be eligible to execute the reservation. AllowedValues []string `protobuf:"bytes,2,rep,name=allowed_values,json=allowedValues,proto3" json:"allowed_values,omitempty"` // contains filtered or unexported fields }
A constraint that a worker must satisfy to be eligible to execute a reservation.
func (*Constraint) Descriptor
deprecated
func (*Constraint) Descriptor() ([]byte, []int)
Deprecated: Use Constraint.ProtoReflect.Descriptor instead.
func (*Constraint) GetAllowedValues ¶
func (x *Constraint) GetAllowedValues() []string
func (*Constraint) GetKey ¶
func (x *Constraint) GetKey() string
func (*Constraint) ProtoMessage ¶
func (*Constraint) ProtoMessage()
func (*Constraint) ProtoReflect ¶
func (x *Constraint) ProtoReflect() protoreflect.Message
func (*Constraint) Reset ¶
func (x *Constraint) Reset()
func (*Constraint) String ¶
func (x *Constraint) String() string
type CreateBotSessionRequest ¶
type CreateBotSessionRequest struct { // The farm resource. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // The bot session to create. Server-assigned fields like name must be unset. BotSession *BotSession `protobuf:"bytes,2,opt,name=bot_session,json=botSession,proto3" json:"bot_session,omitempty"` // contains filtered or unexported fields }
Request message for CreateBotSession.
func (*CreateBotSessionRequest) Descriptor
deprecated
func (*CreateBotSessionRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateBotSessionRequest.ProtoReflect.Descriptor instead.
func (*CreateBotSessionRequest) GetBotSession ¶
func (x *CreateBotSessionRequest) GetBotSession() *BotSession
func (*CreateBotSessionRequest) GetParent ¶
func (x *CreateBotSessionRequest) GetParent() string
func (*CreateBotSessionRequest) ProtoMessage ¶
func (*CreateBotSessionRequest) ProtoMessage()
func (*CreateBotSessionRequest) ProtoReflect ¶
func (x *CreateBotSessionRequest) ProtoReflect() protoreflect.Message
func (*CreateBotSessionRequest) Reset ¶
func (x *CreateBotSessionRequest) Reset()
func (*CreateBotSessionRequest) String ¶
func (x *CreateBotSessionRequest) String() string
type CreateReservationRequest ¶
type CreateReservationRequest struct { Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` Reservation *Reservation `protobuf:"bytes,2,opt,name=reservation,proto3" json:"reservation,omitempty"` // contains filtered or unexported fields }
Request message for CreateReservation.
func (*CreateReservationRequest) Descriptor
deprecated
func (*CreateReservationRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateReservationRequest.ProtoReflect.Descriptor instead.
func (*CreateReservationRequest) GetParent ¶
func (x *CreateReservationRequest) GetParent() string
func (*CreateReservationRequest) GetReservation ¶
func (x *CreateReservationRequest) GetReservation() *Reservation
func (*CreateReservationRequest) ProtoMessage ¶
func (*CreateReservationRequest) ProtoMessage()
func (*CreateReservationRequest) ProtoReflect ¶
func (x *CreateReservationRequest) ProtoReflect() protoreflect.Message
func (*CreateReservationRequest) Reset ¶
func (x *CreateReservationRequest) Reset()
func (*CreateReservationRequest) String ¶
func (x *CreateReservationRequest) String() string
type Device ¶
type Device struct { // The handle can be thought of as the "name" of the device, and must be // unique within a Worker. // // In the Status context, the handle should be some human-understandable name, // perhaps corresponding to a label physically written on the device to make // it easy to locate. In the Request context, the name should be the // *logical* name expected by the task. The bot is responsible for mapping the // logical name expected by the task to a machine-readable name that the task // can actually use, such as a USB address. The method by which this mapping // is communicated to the task is not covered in this API. Handle string `protobuf:"bytes,1,opt,name=handle,proto3" json:"handle,omitempty"` // Properties of this device that don't change based on the tasks that are // running on it, e.g. OS, CPU architecture, etc. // // Keys may be repeated, and have the following interpretation: // // - Status context: the device can support *any* the listed values. For // example, an "ISA" property might include "x86", "x86-64" and "sse4". // // - Request context: the device *must* support *all* of the listed values. Properties []*Device_Property `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties,omitempty"` // contains filtered or unexported fields }
Any device, including computers, phones, accelerators (e.g. GPUs), etc. All names must be unique.
func (*Device) Descriptor
deprecated
func (*Device) GetProperties ¶
func (x *Device) GetProperties() []*Device_Property
func (*Device) ProtoMessage ¶
func (*Device) ProtoMessage()
func (*Device) ProtoReflect ¶
func (x *Device) ProtoReflect() protoreflect.Message
type Device_Property ¶
type Device_Property struct { // For general information on keys, see the documentation to `Worker`. // // The current set of standard keys are: // // * os: a human-readable description of the OS. Examples include `linux`, // `ubuntu` and `ubuntu 14.04` (note that a bot may advertise itself as more // than one). This will be replaced in the future by more well-structured // keys and values to represent OS variants. // // * has-docker: "true" if the bot has Docker installed. This will be // replaced in the future by a more structured message for Docker support. Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The property's value. Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
A device property; see `properties` for more information.
func (*Device_Property) Descriptor
deprecated
func (*Device_Property) Descriptor() ([]byte, []int)
Deprecated: Use Device_Property.ProtoReflect.Descriptor instead.
func (*Device_Property) GetKey ¶
func (x *Device_Property) GetKey() string
func (*Device_Property) GetValue ¶
func (x *Device_Property) GetValue() string
func (*Device_Property) ProtoMessage ¶
func (*Device_Property) ProtoMessage()
func (*Device_Property) ProtoReflect ¶
func (x *Device_Property) ProtoReflect() protoreflect.Message
func (*Device_Property) Reset ¶
func (x *Device_Property) Reset()
func (*Device_Property) String ¶
func (x *Device_Property) String() string
type GetReservationRequest ¶
type GetReservationRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // If non-zero, GetReservation will attempt to wait for the reservation's // state to become COMPLETED for up to this amount of time, though this is not // guaranteed. WaitSeconds int64 `protobuf:"varint,2,opt,name=wait_seconds,json=waitSeconds,proto3" json:"wait_seconds,omitempty"` // contains filtered or unexported fields }
func (*GetReservationRequest) Descriptor
deprecated
func (*GetReservationRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetReservationRequest.ProtoReflect.Descriptor instead.
func (*GetReservationRequest) GetName ¶
func (x *GetReservationRequest) GetName() string
func (*GetReservationRequest) GetWaitSeconds ¶
func (x *GetReservationRequest) GetWaitSeconds() int64
func (*GetReservationRequest) ProtoMessage ¶
func (*GetReservationRequest) ProtoMessage()
func (*GetReservationRequest) ProtoReflect ¶
func (x *GetReservationRequest) ProtoReflect() protoreflect.Message
func (*GetReservationRequest) Reset ¶
func (x *GetReservationRequest) Reset()
func (*GetReservationRequest) String ¶
func (x *GetReservationRequest) String() string
type Lease ¶
type Lease struct { // A short string uniquely identifing the lease within this bot session. Id string `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` // The actual work to be performed, if any. May be omitted by the server if // the lease is not in the `PENDING` state. The message must be meaningful to // the bot. Output only (must only be set by the server). Payload *anypb.Any `protobuf:"bytes,8,opt,name=payload,proto3" json:"payload,omitempty"` // Any result the bot wishes to provide about the lease. Must not be changed // after the first call with the lease in the `COMPLETED` or `CANCELLED` // state. Input only (must only be set by the bot, will not be echoed by the // server). Result *anypb.Any `protobuf:"bytes,9,opt,name=result,proto3" json:"result,omitempty"` // The state of the lease. See LeaseState for more information. State LeaseState `protobuf:"varint,2,opt,name=state,proto3,enum=google.devtools.remoteworkers.v1test2.LeaseState" json:"state,omitempty"` // The final status of the lease (should be populated by the bot if the state // is completed). This is the status of the lease, not of any task represented // by the lease. For example, if the bot could not accept the lease because it // asked for some resource the bot didn't have, this status will be // FAILED_PRECONDITION. But if the assignment in the lease didn't execute // correctly, this field will be `OK` while the failure of the assignment must // communicated via the `result` field. Status *status.Status `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // The requirements that are being claimed by this lease. This field may be // omitted by the server if the lease is not pending. Requirements *Worker `protobuf:"bytes,4,opt,name=requirements,proto3" json:"requirements,omitempty"` // The time at which this lease expires. The server *may* extend this over // time, but due to race conditions, the bot is not *required* to respect any // expiry date except the first one. ExpireTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` // DEPRECATED. The assignment should be provided to the bot via the `payload` // field. Clients that wish to use a simple name (such as a queue of work // provided elsewhere) should define a custom message type and encode it into // `payload`. // // Deprecated: Marked as deprecated in go.chromium.org/luci/swarming/internal/remoteworkers/bots.proto. Assignment string `protobuf:"bytes,1,opt,name=assignment,proto3" json:"assignment,omitempty"` // DEPRECATED. Use `payload` instead. // // Deprecated: Marked as deprecated in go.chromium.org/luci/swarming/internal/remoteworkers/bots.proto. InlineAssignment *anypb.Any `protobuf:"bytes,6,opt,name=inline_assignment,json=inlineAssignment,proto3" json:"inline_assignment,omitempty"` // contains filtered or unexported fields }
A Lease is a lease that the scheduler has assigned to this bot. If the bot notices (by UpdateBotSession) that it has any leases in the PENDING state, it should call UpdateBotSession to put the leases into the ACTIVE state and start executing their assignments.
All fields in this message are output-only, *except* the `state` and `status` fields. Note that repeated fields can only be updated as a unit, so on every update the bot must provide an update for *all* the leases the server expects it to report on.
The scheduler *should* ensure that all leases scheduled to a bot can actually be accepted, but race conditions may occur. In such cases, the bot should attempt to accept the leases in the order they are listed by the server, to allow the server to control priorities.
The server will remove COMPLETED leases from time to time, after which the bot shouldn't report on them any more (the server will ignore superfluous COMPLETED records).
func (*Lease) Descriptor
deprecated
func (*Lease) GetAssignment
deprecated
func (*Lease) GetExpireTime ¶
func (x *Lease) GetExpireTime() *timestamppb.Timestamp
func (*Lease) GetInlineAssignment
deprecated
func (*Lease) GetPayload ¶
func (*Lease) GetRequirements ¶
func (*Lease) GetState ¶
func (x *Lease) GetState() LeaseState
func (*Lease) ProtoMessage ¶
func (*Lease) ProtoMessage()
func (*Lease) ProtoReflect ¶
func (x *Lease) ProtoReflect() protoreflect.Message
type LeaseState ¶
type LeaseState int32
The state of the lease. All leases start in the PENDING state. A bot can change PENDING to ACTIVE or (in the case of an error) COMPLETED, or from ACTIVE to COMPLETED. The server can change PENDING or ACTIVE to CANCELLED if it wants the bot to release its resources - for example, if the bot needs to be quarantined (it's producing bad output) or a cell needs to be drained.
const ( // Default value; do not use. LeaseState_LEASE_STATE_UNSPECIFIED LeaseState = 0 // Pending: the server expects the bot to accept this lease. This may only be // set by the server. LeaseState_PENDING LeaseState = 1 // Active: the bot has accepted this lease. This may only be set by the bot. LeaseState_ACTIVE LeaseState = 2 // Completed: the bot is no longer leased. This may only be set by the bot, // and the status field must be populated iff the state is COMPLETED. LeaseState_COMPLETED LeaseState = 4 // Cancelled: The bot should immediately release all resources associated with // the lease. This may only be set by the server. LeaseState_CANCELLED LeaseState = 5 )
func (LeaseState) Descriptor ¶
func (LeaseState) Descriptor() protoreflect.EnumDescriptor
func (LeaseState) Enum ¶
func (x LeaseState) Enum() *LeaseState
func (LeaseState) EnumDescriptor
deprecated
func (LeaseState) EnumDescriptor() ([]byte, []int)
Deprecated: Use LeaseState.Descriptor instead.
func (LeaseState) Number ¶
func (x LeaseState) Number() protoreflect.EnumNumber
func (LeaseState) String ¶
func (x LeaseState) String() string
func (LeaseState) Type ¶
func (LeaseState) Type() protoreflect.EnumType
type PubSubMetadata ¶
type PubSubMetadata struct { // The topic_id is the name of the topic that the pubsub service will publish. // The subscriber should be subscribing to the topic_id. TopicId string `protobuf:"bytes,1,opt,name=topic_id,json=topicId,proto3" json:"topic_id,omitempty"` // The publisher_id is the id that the pubsub service will use when publishing // the topic identified by the topic_id. PublisherId string `protobuf:"bytes,2,opt,name=publisher_id,json=publisherId,proto3" json:"publisher_id,omitempty"` // contains filtered or unexported fields }
func (*PubSubMetadata) Descriptor
deprecated
func (*PubSubMetadata) Descriptor() ([]byte, []int)
Deprecated: Use PubSubMetadata.ProtoReflect.Descriptor instead.
func (*PubSubMetadata) GetPublisherId ¶
func (x *PubSubMetadata) GetPublisherId() string
func (*PubSubMetadata) GetTopicId ¶
func (x *PubSubMetadata) GetTopicId() string
func (*PubSubMetadata) ProtoMessage ¶
func (*PubSubMetadata) ProtoMessage()
func (*PubSubMetadata) ProtoReflect ¶
func (x *PubSubMetadata) ProtoReflect() protoreflect.Message
func (*PubSubMetadata) Reset ¶
func (x *PubSubMetadata) Reset()
func (*PubSubMetadata) String ¶
func (x *PubSubMetadata) String() string
type Reservation ¶
type Reservation struct { // The full reservation resource in the form of // "{parent}/reservations/{reservation}". The {reservation} component must be // a globally unique random identifier, e.g. UUID. This component must be set // in the CreateReservation request. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // A message describing what the worker should do. Payload *anypb.Any `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // Any result provided by the worker. Output only. Result *anypb.Any `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty"` // The state of the reservation - see ReservationState for more information. // Output only. State ReservationState `protobuf:"varint,4,opt,name=state,proto3,enum=google.devtools.remoteworkers.v1test2.ReservationState" json:"state,omitempty"` // If `state` is COMPLETED, this is the final status of the reservation. // Typically, this will be OK if a worker was successfully assigned - if the // worker failed to do work, that failure will be reported in the `result` // field, not here. // Output only. Status *status.Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` // The constraints that a worker must satisfy to be eligible to execute this // reservation. Constraints []*Constraint `protobuf:"bytes,13,rep,name=constraints,proto3" json:"constraints,omitempty"` // The time after which the client no longer cares about this reservation. The // lease must be *completed* by this time, not started. expire_time is // enforced independently of other timeouts like queuing_timeout and // execution_timeout. ExpireTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` // Limits how long the reservation can be queued before being killed. Has no // effect once the reservation begins execution. queuing_timeout is enforced // independently of other timeouts like expire_time and execution_timeout. QueuingTimeout *durationpb.Duration `protobuf:"bytes,14,opt,name=queuing_timeout,json=queuingTimeout,proto3" json:"queuing_timeout,omitempty"` // Limits how long a reservation is allowed to run. Does not include any time // the reservation was queued. execution_timeout is enforced independently of // other timeouts like expire_time and queuing_timeout. ExecutionTimeout *durationpb.Duration `protobuf:"bytes,15,opt,name=execution_timeout,json=executionTimeout,proto3" json:"execution_timeout,omitempty"` // The priority (relative importance) of this reservation. Generally, a lower // value means that the reservation should be run sooner than reservations // having a greater priority value, but the interpretation of a given value is // server-dependent. A priority of 0 means the *default* priority. Priorities // may be positive or negative, and such reservations should run later or // sooner than reservations having the default priority, respectively. The // particular semantics of this field is up to the server. In particular, // every server will have their own supported range of priorities, and will // decide how these map into scheduling policy. Priority int32 `protobuf:"varint,8,opt,name=priority,proto3" json:"priority,omitempty"` // The pubsub_metadata field is a PubSubMetadata message containing topic_id // and publisher_id. If this message is provided, then the pubsub service will // be used to publish a Reservation message to the topic_id using the // publisher_id. The published Reservation message will contain the // reservation ID along with basic status info about the result. The // subscriber will then need to call GetReservation RPC to get more details. PubsubMetadata *PubSubMetadata `protobuf:"bytes,9,opt,name=pubsub_metadata,json=pubsubMetadata,proto3" json:"pubsub_metadata,omitempty"` // The assigned_bot_id field is a string message of the name of the machine // tasked with executing a Reservation. This is a necessary debugging field // for Reservation users that control their own workers. AssignedBotId string `protobuf:"bytes,10,opt,name=assigned_bot_id,json=assignedBotId,proto3" json:"assigned_bot_id,omitempty"` // The name of the machine that should execute the Reservation. RequestedBotId string `protobuf:"bytes,12,opt,name=requested_bot_id,json=requestedBotId,proto3" json:"requested_bot_id,omitempty"` // Identifies the group that this reservation belongs to. For example, if this // reservation represents one of several actions to be performed as part of a // particular job, the group ID may be the ID of that job. GroupId string `protobuf:"bytes,11,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` // contains filtered or unexported fields }
A low-level request for a lease of a worker.
func (*Reservation) Descriptor
deprecated
func (*Reservation) Descriptor() ([]byte, []int)
Deprecated: Use Reservation.ProtoReflect.Descriptor instead.
func (*Reservation) GetAssignedBotId ¶
func (x *Reservation) GetAssignedBotId() string
func (*Reservation) GetConstraints ¶
func (x *Reservation) GetConstraints() []*Constraint
func (*Reservation) GetExecutionTimeout ¶
func (x *Reservation) GetExecutionTimeout() *durationpb.Duration
func (*Reservation) GetExpireTime ¶
func (x *Reservation) GetExpireTime() *timestamppb.Timestamp
func (*Reservation) GetGroupId ¶
func (x *Reservation) GetGroupId() string
func (*Reservation) GetName ¶
func (x *Reservation) GetName() string
func (*Reservation) GetPayload ¶
func (x *Reservation) GetPayload() *anypb.Any
func (*Reservation) GetPriority ¶
func (x *Reservation) GetPriority() int32
func (*Reservation) GetPubsubMetadata ¶
func (x *Reservation) GetPubsubMetadata() *PubSubMetadata
func (*Reservation) GetQueuingTimeout ¶
func (x *Reservation) GetQueuingTimeout() *durationpb.Duration
func (*Reservation) GetRequestedBotId ¶
func (x *Reservation) GetRequestedBotId() string
func (*Reservation) GetResult ¶
func (x *Reservation) GetResult() *anypb.Any
func (*Reservation) GetState ¶
func (x *Reservation) GetState() ReservationState
func (*Reservation) GetStatus ¶
func (x *Reservation) GetStatus() *status.Status
func (*Reservation) ProtoMessage ¶
func (*Reservation) ProtoMessage()
func (*Reservation) ProtoReflect ¶
func (x *Reservation) ProtoReflect() protoreflect.Message
func (*Reservation) Reset ¶
func (x *Reservation) Reset()
func (*Reservation) String ¶
func (x *Reservation) String() string
type ReservationState ¶
type ReservationState int32
The state of the reservation.
const ( // Default value; do not use. ReservationState_RESERVATION_STATE_UNSPECIFIED ReservationState = 0 // The reservation has not yet been assigned. ReservationState_RESERVATION_PENDING ReservationState = 1 // The reservation has been assigned to a worker but is not yet active. ReservationState_RESERVATION_ASSIGNED ReservationState = 2 // The reservation is currently active. ReservationState_RESERVATION_ACTIVE ReservationState = 3 // The reservation has completed. ReservationState_RESERVATION_COMPLETED ReservationState = 4 // The reservation is cancelled. ReservationState_RESERVATION_CANCELLED ReservationState = 5 )
func (ReservationState) Descriptor ¶
func (ReservationState) Descriptor() protoreflect.EnumDescriptor
func (ReservationState) Enum ¶
func (x ReservationState) Enum() *ReservationState
func (ReservationState) EnumDescriptor
deprecated
func (ReservationState) EnumDescriptor() ([]byte, []int)
Deprecated: Use ReservationState.Descriptor instead.
func (ReservationState) Number ¶
func (x ReservationState) Number() protoreflect.EnumNumber
func (ReservationState) String ¶
func (x ReservationState) String() string
func (ReservationState) Type ¶
func (ReservationState) Type() protoreflect.EnumType
type ReservationsClient ¶
type ReservationsClient interface { // Creates a new reservation and enqueues it for submissions. CreateReservation(ctx context.Context, in *CreateReservationRequest, opts ...grpc.CallOption) (*Reservation, error) // Retrieves a reservation, along with its results if it's completed. Can // optionally wait for completion as well. GetReservation(ctx context.Context, in *GetReservationRequest, opts ...grpc.CallOption) (*Reservation, error) // Attempts to cancel a reservation. If it is successful, the reservation's // state will change to COMPLETED and its status code to CANCELLED. CancelReservation(ctx context.Context, in *CancelReservationRequest, opts ...grpc.CallOption) (*CancelReservationResponse, error) }
ReservationsClient is the client API for Reservations service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewReservationsClient ¶
func NewReservationsClient(cc grpc.ClientConnInterface) ReservationsClient
type ReservationsServer ¶
type ReservationsServer interface { // Creates a new reservation and enqueues it for submissions. CreateReservation(context.Context, *CreateReservationRequest) (*Reservation, error) // Retrieves a reservation, along with its results if it's completed. Can // optionally wait for completion as well. GetReservation(context.Context, *GetReservationRequest) (*Reservation, error) // Attempts to cancel a reservation. If it is successful, the reservation's // state will change to COMPLETED and its status code to CANCELLED. CancelReservation(context.Context, *CancelReservationRequest) (*CancelReservationResponse, error) // contains filtered or unexported methods }
ReservationsServer is the server API for Reservations service. All implementations must embed UnimplementedReservationsServer for forward compatibility.
type UnimplementedBotsServer ¶
type UnimplementedBotsServer struct{}
UnimplementedBotsServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedBotsServer) CreateBotSession ¶
func (UnimplementedBotsServer) CreateBotSession(context.Context, *CreateBotSessionRequest) (*BotSession, error)
func (UnimplementedBotsServer) UpdateBotSession ¶
func (UnimplementedBotsServer) UpdateBotSession(context.Context, *UpdateBotSessionRequest) (*BotSession, error)
type UnimplementedReservationsServer ¶
type UnimplementedReservationsServer struct{}
UnimplementedReservationsServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedReservationsServer) CancelReservation ¶
func (UnimplementedReservationsServer) CancelReservation(context.Context, *CancelReservationRequest) (*CancelReservationResponse, error)
func (UnimplementedReservationsServer) CreateReservation ¶
func (UnimplementedReservationsServer) CreateReservation(context.Context, *CreateReservationRequest) (*Reservation, error)
func (UnimplementedReservationsServer) GetReservation ¶
func (UnimplementedReservationsServer) GetReservation(context.Context, *GetReservationRequest) (*Reservation, error)
type UnsafeBotsServer ¶
type UnsafeBotsServer interface {
// contains filtered or unexported methods
}
UnsafeBotsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BotsServer will result in compilation errors.
type UnsafeReservationsServer ¶
type UnsafeReservationsServer interface {
// contains filtered or unexported methods
}
UnsafeReservationsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ReservationsServer will result in compilation errors.
type UpdateBotSessionRequest ¶
type UpdateBotSessionRequest struct { // The bot session name. Must match bot_session.name. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The bot session resource to update. BotSession *BotSession `protobuf:"bytes,2,opt,name=bot_session,json=botSession,proto3" json:"bot_session,omitempty"` // The fields on the bot that should be updated. See the BotSession resource // for which fields are updatable by which caller. UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` // contains filtered or unexported fields }
Request message for UpdateBotSession.
func (*UpdateBotSessionRequest) Descriptor
deprecated
func (*UpdateBotSessionRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateBotSessionRequest.ProtoReflect.Descriptor instead.
func (*UpdateBotSessionRequest) GetBotSession ¶
func (x *UpdateBotSessionRequest) GetBotSession() *BotSession
func (*UpdateBotSessionRequest) GetName ¶
func (x *UpdateBotSessionRequest) GetName() string
func (*UpdateBotSessionRequest) GetUpdateMask ¶
func (x *UpdateBotSessionRequest) GetUpdateMask() *fieldmaskpb.FieldMask
func (*UpdateBotSessionRequest) ProtoMessage ¶
func (*UpdateBotSessionRequest) ProtoMessage()
func (*UpdateBotSessionRequest) ProtoReflect ¶
func (x *UpdateBotSessionRequest) ProtoReflect() protoreflect.Message
func (*UpdateBotSessionRequest) Reset ¶
func (x *UpdateBotSessionRequest) Reset()
func (*UpdateBotSessionRequest) String ¶
func (x *UpdateBotSessionRequest) String() string
type Worker ¶
type Worker struct { // A list of devices; the first device is the primary device. See the `Device` // message for more information. Devices []*Device `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` // A worker may contain "global" properties. For example, certain machines // might be reserved for certain types of jobs, like short-running compilation // versus long-running integration tests. This property is known as a "pool" // and is not related to any one device within the worker; rather, it applies // to the worker as a whole. // // The behaviour of repeated keys is identical to that of Device.Property. Properties []*Worker_Property `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties,omitempty"` // Bots can be configured in certain ways when accepting leases. For example, // many leases are executed inside a Docker container. To support this, the // bot needs to be able to report that it has Docker installed (and knows how // to execute something inside a container), and the task submitter needs to // specify which image should be used to start the container. Similarly, a // lease may be able to run as one of several users on the worker; in such // cases, the bot needs to report what users are available, and the submitter // needs to choose one. // // Therefore, when this message is reported by the bot to the service, each // key represents a *type* of configuration that the bot knows how to set, // while each *value* represents a legal value for that configuration (the // empty string is interpreted as a wildcard, such as for Docker images). // When this message is sent by the server to the bot in the context of a // lease, it represents a command to the bot to apply the setting. Keys may // be repeated during reporting but not in a lease. Configs []*Worker_Config `protobuf:"bytes,3,rep,name=configs,proto3" json:"configs,omitempty"` // Implementation-dependent metadata about the worker. Both servers and bots // may define messages which can be encoded here; bots are free to provide // metadata in multiple formats, and servers are free to choose one or more // of the values to process and ignore others. In particular, it is *not* // considered an error for the bot to provide the server with a field that it // doesn't know about. Metadata []*anypb.Any `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty"` // contains filtered or unexported fields }
Describes a worker, which is a list of one or more devices and the connections between them. A device could be a computer, a phone, or even an accelerator like a GPU; it's up to the farm administrator to decide how to model their farm. For example, if a farm only has one type of GPU, the GPU could be modelled as a "has_gpu" property on its host computer; if it has many subproperties itself, it might be better to model it as a separate device.
The first device in the worker is the "primary device" - that is, the device running a bot and which is responsible for actually executing commands. All other devices are considered to be attached devices, and must be controllable by the primary device.
This message (and all its submessages) can be used in two contexts:
* Status: sent by the bot to report the current capabilities of the device to allow reservation matching. * Request: sent by a client to request a device with certain capabilities in a reservation.
Several of the fields in this message have different semantics depending on which of which of these contexts it is used. These semantics are described below.
Several messages in Worker and its submessages have the concept of keys and values, such as `Worker.Property` and `Device.Property`. All keys are simple strings, but certain keys are "standard" keys and should be broadly supported across farms and implementations; these are listed below each relevant message. Bot implementations or farm admins may add *additional* keys, but these SHOULD all begin with an underscore so they do not conflict with standard keys that may be added in the future.
Keys are not context sensitive.
See http://goo.gl/NurY8g for more information on the Worker message.
func (*Worker) Descriptor
deprecated
func (*Worker) GetConfigs ¶
func (x *Worker) GetConfigs() []*Worker_Config
func (*Worker) GetDevices ¶
func (*Worker) GetMetadata ¶
func (*Worker) GetProperties ¶
func (x *Worker) GetProperties() []*Worker_Property
func (*Worker) ProtoMessage ¶
func (*Worker) ProtoMessage()
func (*Worker) ProtoReflect ¶
func (x *Worker) ProtoReflect() protoreflect.Message
type Worker_Config ¶
type Worker_Config struct { // For general information on keys, see the documentation to `Worker`. // // The current set of standard keys are: // // * DockerImage: the image of the container. When being reported by the // bot, the empty value should always be included if the bot is able to pull // its own images; the bot may optionally *also* report images that are // present in its cache. When being requested in a lease, the value is the // URI of the image (eg `gcr.io/user/image@sha256:hash`). Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The configuration's value. Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
A configuration request or report; see the `configs` field for more information.
func (*Worker_Config) Descriptor
deprecated
func (*Worker_Config) Descriptor() ([]byte, []int)
Deprecated: Use Worker_Config.ProtoReflect.Descriptor instead.
func (*Worker_Config) GetKey ¶
func (x *Worker_Config) GetKey() string
func (*Worker_Config) GetValue ¶
func (x *Worker_Config) GetValue() string
func (*Worker_Config) ProtoMessage ¶
func (*Worker_Config) ProtoMessage()
func (*Worker_Config) ProtoReflect ¶
func (x *Worker_Config) ProtoReflect() protoreflect.Message
func (*Worker_Config) Reset ¶
func (x *Worker_Config) Reset()
func (*Worker_Config) String ¶
func (x *Worker_Config) String() string
type Worker_Property ¶
type Worker_Property struct { // For general information on keys, see the documentation to `Worker`. // // The current set of standard keys are: // // * pool: different workers can be reserved for different purposes. For // example, an admin might want to segregate long-running integration tests // from short-running unit tests, so unit tests will always get some // throughput. To support this, the server can assign different values for // `pool` (such as "itest" and "utest") to different workers, and then have // jobs request workers from those pools. Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The property's value. Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
A global property; see the `properties` field for more information.
func (*Worker_Property) Descriptor
deprecated
func (*Worker_Property) Descriptor() ([]byte, []int)
Deprecated: Use Worker_Property.ProtoReflect.Descriptor instead.
func (*Worker_Property) GetKey ¶
func (x *Worker_Property) GetKey() string
func (*Worker_Property) GetValue ¶
func (x *Worker_Property) GetValue() string
func (*Worker_Property) ProtoMessage ¶
func (*Worker_Property) ProtoMessage()
func (*Worker_Property) ProtoReflect ¶
func (x *Worker_Property) ProtoReflect() protoreflect.Message
func (*Worker_Property) Reset ¶
func (x *Worker_Property) Reset()
func (*Worker_Property) String ¶
func (x *Worker_Property) String() string