pipelines

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PipelineNamespace = "default"
	PipelineId        = "12345"
	AnotherPipelineId = "67890"
)
View Source
const (
	PipelineNameLabelKey = "pipelines.kubeflow.org/pipeline"
	OperationLabelKey    = "pipelines.kubeflow.org/operation"
	CreateOperationLabel = "create-pipeline"
	UpdateOperationLabel = "update-pipeline"
	DeleteOperationLabel = "delete-pipeline"
)

Variables

View Source
var SpecV1 = pipelinesv1.PipelineSpec{
	Image:         "test-pipeline",
	TfxComponents: "pipeline.create_components",
	Env: map[string]string{
		"a": "aVal",
		"b": "bVal",
	},
}
View Source
var SpecV2 = pipelinesv1.PipelineSpec{
	Image:         "test-pipeline",
	TfxComponents: "pipeline.create_components",
	Env: map[string]string{
		"a": "aVal",
		"b": "bVal",
		"c": "cVal",
	},
}
View Source
var V0 = pipelinesv1.ComputeVersion(pipelinesv1.PipelineSpec{})
View Source
var V1 = pipelinesv1.ComputeVersion(SpecV1)
View Source
var V2 = pipelinesv1.ComputeVersion(SpecV2)
View Source
var WorkflowFactoryConstants = struct {
	pipelineIdParameterName   string
	pipelineYamlParameterName string
	compileStepName           string
	uploadStepName            string
	deletionStepName          string
	updateStepName            string
	pipelineYamlFilePath      string
	pipelineIdFilePath        string
}{
	// contains filtered or unexported fields
}

Functions

func RandomLowercaseString

func RandomLowercaseString() string

func RandomMap

func RandomMap() map[string]string

func RandomPipeline

func RandomPipeline() *pipelinesv1.Pipeline

func RandomShortHash

func RandomShortHash() string

func RandomString

func RandomString() string

Types

type Command

type Command interface {
	// contains filtered or unexported methods
}

type CreateWorkflow

type CreateWorkflow struct {
	Workflow argo.Workflow
}

type DeletePipeline

type DeletePipeline struct {
}

type DeleteWorkflows

type DeleteWorkflows struct {
	Workflows []argo.Workflow
}

type PipelineReconciler

type PipelineReconciler struct {
	client.Client
	Scheme       *runtime.Scheme
	StateHandler StateHandler
}

func (*PipelineReconciler) AddFinalizer

func (r *PipelineReconciler) AddFinalizer(ctx context.Context, pipeline *pipelinesv1.Pipeline) error

func (*PipelineReconciler) CreateChildWorkflow

func (r *PipelineReconciler) CreateChildWorkflow(ctx context.Context, pipeline *pipelinesv1.Pipeline, workflow argo.Workflow) error

func (*PipelineReconciler) Reconcile

func (r *PipelineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*PipelineReconciler) RemoveFinalizer

func (r *PipelineReconciler) RemoveFinalizer(ctx context.Context, pipeline pipelinesv1.Pipeline) error

func (*PipelineReconciler) SetupWithManager

func (r *PipelineReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type SetPipelineStatus

type SetPipelineStatus struct {
	Status pipelinesv1.PipelineStatus
}

type StateHandler

type StateHandler struct {
	WorkflowFactory    WorkflowFactory
	WorkflowRepository WorkflowRepository
}

func (StateHandler) StateTransition

func (st StateHandler) StateTransition(ctx context.Context, pipeline *pipelinesv1.Pipeline) []Command

type TestContext

type TestContext struct {
	K8sClient client.Client

	Pipeline          *pipelinesv1.Pipeline
	PipelineLookupKey types.NamespacedName
	Version           string
	// contains filtered or unexported fields
}

func NewTestContext

func NewTestContext(k8sClient client.Client, ctx context.Context) TestContext

func NewTestContextWithPipeline

func NewTestContextWithPipeline(pipeline *pipelinesv1.Pipeline, k8sClient client.Client, ctx context.Context) TestContext

func (TestContext) DeletePipeline

func (testCtx TestContext) DeletePipeline() error

func (TestContext) PipelineCreated

func (testCtx TestContext) PipelineCreated()

func (TestContext) PipelineCreatedWithStatus

func (testCtx TestContext) PipelineCreatedWithStatus(status pipelinesv1.PipelineStatus)

func (TestContext) PipelineExists

func (testCtx TestContext) PipelineExists() error

func (TestContext) PipelineToMatch

func (testCtx TestContext) PipelineToMatch(matcher func(Gomega, *pipelinesv1.Pipeline)) func(Gomega)

func (TestContext) UpdatePipeline

func (testCtx TestContext) UpdatePipeline(updateFunc func(*pipelinesv1.Pipeline)) error

func (TestContext) UpdatePipelineStatus

func (testCtx TestContext) UpdatePipelineStatus(updateFunc func(*pipelinesv1.Pipeline)) error

func (TestContext) UpdateWorkflow

func (testCtx TestContext) UpdateWorkflow(operation string, updateFunc func(*argo.Workflow)) error

func (TestContext) WorkflowInputToMatch

func (testCtx TestContext) WorkflowInputToMatch(operation string, matcher func(Gomega, map[string]string)) func(Gomega)

func (TestContext) WorkflowToMatch

func (testCtx TestContext) WorkflowToMatch(operation string, matcher func(Gomega, *argo.Workflow)) func(Gomega)

type WorkflowFactory

type WorkflowFactory struct {
	Config configv1.Configuration
}

func (WorkflowFactory) ConstructCreationWorkflow

func (w WorkflowFactory) ConstructCreationWorkflow(pipelineSpec pipelinesv1.PipelineSpec, pipelineMeta metav1.ObjectMeta, pipelineVersion string) (*argo.Workflow, error)

func (WorkflowFactory) ConstructDeletionWorkflow

func (w WorkflowFactory) ConstructDeletionWorkflow(pipelineMeta metav1.ObjectMeta, pipelineId string) *argo.Workflow

func (WorkflowFactory) ConstructUpdateWorkflow

func (w WorkflowFactory) ConstructUpdateWorkflow(pipelineSpec pipelinesv1.PipelineSpec, pipelineMeta metav1.ObjectMeta, pipelineId string, pipelineVersion string) (*argo.Workflow, error)

type WorkflowRepository

type WorkflowRepository interface {
	GetByOperation(ctx context.Context, operation string, pipelineName *pipelinesv1.Pipeline) []argo.Workflow
}

type WorkflowRepositoryImpl

type WorkflowRepositoryImpl struct {
	client.Client
}

func (WorkflowRepositoryImpl) GetByOperation

func (w WorkflowRepositoryImpl) GetByOperation(ctx context.Context, operation string, pipeline *pipelinesv1.Pipeline) []argo.Workflow

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳