Documentation ¶
Index ¶
- type ConfigStorage
- type Discoverer
- type ModelsMetadata
- type ModelsReloader
- type Reloader
- type ServableConfig
- func (sc *ServableConfig) AddModel(ctx context.Context, id app.ModelID) error
- func (sc *ServableConfig) Config(ctx context.Context, team, project string) (*tfsConfig.ModelServerConfig, error)
- func (sc *ServableConfig) ConfigFileStream(ctx context.Context, team, project string) ([]byte, error)
- func (sc *ServableConfig) ConfigWithoutLabels(ctx context.Context, team, project string) (*tfsConfig.ModelServerConfig, error)
- func (sc *ServableConfig) DefaultLabel() string
- func (sc *ServableConfig) Models(ctx context.Context, team, project string, msc *tfsConfig.ModelServerConfig) ([]app.ModelID, error)
- func (sc *ServableConfig) RemoveModel(ctx context.Context, id app.ModelID) error
- func (sc *ServableConfig) RemoveModelLabel(ctx context.Context, id app.ModelID) error
- func (sc *ServableConfig) UpdateLabel(ctx context.Context, id app.ModelID) (int64, error)
- type ServableConfigurer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigStorage ¶
type Discoverer ¶
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 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) 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 ¶
RemoveModel removes specific model for model version identified by ModelID
func (*ServableConfig) RemoveModelLabel ¶
RemoveModelLabel removes specific label of model identified by ModelID
func (*ServableConfig) UpdateLabel ¶
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) }