lambda

package
v0.0.0-...-12a582f Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultOperation is the default mode with which to perform a clone
	DefaultOperation = "clone"

	// DefaultCanaryWeight shall be an equal, uniform split
	DefaultCanaryWeight = 0.5

	DefaultSize = 512
)

Variables

View Source
var (
	// ErrOperationNotDefined is returned if we attempt to clone a function and the
	// given operation in the config is neither clone or alias
	ErrOperationNotDefined = errors.New("operation not defined, expecting clone or alias")
)

Functions

func NewProvider

func NewProvider(req *pb.CreateRequest) providers.Provider

NewProvider initializes a Provider with defaults

Types

type Config

type Config struct {
	// Operation allows you to chose between
	// clone or alias, default is to alias
	Operation string

	// Canary defaults to false
	Canary bool

	Name string

	// CanaryWeight, which should be set from the
	CanaryWeight float64

	// MemorySize is the lambda compute resources size
	MemorySize int64

	Timeout int64

	// Handler allows a different handler to be used
	Handler string

	// Version of the deployed function
	Version string

	// Function runtime
	Runtime string
}

Config holds allowed values for an implemented resource provider. Any value outside of this config is unable to be modified during an experiment

type Provider

type Provider struct {
	Target target.Target

	// Config holds our internal configuration options
	// for the instance of the Provider
	Config Config

	// RemoteConfig identifies the
	RemoteConfig *lambda.GetFunctionOutput

	// CurrentAliasArn is the ARN of an alias if we are operating a clone
	CurrentAliasArn string
}

Provider implements a lambda Provider

func (*Provider) Annotate

func (p *Provider) Annotate(id string, l labels.Labels) error

Annotate should implement applying labels or tags for a given resource type

func (*Provider) Apply

func (p *Provider) Apply() error

Apply runs the Provider end to end, so calls read and clone

func (*Provider) AwaitReadiness

func (p *Provider) AwaitReadiness() chan error

AwaitReadiness should be implemented to detect when a Provider has finished setting up a variant and can begin using it in an experiment

func (*Provider) Cancel

func (p *Provider) Cancel() error

Cancel will abort and running or submitted Provider

func (*Provider) Clone

func (p *Provider) Clone() error

Clone creates a modified variant

func (*Provider) ProbeReadiness

func (p *Provider) ProbeReadiness() (bool, error)

ProbeReadiness checks that the provisioned resource is available and ready to be included in a live experiment

func (*Provider) Read

func (p *Provider) Read() error

Read fetches and stores the configuration for an existing lambda cluster. What is read of the existing resource acts as the template/configuration to implement a clone via creating a new resource with the existing output as input for a variant

func (*Provider) Select

func (p *Provider) Select() (target.Selection, error)

Select is similar to Read yet copies a selection of resources based on the Target configuration

func (*Provider) Stop

func (p *Provider) Stop() error

Stop will stop any running Provider

func (*Provider) Teardown

func (p *Provider) Teardown() error

Teardown eradicates any resource that has been provisioned as part of a variant

type RoutingConfigurationWeights

type RoutingConfigurationWeights map[string]*float64

RoutingConfigurationWeights is for configuration of routing weights if Canary is true

Jump to

Keyboard shortcuts

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