workloads

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	WorkloadTypeAPI = "api"
)

Variables

This section is empty.

Functions

func APIDeploymentCompute

func APIDeploymentCompute(deployment *appsv1b1.Deployment) userconfig.APICompute

func APIPodCompute

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

func APIsBaseURL

func APIsBaseURL() (string, error)

func Create

func Create(ctx *context.Context) (*awfv1.Workflow, 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 ErrorContextAppMismatch added in v0.4.0

func ErrorContextAppMismatch() error

func ErrorCortexInstallationBroken added in v0.4.0

func ErrorCortexInstallationBroken() error

func ErrorLoadBalancerInitializing added in v0.4.0

func ErrorLoadBalancerInitializing() error

func ErrorMoreThanOneWorkflow added in v0.4.0

func ErrorMoreThanOneWorkflow() error

func ErrorNotFound added in v0.4.0

func ErrorNotFound() error

func ErrorWorkflowAppMismatch added in v0.4.0

func ErrorWorkflowAppMismatch() error

func GetAPIGroupStatuses

func GetAPIGroupStatuses(apiStatuses map[string]*resource.APIStatus, ctx *context.Context) (map[string]*resource.APIGroupStatus, error)

func GetCurrentAPIStatuses

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

func GetCurrentDataStatuses

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

func GetLatestWorkloadID

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

func GetWorkflow

func GetWorkflow(appName string) (*awfv1.Workflow, error)

func Init added in v0.4.0

func Init() error

func ReadLogs

func ReadLogs(appName string, workloadID string, verbose bool, socket *websocket.Conn)

func Run

func Run(wf *awfv1.Workflow, ctx *context.Context, existingWf *awfv1.Workflow) error

func Stop

func Stop(wf *awfv1.Workflow, ctx *context.Context) error

func UpdateAPISavedStatuses

func UpdateAPISavedStatuses(allPods []corev1.Pod) error

func UpdateDataWorkflowErrors

func UpdateDataWorkflowErrors(failedPods []corev1.Pod) error

func UploadLogPrefixesFromAPIPods

func UploadLogPrefixesFromAPIPods(pods []corev1.Pod) error

Types

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
	ErrContextAppMismatch
	ErrWorkflowAppMismatch
	ErrCortexInstallationBroken
	ErrLoadBalancerInitializing
	ErrNotFound
)

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 LogPrefixInfo

type LogPrefixInfo struct {
	LogPrefix  string
	WorkloadID string
	AppName    string
}

type ParsedWorkflow

type ParsedWorkflow struct {
	Workloads map[string]*WorkflowItem // workloadID -> *WorkflowItem
	Wf        *awfv1.Workflow
}

type SavedWorkloadSpec

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

type WorkflowItem

type WorkflowItem struct {
	WorkloadID         string
	WorkloadType       string
	StartedAt          *time.Time
	FinishedAt         *time.Time
	ArgoPhase          *awfv1.NodePhase
	DirectDependencies strset.Set
	AllDependencies    strset.Set
}

type WorkloadSpec

type WorkloadSpec struct {
	WorkloadID       string
	ResourceIDs      strset.Set
	Spec             metav1.Object
	K8sAction        string
	SuccessCondition string
	FailureCondition string
	WorkloadType     string
}

Jump to

Keyboard shortcuts

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