routing

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionRouter

type ActionRouter interface {
	RouteAction(ctx context.Context, digestFunction digest.Function, action *remoteexecution.Action, requestMetadata *remoteexecution.RequestMetadata) (platform.Key, []invocation.Key, initialsizeclass.Selector, error)
}

ActionRouter is responsible for doing all forms of analysis on an incoming execution request up to the point where InMemoryBuildQueue acquires locks and enqueues an operation. ActionRouter is responsible for the following things:

  • To extract a platform key from the action, so that InMemoryBuildQueue knows on which workers the action needs to execute.
  • To extract invocation keys from the client's context, so that InMemoryBuildQueue can group operations belonging to the same client and schedule them fairly with respect to other clients.
  • To create an initial size class selector, which InMemoryBuildQueue can use to select the appropriate worker size.

func NewActionRouterFromConfiguration

func NewActionRouterFromConfiguration(configuration *pb.ActionRouterConfiguration, contentAddressableStorage blobstore.BlobAccess, maximumMessageSizeBytes int, previousExecutionStatsStore initialsizeclass.PreviousExecutionStatsStore) (ActionRouter, error)

NewActionRouterFromConfiguration creates an ActionRouter based on options specified in a configuration file.

func NewSimpleActionRouter

func NewSimpleActionRouter(platformKeyExtractor platform.KeyExtractor, invocationKeyExtractors []invocation.KeyExtractor, initialSizeClassAnalyzer initialsizeclass.Analyzer) ActionRouter

NewSimpleActionRouter creates an ActionRouter that creates a platform key, invocation key and initial size class selector by independently calling into separate extractors/analyzers.

This implementation should be sufficient for most simple setups, where only a small number of execution platforms exist, or where scheduling decisions are identical for all platforms.

type DemultiplexingActionRouter

type DemultiplexingActionRouter struct {
	// contains filtered or unexported fields
}

DemultiplexingActionRouter is an implementation of ActionRouter that demultiplexes routing requests by REv2 instance name and platform properties, using a platform.Trie. This makes it possible to use different invocation key extractors or initial size class analyzers depending on the platform. When combined with platform.StaticKeyExtractor, it can be used to rewrite platform properties.

func NewDemultiplexingActionRouter

func NewDemultiplexingActionRouter(platformKeyExtractor platform.KeyExtractor, defaultActionRouter ActionRouter) *DemultiplexingActionRouter

NewDemultiplexingActionRouter creates a new DemultiplexingActionRouter that forwards all incoming requests to a single ActionRouter.

func (*DemultiplexingActionRouter) RegisterActionRouter

func (ar *DemultiplexingActionRouter) RegisterActionRouter(instanceNamePrefix digest.InstanceName, platformMessage *remoteexecution.Platform, actionRouter ActionRouter) error

RegisterActionRouter registers a new ActionRouter by REv2 instance name prefix and platform properties, so that subsequent calls to RouteAction() may forward requests to it.

func (*DemultiplexingActionRouter) RouteAction

RouteAction forwards requests to one of the ActionRouters that was provided to NewDemultiplexingActionRouter() or RegisterActionRouter().

Jump to

Keyboard shortcuts

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