types

package
v0.0.0-...-d3e8332 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgoWorkflow

type ArgoWorkflow struct {
	Workflow *argotypes.Workflow
}

ArgoWorkflow is a simple wrapper for the Workflow type from Argo. A struct is used instead of type alias because a pointer is required for the argotypes.Workflow

func (ArgoWorkflow) Delete

func (argoWorkflow ArgoWorkflow) Delete(clientsets *wfdefcommon.K8sClientsets, name, namespace string) error

Delete will delete the resources created by the Run method

func (ArgoWorkflow) Run

func (argoWorkflow ArgoWorkflow) Run(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string) error

Run will create and deploy all the necessary Kubernetes resources for this type of Workflow. These are the resources created by this function:

  • workflows.argoproj.io
  • deployments.apps

func (ArgoWorkflow) ScaleFromZero

func (argoWorkflow ArgoWorkflow) ScaleFromZero(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string) error

ScaleFromZero will re-run a Workflow that has completed and scaled down

func (ArgoWorkflow) SetupRouting

func (argoWorkflow ArgoWorkflow) SetupRouting(clientsets *wfdefcommon.K8sClientsets, adminClientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string, cluster common.Cluster) error

SetupRouting ...

func (ArgoWorkflow) Type

func (argoWorkflow ArgoWorkflow) Type() string

Type returns the name of this Workflow Type

type CacaoWorkflow

type CacaoWorkflow interface {
	Type() string
	Run(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string) error
	SetupRouting(clientsets *wfdefcommon.K8sClientsets, adminClientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string, cluster common.Cluster) error
	Delete(clientsets *wfdefcommon.K8sClientsets, name, namespace string) error
	ScaleFromZero(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string) error
}

CacaoWorkflow is an interface used to allow Pleo to simply run WorkflowDefinition.Run in order to create and deploy all the necessary Kubernetes resources. This makes it simpler to add new WorkflowTypes

func NewArgoWorkflow

func NewArgoWorkflow(parsedWorkflow []byte) (CacaoWorkflow, error)

NewArgoWorkflow is a constructor to create an ArgoWorkflow type of CacaoWorkflow from a []byte, which is the workflow defined in the 'wfd.yaml' file

func NewContainerWorkflow

func NewContainerWorkflow(parsedWorkflow []byte) (CacaoWorkflow, error)

NewContainerWorkflow is a constructor to create a ContainerWorkflow type by reading the []byte from the string in 'wfd.yaml'

func NewMockWorkflow

func NewMockWorkflow(parsedWorkflow []byte) (CacaoWorkflow, error)

NewMockWorkflow creates a string from the bytes input

func NewOpenFaaSWorkflow

func NewOpenFaaSWorkflow(parsedWorkflow []byte) (CacaoWorkflow, error)

NewOpenFaaSWorkflow ...

func ParseRawWorkflow

func ParseRawWorkflow(rawWorkflow, workflowType string, buildSteps []*common.BuildStep) (workflow CacaoWorkflow, err error)

ParseRawWorkflow will read the RawWorkflow string and create the correct type of CacaoWorkflow from it

func WorkflowFactory

func WorkflowFactory(workflowType string, workflowBytes []byte) (CacaoWorkflow, error)

WorkflowFactory is used to get the constructor for the correct type of Workflow and parse the bytes to create a CacaoWorkflow

type ContainerWorkflow

type ContainerWorkflow []core.Container

ContainerWorkflow is a type alias for a list of Kubernetes Containers

func (ContainerWorkflow) Delete

func (containers ContainerWorkflow) Delete(clientsets *wfdefcommon.K8sClientsets, name, namespace string) error

Delete will delete the resources created by the Run method

func (ContainerWorkflow) Run

func (containers ContainerWorkflow) Run(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string) error

Run will create and deploy all the necessary Kubernetes resources for this type of Workflow. These are the resources created by this function:

  • deployments.apps
  • scaledobjects.keda.k8s.io

func (ContainerWorkflow) ScaleFromZero

func (containers ContainerWorkflow) ScaleFromZero(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string) error

ScaleFromZero is used to scale up or re-create a Deployment that has been scaled to zero due to inactivity

func (ContainerWorkflow) SetupRouting

func (containers ContainerWorkflow) SetupRouting(clientsets *wfdefcommon.K8sClientsets, adminClientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string, cluster common.Cluster) error

SetupRouting ...

func (ContainerWorkflow) Type

func (containers ContainerWorkflow) Type() string

Type returns the name of this Workflow Type

type MockWorkflow

type MockWorkflow string

MockWorkflow is just an alias for a string so we can test wfd.Run and wfd.Delete

func (MockWorkflow) Delete

func (w MockWorkflow) Delete(clientsets *wfdefcommon.K8sClientsets, name, namespace string) error

Delete also does nothing

func (MockWorkflow) Run

func (w MockWorkflow) Run(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string) error

Run does nothing

func (MockWorkflow) ScaleFromZero

func (w MockWorkflow) ScaleFromZero(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string) error

ScaleFromZero also does nothing

func (MockWorkflow) SetupRouting

func (w MockWorkflow) SetupRouting(clientsets *wfdefcommon.K8sClientsets, adminClientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string, cluster common.Cluster) error

SetupRouting also does nothing

func (MockWorkflow) Type

func (w MockWorkflow) Type() string

Type returns the name of this WorkflowType

type OpenFaaSWorkflow

type OpenFaaSWorkflow struct {
	Services *stack.Services
}

OpenFaaSWorkflow ...

func (OpenFaaSWorkflow) Delete

func (faas OpenFaaSWorkflow) Delete(clientsets *wfdefcommon.K8sClientsets, name, namespace string) error

Delete ...

func (OpenFaaSWorkflow) Run

func (faas OpenFaaSWorkflow) Run(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string) error

Run ...

func (OpenFaaSWorkflow) ScaleFromZero

func (faas OpenFaaSWorkflow) ScaleFromZero(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string) error

ScaleFromZero ...

func (OpenFaaSWorkflow) SetupRouting

func (faas OpenFaaSWorkflow) SetupRouting(clientsets *wfdefcommon.K8sClientsets, adminClientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, name, namespace string, cluster common.Cluster) error

SetupRouting ...

func (OpenFaaSWorkflow) Type

func (faas OpenFaaSWorkflow) Type() string

Type returns the name of this Workflow Type

Jump to

Keyboard shortcuts

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