batch

package
v0.0.0-...-58c3220 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmptyServiceJobField = `field "%s"" must be set for BatchInferenceJob 
or as a default for a corresponding BatchInferenceService`
	ConnectionNotFound = `connection from "%s" with name "%s" is not found`
)
View Source
const (
	EmptySpecFieldErrorMessage = "%s must be non-empty"
	IDLengthExceeded           = "ID length must be less or equal to %d"
)

Variables

This section is empty.

Functions

func DefaultCreate

func DefaultCreate(bis *api_types.InferenceService)

func DefaultJob

func DefaultJob(job *api_types.InferenceJob, service api_types.InferenceService)

func ValidateCreateUpdate

func ValidateCreateUpdate(bis api_types.InferenceService) (errs []error)

func ValidateJob

func ValidateJob(
	job api_types.InferenceJob,
	connGetter ConnectionGetter,
	service api_types.InferenceService) (valErrs []error, err error)

ValidateJob validates a job after it was defaulted by BatchInferenceService values

func ValidateJobInput

func ValidateJobInput(job api_types.InferenceJob) (errs []error)

ValidateJobInput validates a job before it was defaulted by BatchInferenceService values

Types

type ConnectionGetter

type ConnectionGetter interface {
	GetConnection(id string, encrypted bool) (*connection.Connection, error)
}

type InferenceServiceRepo

type InferenceServiceRepo interface {
	Create(ctx context.Context, tx *sql.Tx, bis api_types.InferenceService) (err error)
	Get(ctx context.Context, tx *sql.Tx, id string) (res api_types.InferenceService, err error)
	Update(ctx context.Context, tx *sql.Tx, id string, bis api_types.InferenceService) (err error)
	List(ctx context.Context, tx *sql.Tx, options ...filter.ListOption) (res []api_types.InferenceService, err error)
	Delete(ctx context.Context, tx *sql.Tx, id string) (err error)
}

type InferenceServiceService

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

func NewInferenceServiceService

func NewInferenceServiceService(repo InferenceServiceRepo) *InferenceServiceService

func (*InferenceServiceService) Create

Create creates api_types.InferenceService

func (*InferenceServiceService) Delete

func (s *InferenceServiceService) Delete(ctx context.Context, id string) (err error)

func (*InferenceServiceService) Get

func (*InferenceServiceService) List

func (*InferenceServiceService) Update

Update updates api_types.InferenceService

type JobRepository

type JobRepository interface {
	Create(ctx context.Context, tx *sql.Tx, bij api_types.InferenceJob) (err error)
	UpdateStatus(ctx context.Context, tx *sql.Tx, id string, s api_types.InferenceJobStatus) (err error)
	Delete(ctx context.Context, tx *sql.Tx, id string) (err error)
	List(ctx context.Context, tx *sql.Tx, options ...filter.ListOption) (res []api_types.InferenceJob, err error)
	Get(ctx context.Context, tx *sql.Tx, id string) (res api_types.InferenceJob, err error)
	SetDeletionMark(ctx context.Context, tx *sql.Tx, id string, value bool) error
}

type JobService

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

func NewJobService

func NewJobService(repo JobRepository, sRepo ServiceRepository, connGetter ConnectionGetter) *JobService

func (*JobService) Create

func (s *JobService) Create(ctx context.Context, bij *api_types.InferenceJob) (err error)

Create launches BatchInferenceJob Because we ensure immutability of jobs we also generate ID to take this responsibility from client Generated ID should be returned to client

func (*JobService) Delete

func (s *JobService) Delete(ctx context.Context, id string) error

func (*JobService) Get

func (*JobService) List

func (s *JobService) List(ctx context.Context, options ...filter.ListOption) ([]api_types.InferenceJob, error)

func (*JobService) SetDeletionMark

func (s *JobService) SetDeletionMark(ctx context.Context, id string) error

func (*JobService) UpdateStatus

func (s *JobService) UpdateStatus(ctx context.Context, id string, status api_types.InferenceJobStatus) error

type ServiceRepository

type ServiceRepository interface {
	Get(ctx context.Context, tx *sql.Tx, id string) (res api_types.InferenceService, err error)
}

Jump to

Keyboard shortcuts

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