protos

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_infra_qscheduler_qslib_protos_config_proto protoreflect.FileDescriptor
View Source
var File_infra_qscheduler_qslib_protos_reconciler_proto protoreflect.FileDescriptor
View Source
var File_infra_qscheduler_qslib_protos_scheduler_proto protoreflect.FileDescriptor
View Source
var File_infra_qscheduler_qslib_protos_state_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AccountConfig

type AccountConfig struct {

	// ChargeRate is the rates (per second) at which per-priority accounts grow.
	//
	// Conceptually this is the time-averaged number of workers that this account
	// may use, at each priority level.
	ChargeRate []float32 `protobuf:"fixed32,1,rep,packed,name=charge_rate,json=chargeRate,proto3" json:"charge_rate,omitempty"`
	// MaxChargeSeconds is the maximum amount of time over which this account can
	// accumulate quota before hitting its cap.
	//
	// Conceptually this sets the time window over which the time averaged
	// utilization by this account is measured. Very bursty clients will need to
	// use a wider window, whereas very consistent clients will use a narrow one.
	MaxChargeSeconds float32 `protobuf:"fixed32,2,opt,name=max_charge_seconds,json=maxChargeSeconds,proto3" json:"max_charge_seconds,omitempty"`
	// MaxFanout is the maximum number of concurrent paid jobs for a single
	// provisionable label that this account will pay for (0 = no limit).
	//
	// Additional jobs beyond this may run if there is idle capacity, but they
	// will run in the FreeBucket priority level (except if DisableFreeTasks
	// is true, in which case they will not run).
	MaxFanout int32 `protobuf:"varint,3,opt,name=max_fanout,json=maxFanout,proto3" json:"max_fanout,omitempty"`
	// If DisableFreeTasks is true, then jobs for this account will not start
	// running if they would be run at FreeBucket priority.
	DisableFreeTasks bool `protobuf:"varint,4,opt,name=disable_free_tasks,json=disableFreeTasks,proto3" json:"disable_free_tasks,omitempty"`
	// Human readable description of account's intended purpose.
	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// PerLabelTaskLimits allows for extra limits to be enforced for any given
	// label, e.g. setting label-model:2 ensures that a maximum of two concurrent
	// jobs per model can run under this account.
	PerLabelTaskLimits map[string]int32 `` /* 208-byte string literal not displayed */
	// contains filtered or unexported fields
}

AccountConfig represents per-quota-account configuration information, such as the recharge parameters. This does not represent anything about the current state of an account.

func (*AccountConfig) Descriptor deprecated

func (*AccountConfig) Descriptor() ([]byte, []int)

Deprecated: Use AccountConfig.ProtoReflect.Descriptor instead.

func (*AccountConfig) GetChargeRate

func (x *AccountConfig) GetChargeRate() []float32

func (*AccountConfig) GetDescription

func (x *AccountConfig) GetDescription() string

func (*AccountConfig) GetDisableFreeTasks

func (x *AccountConfig) GetDisableFreeTasks() bool

func (*AccountConfig) GetMaxChargeSeconds

func (x *AccountConfig) GetMaxChargeSeconds() float32

func (*AccountConfig) GetMaxFanout

func (x *AccountConfig) GetMaxFanout() int32

func (*AccountConfig) GetPerLabelTaskLimits

func (x *AccountConfig) GetPerLabelTaskLimits() map[string]int32

func (*AccountConfig) ProtoMessage

func (*AccountConfig) ProtoMessage()

func (*AccountConfig) ProtoReflect

func (x *AccountConfig) ProtoReflect() protoreflect.Message

func (*AccountConfig) Reset

func (x *AccountConfig) Reset()

func (*AccountConfig) String

func (x *AccountConfig) String() string

type Reconciler

type Reconciler struct {

	// WorkerQueues holds pending assignments for workers.
	//
	// An assignment remains pending until a notification from Swarming
	// acknowledges that it has taken place.
	WorkerQueues map[string]*WorkerQueue `` /* 185-byte string literal not displayed */
	// TaskErrors is a map from task ids that had an error to the error description.
	//
	// Task errors remain pending until a notification from Swarming acknowledges
	// that the task is no longer pending.
	TaskErrors map[string]string `` /* 179-byte string literal not displayed */
	// contains filtered or unexported fields
}

ReconcilerState represents a reconciler. It holds tasks that are pending assignment to workers and tasks that have errored out.

func (*Reconciler) Descriptor deprecated

func (*Reconciler) Descriptor() ([]byte, []int)

Deprecated: Use Reconciler.ProtoReflect.Descriptor instead.

func (*Reconciler) GetTaskErrors

func (x *Reconciler) GetTaskErrors() map[string]string

func (*Reconciler) GetWorkerQueues

func (x *Reconciler) GetWorkerQueues() map[string]*WorkerQueue

func (*Reconciler) ProtoMessage

func (*Reconciler) ProtoMessage()

func (*Reconciler) ProtoReflect

func (x *Reconciler) ProtoReflect() protoreflect.Message

func (*Reconciler) Reset

func (x *Reconciler) Reset()

func (*Reconciler) String

func (x *Reconciler) String() string

type Scheduler

type Scheduler struct {

	// SchedulerState is the state of the scheduler.
	State *SchedulerState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
	// SchedulerConfig is the config of the scheduler.
	Config *SchedulerConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

Scheduler encapsulates the state and configuration of a running quotascheduler for a single pool.

func (*Scheduler) Descriptor deprecated

func (*Scheduler) Descriptor() ([]byte, []int)

Deprecated: Use Scheduler.ProtoReflect.Descriptor instead.

func (*Scheduler) GetConfig

func (x *Scheduler) GetConfig() *SchedulerConfig

func (*Scheduler) GetState

func (x *Scheduler) GetState() *SchedulerState

func (*Scheduler) ProtoMessage

func (*Scheduler) ProtoMessage()

func (*Scheduler) ProtoReflect

func (x *Scheduler) ProtoReflect() protoreflect.Message

func (*Scheduler) Reset

func (x *Scheduler) Reset()

func (*Scheduler) String

func (x *Scheduler) String() string

type SchedulerConfig

type SchedulerConfig struct {

	// Configuration for a given account, keyed by account id.
	AccountConfigs map[string]*AccountConfig `` /* 191-byte string literal not displayed */
	// If set, scheduler will never preempt running tasks.
	DisablePreemption bool `protobuf:"varint,2,opt,name=disable_preemption,json=disablePreemption,proto3" json:"disable_preemption,omitempty"`
	// BotExpiration is the duration after which a bot will no longer be
	// considered idle, if the scheduler doesn't receive any assignment requests
	// for it.
	//
	// If unspecified, defaults to 300 seconds.
	BotExpiration *durationpb.Duration `protobuf:"bytes,4,opt,name=bot_expiration,json=botExpiration,proto3" json:"bot_expiration,omitempty"`
	// contains filtered or unexported fields
}

SchedulerConfig represents configuration information about the behavior of accounts for this quota scheduler pool.

func (*SchedulerConfig) Descriptor deprecated

func (*SchedulerConfig) Descriptor() ([]byte, []int)

Deprecated: Use SchedulerConfig.ProtoReflect.Descriptor instead.

func (*SchedulerConfig) GetAccountConfigs

func (x *SchedulerConfig) GetAccountConfigs() map[string]*AccountConfig

func (*SchedulerConfig) GetBotExpiration

func (x *SchedulerConfig) GetBotExpiration() *durationpb.Duration

func (*SchedulerConfig) GetDisablePreemption

func (x *SchedulerConfig) GetDisablePreemption() bool

func (*SchedulerConfig) ProtoMessage

func (*SchedulerConfig) ProtoMessage()

func (*SchedulerConfig) ProtoReflect

func (x *SchedulerConfig) ProtoReflect() protoreflect.Message

func (*SchedulerConfig) Reset

func (x *SchedulerConfig) Reset()

func (*SchedulerConfig) String

func (x *SchedulerConfig) String() string

type SchedulerState

type SchedulerState struct {

	// QueuedRequests is the set of Requests that are waiting to be assigned to a
	// worker, keyed by request id.
	QueuedRequests map[string]*TaskRequest `` /* 191-byte string literal not displayed */
	// Balance of all quota accounts for this pool, keyed by account id.
	Balances map[string]*SchedulerState_Balance `` /* 157-byte string literal not displayed */
	// Workers that may run tasks, and their states, keyed by worker id.
	Workers map[string]*Worker `` /* 155-byte string literal not displayed */
	// LastUpdateTime is the last time at which UpdateTime was called on a scheduler,
	// and corresponds to the when the quota account balances were updated.
	LastUpdateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_update_time,json=lastUpdateTime,proto3" json:"last_update_time,omitempty"`
	// LabelMap maps label IDs to their string values.
	//
	// Requests and workers store labels by IDs.
	LabelMap map[uint64]string `` /* 174-byte string literal not displayed */
	// contains filtered or unexported fields
}

State represents the overall state of a quota scheduler worker pool, account set, and task queue. This is represented separately from configuration information. The state is expected to be updated frequently, on each scheduler tick.

The proto representation optimizes for a small binary-serialized size, rather than human-friendliness, because the number of tasks that can be stored in a single datastore entity (~1 MB) is one of the main scaling limits of the quotascheduler.

func (*SchedulerState) Descriptor deprecated

func (*SchedulerState) Descriptor() ([]byte, []int)

Deprecated: Use SchedulerState.ProtoReflect.Descriptor instead.

func (*SchedulerState) GetBalances

func (x *SchedulerState) GetBalances() map[string]*SchedulerState_Balance

func (*SchedulerState) GetLabelMap

func (x *SchedulerState) GetLabelMap() map[uint64]string

func (*SchedulerState) GetLastUpdateTime

func (x *SchedulerState) GetLastUpdateTime() *timestamppb.Timestamp

func (*SchedulerState) GetQueuedRequests

func (x *SchedulerState) GetQueuedRequests() map[string]*TaskRequest

func (*SchedulerState) GetWorkers

func (x *SchedulerState) GetWorkers() map[string]*Worker

func (*SchedulerState) ProtoMessage

func (*SchedulerState) ProtoMessage()

func (*SchedulerState) ProtoReflect

func (x *SchedulerState) ProtoReflect() protoreflect.Message

func (*SchedulerState) Reset

func (x *SchedulerState) Reset()

func (*SchedulerState) String

func (x *SchedulerState) String() string

type SchedulerState_Balance

type SchedulerState_Balance struct {
	Value []float32 `protobuf:"fixed32,1,rep,packed,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*SchedulerState_Balance) Descriptor deprecated

func (*SchedulerState_Balance) Descriptor() ([]byte, []int)

Deprecated: Use SchedulerState_Balance.ProtoReflect.Descriptor instead.

func (*SchedulerState_Balance) GetValue

func (x *SchedulerState_Balance) GetValue() []float32

func (*SchedulerState_Balance) ProtoMessage

func (*SchedulerState_Balance) ProtoMessage()

func (*SchedulerState_Balance) ProtoReflect

func (x *SchedulerState_Balance) ProtoReflect() protoreflect.Message

func (*SchedulerState_Balance) Reset

func (x *SchedulerState_Balance) Reset()

func (*SchedulerState_Balance) String

func (x *SchedulerState_Balance) String() string

type TaskRequest

type TaskRequest struct {

	// AccountId is the id of the account that this request charges to.
	AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`
	// EnqueueTime is the time at which the request was enqueued.
	EnqueueTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=enqueue_time,json=enqueueTime,proto3" json:"enqueue_time,omitempty"`
	// ConfirmedTime is the most recent time at which the Request state was
	// provided or confirmed by external authority (via a call to Enforce or
	// AddRequest).
	ConfirmedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=confirmed_time,json=confirmedTime,proto3" json:"confirmed_time,omitempty"`
	// ProvisionableLabelIds represents the task's provisionable labels.
	ProvisionableLabelIds []uint64 `` /* 134-byte string literal not displayed */
	// BaseLabelIds represents the task's base labels.
	BaseLabelIds []uint64               `protobuf:"varint,7,rep,packed,name=base_label_ids,json=baseLabelIds,proto3" json:"base_label_ids,omitempty"`
	ExaminedTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=examined_time,json=examinedTime,proto3" json:"examined_time,omitempty"`
	// contains filtered or unexported fields
}

TaskRequestProto represents a requested task in the queue, and refers to the quota account to run it against. This representation intentionally excludes most of the details of a Swarming task request.

func (*TaskRequest) Descriptor deprecated

func (*TaskRequest) Descriptor() ([]byte, []int)

Deprecated: Use TaskRequest.ProtoReflect.Descriptor instead.

func (*TaskRequest) GetAccountId

func (x *TaskRequest) GetAccountId() string

func (*TaskRequest) GetBaseLabelIds

func (x *TaskRequest) GetBaseLabelIds() []uint64

func (*TaskRequest) GetConfirmedTime

func (x *TaskRequest) GetConfirmedTime() *timestamppb.Timestamp

func (*TaskRequest) GetEnqueueTime

func (x *TaskRequest) GetEnqueueTime() *timestamppb.Timestamp

func (*TaskRequest) GetExaminedTime

func (x *TaskRequest) GetExaminedTime() *timestamppb.Timestamp

func (*TaskRequest) GetProvisionableLabelIds

func (x *TaskRequest) GetProvisionableLabelIds() []uint64

func (*TaskRequest) ProtoMessage

func (*TaskRequest) ProtoMessage()

func (*TaskRequest) ProtoReflect

func (x *TaskRequest) ProtoReflect() protoreflect.Message

func (*TaskRequest) Reset

func (x *TaskRequest) Reset()

func (*TaskRequest) String

func (x *TaskRequest) String() string

type TaskRun

type TaskRun struct {

	// Cost is the total cost that has been incurred on this task while running.
	Cost []float32 `protobuf:"fixed32,1,rep,packed,name=cost,proto3" json:"cost,omitempty"`
	// Request is the request that this running task corresponds to.
	Request *TaskRequest `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"`
	// RequestId is the request id of the request that this running task
	// corresponds to.
	RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// Priority is the current priority level of the running task.
	Priority int32 `protobuf:"varint,4,opt,name=priority,proto3" json:"priority,omitempty"`
	// contains filtered or unexported fields
}

TaskRun represents a task that has been assigned to a worker and is now running.

func (*TaskRun) Descriptor deprecated

func (*TaskRun) Descriptor() ([]byte, []int)

Deprecated: Use TaskRun.ProtoReflect.Descriptor instead.

func (*TaskRun) GetCost

func (x *TaskRun) GetCost() []float32

func (*TaskRun) GetPriority

func (x *TaskRun) GetPriority() int32

func (*TaskRun) GetRequest

func (x *TaskRun) GetRequest() *TaskRequest

func (*TaskRun) GetRequestId

func (x *TaskRun) GetRequestId() string

func (*TaskRun) ProtoMessage

func (*TaskRun) ProtoMessage()

func (*TaskRun) ProtoReflect

func (x *TaskRun) ProtoReflect() protoreflect.Message

func (*TaskRun) Reset

func (x *TaskRun) Reset()

func (*TaskRun) String

func (x *TaskRun) String() string

type Worker

type Worker struct {

	// RunningTask is, if non-nil, the task that is currently running on the
	// worker.
	RunningTask *TaskRun `protobuf:"bytes,2,opt,name=running_task,json=runningTask,proto3" json:"running_task,omitempty"`
	// ConfirmedTime is the most recent time at which the Worker state was
	// directly confirmed as idle by external authority (via a call to MarkIdle or
	// NotifyRequest).
	ConfirmedTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=confirmed_time,json=confirmedTime,proto3" json:"confirmed_time,omitempty"`
	// LabelIds represents the worker's labels.
	LabelIds     []uint64               `protobuf:"varint,4,rep,packed,name=label_ids,json=labelIds,proto3" json:"label_ids,omitempty"`
	ModifiedTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=modified_time,json=modifiedTime,proto3" json:"modified_time,omitempty"`
	// contains filtered or unexported fields
}

Worker represents a resource that can run 1 task at a time. This corresponds to the swarming concept of a Bot. This representation considers only the subset of Labels that are Provisionable (can be changed by running a task), because the quota scheduler algorithm is expected to run against a pool of otherwise homogenous workers.

func (*Worker) Descriptor deprecated

func (*Worker) Descriptor() ([]byte, []int)

Deprecated: Use Worker.ProtoReflect.Descriptor instead.

func (*Worker) GetConfirmedTime

func (x *Worker) GetConfirmedTime() *timestamppb.Timestamp

func (*Worker) GetLabelIds

func (x *Worker) GetLabelIds() []uint64

func (*Worker) GetModifiedTime

func (x *Worker) GetModifiedTime() *timestamppb.Timestamp

func (*Worker) GetRunningTask

func (x *Worker) GetRunningTask() *TaskRun

func (*Worker) ProtoMessage

func (*Worker) ProtoMessage()

func (*Worker) ProtoReflect

func (x *Worker) ProtoReflect() protoreflect.Message

func (*Worker) Reset

func (x *Worker) Reset()

func (*Worker) String

func (x *Worker) String() string

type WorkerQueue

type WorkerQueue struct {

	// EnqueueTime is the time at which the pending assignment was created
	// by the scheduler.
	EnqueueTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=enqueue_time,json=enqueueTime,proto3" json:"enqueue_time,omitempty"`
	// TaskToAssign is the id of the task that should be assigned to this worker.
	TaskToAssign string `protobuf:"bytes,2,opt,name=task_to_assign,json=taskToAssign,proto3" json:"task_to_assign,omitempty"`
	// TaskToAbort is the id of the task that should be aborted on this worker.
	//
	// An empty string indicates that there is no task to abort.
	TaskToAbort string `protobuf:"bytes,3,opt,name=task_to_abort,json=taskToAbort,proto3" json:"task_to_abort,omitempty"`
	// contains filtered or unexported fields
}

WorkerQueue represents a task request that is pending assignment to a given worker and optionally the expected task on the worker to preempt.

Note: the name WorkerQueue is a legacy name, which is why it isn't a great match for what it represents.

func (*WorkerQueue) Descriptor deprecated

func (*WorkerQueue) Descriptor() ([]byte, []int)

Deprecated: Use WorkerQueue.ProtoReflect.Descriptor instead.

func (*WorkerQueue) GetEnqueueTime

func (x *WorkerQueue) GetEnqueueTime() *timestamppb.Timestamp

func (*WorkerQueue) GetTaskToAbort

func (x *WorkerQueue) GetTaskToAbort() string

func (*WorkerQueue) GetTaskToAssign

func (x *WorkerQueue) GetTaskToAssign() string

func (*WorkerQueue) ProtoMessage

func (*WorkerQueue) ProtoMessage()

func (*WorkerQueue) ProtoReflect

func (x *WorkerQueue) ProtoReflect() protoreflect.Message

func (*WorkerQueue) Reset

func (x *WorkerQueue) Reset()

func (*WorkerQueue) String

func (x *WorkerQueue) String() string

Directories

Path Synopsis
Package metrics defines types used for structured logs and metrics of the quotascheduler behavior.
Package metrics defines types used for structured logs and metrics of the quotascheduler behavior.

Jump to

Keyboard shortcuts

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