Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BackgroundLearningKeys = []Key{ MustNewKey(mustNewAny(&buildqueuestate.BackgroundLearning{})), }
BackgroundLearningKeys is a predefined list of Keys that is used for all operations that are created to perform background learning (see initialsizeclass.FeedbackAnalyzer).
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key string
Key for identifying client invocations. InMemoryBuildQueue uses this type to group operations within a given size class queue. This grouping is used to introduce fairness between builds.
For most setups, it is sufficient to set the Key to the tool invocation ID that's part of the RequestMetadata header. For more advanced setups, it may be recommended to include information such as the username.
func MustNewKey ¶
MustNewKey is identical to NewKey, except that it panics in case of failures.
type KeyExtractor ¶
type KeyExtractor interface {
ExtractKey(ctx context.Context, requestMetadata *remoteexecution.RequestMetadata) (Key, error)
}
KeyExtractor is responsible for extracting an invocation key from an incoming execution request. Operations will be grouped by invocation key and scheduled fairly.
Implementations of KeyExtract may construct keys based on REv2 request metadata or user credentials.
var AuthenticationMetadataKeyExtractor KeyExtractor = authenticationMetadataKeyExtractor{}
AuthenticationMetadataKeyExtractor is an implementation of KeyExtractor that returns a Key that is based on the publicly displayable part of the authentication metadata. This will cause InMemoryBuildQueue to group all operations created by the same user together, which ensures fair scheduling between users.
CorrelatedInvocationsIDKeyExtractor is an implementation of KeyExtractor that returns a Key that is based on the correlated_invocations_id field of the RequestMetadata provided by a client. This will cause InMemoryBuildQueue to group all operations created by all invocation of Bazel that use the same --build_request_id together, which ensures scheduling fairness.
var ToolInvocationIDKeyExtractor KeyExtractor = toolInvocationIDKeyExtractor{}
ToolInvocationIDKeyExtractor is an implementation of KeyExtractor that returns a Key that is based on the tool_invocation_id field of the RequestMetadata provided by a client. This will cause InMemoryBuildQueue to group all operations created by a single invocation of Bazel together, which ensures scheduling fairness.
func NewKeyExtractorFromConfiguration ¶
func NewKeyExtractorFromConfiguration(configuration *pb.InvocationKeyExtractorConfiguration) (KeyExtractor, error)
NewKeyExtractorFromConfiguration creates a KeyExtractor based on settings provided in a configuration file.