Kserve participant for simple rApp 17/12517/5
authorambrishest <ambrish.singh@est.tech>
Thu, 8 Feb 2024 10:45:49 +0000 (10:45 +0000)
committerJohn Keeney <john.keeney@est.tech>
Tue, 20 Feb 2024 10:43:59 +0000 (10:43 +0000)
Issue-ID: NONRTRIC-965
Change-Id: Ie054c934a5941cc07df5df62085885703f23e077
Signed-off-by: ambrishest <ambrish.singh@est.tech>
sample-rapp-generator/rapp-kserve/Definitions/asd.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-kserve/Definitions/asd_types.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-kserve/Files/Acm/definition/compositions.json [new file with mode: 0644]
sample-rapp-generator/rapp-kserve/Files/Acm/instances/kserve-instance.json [new file with mode: 0644]
sample-rapp-generator/rapp-kserve/Files/Sme/providers/provider-function-1.json [new file with mode: 0644]
sample-rapp-generator/rapp-kserve/Files/Sme/serviceapis/api-set-1.json [new file with mode: 0644]
sample-rapp-generator/rapp-kserve/TOSCA-Metadata/TOSCA.meta [new file with mode: 0644]
sample-rapp-generator/rapp-kserve/asd.mf [new file with mode: 0644]

diff --git a/sample-rapp-generator/rapp-kserve/Definitions/asd.yaml b/sample-rapp-generator/rapp-kserve/Definitions/asd.yaml
new file mode 100644 (file)
index 0000000..e2aeffb
--- /dev/null
@@ -0,0 +1,39 @@
+#  ============LICENSE_START=======================================================\r
+#  Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.\r
+#  ================================================================================\r
+#  Licensed under the Apache License, Version 2.0 (the "License");\r
+#  you may not use this file except in compliance with the License.\r
+#  You may obtain a copy of the License at\r
+#\r
+#        http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+#  Unless required by applicable law or agreed to in writing, software\r
+#  distributed under the License is distributed on an "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+#  See the License for the specific language governing permissions and\r
+#  limitations under the License.\r
+#\r
+#  SPDX-License-Identifier: Apache-2.0\r
+#  ============LICENSE_END=========================================================\r
+\r
+tosca_definitions_version: tosca_simple_yaml_1_2\r
+\r
+description: rApp Kserve\r
+\r
+imports:\r
+  - asd_types.yaml\r
+\r
+topology_template:\r
+  node_templates:\r
+    applicationServiceDescriptor:\r
+      type: tosca.nodes.asd\r
+      description: "rapp-kserve"\r
+      properties:\r
+        descriptor_id: 0fd5d1a0-805b-4b05-9e9a-bb150990fe2f\r
+        descriptor_invariant_id: 1a2e99e1-3f57-4a7c-8b85-3a9c991d2c0e\r
+        descriptor_version: 1.0\r
+        schema_version: 2.0\r
+        function_description: rApp description\r
+        provider: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
+        application_name: rapp-kserve\r
+        application_version: 1.0\r
diff --git a/sample-rapp-generator/rapp-kserve/Definitions/asd_types.yaml b/sample-rapp-generator/rapp-kserve/Definitions/asd_types.yaml
new file mode 100644 (file)
index 0000000..237ccfd
--- /dev/null
@@ -0,0 +1,79 @@
+#  ============LICENSE_START=======================================================\r
+#  Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.\r
+#  ================================================================================\r
+#  Licensed under the Apache License, Version 2.0 (the "License");\r
+#  you may not use this file except in compliance with the License.\r
+#  You may obtain a copy of the License at\r
+#\r
+#        http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+#  Unless required by applicable law or agreed to in writing, software\r
+#  distributed under the License is distributed on an "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+#  See the License for the specific language governing permissions and\r
+#  limitations under the License.\r
+#\r
+#  SPDX-License-Identifier: Apache-2.0\r
+#  ============LICENSE_END=========================================================\r
+\r
+tosca_definitions_version: tosca_simple_yaml_1_2\r
+description: ASD types definitions version 0.1\r
+node_types:\r
+  tosca.nodes.asd:\r
+    derived_from: tosca.nodes.Root\r
+    description: "The ASD node type"\r
+    version: 0.1\r
+    properties:\r
+      descriptor_id:\r
+        type: string # UUID\r
+        required: true\r
+        description: Identifier of this ASD. It is in UUID format as specified in RFC 4122\r
+      descriptor_invariant_id:\r
+        type: string # UUID\r
+        required: true\r
+        description: >\r
+          Identifier of this descriptor in a version independent manner. This attribute\r
+          is invariant across versions of ASD. It is in UUID format as specified in RFC 4122\r
+      descriptor_version:\r
+        type: string\r
+        required: true\r
+        description: Identifies the version of the ASD.\r
+      schema_version:\r
+        type: string\r
+        required: true\r
+        description: Identifies the Identifies the version of this ASD’s schema.\r
+      function_description:\r
+        type: string\r
+        required: false\r
+        description: Description of the application service described by this ASD.\r
+      provider:\r
+        type: string\r
+        required: true\r
+        description: Identifies the provider of the ASD.\r
+      application_name:\r
+        type: string\r
+        required: true\r
+        description: Name to identify the application service described by this ASD\r
+      application_version:\r
+        type: string\r
+        required: true\r
+        description: Identifies the version of the application service described by this ASD.\r
+\r
+artifact_types:\r
+tosca.artifacts.asd.deploymentItem:\r
+  version: 0.1\r
+  derived_from: tosca.artifacts.Root\r
+  description: "Describes the artifact type of asd deployment item"\r
+  file: "Relative path of the artifact in the package"\r
+  properties:\r
+    item_id:\r
+      description: "The identifier of this asd deployment item"\r
+      required: true\r
+      type: string\r
+    artifact_type:\r
+      description: >\r
+        Specify artifact type.\r
+      required: true\r
+      type: string\r
+      constraints:\r
+        - valid_values: ["helm_chart"]\r
diff --git a/sample-rapp-generator/rapp-kserve/Files/Acm/definition/compositions.json b/sample-rapp-generator/rapp-kserve/Files/Acm/definition/compositions.json
new file mode 100644 (file)
index 0000000..377cd71
--- /dev/null
@@ -0,0 +1,201 @@
+{\r
+  "tosca_definitions_version": "tosca_simple_yaml_1_3",\r
+  "data_types": {\r
+    "onap.datatypes.ToscaConceptIdentifier": {\r
+      "derived_from": "tosca.datatypes.Root",\r
+      "properties": {\r
+        "name": {\r
+          "type": "string",\r
+          "required": true\r
+        },\r
+        "version": {\r
+          "type": "string",\r
+          "required": true\r
+        }\r
+      }\r
+    },\r
+    "org.onap.datatypes.policy.clamp.acm.kserveAutomationCompositionElement.KserveInferenceEntity": {\r
+      "version": "1.0.0",\r
+      "derived_from": "tosca.datatypes.Root",\r
+      "properties": {\r
+        "kserveEntityId": {\r
+          "type": "onap.datatypes.ToscaConceptIdentifier",\r
+          "required": true,\r
+          "description": "The name and version of a Configuration Entity to be handled by the Kserve Automation Composition Element"\r
+        },\r
+        "name": {\r
+          "type": "string",\r
+          "required": true,\r
+          "description": "Inference service name to be created"\r
+        },\r
+        "payload": {\r
+          "type": "string",\r
+          "required": true,\r
+          "description": "Inference Service payload"\r
+        }\r
+      }\r
+    }\r
+  },\r
+  "node_types": {\r
+    "org.onap.policy.clamp.acm.Participant": {\r
+      "version": "1.0.1",\r
+      "derived_from": "tosca.nodetypes.Root",\r
+      "properties": {\r
+        "provider": {\r
+          "type": "string",\r
+          "required": false\r
+        }\r
+      }\r
+    },\r
+    "org.onap.policy.clamp.acm.AutomationCompositionElement": {\r
+      "version": "1.0.1",\r
+      "derived_from": "tosca.nodetypes.Root",\r
+      "properties": {\r
+        "provider": {\r
+          "type": "string",\r
+          "required": false\r
+        },\r
+        "participantType": {\r
+          "type": "onap.datatypes.ToscaConceptIdentifier",\r
+          "required": true\r
+        },\r
+        "startPhase": {\r
+          "type": "integer",\r
+          "required": false,\r
+          "constraints": [\r
+            {\r
+              "greater-or-equal": 0\r
+            }\r
+          ],\r
+          "metadata": {\r
+            "common": true\r
+          },\r
+          "description": "A value indicating the start phase in which this automation composition element will be started, the first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously"\r
+        },\r
+        "passiveToRunningTimeout": {\r
+          "type": "integer",\r
+          "required": false,\r
+          "constraints": [\r
+            {\r
+              "greater_or_equal": 0\r
+            }\r
+          ],\r
+          "default": 60,\r
+          "metadata": {\r
+            "common": true\r
+          },\r
+          "description": "The maximum time in seconds to wait for a state chage from passive to running"\r
+        },\r
+        "runningToPassiveTimeout": {\r
+          "type": "integer",\r
+          "required": false,\r
+          "constraints": [\r
+            {\r
+              "greater_or_equal": 0\r
+            }\r
+          ],\r
+          "default": 60,\r
+          "metadata": {\r
+            "common": true\r
+          },\r
+          "description": "The maximum time in seconds to wait for a state chage from running to passive"\r
+        },\r
+        "passiveToUninitializedTimeout": {\r
+          "type": "integer",\r
+          "required": false,\r
+          "constraints": [\r
+            {\r
+              "greater_or_equal": 0\r
+            }\r
+          ],\r
+          "default": 60,\r
+          "metadata": {\r
+            "common": true\r
+          },\r
+          "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized"\r
+        }\r
+      }\r
+    },\r
+    "org.onap.policy.clamp.acm.AutomationComposition": {\r
+      "version": "1.0.1",\r
+      "derived_from": "tosca.nodetypes.Root",\r
+      "properties": {\r
+        "provider": {\r
+          "type": "string",\r
+          "required": false,\r
+          "metadata": {\r
+            "common": true\r
+          }\r
+        },\r
+        "elements": {\r
+          "type": "list",\r
+          "required": true,\r
+          "metadata": {\r
+            "common": true\r
+          },\r
+          "entry_schema": {\r
+            "type": "onap.datatypes.ToscaConceptIdentifier"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "org.onap.policy.clamp.acm.KserveAutomationCompositionElement": {\r
+      "version": "1.0.1",\r
+      "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",\r
+      "properties": {\r
+        "kserveInferenceEntities": {\r
+          "type": "list",\r
+          "required": true,\r
+          "entry_schema": {\r
+            "type": "org.onap.datatypes.policy.clamp.acm.kserveAutomationCompositionElement.KserveInferenceEntity",\r
+            "type_version": "1.0.0"\r
+          },\r
+          "description": "The configuration entities of Kserve inference service"\r
+        }\r
+      }\r
+    }\r
+  },\r
+  "topology_template": {\r
+    "node_templates": {\r
+      "org.onap.policy.clamp.acm.KserveParticipant": {\r
+        "version": "2.3.4",\r
+        "type": "org.onap.policy.clamp.acm.Participant",\r
+        "type_version": "1.0.1",\r
+        "description": "Participant for Kserve requests",\r
+        "properties": {\r
+          "provider": "ONAP"\r
+        }\r
+      },\r
+      "onap.policy.clamp.ac.element.KserveAutomationCompositionElement": {\r
+        "version": "1.2.3",\r
+        "type": "org.onap.policy.clamp.acm.KserveAutomationCompositionElement",\r
+        "type_version": "1.0.1",\r
+        "description": "Automation composition element for the Kserve Requests",\r
+        "properties": {\r
+          "provider": "ONAP",\r
+          "participantType": {\r
+            "name": "org.onap.policy.clamp.acm.KserveParticipant",\r
+            "version": "2.3.4"\r
+          },\r
+          "uninitializedToPassiveTimeout": 300,\r
+          "statusCheckInterval": 30\r
+        }\r
+      },\r
+      "onap.policy.clamp.ac.element.AutomationCompositionDefinition": {\r
+        "version": "1.2.3",\r
+        "type": "org.onap.policy.clamp.acm.AutomationComposition",\r
+        "type_version": "1.0.1",\r
+        "description": "Automation composition for rapp deployment",\r
+        "properties": {\r
+          "provider": "ONAP",\r
+          "elements": [\r
+            {\r
+              "name": "onap.policy.clamp.ac.element.KserveAutomationCompositionElement",\r
+              "version": "1.2.3"\r
+            }\r
+          ]\r
+        }\r
+      }\r
+    }\r
+  }\r
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-kserve/Files/Acm/instances/kserve-instance.json b/sample-rapp-generator/rapp-kserve/Files/Acm/instances/kserve-instance.json
new file mode 100644 (file)
index 0000000..09a5759
--- /dev/null
@@ -0,0 +1,29 @@
+{\r
+  "name": "DemoKserveInstance0",\r
+  "version": "1.0.1",\r
+  "compositionId": "COMPOSITIONID",\r
+  "description": "Demo automation composition instance 0",\r
+  "elements": {\r
+    "709c62b3-8918-41b9-a747-d21eb79c6c20": {\r
+      "id": "709c62b3-8918-41b9-a747-d21eb79c6c20",\r
+      "definition": {\r
+        "name": "onap.policy.clamp.ac.element.KserveAutomationCompositionElement",\r
+        "version": "1.2.3"\r
+      },\r
+      "description": "Starter Automation Composition Element for the Demo",\r
+      "properties": {\r
+        "kserveInferenceEntities": [\r
+          {\r
+            "kserveInferenceEntityId": {\r
+              "name": "entity1",\r
+              "version": "1.0.1"\r
+            },\r
+            "name": "sklearn-iris",\r
+            "namespace": "kserve-test",\r
+            "payload": "{\"apiVersion\": \"serving.kserve.io/v1beta1\",\"kind\": \"InferenceService\",\"metadata\": {\"name\": \"sklearn-iris\"},\"spec\": {\"predictor\": {\"model\":{\"modelFormat\": {\"name\": \"sklearn\"},\"storageUri\": \"gs://kfserving-examples/models/sklearn/1.0/model\"}}}}"\r
+          }\r
+        ]\r
+      }\r
+    }\r
+  }\r
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-kserve/Files/Sme/providers/provider-function-1.json b/sample-rapp-generator/rapp-kserve/Files/Sme/providers/provider-function-1.json
new file mode 100644 (file)
index 0000000..875a30d
--- /dev/null
@@ -0,0 +1,20 @@
+{\r
+  "apiProvDomInfo": "Provider domain",\r
+  "apiProvFuncs": [\r
+    {\r
+      "apiProvFuncInfo": "sklearn-iris as APF",\r
+      "apiProvFuncRole": "APF",\r
+      "regInfo": {\r
+        "apiProvPubKey": "NOT USED here"\r
+      }\r
+    },\r
+    {\r
+      "apiProvFuncInfo": "sklearn-iris as AEF",\r
+      "apiProvFuncRole": "AEF",\r
+      "regInfo": {\r
+        "apiProvPubKey": "NOT USED here"\r
+      }\r
+    }\r
+  ],\r
+  "regSec": "plain"\r
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-kserve/Files/Sme/serviceapis/api-set-1.json b/sample-rapp-generator/rapp-kserve/Files/Sme/serviceapis/api-set-1.json
new file mode 100644 (file)
index 0000000..5137b82
--- /dev/null
@@ -0,0 +1,32 @@
+{\r
+  "apiName": "sklearn-iris API Set",\r
+  "description": "sklearn-iris API",\r
+  "aefProfiles": [\r
+    {\r
+      "aefId": "sklearn-iris as AEF",\r
+      "description": "sklearn-iris API",\r
+      "versions": [\r
+        {\r
+          "apiVersion": "v1",\r
+          "resources": [\r
+            {\r
+              "resourceName": "sklearn",\r
+              "commType": "REQUEST_RESPONSE",\r
+              "uri": "v1/models/sklearn-iris:predict",\r
+              "operations": [\r
+                "POST"\r
+              ]\r
+            }\r
+          ]\r
+        }\r
+      ],\r
+      "protocol": "HTTP_1_1",\r
+      "interfaceDescriptions": [\r
+        {\r
+          "ipv4Addr": "sklearn-iris-predictor-default.kserve-test.svc.cluster.local",\r
+          "port": 80\r
+        }\r
+      ]\r
+    }\r
+  ]\r
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-kserve/TOSCA-Metadata/TOSCA.meta b/sample-rapp-generator/rapp-kserve/TOSCA-Metadata/TOSCA.meta
new file mode 100644 (file)
index 0000000..3da5f0d
--- /dev/null
@@ -0,0 +1,5 @@
+TOSCA-Meta-File-Version: 1.0\r
+CSAR-Version: 1.0\r
+Created-By: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
+Entry-Definitions: Definitions/asd.yaml\r
+ETSI-Entry-Manifest: asd.mf
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-kserve/asd.mf b/sample-rapp-generator/rapp-kserve/asd.mf
new file mode 100644 (file)
index 0000000..ce4b6b4
--- /dev/null
@@ -0,0 +1,14 @@
+metadata:\r
+  application_name: rapp-kserve\r
+  application_provider: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
+  release_date_time: 2024-02-12T11:30:00+00:00\r
+  entry_definition_type: asd\r
+\r
+Source: asd.mf\r
+Source: Definitions/asd.yaml\r
+Source: Definitions/asd_types.yaml\r
+Source: TOSCA-Metadata/TOSCA.meta\r
+Source: Files/Acm/definition/compositions.json\r
+Source: Files/Acm/instances/kserve-instance.json\r
+Source: Files/Sme/provider/provider-function-1.json\r
+Source: Files/Sme/serviceapis/api-set-1.json\r