Changes to add RuntimeVersion parameter 23/11323/1
authorjosephthaliath <jo.thaliath@samsung.com>
Mon, 12 Jun 2023 10:16:23 +0000 (15:46 +0530)
committerjosephthaliath <jo.thaliath@samsung.com>
Mon, 12 Jun 2023 10:17:41 +0000 (15:47 +0530)
Issue-Id: AIMLFW-31

Change-Id: Icc985b425d47b9a5a37c47831e9b326e11d424f0
Signed-off-by: josephthaliath <jo.thaliath@samsung.com>
pkg/client/kserve/utils.go
pkg/commons/types/values.go
pkg/helm/chart_builder.go
pkg/helm/config.go
pkg/helm/data/sample_config.json
pkg/helm/data/sample_schema.json
pkg/helm/schema.go

index b597ba8..0462be4 100644 (file)
@@ -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",
-                                               },
-                                       },
                                },
                        },
                }
index f27a5ad..1caa1a1 100644 (file)
@@ -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
index 6aa5fec..7c163cb 100755 (executable)
@@ -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
index dc71fb9..9dbe5a4 100755 (executable)
@@ -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"`
 }
index 00c8579..ed2f587 100755 (executable)
@@ -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": "<Model URL>",
+        "runtime_version": "2.5.1",
         "api_version": "serving.kubeflow.org/v1beta1",
         "min_replicas": 1,
         "max_replicas": 1
index 04f3ca9..abce4ed 100755 (executable)
@@ -19,6 +19,7 @@
         "required": [
           "engine",
           "storage_uri",
+          "runtime_version",
           "api_version",
           "min_replicas",
           "max_replicas"
                 "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
+  
index 046374b..7f7a771 100755 (executable)
@@ -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 {