serving

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: ISC Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigStorage

type ConfigStorage interface {
	ReadConfig(ctx context.Context, team, project string) ([]byte, error)
	SaveConfig(ctx context.Context, team, project string, config []byte) error
}

type Discoverer

type Discoverer interface {
	Discover(ctx context.Context, model app.ServableID) ([]string, error)
}

type ModelsMetadata

type ModelsMetadata interface {
	ListUniqueTeamProject(ctx context.Context) ([]*app.ServableID, error)
}

type ModelsReloader

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

func NewModelsReloader

func NewModelsReloader(serviceDiscovery Discoverer, modelMetadata ModelsMetadata, modelsConfig ServableConfigurer, lock *lock.Lock, reloadInterval, maxDurationAutoReload int, allowLabelsForUnavailableModels bool) *ModelsReloader

NewModelsReloader returns new instance of ModelsReloader

func (*ModelsReloader) ReloadConfig

func (r *ModelsReloader) ReloadConfig(ctx context.Context, team, project string, skipConfigWithoutLabels bool) ([]app.ReloadResponse, error)

ReloadConfig reloads all instances

func (*ModelsReloader) ReloadInstancesIfIsNecessary

func (r *ModelsReloader) ReloadInstancesIfIsNecessary(ctx context.Context)

ReloadInstancesIfIsNecessary reloads instances of model

func (*ModelsReloader) ReloadInstancesJob

func (r *ModelsReloader) ReloadInstancesJob(ctx context.Context)

ReloadInstancesJob reloads TFS instances

type Reloader

type Reloader interface {
	ReloadInstances(ctx context.Context, id app.ServableID) (instanceErrorList *[]string, err error)
	ReloadInstancesJob(ctx context.Context)
}

type ServableConfig

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

func NewServableConfig

func NewServableConfig(configStorage ConfigStorage, defaultLabel string) (*ServableConfig, error)

NewServableConfig returns new instance of ServableConfig

func (*ServableConfig) AddModel

func (sc *ServableConfig) AddModel(ctx context.Context, id app.ModelID) error

AddModel adds new model to configuration file

func (*ServableConfig) Config

func (sc *ServableConfig) Config(ctx context.Context, team, project string) (*tfsConfig.ModelServerConfig, error)

Config returns valid ModelServerConfig struct read from storage

func (*ServableConfig) ConfigFileStream

func (sc *ServableConfig) ConfigFileStream(ctx context.Context, team, project string) ([]byte, error)

ConfigFileStream returns byte stream

func (*ServableConfig) ConfigWithoutLabels

func (sc *ServableConfig) ConfigWithoutLabels(ctx context.Context, team, project string) (*tfsConfig.ModelServerConfig, error)

ConfigWithoutLabels return parsed ModelServerConfig struct from models.config file

func (*ServableConfig) DefaultLabel

func (sc *ServableConfig) DefaultLabel() string

func (*ServableConfig) Models

func (sc *ServableConfig) Models(ctx context.Context, team, project string, msc *tfsConfig.ModelServerConfig) ([]app.ModelID, error)

Models returns data of models from config

func (*ServableConfig) RemoveModel

func (sc *ServableConfig) RemoveModel(ctx context.Context, id app.ModelID) error

RemoveModel removes specific model for model version identified by ModelID

func (*ServableConfig) RemoveModelLabel

func (sc *ServableConfig) RemoveModelLabel(ctx context.Context, id app.ModelID) error

RemoveModelLabel removes specific label of model identified by ModelID

func (*ServableConfig) UpdateLabel

func (sc *ServableConfig) UpdateLabel(ctx context.Context, id app.ModelID) (int64, error)

UpdateLabel sets specific label for model version identified by ModelID

type ServableConfigurer

type ServableConfigurer interface {
	Config(ctx context.Context, team, project string) (*tfsConfig.ModelServerConfig, error)
	ConfigWithoutLabels(ctx context.Context, team, project string) (*tfsConfig.ModelServerConfig, error)
	Models(ctx context.Context, team, project string, msc *tfsConfig.ModelServerConfig) ([]app.ModelID, error)
}

Jump to

Keyboard shortcuts

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