From: josephthaliath Date: Mon, 12 Jun 2023 10:16:23 +0000 (+0530) Subject: Changes to add RuntimeVersion parameter X-Git-Tag: 1.0.0~5 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=75ae75deeb380c07ad9d850e4d937de5762eacd7;p=aiml-fw%2Faihp%2Fips%2Fkserve-adapter.git Changes to add RuntimeVersion parameter Issue-Id: AIMLFW-31 Change-Id: Icc985b425d47b9a5a37c47831e9b326e11d424f0 Signed-off-by: josephthaliath --- diff --git a/pkg/client/kserve/utils.go b/pkg/client/kserve/utils.go index b597ba8..0462be4 100644 --- a/pkg/client/kserve/utils.go +++ b/pkg/client/kserve/utils.go @@ -57,7 +57,6 @@ func convertValuesToInferenceService(values types.Values) (ifsv api_v1beta1.Infe Name: values.FullName, Namespace: ips_namespace, Labels: map[string]string{ - "controller-tools.k8s.io": "1.0", "app": values.FullName, }, }, @@ -80,15 +79,9 @@ func convertValuesToInferenceService(values types.Values) (ifsv api_v1beta1.Infe ifsv.Spec.Predictor.Tensorflow = &api_v1beta1.TFServingSpec{ PredictorExtensionSpec: api_v1beta1.PredictorExtensionSpec{ StorageURI: &values.StorageURI, + RuntimeVersion: &values.RuntimeVersion, Container: core_v1.Container{ Image: values.Image, - Ports: []core_v1.ContainerPort{ - { - Name: "h2c", - ContainerPort: 9000, - Protocol: "TCP", - }, - }, }, }, } @@ -98,13 +91,6 @@ func convertValuesToInferenceService(values types.Values) (ifsv api_v1beta1.Infe StorageURI: &values.StorageURI, Container: core_v1.Container{ Image: values.Image, - Ports: []core_v1.ContainerPort{ - { - Name: "h2c", - ContainerPort: 9000, - Protocol: "TCP", - }, - }, }, }, } diff --git a/pkg/commons/types/values.go b/pkg/commons/types/values.go index f27a5ad..1caa1a1 100644 --- a/pkg/commons/types/values.go +++ b/pkg/commons/types/values.go @@ -30,6 +30,7 @@ type Values struct { Resources string `yaml:"resources"` RICServiceAccountName string `yaml:"ric_serviceaccount_name"` StorageURI string `yaml:"storageUri"` + RuntimeVersion string `yaml:"runtimeVersion"` Image string `yaml:"image"` ResourceVersion string CanaryTrafficPercent int64 diff --git a/pkg/helm/chart_builder.go b/pkg/helm/chart_builder.go index 6aa5fec..7c163cb 100755 --- a/pkg/helm/chart_builder.go +++ b/pkg/helm/chart_builder.go @@ -296,6 +296,7 @@ func (c *ChartBuilder) appendConfigToValuesYaml() (err error) { data["engine"] = c.config.InferenceService.Engine data["storageUri"] = c.config.InferenceService.StorageURI + data["runtimeVersion"] = c.config.InferenceService.RuntimeVersion //data["resources"] = c.config. data["max_replicas"] = c.config.InferenceService.MaxReplicas diff --git a/pkg/helm/config.go b/pkg/helm/config.go index dc71fb9..9dbe5a4 100755 --- a/pkg/helm/config.go +++ b/pkg/helm/config.go @@ -29,9 +29,10 @@ type Config struct { } type InferenceService struct { - Engine string `json:"engine"` - StorageURI string `json:"storage_uri"` - ApiVersion string `json:"api_version"` - MinReplicas int32 `json:"min_replicas"` - MaxReplicas int32 `json:"max_replicas"` + Engine string `json:"engine"` + StorageURI string `json:"storage_uri"` + RuntimeVersion string `json:"runtime_version"` + ApiVersion string `json:"api_version"` + MinReplicas int32 `json:"min_replicas"` + MaxReplicas int32 `json:"max_replicas"` } diff --git a/pkg/helm/data/sample_config.json b/pkg/helm/data/sample_config.json index 00c8579..ed2f587 100755 --- a/pkg/helm/data/sample_config.json +++ b/pkg/helm/data/sample_config.json @@ -5,7 +5,8 @@ "sa_name": "default", "inferenceservice": { "engine": "tensorflow", - "storage_uri": "s3://mlpipeline/artifacts/sample-rl-pipeline-bbzh4/sample-rl-pipeline-bbzh4-949264085/sample-training-saved-model.tgz", + "storage_uri": "", + "runtime_version": "2.5.1", "api_version": "serving.kubeflow.org/v1beta1", "min_replicas": 1, "max_replicas": 1 diff --git a/pkg/helm/data/sample_schema.json b/pkg/helm/data/sample_schema.json index 04f3ca9..abce4ed 100755 --- a/pkg/helm/data/sample_schema.json +++ b/pkg/helm/data/sample_schema.json @@ -19,6 +19,7 @@ "required": [ "engine", "storage_uri", + "runtime_version", "api_version", "min_replicas", "max_replicas" @@ -42,6 +43,15 @@ "s3://mlpipeline/artifacts/sample-rl-pipeline-bbzh4/sample-rl-pipeline-bbzh4-949264085/sample-training-saved-model.tgz" ] }, + "runtime_version": { + "$id": "#/properties/inferenceservice/properties/runtime_version", + "type": "string", + "title": "The runtime version Schema", + "default": "", + "examples": [ + "2.5.1" + ] + }, "api_version": { "$id": "#/properties/inferenceservice/properties/api_version", "type": "string", @@ -75,4 +85,4 @@ } } - \ No newline at end of file + diff --git a/pkg/helm/schema.go b/pkg/helm/schema.go index 046374b..7f7a771 100755 --- a/pkg/helm/schema.go +++ b/pkg/helm/schema.go @@ -46,11 +46,12 @@ type InferenceServiceSchema struct { } type InferenceServiceProperty struct { - Engine StringProperty `json:"engine"` - StorageURI StringProperty `json:"storage_uri"` - ApiVersion StringProperty `json:"api_version"` - MinReplicas IntegerProperty `json:"min_replicas"` - MaxReplicas IntegerProperty `json:"max_replicas"` + Engine StringProperty `json:"engine"` + StorageURI StringProperty `json:"storage_uri"` + RuntimeVersion StringProperty `json:"runtime_version"` + ApiVersion StringProperty `json:"api_version"` + MinReplicas IntegerProperty `json:"min_replicas"` + MaxReplicas IntegerProperty `json:"max_replicas"` } type StringProperty struct {