Documentation ¶
Index ¶
- type ArgoWorkflow
- func (argoWorkflow ArgoWorkflow) Delete(clientsets *wfdefcommon.K8sClientsets, name, namespace string) error
- func (argoWorkflow ArgoWorkflow) Run(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, ...) error
- func (argoWorkflow ArgoWorkflow) ScaleFromZero(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, ...) error
- func (argoWorkflow ArgoWorkflow) SetupRouting(clientsets *wfdefcommon.K8sClientsets, ...) error
- func (argoWorkflow ArgoWorkflow) Type() string
- type CacaoWorkflow
- func NewArgoWorkflow(parsedWorkflow []byte) (CacaoWorkflow, error)
- func NewContainerWorkflow(parsedWorkflow []byte) (CacaoWorkflow, error)
- func NewMockWorkflow(parsedWorkflow []byte) (CacaoWorkflow, error)
- func NewOpenFaaSWorkflow(parsedWorkflow []byte) (CacaoWorkflow, error)
- func ParseRawWorkflow(rawWorkflow, workflowType string, buildSteps []*common.BuildStep) (workflow CacaoWorkflow, err error)
- func WorkflowFactory(workflowType string, workflowBytes []byte) (CacaoWorkflow, error)
- type ContainerWorkflow
- func (containers ContainerWorkflow) Delete(clientsets *wfdefcommon.K8sClientsets, name, namespace string) error
- func (containers ContainerWorkflow) Run(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, ...) error
- func (containers ContainerWorkflow) ScaleFromZero(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, ...) error
- func (containers ContainerWorkflow) SetupRouting(clientsets *wfdefcommon.K8sClientsets, ...) error
- func (containers ContainerWorkflow) Type() string
- type MockWorkflow
- func (w MockWorkflow) Delete(clientsets *wfdefcommon.K8sClientsets, name, namespace string) error
- func (w MockWorkflow) Run(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, ...) error
- func (w MockWorkflow) ScaleFromZero(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, ...) error
- func (w MockWorkflow) SetupRouting(clientsets *wfdefcommon.K8sClientsets, ...) error
- func (w MockWorkflow) Type() string
- type OpenFaaSWorkflow
- func (faas OpenFaaSWorkflow) Delete(clientsets *wfdefcommon.K8sClientsets, name, namespace string) error
- func (faas OpenFaaSWorkflow) Run(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, ...) error
- func (faas OpenFaaSWorkflow) ScaleFromZero(clientsets *wfdefcommon.K8sClientsets, request map[string]interface{}, ...) error
- func (faas OpenFaaSWorkflow) SetupRouting(clientsets *wfdefcommon.K8sClientsets, ...) error
- func (faas OpenFaaSWorkflow) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgoWorkflow ¶
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 ¶
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 ¶
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