workloads

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIPodCompute

func APIPodCompute(containers []kcore.Container) (*userconfig.Quantity, *userconfig.Quantity, int64)

func APIPodComputeID added in v0.6.0

func APIPodComputeID(containers []kcore.Container) string

func APIsBaseURL

func APIsBaseURL() (string, error)

func BaseWorkloadPtrsEqual added in v0.7.0

func BaseWorkloadPtrsEqual(bw1 *BaseWorkload, bw2 *BaseWorkload) bool

func CheckAPIEndpointCollisions added in v0.10.0

func CheckAPIEndpointCollisions(ctx *context.Context) error

func CurrentContext

func CurrentContext(appName string) *context.Context

func CurrentContexts

func CurrentContexts() []*context.Context

func DeleteApp

func DeleteApp(appName string, keepCache bool) bool

func ErrorAPIInitializing added in v0.8.0

func ErrorAPIInitializing() error

func ErrorCortexInstallationBroken added in v0.4.0

func ErrorCortexInstallationBroken() error

func ErrorDuplicateEndpointOtherDeployment added in v0.10.0

func ErrorDuplicateEndpointOtherDeployment(appName string, apiName string) error

func ErrorLoadBalancerInitializing added in v0.4.0

func ErrorLoadBalancerInitializing() error

func ErrorMoreThanOneWorkflow added in v0.4.0

func ErrorMoreThanOneWorkflow() error

func ErrorNoAvailableNodeComputeLimit added in v0.8.0

func ErrorNoAvailableNodeComputeLimit(resource string, reqStr string, maxStr string) error

func ErrorNotFound added in v0.4.0

func ErrorNotFound() error

func GetCurrentAPIAndGroupStatuses added in v0.7.0

func GetCurrentAPIAndGroupStatuses(
	dataStatuses map[string]*resource.DataStatus,
	ctx *context.Context,
) (map[string]*resource.APIStatus, map[string]*resource.APIGroupStatus, error)

func GetCurrentDataStatuses

func GetCurrentDataStatuses(ctx *context.Context) (map[string]*resource.DataStatus, error)

func GetDeploymentStatus added in v0.7.0

func GetDeploymentStatus(appName string) (resource.DeploymentStatus, error)

func GetLatestWorkloadID

func GetLatestWorkloadID(resourceID string, appName string) (string, error)

func GetMetrics added in v0.8.0

func GetMetrics(appName, apiName string) (schema.APIMetrics, error)

func Init added in v0.4.0

func Init() error

func IsWorkloadEnded added in v0.7.0

func IsWorkloadEnded(appName string, workloadID string) (bool, error)

func PopulateWorkloadIDs added in v0.7.0

func PopulateWorkloadIDs(ctx *context.Context) error

func ReadLogs

func ReadLogs(appName string, podLabels map[string]string, socket *websocket.Conn)

func Run

func Run(ctx *context.Context) error

func StreamFromCloudWatch added in v0.8.0

func StreamFromCloudWatch(podCheckCancel chan struct{}, appName string, podLabels map[string]string, socket *websocket.Conn)

func UpdateWorkflows added in v0.7.0

func UpdateWorkflows() error

func ValidateDeploy added in v0.7.0

func ValidateDeploy(ctx *context.Context) error

Types

type APIWorkload added in v0.7.0

type APIWorkload struct {
	BaseWorkload
}

func (*APIWorkload) CanRun added in v0.7.0

func (aw *APIWorkload) CanRun(ctx *context.Context) (bool, error)

func (*APIWorkload) IsFailed added in v0.7.0

func (aw *APIWorkload) IsFailed(ctx *context.Context) (bool, error)

func (*APIWorkload) IsRunning added in v0.7.0

func (aw *APIWorkload) IsRunning(ctx *context.Context) (bool, error)

func (*APIWorkload) IsStarted added in v0.7.0

func (aw *APIWorkload) IsStarted(ctx *context.Context) (bool, error)

func (*APIWorkload) IsSucceeded added in v0.7.0

func (aw *APIWorkload) IsSucceeded(ctx *context.Context) (bool, error)

func (*APIWorkload) Start added in v0.7.0

func (aw *APIWorkload) Start(ctx *context.Context) error

type BaseWorkload added in v0.7.0

type BaseWorkload struct {
	AppName      string
	WorkloadID   string
	WorkloadType string
	Resources    map[string]context.ResourceFields
}

func (*BaseWorkload) AddResource added in v0.7.0

func (bw *BaseWorkload) AddResource(res context.ComputedResource)

func (*BaseWorkload) Copy added in v0.7.0

func (bw *BaseWorkload) Copy() *BaseWorkload

func (*BaseWorkload) CreatesResource added in v0.7.0

func (bw *BaseWorkload) CreatesResource(resourceID string) bool

func (*BaseWorkload) Equal added in v0.7.0

func (bw *BaseWorkload) Equal(bw2 BaseWorkload) bool

func (*BaseWorkload) GetAppName added in v0.7.0

func (bw *BaseWorkload) GetAppName() string

func (*BaseWorkload) GetBaseWorkloadPtr added in v0.7.0

func (bw *BaseWorkload) GetBaseWorkloadPtr() *BaseWorkload

func (*BaseWorkload) GetResourceIDs added in v0.7.0

func (bw *BaseWorkload) GetResourceIDs() strset.Set

func (*BaseWorkload) GetResources added in v0.7.0

func (bw *BaseWorkload) GetResources() map[string]context.ResourceFields

func (*BaseWorkload) GetSingleResourceID added in v0.7.0

func (bw *BaseWorkload) GetSingleResourceID() string

func (*BaseWorkload) GetWorkloadID added in v0.7.0

func (bw *BaseWorkload) GetWorkloadID() string

func (*BaseWorkload) GetWorkloadType added in v0.7.0

func (bw *BaseWorkload) GetWorkloadType() string

type BaseWorkloadInterface added in v0.7.0

type BaseWorkloadInterface interface {
	GetAppName() string
	GetWorkloadID() string
	GetWorkloadType() string
	GetResources() map[string]context.ResourceFields
	CreatesResource(resourceID string) bool
	AddResource(res context.ComputedResource)
	GetResourceIDs() strset.Set
	GetSingleResourceID() string
	GetBaseWorkloadPtr() *BaseWorkload
}

type Error added in v0.4.0

type Error struct {
	Kind ErrorKind
	// contains filtered or unexported fields
}

func (Error) Error added in v0.4.0

func (e Error) Error() string

type ErrorKind added in v0.4.0

type ErrorKind int
const (
	ErrUnknown ErrorKind = iota
	ErrMoreThanOneWorkflow
	ErrCortexInstallationBroken
	ErrLoadBalancerInitializing
	ErrNotFound
	ErrAPIInitializing
	ErrNoAvailableNodeComputeLimit
	ErrDuplicateEndpointOtherDeployment
)

func (ErrorKind) MarshalBinary added in v0.4.0

func (t ErrorKind) MarshalBinary() ([]byte, error)

MarshalBinary satisfies BinaryMarshaler

func (ErrorKind) MarshalText added in v0.4.0

func (t ErrorKind) MarshalText() ([]byte, error)

MarshalText satisfies TextMarshaler

func (ErrorKind) String added in v0.4.0

func (t ErrorKind) String() string

func (*ErrorKind) UnmarshalBinary added in v0.4.0

func (t *ErrorKind) UnmarshalBinary(data []byte) error

UnmarshalBinary satisfies BinaryUnmarshaler Needed for msgpack

func (*ErrorKind) UnmarshalText added in v0.4.0

func (t *ErrorKind) UnmarshalText(text []byte) error

UnmarshalText satisfies TextUnmarshaler

type FluentdLog added in v0.8.0

type FluentdLog struct {
	Log string `json:"log"`
}

type HPAWorkload added in v0.7.0

type HPAWorkload struct {
	BaseWorkload
	APIID string
}

func (*HPAWorkload) CanRun added in v0.7.0

func (hw *HPAWorkload) CanRun(ctx *context.Context) (bool, error)

func (*HPAWorkload) IsFailed added in v0.7.0

func (hw *HPAWorkload) IsFailed(ctx *context.Context) (bool, error)

func (*HPAWorkload) IsRunning added in v0.7.0

func (hw *HPAWorkload) IsRunning(ctx *context.Context) (bool, error)

func (*HPAWorkload) IsStarted added in v0.7.0

func (hw *HPAWorkload) IsStarted(ctx *context.Context) (bool, error)

func (*HPAWorkload) IsSucceeded added in v0.7.0

func (hw *HPAWorkload) IsSucceeded(ctx *context.Context) (bool, error)

func (*HPAWorkload) Start added in v0.7.0

func (hw *HPAWorkload) Start(ctx *context.Context) error

type Workload added in v0.7.0

type Workload interface {
	BaseWorkloadInterface
	CanRun(*context.Context) (bool, error)      // All of the dependencies are satisfied and the workload can be started
	Start(*context.Context) error               // Start the workload
	IsStarted(*context.Context) (bool, error)   // The workload was started on the most recent deploy (might be running, succeeded, or failed). It's ok if this doesn't remain accurate across cx deploys
	IsRunning(*context.Context) (bool, error)   // The workload is currently running
	IsSucceeded(*context.Context) (bool, error) // The workload succeeded
	IsFailed(*context.Context) (bool, error)    // The workload failed
}

Jump to

Keyboard shortcuts

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