capabilities

package
v0.0.0-...-a9d0937 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(provider Provider) remoteexecution.CapabilitiesServer

NewServer creates a gRPC server object for the REv2 Capabilities service.

Types

type Provider

type Provider interface {
	GetCapabilities(ctx context.Context, instanceName digest.InstanceName) (*remoteexecution.ServerCapabilities, error)
}

Provider of capabilities.

This interface is implemented for objects like BlobAccess and BuildQueue to report parts of REv2 ServerCapabilities messages. Each type is responsible for only reporting the fields that apply that subsystem. For example, BlobAccess will report CacheCapabilities, while BuildQueue will report ExecutionCapabilities. The messages returned by each subsystem can be merged into a complete message that can be returned to clients.

All implementations of Provider must make sure that if GetCapabilities() succeeds, either CacheCapabilities or ExecutionCapabilities is set. The REv2 spec doesn't describe the case where both are unset.

func NewActionCacheUpdateEnabledClearingProvider

func NewActionCacheUpdateEnabledClearingProvider(base Provider, authorizer auth.Authorizer) Provider

NewActionCacheUpdateEnabledClearingProvider creates a decorator for a capabilities provider that clears the ActionCacheUpdateCapabilities.update_enabled field based on an authorization decision. This can be used to report to clients that an Action Cache is only available for reading; not for writing.

func NewAuthorizingProvider

func NewAuthorizingProvider(base Provider, authorizer auth.Authorizer) Provider

NewAuthorizingProvider creates a decorator for Provider that only performs GetCapabilities() calls in case a client is authorized.

func NewMergingProvider

func NewMergingProvider(providers []Provider) Provider

NewMergingProvider creates a capabilities provider that merges the capabilities reported by multiple backends. It can, for example, be used by frontend processes to merge the capabilities reported by separate storage cluster and scheduler.

This implementation assumes that backends report non-overlapping capabilities.

func NewStaticProvider

func NewStaticProvider(capabilities *remoteexecution.ServerCapabilities) Provider

NewStaticProvider creates a capabilities provider that returns a fixed response. This can be used by individual subsystems to declare base providers that report capabilities of features they implement.

Jump to

Keyboard shortcuts

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