run

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BioosRunIDKey = "bioos-run-id"
)

Variables

This section is empty.

Functions

func NewDataModel

func NewDataModel(srcDataModel *workspaceproto.DataModel, srcHeader []string, srcRows []*workspaceproto.Row) *dataModel

Types

type CancelHandler

type CancelHandler struct {
	// contains filtered or unexported fields
}

func NewEventHandlerCancelRun

func NewEventHandlerCancelRun(wes wes.Client, repository Repository, eventbus eventbus.EventBus) *CancelHandler

func (*CancelHandler) Handle

func (h *CancelHandler) Handle(ctx context.Context, event *submission.EventRun) (err error)

type CreateRunParam

type CreateRunParam struct {
	ID           string
	Name         string
	SubmissionID string
	Inputs       map[string]interface{}  `gorm:"serializer:json"`
	Outputs      *map[string]interface{} `gorm:"serializer:json"`
	EngineRunID  string
	Status       string
	Log          *string
	Message      *string
	StartTime    time.Time
	FinishTime   *time.Time
}

type CreateTaskParam

type CreateTaskParam struct {
	Name       string
	RunID      string
	Status     string
	Stdout     string
	Stderr     string
	StartTime  time.Time
	FinishTime *time.Time
}

type DeleteHandler

type DeleteHandler struct {
	// contains filtered or unexported fields
}

func NewEventHandlerDeleteRun

func NewEventHandlerDeleteRun(repository Repository, eventbus eventbus.EventBus) *DeleteHandler

func (*DeleteHandler) Handle

func (h *DeleteHandler) Handle(ctx context.Context, event *submission.EventRun) (err error)

type EventHandlerCreateRuns

type EventHandlerCreateRuns struct {
	// contains filtered or unexported fields
}

save submission -> save runs

func NewEventHandlerCreateRuns

func NewEventHandlerCreateRuns(repo Repository, client grpc.DataModelClient, eventBus eventbus.EventBus, runFactory Factory) *EventHandlerCreateRuns

func (*EventHandlerCreateRuns) Handle

func (*EventHandlerCreateRuns) Publish

type EventHandlerSubmitRun

type EventHandlerSubmitRun struct {
	// contains filtered or unexported fields
}

func NewEventHandlerSubmitRun

func NewEventHandlerSubmitRun(wesClient wes.Client, eventBus eventbus.EventBus, runRepo Repository) *EventHandlerSubmitRun

func (*EventHandlerSubmitRun) Handle

type EventHandlerSyncRun

type EventHandlerSyncRun struct {
	// contains filtered or unexported fields
}

EventHandlerSyncRun submit run -> list run/task

func NewEventHandlerSyncRun

func NewEventHandlerSyncRun(wesClient wes.Client, runRepo Repository, runFactory Factory, eventBus eventbus.EventBus) *EventHandlerSyncRun

func (*EventHandlerSyncRun) Handle

type Factory

type Factory struct{}

Factory workspace factory.

func NewRunFactory

func NewRunFactory(_ context.Context) *Factory

NewRunFactory return a workspace factory.

func (*Factory) CreateWithRunParam

func (fac *Factory) CreateWithRunParam(param CreateRunParam) (*Run, error)

CreateWithRunParam ...

func (*Factory) CreateWithTaskParam

func (fac *Factory) CreateWithTaskParam(param CreateTaskParam) (*Task, error)

CreateWithTaskParam ...

type Repository

type Repository interface {
	Save(ctx context.Context, r *Run) error
	Get(ctx context.Context, id string) (*Run, error)
	Delete(ctx context.Context, r *Run) error
}

Repository allows to get/save events from/to event store.

type Run

type Run struct {
	ID           string
	Name         string
	SubmissionID string
	Inputs       map[string]interface{}  `gorm:"serializer:json"`
	Outputs      *map[string]interface{} `gorm:"serializer:json"`
	EngineRunID  string
	Status       string
	Log          *string
	Message      *string
	StartTime    time.Time
	FinishTime   *time.Time
	Tasks        []*Task
}

Run ...

func (*Run) Copy

func (run *Run) Copy() *Run

func (*Run) IsCancelling

func (run *Run) IsCancelling() bool

func (*Run) IsFinished

func (run *Run) IsFinished() bool

type Service

type Service interface {
	Upsert(context.Context, *Run, []*Task) error
	Create(context.Context, *Run, []*Task) error
	Update(context.Context, *Run, []*Task) error
	Delete(ctx context.Context, id string) error
	Cancel(ctx context.Context, id string) error
	CheckWorkspaceExist(ctx context.Context, workspaceID string) error
}

func NewService

func NewService(grpcFactory grpc.Factory, repo Repository, eventbus eventbus.EventBus, wesClient wes.Client) Service

type Task

type Task struct {
	Name       string
	RunID      string
	Status     string
	Stdout     string
	Stderr     string
	StartTime  time.Time
	FinishTime *time.Time
}

Task ...

Jump to

Keyboard shortcuts

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