nanny

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_internal_nanny_nanny_proto protoreflect.FileDescriptor

Functions

func Advance

func Advance(s *Schedule) error

Advance advances the schedule to the next traffic fraction. A schedule can only be advanced if it's ready. See the Ready method.

func ChangeTimes

func ChangeTimes(t *TargetFn, start time.Time) []time.Time

ChangeTimes returns the set of times at which the target function changes, assuming the target function is started at the provided time.

func Done

func Done(s *Schedule) bool

Done returns whether the schedule has been fully applied.

func Fraction

func Fraction(s *Schedule) float32

Fraction returns the current traffic fraction.

func IncrementAppliedDuration

func IncrementAppliedDuration(s *Schedule, d time.Duration)

IncrementAppliedDuration increases the duration the current traffic fraction has been applied.

func Length

func Length(t *TargetFn) time.Duration

Length returns the total length of the TargetFn.

func Ready

func Ready(s *Schedule) bool

Ready returns whether the schedule is ready to be advanced. A schedule is ready to be advanced if the current traffic fraction has been applied for its specified duration.

Example usage:

if Ready(schedule) {
    if err := Advance(schedule); err != nil {
        ...
    }
}

func Remaining

func Remaining(s *Schedule) time.Duration

Remaining returns the remaining duration the current traffic fraction should be applied for.

func TargetFraction

func TargetFraction(t *TargetFn, d time.Duration) float32

TargetFraction returns the target fraction at the given duration after a target function has started to be applied, assuming no delays.

Types

type ApplicationCleanupRequest

type ApplicationCleanupRequest struct {
	AppName  string   `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	Versions []string `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"`
	// contains filtered or unexported fields
}

ApplicationCleanupRequest is a request to the distributor to clean up a set of versions for a given application.

func (*ApplicationCleanupRequest) Descriptor deprecated

func (*ApplicationCleanupRequest) Descriptor() ([]byte, []int)

Deprecated: Use ApplicationCleanupRequest.ProtoReflect.Descriptor instead.

func (*ApplicationCleanupRequest) GetAppName

func (x *ApplicationCleanupRequest) GetAppName() string

func (*ApplicationCleanupRequest) GetVersions

func (x *ApplicationCleanupRequest) GetVersions() []string

func (*ApplicationCleanupRequest) ProtoMessage

func (*ApplicationCleanupRequest) ProtoMessage()

func (*ApplicationCleanupRequest) ProtoReflect

func (*ApplicationCleanupRequest) Reset

func (x *ApplicationCleanupRequest) Reset()

func (*ApplicationCleanupRequest) String

func (x *ApplicationCleanupRequest) String() string

type ApplicationDeleteRequest

type ApplicationDeleteRequest struct {
	AppName  string   `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	Versions []string `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"`
	// contains filtered or unexported fields
}

ApplicationDeleteRequest is a request to the manager to delete a set of versions for a given application.

func (*ApplicationDeleteRequest) Descriptor deprecated

func (*ApplicationDeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use ApplicationDeleteRequest.ProtoReflect.Descriptor instead.

func (*ApplicationDeleteRequest) GetAppName

func (x *ApplicationDeleteRequest) GetAppName() string

func (*ApplicationDeleteRequest) GetVersions

func (x *ApplicationDeleteRequest) GetVersions() []string

func (*ApplicationDeleteRequest) ProtoMessage

func (*ApplicationDeleteRequest) ProtoMessage()

func (*ApplicationDeleteRequest) ProtoReflect

func (x *ApplicationDeleteRequest) ProtoReflect() protoreflect.Message

func (*ApplicationDeleteRequest) Reset

func (x *ApplicationDeleteRequest) Reset()

func (*ApplicationDeleteRequest) String

func (x *ApplicationDeleteRequest) String() string

type ApplicationDeploymentRequest

type ApplicationDeploymentRequest struct {
	AppName  string              `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	Versions []*config.GKEConfig `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"`
	// contains filtered or unexported fields
}

ApplicationDeploymentRequest is a request to the manager to deploy a set of versions for a given application.

func (*ApplicationDeploymentRequest) Descriptor deprecated

func (*ApplicationDeploymentRequest) Descriptor() ([]byte, []int)

Deprecated: Use ApplicationDeploymentRequest.ProtoReflect.Descriptor instead.

func (*ApplicationDeploymentRequest) GetAppName

func (x *ApplicationDeploymentRequest) GetAppName() string

func (*ApplicationDeploymentRequest) GetVersions

func (x *ApplicationDeploymentRequest) GetVersions() []*config.GKEConfig

func (*ApplicationDeploymentRequest) ProtoMessage

func (*ApplicationDeploymentRequest) ProtoMessage()

func (*ApplicationDeploymentRequest) ProtoReflect

func (*ApplicationDeploymentRequest) Reset

func (x *ApplicationDeploymentRequest) Reset()

func (*ApplicationDeploymentRequest) String

type ApplicationDistributionRequest

type ApplicationDistributionRequest struct {
	AppName  string                        `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	Requests []*VersionDistributionRequest `protobuf:"bytes,2,rep,name=requests,proto3" json:"requests,omitempty"`
	// contains filtered or unexported fields
}

ApplicationDistributionRequest is a request to the distributor to start a set of versions for a given application in their deployment locations (e.g., a cloud region), and gradually shift traffic to them.

func (*ApplicationDistributionRequest) Descriptor deprecated

func (*ApplicationDistributionRequest) Descriptor() ([]byte, []int)

Deprecated: Use ApplicationDistributionRequest.ProtoReflect.Descriptor instead.

func (*ApplicationDistributionRequest) GetAppName

func (x *ApplicationDistributionRequest) GetAppName() string

func (*ApplicationDistributionRequest) GetRequests

func (*ApplicationDistributionRequest) ProtoMessage

func (*ApplicationDistributionRequest) ProtoMessage()

func (*ApplicationDistributionRequest) ProtoReflect

func (*ApplicationDistributionRequest) Reset

func (x *ApplicationDistributionRequest) Reset()

func (*ApplicationDistributionRequest) String

type ApplicationStateAtDistributor

type ApplicationStateAtDistributor struct {
	VersionState    []*VersionStateAtDistributor `protobuf:"bytes,1,rep,name=version_state,json=versionState,proto3" json:"version_state,omitempty"`
	DeletedVersions []string                     `protobuf:"bytes,2,rep,name=deleted_versions,json=deletedVersions,proto3" json:"deleted_versions,omitempty"`
	// contains filtered or unexported fields
}

ApplicationStateAtDistributor contains the latest state for a given application at a particular distributor.

func (*ApplicationStateAtDistributor) Descriptor deprecated

func (*ApplicationStateAtDistributor) Descriptor() ([]byte, []int)

Deprecated: Use ApplicationStateAtDistributor.ProtoReflect.Descriptor instead.

func (*ApplicationStateAtDistributor) GetDeletedVersions

func (x *ApplicationStateAtDistributor) GetDeletedVersions() []string

func (*ApplicationStateAtDistributor) GetVersionState

func (*ApplicationStateAtDistributor) ProtoMessage

func (*ApplicationStateAtDistributor) ProtoMessage()

func (*ApplicationStateAtDistributor) ProtoReflect

func (*ApplicationStateAtDistributor) Reset

func (x *ApplicationStateAtDistributor) Reset()

func (*ApplicationStateAtDistributor) String

type ApplicationStateAtDistributorRequest

type ApplicationStateAtDistributorRequest struct {
	AppName string `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	// contains filtered or unexported fields
}

ApplicationStateAtDistributorRequest is a request to the distributor to get the latest state for a given application.

func (*ApplicationStateAtDistributorRequest) Descriptor deprecated

func (*ApplicationStateAtDistributorRequest) Descriptor() ([]byte, []int)

Deprecated: Use ApplicationStateAtDistributorRequest.ProtoReflect.Descriptor instead.

func (*ApplicationStateAtDistributorRequest) GetAppName

func (*ApplicationStateAtDistributorRequest) ProtoMessage

func (*ApplicationStateAtDistributorRequest) ProtoMessage()

func (*ApplicationStateAtDistributorRequest) ProtoReflect

func (*ApplicationStateAtDistributorRequest) Reset

func (*ApplicationStateAtDistributorRequest) String

type ApplicationStopRequest

type ApplicationStopRequest struct {
	AppName  string   `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	Versions []string `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"`
	// contains filtered or unexported fields
}

ApplicationStopRequest is a request to the manager to stop a set of versions for a given application.

func (*ApplicationStopRequest) Descriptor deprecated

func (*ApplicationStopRequest) Descriptor() ([]byte, []int)

Deprecated: Use ApplicationStopRequest.ProtoReflect.Descriptor instead.

func (*ApplicationStopRequest) GetAppName

func (x *ApplicationStopRequest) GetAppName() string

func (*ApplicationStopRequest) GetVersions

func (x *ApplicationStopRequest) GetVersions() []string

func (*ApplicationStopRequest) ProtoMessage

func (*ApplicationStopRequest) ProtoMessage()

func (*ApplicationStopRequest) ProtoReflect

func (x *ApplicationStopRequest) ProtoReflect() protoreflect.Message

func (*ApplicationStopRequest) Reset

func (x *ApplicationStopRequest) Reset()

func (*ApplicationStopRequest) String

func (x *ApplicationStopRequest) String() string

type CascadeTarget

type CascadeTarget struct {
	Location        string                        // e.g. "local", "us-central1"
	AppName         string                        // e.g. "collatz", "todo"
	VersionId       string                        // e.g. "6ba7b810-9dad-11d1"
	Listeners       map[string][]*protos.Listener // listeners, keyed by host
	TrafficFraction float32                       // the desired traffic fraction
}

CascadeTarget encapsulates the traffic specific information about a version of a Service Weaver app. Typically, you create one CascadeTarget for every version of your app and then call CascadeTraffic to assign traffic between them.

type ColocationGroupStartRequest

type ColocationGroupStartRequest struct {
	AppName string                  `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	Group   *protos.ColocationGroup `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"`
	Config  *config.GKEConfig       `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

ColocationGroupStartEequest is a request to the manager to start a colocation group for a given application version.

func (*ColocationGroupStartRequest) Descriptor deprecated

func (*ColocationGroupStartRequest) Descriptor() ([]byte, []int)

Deprecated: Use ColocationGroupStartRequest.ProtoReflect.Descriptor instead.

func (*ColocationGroupStartRequest) GetAppName

func (x *ColocationGroupStartRequest) GetAppName() string

func (*ColocationGroupStartRequest) GetConfig

func (*ColocationGroupStartRequest) GetGroup

func (*ColocationGroupStartRequest) ProtoMessage

func (*ColocationGroupStartRequest) ProtoMessage()

func (*ColocationGroupStartRequest) ProtoReflect

func (*ColocationGroupStartRequest) Reset

func (x *ColocationGroupStartRequest) Reset()

func (*ColocationGroupStartRequest) String

func (x *ColocationGroupStartRequest) String() string

type ExportListenerRequest

type ExportListenerRequest struct {
	AppName  string                   `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	Listener *protos.ListenerToExport `protobuf:"bytes,2,opt,name=listener,proto3" json:"listener,omitempty"`
	Config   *config.GKEConfig        `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

ExportListenerRequest is a request to the manager to export a listener.

func (*ExportListenerRequest) Descriptor deprecated

func (*ExportListenerRequest) Descriptor() ([]byte, []int)

Deprecated: Use ExportListenerRequest.ProtoReflect.Descriptor instead.

func (*ExportListenerRequest) GetAppName

func (x *ExportListenerRequest) GetAppName() string

func (*ExportListenerRequest) GetConfig

func (x *ExportListenerRequest) GetConfig() *config.GKEConfig

func (*ExportListenerRequest) GetListener

func (x *ExportListenerRequest) GetListener() *protos.ListenerToExport

func (*ExportListenerRequest) ProtoMessage

func (*ExportListenerRequest) ProtoMessage()

func (*ExportListenerRequest) ProtoReflect

func (x *ExportListenerRequest) ProtoReflect() protoreflect.Message

func (*ExportListenerRequest) Reset

func (x *ExportListenerRequest) Reset()

func (*ExportListenerRequest) String

func (x *ExportListenerRequest) String() string

type FractionSpec

type FractionSpec struct {

	// Minimum duration the traffic fraction should be applied.
	Duration *durationpb.Duration `protobuf:"bytes,1,opt,name=duration,proto3" json:"duration,omitempty"`
	// Traffic fraction in the range [0, 1] to be sent to the application version.
	TrafficFraction float32 `protobuf:"fixed32,2,opt,name=traffic_fraction,json=trafficFraction,proto3" json:"traffic_fraction,omitempty"`
	// contains filtered or unexported fields
}

FractionSpec represents one stage in the TargetFn that should be applied to a given application version.

It stores the traffic fraction that should be assigned to the application version, as well as the duration of that traffic assignment. Once the traffic fraction has been applied for longer than the specified duration, the target function moves to the next rollout stage (see comments above TargetFn).

func (*FractionSpec) Descriptor deprecated

func (*FractionSpec) Descriptor() ([]byte, []int)

Deprecated: Use FractionSpec.ProtoReflect.Descriptor instead.

func (*FractionSpec) GetDuration

func (x *FractionSpec) GetDuration() *durationpb.Duration

func (*FractionSpec) GetTrafficFraction

func (x *FractionSpec) GetTrafficFraction() float32

func (*FractionSpec) ProtoMessage

func (*FractionSpec) ProtoMessage()

func (*FractionSpec) ProtoReflect

func (x *FractionSpec) ProtoReflect() protoreflect.Message

func (*FractionSpec) Reset

func (x *FractionSpec) Reset()

func (*FractionSpec) String

func (x *FractionSpec) String() string

type HostTrafficAssignment

type HostTrafficAssignment struct {
	Allocs []*TrafficAllocation `protobuf:"bytes,1,rep,name=allocs,proto3" json:"allocs,omitempty"`
	// contains filtered or unexported fields
}

HostTrafficAssignment contains the traffic assignment for a given hostname.

func (*HostTrafficAssignment) Descriptor deprecated

func (*HostTrafficAssignment) Descriptor() ([]byte, []int)

Deprecated: Use HostTrafficAssignment.ProtoReflect.Descriptor instead.

func (*HostTrafficAssignment) GetAllocs

func (x *HostTrafficAssignment) GetAllocs() []*TrafficAllocation

func (*HostTrafficAssignment) ProtoMessage

func (*HostTrafficAssignment) ProtoMessage()

func (*HostTrafficAssignment) ProtoReflect

func (x *HostTrafficAssignment) ProtoReflect() protoreflect.Message

func (*HostTrafficAssignment) Reset

func (x *HostTrafficAssignment) Reset()

func (*HostTrafficAssignment) String

func (x *HostTrafficAssignment) String() string

type ProcessState

type ProcessState struct {
	Processes []*ProcessState_Process `protobuf:"bytes,3,rep,name=processes,proto3" json:"processes,omitempty"`
	// Errors encountered collecting the process state.
	// Note that the process data may be partially populated even if there were
	// collection errors.
	Errors []string `protobuf:"bytes,4,rep,name=errors,proto3" json:"errors,omitempty"`
	// contains filtered or unexported fields
}

ProcessState stores the process state for an application version or a collection of applications and their versions.

func (*ProcessState) Descriptor deprecated

func (*ProcessState) Descriptor() ([]byte, []int)

Deprecated: Use ProcessState.ProtoReflect.Descriptor instead.

func (*ProcessState) GetErrors

func (x *ProcessState) GetErrors() []string

func (*ProcessState) GetProcesses

func (x *ProcessState) GetProcesses() []*ProcessState_Process

func (*ProcessState) ProtoMessage

func (*ProcessState) ProtoMessage()

func (*ProcessState) ProtoReflect

func (x *ProcessState) ProtoReflect() protoreflect.Message

func (*ProcessState) Reset

func (x *ProcessState) Reset()

func (*ProcessState) String

func (x *ProcessState) String() string

type ProcessStateRequest

type ProcessStateRequest struct {

	// Application name and version.
	//
	// If the application name is non-empty, the request is for retrieving
	// process state only for the given application; otherwise, the request is
	// for retrieving process state for all active applications.
	// If the application version is non-empty, the request is for retrieving
	// process state only for a particular version of an application; otherwise,
	// the request is for retrieving process state for all versions of an
	// application (or a collection of applications).
	// It is illegal to specify the version and not the application name.
	AppName   string `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	VersionId string `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"`
	// contains filtered or unexported fields
}

ProcessStateRequest is a request to receive the state of processes for the given application version or a collection of applications and their versions.

func (*ProcessStateRequest) Descriptor deprecated

func (*ProcessStateRequest) Descriptor() ([]byte, []int)

Deprecated: Use ProcessStateRequest.ProtoReflect.Descriptor instead.

func (*ProcessStateRequest) GetAppName

func (x *ProcessStateRequest) GetAppName() string

func (*ProcessStateRequest) GetVersionId

func (x *ProcessStateRequest) GetVersionId() string

func (*ProcessStateRequest) ProtoMessage

func (*ProcessStateRequest) ProtoMessage()

func (*ProcessStateRequest) ProtoReflect

func (x *ProcessStateRequest) ProtoReflect() protoreflect.Message

func (*ProcessStateRequest) Reset

func (x *ProcessStateRequest) Reset()

func (*ProcessStateRequest) String

func (x *ProcessStateRequest) String() string

type ProcessState_Process

type ProcessState_Process struct {
	Name       string                          `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Replicas   []*ProcessState_Process_Replica `protobuf:"bytes,2,rep,name=replicas,proto3" json:"replicas,omitempty"`     // All known process replicas.
	Components []string                        `protobuf:"bytes,3,rep,name=components,proto3" json:"components,omitempty"` // Active components hosted by the process.
	Listeners  []*protos.Listener              `protobuf:"bytes,4,rep,name=listeners,proto3" json:"listeners,omitempty"`   // Listeners hosted by the process.
	// contains filtered or unexported fields
}

Process stores information about an application version process.

func (*ProcessState_Process) Descriptor deprecated

func (*ProcessState_Process) Descriptor() ([]byte, []int)

Deprecated: Use ProcessState_Process.ProtoReflect.Descriptor instead.

func (*ProcessState_Process) GetComponents

func (x *ProcessState_Process) GetComponents() []string

func (*ProcessState_Process) GetListeners

func (x *ProcessState_Process) GetListeners() []*protos.Listener

func (*ProcessState_Process) GetName

func (x *ProcessState_Process) GetName() string

func (*ProcessState_Process) GetReplicas

func (*ProcessState_Process) ProtoMessage

func (*ProcessState_Process) ProtoMessage()

func (*ProcessState_Process) ProtoReflect

func (x *ProcessState_Process) ProtoReflect() protoreflect.Message

func (*ProcessState_Process) Reset

func (x *ProcessState_Process) Reset()

func (*ProcessState_Process) String

func (x *ProcessState_Process) String() string

type ProcessState_Process_Replica

type ProcessState_Process_Replica struct {
	WeaveletAddr   string              `protobuf:"bytes,1,opt,name=weavelet_addr,json=weaveletAddr,proto3" json:"weavelet_addr,omitempty"`                            // Weavelet address.
	BabysitterAddr string              `protobuf:"bytes,2,opt,name=babysitter_addr,json=babysitterAddr,proto3" json:"babysitter_addr,omitempty"`                      // Babysitter address.
	HealthStatus   protos.HealthStatus `protobuf:"varint,3,opt,name=health_status,json=healthStatus,proto3,enum=runtime.HealthStatus" json:"health_status,omitempty"` // Health status.
	// contains filtered or unexported fields
}

Replica stores information about a process replica.

func (*ProcessState_Process_Replica) Descriptor deprecated

func (*ProcessState_Process_Replica) Descriptor() ([]byte, []int)

Deprecated: Use ProcessState_Process_Replica.ProtoReflect.Descriptor instead.

func (*ProcessState_Process_Replica) GetBabysitterAddr

func (x *ProcessState_Process_Replica) GetBabysitterAddr() string

func (*ProcessState_Process_Replica) GetHealthStatus

func (x *ProcessState_Process_Replica) GetHealthStatus() protos.HealthStatus

func (*ProcessState_Process_Replica) GetWeaveletAddr

func (x *ProcessState_Process_Replica) GetWeaveletAddr() string

func (*ProcessState_Process_Replica) ProtoMessage

func (*ProcessState_Process_Replica) ProtoMessage()

func (*ProcessState_Process_Replica) ProtoReflect

func (*ProcessState_Process_Replica) Reset

func (x *ProcessState_Process_Replica) Reset()

func (*ProcessState_Process_Replica) String

type ReplicaToRegister

type ReplicaToRegister struct {
	PodName           string                    `protobuf:"bytes,1,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"`                               // Replica pod name (e.g., main-012345-6789)
	BabysitterAddress string                    `protobuf:"bytes,2,opt,name=babysitter_address,json=babysitterAddress,proto3" json:"babysitter_address,omitempty"` // e.g., host:1234
	Replica           *protos.ReplicaToRegister `protobuf:"bytes,3,opt,name=replica,proto3" json:"replica,omitempty"`
	// contains filtered or unexported fields
}

ReplicaToRegister is a request to the manager to register the given Service Weaver replica, running in the given babysitter.

func (*ReplicaToRegister) Descriptor deprecated

func (*ReplicaToRegister) Descriptor() ([]byte, []int)

Deprecated: Use ReplicaToRegister.ProtoReflect.Descriptor instead.

func (*ReplicaToRegister) GetBabysitterAddress

func (x *ReplicaToRegister) GetBabysitterAddress() string

func (*ReplicaToRegister) GetPodName

func (x *ReplicaToRegister) GetPodName() string

func (*ReplicaToRegister) GetReplica

func (x *ReplicaToRegister) GetReplica() *protos.ReplicaToRegister

func (*ReplicaToRegister) ProtoMessage

func (*ReplicaToRegister) ProtoMessage()

func (*ReplicaToRegister) ProtoReflect

func (x *ReplicaToRegister) ProtoReflect() protoreflect.Message

func (*ReplicaToRegister) Reset

func (x *ReplicaToRegister) Reset()

func (*ReplicaToRegister) String

func (x *ReplicaToRegister) String() string

type Schedule

type Schedule struct {

	// The target function being applied.
	//
	// TODO(mwhittaker): Right now, the code is inconsistent about whether a
	// target function ends with a fraction of 1.0. Try to clean that up.
	TargetFn *TargetFn `protobuf:"bytes,1,opt,name=target_fn,json=targetFn,proto3" json:"target_fn,omitempty"`
	// The index of the current traffic fraction in target_fn. After the final
	// traffic fraction has been applied for its specified duration, index is
	// incremented to be equal to the length of the number of traffic fractions.
	// This signals that the target function has been fully applied.
	Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
	// Total duration the current traffic fraction has been applied.
	AppliedDuration *durationpb.Duration `protobuf:"bytes,3,opt,name=applied_duration,json=appliedDuration,proto3" json:"applied_duration,omitempty"`
	// contains filtered or unexported fields
}

Schedule represents a target function being applied.

A target function is a sequence of traffic fractions and the duration for which they should be applied. A schedule represents the actual application of the traffic fractions, as we progress from one traffic fraction to the next.

func NewSchedule

func NewSchedule(target *TargetFn) *Schedule

NewSchedule returns a new Schedule.

func (*Schedule) Descriptor deprecated

func (*Schedule) Descriptor() ([]byte, []int)

Deprecated: Use Schedule.ProtoReflect.Descriptor instead.

func (*Schedule) GetAppliedDuration

func (x *Schedule) GetAppliedDuration() *durationpb.Duration

func (*Schedule) GetIndex

func (x *Schedule) GetIndex() int64

func (*Schedule) GetTargetFn

func (x *Schedule) GetTargetFn() *TargetFn

func (*Schedule) ProtoMessage

func (*Schedule) ProtoMessage()

func (*Schedule) ProtoReflect

func (x *Schedule) ProtoReflect() protoreflect.Message

func (*Schedule) Reset

func (x *Schedule) Reset()

func (*Schedule) String

func (x *Schedule) String() string

type TargetFn

type TargetFn struct {
	Fractions []*FractionSpec `protobuf:"bytes,1,rep,name=fractions,proto3" json:"fractions,omitempty"`
	// contains filtered or unexported fields
}

TargetFn is a target function that controls the traffic rollout for a given application version inside a deployment location (e.g., a cloud region).

Each entry F_i in TargetFn stores a traffic fraction that should be assigned to the application version, as well as the duration of that traffic assignment.

Traffic assignment starts with entry F_0. Once the traffic fraction in F_i has been applied for longer than the duration specified in F_i, the traffic fraction in the entry F_(i+1) is applied. This process continues until all entries in the array have been exhausted, at which point the traffic fraction of 1.0 is applied and the application version is considered "installed".

Note that the traffic fraction is considered "applied" the moment it is successfully assigned to the application version. Failed fraction assignments don't count toward the fraction duration; instead, the earlier fraction remains applied. This means that some traffic fractions may be applied for significantly longer than the specified duration (e.g., cluster becomes unreachable); the only guarantee we provide is that a given fraction will never be applied for less than a specified duration.

func (*TargetFn) Descriptor deprecated

func (*TargetFn) Descriptor() ([]byte, []int)

Deprecated: Use TargetFn.ProtoReflect.Descriptor instead.

func (*TargetFn) GetFractions

func (x *TargetFn) GetFractions() []*FractionSpec

func (*TargetFn) ProtoMessage

func (*TargetFn) ProtoMessage()

func (*TargetFn) ProtoReflect

func (x *TargetFn) ProtoReflect() protoreflect.Message

func (*TargetFn) Reset

func (x *TargetFn) Reset()

func (*TargetFn) String

func (x *TargetFn) String() string

type TrafficAllocation

type TrafficAllocation struct {
	Location        string           `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"`                                        // location (e.g., a cloud region)
	AppName         string           `protobuf:"bytes,2,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`                           // name of the application
	VersionId       string           `protobuf:"bytes,3,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"`                     // application version id
	TrafficFraction float32          `protobuf:"fixed32,4,opt,name=traffic_fraction,json=trafficFraction,proto3" json:"traffic_fraction,omitempty"` // traffic fraction allocated for version id
	Listener        *protos.Listener `protobuf:"bytes,5,opt,name=listener,proto3" json:"listener,omitempty"`                                        // network listener
	// contains filtered or unexported fields
}

TrafficAllocation contains a traffic allocation. It is the finest granularity in terms of traffic assignment.

func (*TrafficAllocation) Descriptor deprecated

func (*TrafficAllocation) Descriptor() ([]byte, []int)

Deprecated: Use TrafficAllocation.ProtoReflect.Descriptor instead.

func (*TrafficAllocation) GetAppName

func (x *TrafficAllocation) GetAppName() string

func (*TrafficAllocation) GetListener

func (x *TrafficAllocation) GetListener() *protos.Listener

func (*TrafficAllocation) GetLocation

func (x *TrafficAllocation) GetLocation() string

func (*TrafficAllocation) GetTrafficFraction

func (x *TrafficAllocation) GetTrafficFraction() float32

func (*TrafficAllocation) GetVersionId

func (x *TrafficAllocation) GetVersionId() string

func (*TrafficAllocation) ProtoMessage

func (*TrafficAllocation) ProtoMessage()

func (*TrafficAllocation) ProtoReflect

func (x *TrafficAllocation) ProtoReflect() protoreflect.Message

func (*TrafficAllocation) Reset

func (x *TrafficAllocation) Reset()

func (*TrafficAllocation) String

func (x *TrafficAllocation) String() string

type TrafficAssignment

type TrafficAssignment struct {
	HostAssignment map[string]*HostTrafficAssignment `` /* 191-byte string literal not displayed */
	// contains filtered or unexported fields
}

TrafficAssignment contains a traffic assignment keyed by hostname.

func CascadeTraffic

func CascadeTraffic(targets []*CascadeTarget) (*TrafficAssignment, error)

CascadeTraffic assigns traffic to a set of targets. For every host, a traffic fraction of 1.0 is cascaded across the versions that export the host.

For example, imagine we version v1, v2, and v3 that export hosts [a, c], [a, b, c], and [b, c] respectively. v1, v2, and v3 have desired traffic fractions of 0.5, 0.4, and 0.4. We cascade traffic between the listeners as follows:

v1 (0.5) | v2 (0.4) | v3 (0.4)
---------+----------+---------
 a (0.6) |  a (0.4) |
         |  b (0.6) |  b (0.4)
 c (0.2) |  c (0.4) |  c (0.4)

func MergeTrafficAssignments

func MergeTrafficAssignments(components []*TrafficAssignment) *TrafficAssignment

MergeTrafficAssignments merges the traffic assignments for each hostname across multiple components.

A component can be an application or a location (e.g., a cloud region).

At a high-level, for a given hostname H it does the following:

  • all of H's traffic allocations in each component are appended together to form the set of allocations for H in the merged set.

  • if H appears in N components, the traffic allocations for H in each component are normalized by a factor of 1/N.

The above algorithm has the property that if the traffic allocations for H were adding up to 1.0 in the individual components, they will add up to 1.0 in the merged set as well.

func (*TrafficAssignment) Descriptor deprecated

func (*TrafficAssignment) Descriptor() ([]byte, []int)

Deprecated: Use TrafficAssignment.ProtoReflect.Descriptor instead.

func (*TrafficAssignment) GetHostAssignment

func (x *TrafficAssignment) GetHostAssignment() map[string]*HostTrafficAssignment

func (*TrafficAssignment) ProtoMessage

func (*TrafficAssignment) ProtoMessage()

func (*TrafficAssignment) ProtoReflect

func (x *TrafficAssignment) ProtoReflect() protoreflect.Message

func (*TrafficAssignment) Reset

func (x *TrafficAssignment) Reset()

func (*TrafficAssignment) String

func (x *TrafficAssignment) String() string

type VersionDistributionRequest

type VersionDistributionRequest struct {

	// Deployment information for the new application version.
	Config *config.GKEConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// Rollout information for the new application version.
	TargetFn *TargetFn `protobuf:"bytes,2,opt,name=target_fn,json=targetFn,proto3" json:"target_fn,omitempty"`
	// Unique identifier that captures the order in which the application version
	// was submitted for rollout at the controller.
	SubmissionId int64 `protobuf:"varint,3,opt,name=submission_id,json=submissionId,proto3" json:"submission_id,omitempty"`
	// contains filtered or unexported fields
}

VersionDistributionRequest is a request to the distributor to start a new application version in its deployment location.

func (*VersionDistributionRequest) Descriptor deprecated

func (*VersionDistributionRequest) Descriptor() ([]byte, []int)

Deprecated: Use VersionDistributionRequest.ProtoReflect.Descriptor instead.

func (*VersionDistributionRequest) GetConfig

func (*VersionDistributionRequest) GetSubmissionId

func (x *VersionDistributionRequest) GetSubmissionId() int64

func (*VersionDistributionRequest) GetTargetFn

func (x *VersionDistributionRequest) GetTargetFn() *TargetFn

func (*VersionDistributionRequest) ProtoMessage

func (*VersionDistributionRequest) ProtoMessage()

func (*VersionDistributionRequest) ProtoReflect

func (*VersionDistributionRequest) Reset

func (x *VersionDistributionRequest) Reset()

func (*VersionDistributionRequest) String

func (x *VersionDistributionRequest) String() string

type VersionStateAtDistributor

type VersionStateAtDistributor struct {
	VersionId string `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"`
	// Last traffic fraction that was applied.
	LastTrafficFractionApplied float32 `` /* 145-byte string literal not displayed */
	// Whether the rollout has successfully completed. Note that a rollout is not
	// necessarily completed when the last traffic fraction was applied (e.g.,
	// the local gateway might have transient failures and the distributor has to
	// reapply).
	RolloutCompleted bool `protobuf:"varint,3,opt,name=rollout_completed,json=rolloutCompleted,proto3" json:"rollout_completed,omitempty"`
	// Whether the main process is deployed.
	IsDeployed bool `protobuf:"varint,4,opt,name=is_deployed,json=isDeployed,proto3" json:"is_deployed,omitempty"`
	// All known processes for this application version.
	Processes *ProcessState `protobuf:"bytes,5,opt,name=processes,proto3" json:"processes,omitempty"`
	// contains filtered or unexported fields
}

VersionStateAtDistributor stores the state of an application version at a particular distributor.

func (*VersionStateAtDistributor) Descriptor deprecated

func (*VersionStateAtDistributor) Descriptor() ([]byte, []int)

Deprecated: Use VersionStateAtDistributor.ProtoReflect.Descriptor instead.

func (*VersionStateAtDistributor) GetIsDeployed

func (x *VersionStateAtDistributor) GetIsDeployed() bool

func (*VersionStateAtDistributor) GetLastTrafficFractionApplied

func (x *VersionStateAtDistributor) GetLastTrafficFractionApplied() float32

func (*VersionStateAtDistributor) GetProcesses

func (x *VersionStateAtDistributor) GetProcesses() *ProcessState

func (*VersionStateAtDistributor) GetRolloutCompleted

func (x *VersionStateAtDistributor) GetRolloutCompleted() bool

func (*VersionStateAtDistributor) GetVersionId

func (x *VersionStateAtDistributor) GetVersionId() string

func (*VersionStateAtDistributor) ProtoMessage

func (*VersionStateAtDistributor) ProtoMessage()

func (*VersionStateAtDistributor) ProtoReflect

func (*VersionStateAtDistributor) Reset

func (x *VersionStateAtDistributor) Reset()

func (*VersionStateAtDistributor) String

func (x *VersionStateAtDistributor) String() string

Directories

Path Synopsis
Package controller handles the deployment of new application versions.
Package controller handles the deployment of new application versions.
Package distributor handles the distribution of new application versions in a particular deployment location (e.g., a cloud region).
Package distributor handles the distribution of new application versions in a particular deployment location (e.g., a cloud region).
Package managertest provides a weavertest like testing framework for testing the gke and gke-local manager.
Package managertest provides a weavertest like testing framework for testing the gke and gke-local manager.

Jump to

Keyboard shortcuts

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