Documentation ¶
Index ¶
- Variables
- type Config
- type Dependency
- func (*Dependency) Descriptor() ([]byte, []int)deprecated
- func (m *Dependency) GetAttemptStrategy() isDependency_AttemptStrategy
- func (x *Dependency) GetAttempts() *SparseRange
- func (x *Dependency) GetMixSeed() bool
- func (x *Dependency) GetPhrase() *Phrase
- func (x *Dependency) GetRetries() uint32
- func (x *Dependency) GetShards() uint64
- func (d *Dependency) Normalize() error
- func (*Dependency) ProtoMessage()
- func (x *Dependency) ProtoReflect() protoreflect.Message
- func (x *Dependency) Reset()
- func (d *Dependency) Seed(rnd *rand.Rand, seed, round int64)
- func (x *Dependency) String() string
- type Dependency_Attempts
- type Dependency_Retries
- type DepsStage
- func (*DepsStage) Descriptor() ([]byte, []int)deprecated
- func (s *DepsStage) ExpandShards()
- func (x *DepsStage) GetDeps() []*Dependency
- func (d *DepsStage) Normalize() error
- func (*DepsStage) ProtoMessage()
- func (x *DepsStage) ProtoReflect() protoreflect.Message
- func (x *DepsStage) Reset()
- func (x *DepsStage) String() string
- type FailureStage
- func (*FailureStage) Descriptor() ([]byte, []int)deprecated
- func (x *FailureStage) GetChance() float32
- func (f *FailureStage) Normalize() error
- func (*FailureStage) ProtoMessage()
- func (x *FailureStage) ProtoReflect() protoreflect.Message
- func (x *FailureStage) Reset()
- func (x *FailureStage) String() string
- type Phrase
- func (*Phrase) Descriptor() ([]byte, []int)deprecated
- func (p *Phrase) FromProperty(prop datastore.Property) error
- func (x *Phrase) GetName() string
- func (x *Phrase) GetReturnStage() *ReturnStage
- func (x *Phrase) GetSeed() int64
- func (x *Phrase) GetStages() []*Stage
- func (p *Phrase) Normalize() error
- func (*Phrase) ProtoMessage()
- func (x *Phrase) ProtoReflect() protoreflect.Message
- func (x *Phrase) Reset()
- func (x *Phrase) String() string
- func (p *Phrase) ToProperty() (prop datastore.Property, err error)
- type Range
- type RangeItem
- func (*RangeItem) Descriptor() ([]byte, []int)deprecated
- func (x *RangeItem) GetRange() *Range
- func (m *RangeItem) GetRangeItem() isRangeItem_RangeItem
- func (x *RangeItem) GetSingle() uint32
- func (*RangeItem) ProtoMessage()
- func (x *RangeItem) ProtoReflect() protoreflect.Message
- func (x *RangeItem) Reset()
- func (x *RangeItem) String() string
- type RangeItem_Range
- type RangeItem_Single
- type Result
- type ReturnStage
- func (*ReturnStage) Descriptor() ([]byte, []int)deprecated
- func (x *ReturnStage) GetExpiration() *timestamppb.Timestamp
- func (x *ReturnStage) GetRetval() int64
- func (*ReturnStage) ProtoMessage()
- func (x *ReturnStage) ProtoReflect() protoreflect.Message
- func (x *ReturnStage) Reset()
- func (x *ReturnStage) String() string
- type SparseRange
- func (*SparseRange) Descriptor() ([]byte, []int)deprecated
- func (x *SparseRange) GetItems() []*RangeItem
- func (s *SparseRange) Normalize() error
- func (*SparseRange) ProtoMessage()
- func (x *SparseRange) ProtoReflect() protoreflect.Message
- func (x *SparseRange) Reset()
- func (x *SparseRange) String() string
- func (s *SparseRange) ToSlice() (ret []uint32)
- type Stage
- func (*Stage) Descriptor() ([]byte, []int)deprecated
- func (x *Stage) GetDeps() *DepsStage
- func (x *Stage) GetFailure() *FailureStage
- func (m *Stage) GetStageType() isStage_StageType
- func (x *Stage) GetStall() *StallStage
- func (s *Stage) Normalize() error
- func (*Stage) ProtoMessage()
- func (x *Stage) ProtoReflect() protoreflect.Message
- func (x *Stage) Reset()
- func (x *Stage) String() string
- type Stage_Deps
- type Stage_Failure
- type Stage_Stall
- type StallStage
- func (*StallStage) Descriptor() ([]byte, []int)deprecated
- func (x *StallStage) GetDelay() *durationpb.Duration
- func (s *StallStage) Normalize() error
- func (*StallStage) ProtoMessage()
- func (x *StallStage) ProtoReflect() protoreflect.Message
- func (x *StallStage) Reset()
- func (x *StallStage) String() string
Constants ¶
This section is empty.
Variables ¶
var File_go_chromium_org_luci_dm_api_distributor_jobsim_jobsim_proto protoreflect.FileDescriptor
var File_go_chromium_org_luci_dm_api_distributor_jobsim_result_proto protoreflect.FileDescriptor
var File_go_chromium_org_luci_dm_api_distributor_jobsim_task_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Pool specifies the unique 'pool' name for this jobsim configuration. This // will be used to namespace jobsim objects in the datastore, and can be used // to demonstrate cross-distributor dependencies (by having one pool's jobs // depend on another pool's results). Pool string `protobuf:"bytes,1,opt,name=pool,proto3" json:"pool,omitempty"` // DoPollback controls whether or not this configuration will force DM to // poll back when recieving a HandleNotification. If this is true, then // HandleNotification will return (nil, nil), and DM will call GetStatus // at some later point. If this is false, then HandleNotification will // directly return the job's status. DoPollback bool `protobuf:"varint,2,opt,name=do_pollback,json=doPollback,proto3" json:"do_pollback,omitempty"` // contains filtered or unexported fields }
Config is ONLY for testing purposes in dm/service. However, because of the way that the distributor proto works it needs to be included in the main distributor.proto file. For consistency, this jobsim proto lives here.
func (*Config) Descriptor
deprecated
func (*Config) GetDoPollback ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type Dependency ¶
type Dependency struct { // shards append [1], [2], [3], etc. to the "name"s of the dependencies, making // them unique quests. Shards uint64 `protobuf:"varint,1,opt,name=shards,proto3" json:"shards,omitempty"` // Types that are assignable to AttemptStrategy: // *Dependency_Attempts // *Dependency_Retries AttemptStrategy isDependency_AttemptStrategy `protobuf_oneof:"attempt_strategy"` // MixSeed will blend the current seed with the seed in the phrase seed, // when depending on it. // // mix_seed phrase.seed==0 -> dep uses "random" seed // mix_seed phrase.seed!=0 -> dep uses blend(current seed, phrase.seed) // !mix_seed phrase.seed==0 -> dep uses current seed // !mix_seed phrase.seed!=0 -> dep uses phrase.seed MixSeed bool `protobuf:"varint,4,opt,name=mix_seed,json=mixSeed,proto3" json:"mix_seed,omitempty"` Phrase *Phrase `protobuf:"bytes,5,opt,name=phrase,proto3" json:"phrase,omitempty"` // contains filtered or unexported fields }
Dependency represents a nested Phrase that this Phrase depends on.
func (*Dependency) Descriptor
deprecated
func (*Dependency) Descriptor() ([]byte, []int)
Deprecated: Use Dependency.ProtoReflect.Descriptor instead.
func (*Dependency) GetAttemptStrategy ¶
func (m *Dependency) GetAttemptStrategy() isDependency_AttemptStrategy
func (*Dependency) GetAttempts ¶
func (x *Dependency) GetAttempts() *SparseRange
func (*Dependency) GetMixSeed ¶
func (x *Dependency) GetMixSeed() bool
func (*Dependency) GetPhrase ¶
func (x *Dependency) GetPhrase() *Phrase
func (*Dependency) GetRetries ¶
func (x *Dependency) GetRetries() uint32
func (*Dependency) GetShards ¶
func (x *Dependency) GetShards() uint64
func (*Dependency) Normalize ¶
func (d *Dependency) Normalize() error
Normalize checks Dependency for errors and converts it to its normalized form.
func (*Dependency) ProtoMessage ¶
func (*Dependency) ProtoMessage()
func (*Dependency) ProtoReflect ¶
func (x *Dependency) ProtoReflect() protoreflect.Message
func (*Dependency) Reset ¶
func (x *Dependency) Reset()
func (*Dependency) Seed ¶
func (d *Dependency) Seed(rnd *rand.Rand, seed, round int64)
Seed rewrites this dependency's Seed value
func (*Dependency) String ¶
func (x *Dependency) String() string
type Dependency_Attempts ¶
type Dependency_Attempts struct {
Attempts *SparseRange `protobuf:"bytes,2,opt,name=attempts,proto3,oneof"`
}
type Dependency_Retries ¶
type Dependency_Retries struct {
Retries uint32 `protobuf:"varint,3,opt,name=retries,proto3,oneof"`
}
type DepsStage ¶
type DepsStage struct { Deps []*Dependency `protobuf:"bytes,1,rep,name=deps,proto3" json:"deps,omitempty"` // contains filtered or unexported fields }
DepsStage represents the opportunity to depend on 1 or more dependencies simultaneously.
func (*DepsStage) Descriptor
deprecated
func (*DepsStage) ExpandShards ¶
func (s *DepsStage) ExpandShards()
ExpandShards expands any dependencies that have non-zero Shards values.
func (*DepsStage) GetDeps ¶
func (x *DepsStage) GetDeps() []*Dependency
func (*DepsStage) Normalize ¶
Normalize checks DepsStage for errors and converts it to its normalized form.
func (*DepsStage) ProtoMessage ¶
func (*DepsStage) ProtoMessage()
func (*DepsStage) ProtoReflect ¶
func (x *DepsStage) ProtoReflect() protoreflect.Message
type FailureStage ¶
type FailureStage struct { Chance float32 `protobuf:"fixed32,1,opt,name=chance,proto3" json:"chance,omitempty"` // contains filtered or unexported fields }
FailureStage is the /chance/ to fail with a certain liklihood. The chance is calculated using the current Phrase's 'seed' with the "math/rand" package, The seed is either 0 (unspecified), or the value of the 'seed' property for the currently running phrase.
0 is a 0-percent chance of failure. 1 is a 100-percent chance of failure.
func (*FailureStage) Descriptor
deprecated
func (*FailureStage) Descriptor() ([]byte, []int)
Deprecated: Use FailureStage.ProtoReflect.Descriptor instead.
func (*FailureStage) GetChance ¶
func (x *FailureStage) GetChance() float32
func (*FailureStage) Normalize ¶
func (f *FailureStage) Normalize() error
Normalize checks FailureStage for errors and converts it to its normalized form.
func (*FailureStage) ProtoMessage ¶
func (*FailureStage) ProtoMessage()
func (*FailureStage) ProtoReflect ¶
func (x *FailureStage) ProtoReflect() protoreflect.Message
func (*FailureStage) Reset ¶
func (x *FailureStage) Reset()
func (*FailureStage) String ¶
func (x *FailureStage) String() string
type Phrase ¶
type Phrase struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Seed should be selected via a fair dice roll (using a d1.84e19). Seed int64 `protobuf:"varint,2,opt,name=seed,proto3" json:"seed,omitempty"` Stages []*Stage `protobuf:"bytes,3,rep,name=stages,proto3" json:"stages,omitempty"` ReturnStage *ReturnStage `protobuf:"bytes,4,opt,name=return_stage,json=returnStage,proto3" json:"return_stage,omitempty"` // contains filtered or unexported fields }
Phrase is a task to do. It consists of zero or more stages, followed by an optional ReturnStage.
func (*Phrase) Descriptor
deprecated
func (*Phrase) FromProperty ¶
FromProperty implements datastore.PropertyConverter. It parses a '[]byte' into an embedded 'Phrase' when used with the "go.chromium.org/luci/gae" library.
func (*Phrase) GetReturnStage ¶
func (x *Phrase) GetReturnStage() *ReturnStage
func (*Phrase) Normalize ¶
Normalize checks Phrase for errors and converts it to its normalized form.
func (*Phrase) ProtoMessage ¶
func (*Phrase) ProtoMessage()
func (*Phrase) ProtoReflect ¶
func (x *Phrase) ProtoReflect() protoreflect.Message
type Range ¶
type Range struct { Low uint32 `protobuf:"varint,1,opt,name=low,proto3" json:"low,omitempty"` High uint32 `protobuf:"varint,2,opt,name=high,proto3" json:"high,omitempty"` // contains filtered or unexported fields }
Range represents a single low-high pair (e.g. [3-40])
func (*Range) Descriptor
deprecated
func (*Range) ProtoMessage ¶
func (*Range) ProtoMessage()
func (*Range) ProtoReflect ¶
func (x *Range) ProtoReflect() protoreflect.Message
type RangeItem ¶
type RangeItem struct { // Types that are assignable to RangeItem: // *RangeItem_Single // *RangeItem_Range RangeItem isRangeItem_RangeItem `protobuf_oneof:"range_item"` // contains filtered or unexported fields }
RangeItem is either a single number or a Range.
func (*RangeItem) Descriptor
deprecated
func (*RangeItem) GetRangeItem ¶
func (m *RangeItem) GetRangeItem() isRangeItem_RangeItem
func (*RangeItem) ProtoMessage ¶
func (*RangeItem) ProtoMessage()
func (*RangeItem) ProtoReflect ¶
func (x *RangeItem) ProtoReflect() protoreflect.Message
type RangeItem_Range ¶
type RangeItem_Range struct {
Range *Range `protobuf:"bytes,2,opt,name=range,proto3,oneof"`
}
type RangeItem_Single ¶
type RangeItem_Single struct {
Single uint32 `protobuf:"varint,1,opt,name=single,proto3,oneof"`
}
type Result ¶
type Result struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Result is the jobsim distributor result object used for executions.
func (*Result) Descriptor
deprecated
func (*Result) GetSuccess ¶
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) ProtoReflect ¶
func (x *Result) ProtoReflect() protoreflect.Message
type ReturnStage ¶
type ReturnStage struct { Retval int64 `protobuf:"varint,1,opt,name=retval,proto3" json:"retval,omitempty"` Expiration *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expiration,proto3" json:"expiration,omitempty"` // contains filtered or unexported fields }
ReturnStage indicates that the Phrase should return the numerical value 'retval' as the result of the current Phrase. If expiration is provided, it will set that as the expiration timestamp for the provided retval.
func (*ReturnStage) Descriptor
deprecated
func (*ReturnStage) Descriptor() ([]byte, []int)
Deprecated: Use ReturnStage.ProtoReflect.Descriptor instead.
func (*ReturnStage) GetExpiration ¶
func (x *ReturnStage) GetExpiration() *timestamppb.Timestamp
func (*ReturnStage) GetRetval ¶
func (x *ReturnStage) GetRetval() int64
func (*ReturnStage) ProtoMessage ¶
func (*ReturnStage) ProtoMessage()
func (*ReturnStage) ProtoReflect ¶
func (x *ReturnStage) ProtoReflect() protoreflect.Message
func (*ReturnStage) Reset ¶
func (x *ReturnStage) Reset()
func (*ReturnStage) String ¶
func (x *ReturnStage) String() string
type SparseRange ¶
type SparseRange struct { Items []*RangeItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
SparseRange allows the expression of mixed partial ranges like [1,3-10,19,21].
func (*SparseRange) Descriptor
deprecated
func (*SparseRange) Descriptor() ([]byte, []int)
Deprecated: Use SparseRange.ProtoReflect.Descriptor instead.
func (*SparseRange) GetItems ¶
func (x *SparseRange) GetItems() []*RangeItem
func (*SparseRange) Normalize ¶
func (s *SparseRange) Normalize() error
Normalize checks SparseRange for errors and converts it to its normalized form.
func (*SparseRange) ProtoMessage ¶
func (*SparseRange) ProtoMessage()
func (*SparseRange) ProtoReflect ¶
func (x *SparseRange) ProtoReflect() protoreflect.Message
func (*SparseRange) Reset ¶
func (x *SparseRange) Reset()
func (*SparseRange) String ¶
func (x *SparseRange) String() string
func (*SparseRange) ToSlice ¶
func (s *SparseRange) ToSlice() (ret []uint32)
ToSlice returns this SparseRange as an expanded slice of uint32s.
type Stage ¶
type Stage struct { // Types that are assignable to StageType: // *Stage_Failure // *Stage_Stall // *Stage_Deps StageType isStage_StageType `protobuf_oneof:"stage_type"` // contains filtered or unexported fields }
Stage is the union of the following stage types:
- FailureStage
- StallStage
- DepsStage
func (*Stage) Descriptor
deprecated
func (*Stage) GetFailure ¶
func (x *Stage) GetFailure() *FailureStage
func (*Stage) GetStageType ¶
func (m *Stage) GetStageType() isStage_StageType
func (*Stage) GetStall ¶
func (x *Stage) GetStall() *StallStage
func (*Stage) ProtoMessage ¶
func (*Stage) ProtoMessage()
func (*Stage) ProtoReflect ¶
func (x *Stage) ProtoReflect() protoreflect.Message
type Stage_Deps ¶
type Stage_Deps struct {
Deps *DepsStage `protobuf:"bytes,3,opt,name=deps,proto3,oneof"`
}
type Stage_Failure ¶
type Stage_Failure struct {
Failure *FailureStage `protobuf:"bytes,1,opt,name=failure,proto3,oneof"`
}
type Stage_Stall ¶
type Stage_Stall struct {
Stall *StallStage `protobuf:"bytes,2,opt,name=stall,proto3,oneof"`
}
type StallStage ¶
type StallStage struct { Delay *durationpb.Duration `protobuf:"bytes,1,opt,name=delay,proto3" json:"delay,omitempty"` // contains filtered or unexported fields }
StallStage delays the phrase for the provided Duration. This could be used to simulate long-running tasks (like builds).
func (*StallStage) Descriptor
deprecated
func (*StallStage) Descriptor() ([]byte, []int)
Deprecated: Use StallStage.ProtoReflect.Descriptor instead.
func (*StallStage) GetDelay ¶
func (x *StallStage) GetDelay() *durationpb.Duration
func (*StallStage) Normalize ¶
func (s *StallStage) Normalize() error
Normalize checks StallStage for errors and converts it to its normalized form.
func (*StallStage) ProtoMessage ¶
func (*StallStage) ProtoMessage()
func (*StallStage) ProtoReflect ¶
func (x *StallStage) ProtoReflect() protoreflect.Message
func (*StallStage) Reset ¶
func (x *StallStage) Reset()
func (*StallStage) String ¶
func (x *StallStage) String() string