invocation

package
v0.0.0-...-43ed5bc Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackgroundLearningKeys = []Key{
	util.Must(NewKey(util.Must(anypb.New(&buildqueuestate_pb.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 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) (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 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.

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