invocation

package
v0.0.0-...-ea22f37 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func MustNewKey(id *anypb.Any) Key

MustNewKey is identical to NewKey, except that it panics in case of failures.

func NewKey

func NewKey(id *anypb.Any) (Key, error)

NewKey creates a new key based on a freeform Protobuf message.

func (Key) GetID

func (k Key) GetID() *anypb.Any

GetID reobtains the Protobuf message that was used to construct the key.

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.

var CorrelatedInvocationsIDKeyExtractor KeyExtractor = correlatedInvocationsIDKeyExtractor{}

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.

Jump to

Keyboard shortcuts

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