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.
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.
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.
Index ¶
- Constants
- Variables
- func ConfigWatchHandler(configMapName types.NamespacedName, f func() []reconcile.Request, ...) handler.EventHandler
- func Hash(predictorSpec *api.PredictorSpec) string
- func PrefixName(prefix string) handler.EventHandler
- type Config
- type ConfigProvider
- type ImageConfig
- type ModelKeyInfo
- type PredictorReconciler
- func (pr *PredictorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (pr *PredictorReconciler) ReconcilePredictor(ctx context.Context, nname types.NamespacedName, sourceId string, ...) (ctrl.Result, error)
- func (pr *PredictorReconciler) SetupWithManager(mgr ctrl.Manager, eventStream *mmesh.ModelMeshEventStream, ...) error
- type PrometheusConfig
- type RESTProxyConfig
- type ResourceQuantities
- type ResourceRequirements
- type ScaleToZeroConfig
- type ServiceReconciler
- func (r *ServiceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ServiceReconciler) ReconcileServiceMonitor(ctx context.Context, metrics PrometheusConfig, owner metav1.Object) (error, bool)
- func (r *ServiceReconciler) SetupWithManager(mgr ctrl.Manager) error
- type ServingRuntimeReconciler
- type TLSConfig
Constants ¶
const ( EnvEtcdSecretName = "ETCD_SECRET_NAME" DefaultEtcdSecretName = "model-serving-etcd" )
const ( // The amount of time failed requests are queued before reattempting DefaultRequeueTime = 5 * time.Second ConfigType = "yaml" MountLocation = "/etc/model-serving/config-defaults.yaml" )
const ( PredictorCRSourceId = "ksp" TrainedModelCRSourceId = "kstm" )
const ( GrpcRequestTimeout = 10 * time.Second K8sStatusUpdateTimeout = 10 * time.Second )
Variables ¶
var RequeueResult = ctrl.Result{RequeueAfter: DefaultRequeueTime}
Functions ¶
func ConfigWatchHandler ¶
func ConfigWatchHandler(configMapName types.NamespacedName, f func() []reconcile.Request, cp *ConfigProvider, kclient *client.Client) handler.EventHandler
Handler used by controllers which depend on the user configuration
func Hash ¶
func Hash(predictorSpec *api.PredictorSpec) string
Hash returns a 10-character hash string of the spec
func PrefixName ¶
func PrefixName(prefix string) handler.EventHandler
Types ¶
type Config ¶
type Config struct {
// System config
EtcdSecretName string // DEPRECATED - should be removed in the future
ModelMeshEndpoint string // For dev use only
// Service config
InferenceServiceName string
InferenceServicePort uint16
TLS TLSConfig
HeadlessService bool
GrpcMaxMessageSizeBytes int
// Runtimes config
ModelMeshImage ImageConfig
ModelMeshResources ResourceRequirements
RESTProxy RESTProxyConfig
StorageHelperImage ImageConfig
StorageHelperResources ResourceRequirements
PodsPerRuntime uint16
StorageSecretName string
EnableAccessLogging bool
ServiceAccountName string
Metrics PrometheusConfig
ScaleToZero ScaleToZeroConfig
}
Type Config holds process global configuration information
func (*Config) GetEtcdSecretName ¶
type ConfigProvider ¶
type ConfigProvider struct {
// contains filtered or unexported fields
}
Type Config holds process global configuration information
func NewConfigProvider ¶
func NewConfigProvider(ctx context.Context, cl client.Client, name types.NamespacedName) (*ConfigProvider, error)
func (*ConfigProvider) AwaitReload ¶
func (cp *ConfigProvider) AwaitReload()
func (*ConfigProvider) GetConfig ¶
func (cp *ConfigProvider) GetConfig() *Config
func (*ConfigProvider) IsReloading ¶
func (cp *ConfigProvider) IsReloading() bool
func (*ConfigProvider) ReloadConfigMap ¶
func (cp *ConfigProvider) ReloadConfigMap(ctx context.Context, c client.Client, name types.NamespacedName) error
type ImageConfig ¶
func (ImageConfig) TaggedImage ¶
func (m ImageConfig) TaggedImage() string
type ModelKeyInfo ¶
type ModelKeyInfo struct {
StorageKey *string `json:"storage_key,omitempty"`
Bucket *string `json:"bucket,omitempty"`
ModelType *api.ModelType `json:"model_type,omitempty"`
SchemaPath *string `json:"schema_path,omitempty"`
}
passed in ModelInfo.Key field of registration requests
type PredictorReconciler ¶
type PredictorReconciler struct {
client.Client
Log logr.Logger
MMService *mmesh.MMService
RegistryLookup map[string]api.PredictorRegistry
}
PredictorReconciler reconciles Predictors
func (*PredictorReconciler) ReconcilePredictor ¶
func (pr *PredictorReconciler) ReconcilePredictor(ctx context.Context, nname types.NamespacedName, sourceId string, registry api.PredictorRegistry) (ctrl.Result, error)
func (*PredictorReconciler) SetupWithManager ¶
func (pr *PredictorReconciler) SetupWithManager(mgr ctrl.Manager, eventStream *mmesh.ModelMeshEventStream, watchTrainedModels bool) error
type PrometheusConfig ¶
type RESTProxyConfig ¶
type RESTProxyConfig struct {
Enabled bool
Port uint16
Image ImageConfig
Resources ResourceRequirements
}
type ResourceQuantities ¶
type ResourceRequirements ¶
type ResourceRequirements struct {
Requests ResourceQuantities
Limits ResourceQuantities
// contains filtered or unexported fields
}
func (ResourceRequirements) ToKubernetesType ¶
func (rr ResourceRequirements) ToKubernetesType() *corev1.ResourceRequirements
type ScaleToZeroConfig ¶
type ServiceReconciler ¶
type ServiceReconciler struct {
client.Client
Log logr.Logger
Scheme *runtime.Scheme
ConfigProvider *ConfigProvider
ConfigMapName types.NamespacedName
ControllerDeployment types.NamespacedName
ModelMeshService *mmesh.MMService
ModelEventStream *mmesh.ModelMeshEventStream
ServiceMonitorCRDExists bool
}
ServiceReconciler reconciles a ServingRuntime object
func (*ServiceReconciler) ReconcileServiceMonitor ¶
func (r *ServiceReconciler) ReconcileServiceMonitor(ctx context.Context, metrics PrometheusConfig, owner metav1.Object) (error, bool)
func (*ServiceReconciler) SetupWithManager ¶
func (r *ServiceReconciler) SetupWithManager(mgr ctrl.Manager) error
type ServingRuntimeReconciler ¶
type ServingRuntimeReconciler struct {
client.Client
Log logr.Logger
Scheme *runtime.Scheme
ConfigProvider *ConfigProvider
ConfigMapName types.NamespacedName
DeploymentName string
DeploymentNamespace string
EnableTrainedModelWatch bool
// contains filtered or unexported fields
}
ServingRuntimeReconciler reconciles a ServingRuntime object
func (*ServingRuntimeReconciler) SetupWithManager ¶
func (r *ServingRuntimeReconciler) SetupWithManager(mgr ctrl.Manager) error