mmesh

package
v0.11.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelRegistryPrefix  = "registry"
	VModelRegistryPrefix = "vmodels"
)
View Source
const KUBE_SCHEME = "kube"

Variables

This section is empty.

Functions

func CreateEtcdClient

func CreateEtcdClient(etcdConfig EtcdConfig, secretData map[string][]byte, logger logr.Logger) (*etcd3.Client, error)

Types

type EtcdConfig

type EtcdConfig struct {
	Endpoints             string `json:"endpoints"`
	Username              string `json:"userid,omitempty"`
	Password              string `json:"password,omitempty"`
	RootPrefix            string `json:"root_prefix,omitempty"`
	Certificate           string `json:"certificate,omitempty"`
	CertificateFile       string `json:"certificate_file,omitempty"`
	ClientKey             string `json:"client_key,omitempty"`
	ClientKeyFile         string `json:"client_key_file,omitempty"`
	ClientCertificate     string `json:"client_certificate,omitempty"`
	ClientCertificateFile string `json:"client_certificate_file,omitempty"`
	OverrideAuthority     string `json:"override_authority,omitempty"`
}

type EtcdRangeWatcher

type EtcdRangeWatcher struct {
	WatchPrefix string
	// contains filtered or unexported fields
}

EtcdRangeWatcher A wrapper for Etcd Watch with common refresh Watch Channel logic

func NewEtcdRangeWatcher

func NewEtcdRangeWatcher(logger logr.Logger, etcd *etcd3.Client, prefix string) *EtcdRangeWatcher

func (*EtcdRangeWatcher) Start

func (r *EtcdRangeWatcher) Start(ctx context.Context, keysOnly bool, listener KvListener)

type EtcdSecret added in v0.8.0

type EtcdSecret struct {
	Log                 logr.Logger
	Name                string
	Namespace           string
	ControllerNamespace string
	EtcdConfig          *EtcdConfig
	Scheme              *runtime.Scheme
}

An EtcdSecret represents the etcd configuation for a user namespace

func (EtcdSecret) Apply added in v0.8.0

func (es EtcdSecret) Apply(ctx context.Context, cl client.Client) error

type KeyEvent

type KeyEvent struct {
	Key   string
	Value []byte
	Type  KeyEventType
}

type KeyEventChan

type KeyEventChan chan KeyEvent

type KeyEventType

type KeyEventType uint8
const (
	UPDATE KeyEventType = iota
	DELETE
	INITIALIZED
)

func (KeyEventType) String

func (t KeyEventType) String() string

type KubeResolver

type KubeResolver struct {
	client.Client
	// contains filtered or unexported fields
}

KubeResolver is a ResolverBuilder and a Reconciler

func InitGrpcResolver

func InitGrpcResolver(defaultNamespace string, mgr ctrl.Manager) (*KubeResolver, error)

InitGrpcResolver should only be called once

func (*KubeResolver) Build

func (*KubeResolver) Reconcile

func (kr *KubeResolver) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*KubeResolver) Scheme

func (*KubeResolver) Scheme() string

type KvListener

type KvListener func(eventType KeyEventType, key string, value []byte)

type MMService

type MMService struct {
	// these don't change
	Log logr.Logger
	// contains filtered or unexported fields
}

Encapsulates ModelMesh gRPC service

func NewMMService

func NewMMService(namespace string, tlsConfig TLSConfigLookup) *MMService

func (*MMService) ConnectIfNeeded added in v0.8.0

func (mms *MMService) ConnectIfNeeded(ctx context.Context) error

ConnectIfNeeded is called only in service reconcile

func (*MMService) Disconnect

func (mms *MMService) Disconnect()

Disconnect is called only in service reconcile

func (*MMService) GetNameAndSpec added in v0.8.0

func (mms *MMService) GetNameAndSpec() (string, *v1.ServiceSpec)

func (*MMService) InferenceEndpoints added in v0.8.0

func (mms *MMService) InferenceEndpoints() (grpc, rest string)

func (*MMService) MMClient

func (mms *MMService) MMClient() mmeshapi.ModelMeshClient

MMClient is called from predictor controller

func (*MMService) UpdateConfig

func (mms *MMService) UpdateConfig(cp *config.ConfigProvider) (*config.Config, bool)

type ModelMeshEventStream

type ModelMeshEventStream struct {
	MMEvents chan event.GenericEvent
	// contains filtered or unexported fields
}

ModelMeshEventStream generates events for Predictors based on changes to models/vmodels within model-mesh's etcd-based registries. This is unfortunately tightly coupled to certain model-mesh internal details (i.e. etcd layout), and in future we would like to expose streaming gRPC APIs from model-mesh for an "official" way to watch for model events.

func NewModelEventStream

func NewModelEventStream(logger logr.Logger, k8sClient k8sClient.Client,
	namespace string) (this *ModelMeshEventStream, err error)

func (*ModelMeshEventStream) RemoveWatchedService added in v0.8.0

func (mes *ModelMeshEventStream) RemoveWatchedService(serviceName, namespace string)

RemoveWatchedService is called from service reconciler

func (*ModelMeshEventStream) UpdateWatchedService

func (mes *ModelMeshEventStream) UpdateWatchedService(ctx context.Context,
	etcdSecretName, serviceName, namespace string) error

UpdateWatchedService is called from service reconciler

type TLSConfigLookup added in v0.8.0

type TLSConfigLookup func(context.Context, string) (*tls.Config, error)

Jump to

Keyboard shortcuts

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