gateway

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderKeyType       = "seldon-infer-type"
	HeaderValueJsonReq  = "json/inferModelRequest"
	HeaderValueJsonRes  = "json/inferModelResponse"
	HeaderValueProtoReq = "proto/InferModelRequest"
	HeaderValueProtoRes = "proto/InferModelResponse"
)
View Source
const (
	DefaultNumWorkers = 8
	EnvVarNumWorkers  = "MODELGATEWAY_NUM_WORKERS"
)
View Source
const (
	EnvMaxNumConsumers     = "MODELGATEWAY_MAX_NUM_CONSUMERS"
	DefaultMaxNumConsumers = 100
)
View Source
const (
	SubscriberName = "seldon-modelgateway"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerConfig

type ConsumerConfig struct {
	KafkaConfig           *config.KafkaConfig
	Namespace             string
	InferenceServerConfig *InferenceServerConfig
	TraceProvider         *seldontracer.TracerProvider
	NumWorkers            int // infer workers
}

type ConsumerManager

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

func NewConsumerManager

func NewConsumerManager(logger log.FieldLogger, consumerConfig *ConsumerConfig, maxNumConsumers int) *ConsumerManager

func (*ConsumerManager) AddModel

func (cm *ConsumerManager) AddModel(modelName string) error

func (*ConsumerManager) GetNumModels

func (cm *ConsumerManager) GetNumModels() int

func (*ConsumerManager) RemoveModel

func (cm *ConsumerManager) RemoveModel(modelName string) error

func (*ConsumerManager) Stop

func (cm *ConsumerManager) Stop()

type InferKafkaConsumer

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

func NewInferKafkaConsumer

func NewInferKafkaConsumer(logger log.FieldLogger, consumerConfig *ConsumerConfig, consumerName string) (*InferKafkaConsumer, error)

func (*InferKafkaConsumer) AddModel

func (kc *InferKafkaConsumer) AddModel(modelName string) error

func (*InferKafkaConsumer) GetNumModels

func (kc *InferKafkaConsumer) GetNumModels() int

func (*InferKafkaConsumer) RemoveModel

func (kc *InferKafkaConsumer) RemoveModel(modelName string) error

func (*InferKafkaConsumer) Serve

func (kc *InferKafkaConsumer) Serve()

func (*InferKafkaConsumer) Stop

func (kc *InferKafkaConsumer) Stop()

type InferWork

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

type InferWorker

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

func NewInferWorker

func NewInferWorker(consumer *InferKafkaConsumer, logger log.FieldLogger, traceProvider *seldontracer.TracerProvider, topicNamer *kafka2.TopicNamer) (*InferWorker, error)

func (*InferWorker) Start

func (iw *InferWorker) Start(jobChan <-chan *InferWork, cancelChan <-chan struct{})

type InferenceServerConfig

type InferenceServerConfig struct {
	Host     string
	HttpPort int
	GrpcPort int
}

type KafkaModelConfig

type KafkaModelConfig struct {
	ModelName   string
	InputTopic  string
	OutputTopic string
	ErrorTopic  string
}

type KafkaSchedulerClient

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

func NewKafkaSchedulerClient

func NewKafkaSchedulerClient(logger logrus.FieldLogger, consumerManager *ConsumerManager) *KafkaSchedulerClient

func (*KafkaSchedulerClient) ConnectToScheduler

func (kc *KafkaSchedulerClient) ConnectToScheduler(host string, plainTxtPort int, tlsPort int) error

func (*KafkaSchedulerClient) Start

func (kc *KafkaSchedulerClient) Start() error

func (*KafkaSchedulerClient) Stop

func (kc *KafkaSchedulerClient) Stop()

func (*KafkaSchedulerClient) SubscribeModelEvents

func (kc *KafkaSchedulerClient) SubscribeModelEvents() error

type V2Error

type V2Error struct {
	Error string `json:"error"`
}

Jump to

Keyboard shortcuts

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