mmesh

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Copyright 2021 IBM Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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"`
	Password              string `json:"password"`
	RootPrefix            string `json:"root_prefix"`
	Certificate           string `json:"certificate"`
	CertificateFile       string `json:"certificate_file"`
	ClientKey             string `json:"client_key"`
	ClientKeyFile         string `json:"client_key_file"`
	ClientCertificate     string `json:"client_certificate"`
	ClientCertificateFile string `json:"client_certificate_file"`
	OverrideAuthority     string `json:"override_authority"`
}

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 KeyEvent

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

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(namespace 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 {
	Log logr.Logger

	Name               string
	Port               uint16
	ManagementEndpoint string
	Headless           bool

	TLSConfig *tls.Config

	MetricsPort uint16
	// contains filtered or unexported fields
}

Encapsulates ModelMesh gRPC service

func NewMMService

func NewMMService() *MMService

func (*MMService) Connect

func (mms *MMService) Connect() error

func (*MMService) Disconnect

func (mms *MMService) Disconnect()

func (*MMService) InferenceEndpoint

func (mms *MMService) InferenceEndpoint() string

func (*MMService) MMClient

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

func (*MMService) UpdateConfig

func (mms *MMService) UpdateConfig(name string, port uint16,
	endpoint, tlsSecretName string, tlsConfig *tls.Config, headless bool, metricsPort uint16) 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) IsWatching

func (mes *ModelMeshEventStream) IsWatching() bool

func (*ModelMeshEventStream) UpdateWatchedService

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

Jump to

Keyboard shortcuts

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