pipeline

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidateWorkflowForPipeline = func(ppl models.Pipeline) error {

	wfs, err := schema.ParseWorkflowSource([]byte(ppl.PipelineYaml))
	if err != nil {
		logger.Logger().Errorf("get WorkflowSource by yaml failed. yaml: %s \n, err:%v", ppl.PipelineYaml, err)
		return err
	}

	param := map[string]interface{}{}
	extra := map[string]string{
		pplcommon.WfExtraInfoKeyUserName: ppl.UserName,
		pplcommon.WfExtraInfoKeyFsName:   ppl.FsName,
		pplcommon.WfExtraInfoKeyFsID:     ppl.FsID,
	}

	wfCbs := pipeline.WorkflowCallbacks{
		UpdateRunCb: func(string, interface{}) bool { return true },
		LogCacheCb:  run.LogCacheFunc,
		ListCacheCb: run.ListCacheFunc,
	}
	wfPtr, err := pipeline.NewWorkflow(wfs, "validatePipeline", "", param, extra, wfCbs)
	if err != nil {
		logger.Logger().Errorf("NewWorkflow for pipeline[%s] failed. err:%v", ppl.Name, err)
		return err
	}
	if wfPtr == nil {
		err := fmt.Errorf("NewWorkflow ptr for pipeline[%s] is nil", ppl.Name)
		logger.Logger().Errorln(err.Error())
		return err
	}
	return nil
}

Functions

func DeletePipeline

func DeletePipeline(ctx *logger.RequestContext, id string) error

func GetPipelineByID

func GetPipelineByID(ctx *logger.RequestContext, pipelineID string) (models.Pipeline, error)

Types

type CreatePipelineRequest

type CreatePipelineRequest struct {
	FsName   string `json:"fsname"`
	YamlPath string `json:"yamlPath,omitempty"` // optional, use "./run.yaml" if not specified
	Name     string `json:"name,omitempty"`     // optional
	UserName string `json:"username,omitempty"` // optional, only for root user
}

type CreatePipelineResponse

type CreatePipelineResponse struct {
	ID   string `json:"pipelineID"`
	Name string `json:"name"`
}

type ListPipelineResponse

type ListPipelineResponse struct {
	common.MarkerInfo
	PipelineList []models.Pipeline `json:"pipelineList"`
}

func ListPipeline

func ListPipeline(ctx *logger.RequestContext, marker string, maxKeys int, userFilter, fsFilter, nameFilter []string) (ListPipelineResponse, error)

Jump to

Keyboard shortcuts

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