rApp all package restructured 59/12759/1
authoraravind.est <aravindhan.a@est.tech>
Fri, 19 Apr 2024 16:29:42 +0000 (17:29 +0100)
committeraravind.est <aravindhan.a@est.tech>
Fri, 19 Apr 2024 16:29:42 +0000 (17:29 +0100)
Existing helm artifacts removed and new artifacts added
Test cases fixed

Issue-ID: NONRTRIC-981
Change-Id: I2ebfcd0e95dd2bba1aad53f8a777e509370b1d8f
Signed-off-by: aravind.est <aravindhan.a@est.tech>
16 files changed:
rapp-manager-models/src/test/java/com/oransc/rappmanager/models/csar/RappCsarConfigurationHandlerTest.java
rapp-manager-models/src/test/java/com/oransc/rappmanager/models/csar/validator/RappValidationHandlerTest.java
sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz [new file with mode: 0644]
sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/hello-world-sme-invoker-0.1.0.tgz [new file with mode: 0644]
sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/orufhrecovery-1.0.0.tgz [deleted file]
sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/ransliceassurance-1.0.0.tgz [deleted file]
sample-rapp-generator/rapp-all/Definitions/asd.yaml
sample-rapp-generator/rapp-all/Files/Acm/instances/all-instance.json
sample-rapp-generator/rapp-all/Files/Acm/instances/k8s-instance.json
sample-rapp-generator/rapp-all/Files/Sme/providers/provider-function-1.json
sample-rapp-generator/rapp-all/Files/Sme/providers/provider-function-2.json
sample-rapp-generator/rapp-all/Files/Sme/providers/provider-function-3.json
sample-rapp-generator/rapp-all/Files/Sme/serviceapis/api-set-1.json
sample-rapp-generator/rapp-all/Files/Sme/serviceapis/api-set-2.json
sample-rapp-generator/rapp-all/Files/Sme/serviceapis/api-set-3.json [new file with mode: 0644]
scripts/init/generate-test-rapp-packages/generatetestrapppackages.go

index f1d3044..7565859 100755 (executable)
@@ -97,8 +97,8 @@ class RappCsarConfigurationHandlerTest {
         assertEquals(jsonNode.get("compositionId").asText(), String.valueOf(compositionId));
         JsonNode overrideParamsNode = jsonNode.at("/elements").elements().next().at("/properties/chart/overrideParams");
         System.out.println(overrideParamsNode);
-        assertEquals(overrideParamsNode.get("appId").asText(), rappInstance.getRappInstanceId().toString());
-        assertEquals(overrideParamsNode.get("smeDiscoveryEndpoint").asText(),
+        assertEquals(overrideParamsNode.get("environment.appId").asText(), rappInstance.getRappInstanceId().toString());
+        assertEquals(overrideParamsNode.get("environment.smeDiscoveryEndpoint").asText(),
                 rappsEnvironmentConfiguration.getSmeDiscoveryEndpoint());
     }
 
@@ -106,7 +106,7 @@ class RappCsarConfigurationHandlerTest {
     void testFileListing() {
         File file = new File(validCsarFileLocation + validRappFile);
         Set<String> fileListFromCsar = rappCsarConfigurationHandler.getFileListFromCsar(file, "Files/Sme/serviceapis/");
-        assertThat(fileListFromCsar).hasSize(2);
+        assertThat(fileListFromCsar).hasSize(3);
     }
 
     @Test
@@ -142,7 +142,7 @@ class RappCsarConfigurationHandlerTest {
         assertNotNull(rappResources.getAcm().getCompositionDefinitions());
         assertThat(rappResources.getAcm().getCompositionInstances()).hasSize(4);
         assertThat(rappResources.getSme().getProviderFunctions()).hasSize(3);
-        assertThat(rappResources.getSme().getServiceApis()).hasSize(2);
+        assertThat(rappResources.getSme().getServiceApis()).hasSize(3);
         assertThat(rappResources.getSme().getInvokers()).hasSize(2);
         assertThat(rappResources.getDme().getProducerInfoTypes()).hasSize(2);
         assertThat(rappResources.getDme().getConsumerInfoTypes()).hasSize(2);
index ac61c3e..9487739 100755 (executable)
@@ -103,7 +103,7 @@ class RappValidationHandlerTest {
                 Arguments.of(multipartFileNoTosca, "rApp package missing a file TOSCA-Metadata/TOSCA.meta"),
                 Arguments.of(multipartFileNoAsdYaml, "rApp package missing a file Definitions/asd.yaml"),
                 Arguments.of(multipartFileMissingArtifact,
-                        "rApp package missing a file Artifacts/Deployment/HELM/orufhrecovery-1.0.0.tgz"),
+                        "rApp package missing a file Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz"),
                 Arguments.of(multipartFileNoComposition, errorMsgMissingAcmComposition));
     }
 
diff --git a/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz b/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz
new file mode 100644 (file)
index 0000000..8ab7441
Binary files /dev/null and b/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz differ
diff --git a/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/hello-world-sme-invoker-0.1.0.tgz b/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/hello-world-sme-invoker-0.1.0.tgz
new file mode 100644 (file)
index 0000000..2288946
Binary files /dev/null and b/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/hello-world-sme-invoker-0.1.0.tgz differ
diff --git a/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/orufhrecovery-1.0.0.tgz b/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/orufhrecovery-1.0.0.tgz
deleted file mode 100755 (executable)
index 4dc0b27..0000000
Binary files a/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/orufhrecovery-1.0.0.tgz and /dev/null differ
diff --git a/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/ransliceassurance-1.0.0.tgz b/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/ransliceassurance-1.0.0.tgz
deleted file mode 100755 (executable)
index 348e1a6..0000000
Binary files a/sample-rapp-generator/rapp-all/Artifacts/Deployment/HELM/ransliceassurance-1.0.0.tgz and /dev/null differ
index b53c6c7..486b038 100755 (executable)
@@ -20,17 +20,17 @@ topology_template:
         application_name: rapp-all\r
         application_version: 1.0\r
       artifacts:\r
-        ransliceassurance:\r
+        helloworld:\r
           type: tosca.artifacts.asd.deploymentItem\r
-          file: "Artifacts/Deployment/HELM/ransliceassurance-1.0.0.tgz"\r
+          file: "Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz"\r
           properties:\r
             artifact_type: "helm_chart"\r
             target_server: "chartmuseum"\r
             target_server_uri: "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI"\r
             item_id: 1\r
-        oru-app:\r
+        helloworld-sme-invoker:\r
           type: tosca.artifacts.asd.deploymentItem\r
-          file: "Artifacts/Deployment/HELM/orufhrecovery-1.0.0.tgz"\r
+          file: "Artifacts/Deployment/HELM/hello-world-sme-invoker-0.1.0.tgz"\r
           properties:\r
             artifact_type: "helm_chart"\r
             target_server: "chartmuseum"\r
index 2e5a18a..a654bff 100755 (executable)
         ]
       }
     },
-    "709c62b3-8918-41b9-a747-d21eb79c6c21": {
-      "id": "709c62b3-8918-41b9-a747-d21eb79c6c21",
+    "d7be552e-bcc5-4478-b64d-797dbaec8f55": {
+      "id": "d7be552e-bcc5-4478-b64d-797dbaec8f55",
       "definition": {
         "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
         "version": "1.2.3"
       },
-      "description": "Starter Automation Composition Element for the Demo",
+      "description": "Starter Automation Composition Element for the Hello World",
+      "properties": {
+        "chart": {
+          "chartId": {
+            "name": "hello-world-chart",
+            "version": "0.1.0"
+          },
+          "namespace": "nonrtric",
+          "releaseName": "hello-world-chart",
+          "podName": "hello-world-chart",
+          "repository": {
+            "repoName": "local",
+            "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
+          },
+          "overrideParams": {
+            "environment.appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
+            "environment.smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
+          }
+        }
+      }
+    },
+    "d7be552e-bdd5-2233-b64d-797dbaec8f55": {
+      "id": "d7be552e-bdd5-2233-b64d-797dbaec8f55",
+      "definition": {
+        "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
+        "version": "1.2.3"
+      },
+      "description": "Starter Automation Composition Element for the Hello World",
       "properties": {
         "chart": {
           "chartId": {
-            "name": "ransliceassurance",
-            "version": "1.0.0"
+            "name": "hello-world-sme-invoker",
+            "version": "0.1.0"
           },
           "namespace": "nonrtric",
-          "releaseName": "ransliceassurance",
-          "podName": "ransliceassurance",
+          "releaseName": "hello-world-sme-invoker",
+          "podName": "hello-world-sme-invoker",
           "repository": {
             "repoName": "local",
             "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
           },
           "overrideParams": {
-            "appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
-            "smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
+            "environment.appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
+            "environment.smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
           }
         }
       }
index a77ac5b..b42cc29 100755 (executable)
@@ -4,29 +4,56 @@
   "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID",
   "description": "Demo automation composition instance 0",
   "elements": {
-    "709c62b3-8918-41b9-a747-d21eb79c6c21": {
-      "id": "709c62b3-8918-41b9-a747-d21eb79c6c21",
+    "d7be552e-bcc5-4478-b64d-797dbaec8f55": {
+      "id": "d7be552e-bcc5-4478-b64d-797dbaec8f55",
       "definition": {
         "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
         "version": "1.2.3"
       },
-      "description": "Starter Automation Composition Element for the Demo",
+      "description": "Starter Automation Composition Element for the Hello World",
       "properties": {
         "chart": {
           "chartId": {
-            "name": "ransliceassurance",
-            "version": "1.0.0"
+            "name": "hello-world-chart",
+            "version": "0.1.0"
           },
           "namespace": "nonrtric",
-          "releaseName": "ransliceassurance",
-          "podName": "ransliceassurance",
+          "releaseName": "hello-world-chart",
+          "podName": "hello-world-chart",
           "repository": {
             "repoName": "local",
             "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
           },
           "overrideParams": {
-            "appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
-            "smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
+            "environment.appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
+            "environment.smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
+          }
+        }
+      }
+    },
+    "d7be552e-bdd5-2233-b64d-797dbaec8f55": {
+      "id": "d7be552e-bdd5-2233-b64d-797dbaec8f55",
+      "definition": {
+        "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
+        "version": "1.2.3"
+      },
+      "description": "Starter Automation Composition Element for the Hello World",
+      "properties": {
+        "chart": {
+          "chartId": {
+            "name": "hello-world-sme-invoker",
+            "version": "0.1.0"
+          },
+          "namespace": "nonrtric",
+          "releaseName": "hello-world-sme-invoker",
+          "podName": "hello-world-sme-invoker",
+          "repository": {
+            "repoName": "local",
+            "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
+          },
+          "overrideParams": {
+            "environment.appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
+            "environment.smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
           }
         }
       }
index 21afb1c..cdcf111 100755 (executable)
@@ -3,16 +3,16 @@
   "description": "Example A API of rApp",
   "aefProfiles": [
     {
-      "aefId": "rApp as AEF",
-      "description": "Example A rApp as AEF",
+      "aefId": "Hello World as AEF",
+      "description": "Simple Hello World API",
       "versions": [
         {
-          "apiVersion": "v1",
+          "apiVersion": "",
           "resources": [
             {
-              "resourceName": "exampleA",
+              "resourceName": "helloworld",
               "commType": "REQUEST_RESPONSE",
-              "uri": "/exampleA/subscription/subscription_id_1",
+              "uri": "/helloworld/v1",
               "operations": [
                 "GET"
               ]
         }
       ],
       "protocol": "HTTP_1_1",
-      "securityMethods": [
-        "PSK"
-      ],
       "interfaceDescriptions": [
         {
-          "ipv4Addr": "string",
-          "port": 65535,
-          "securityMethods": [
-            "PKI"
-          ]
-        },
-        {
-          "ipv4Addr": "string",
-          "port": 65535,
-          "securityMethods": [
-            "PKI"
-          ]
+          "ipv4Addr": "hello-world-chart-service.nonrtric.svc.cluster.local",
+          "port": 8080
         }
       ]
     }
index 8b377fe..34b00d3 100755 (executable)
@@ -3,41 +3,28 @@
   "description": "Example B API of rApp",
   "aefProfiles": [
     {
-      "aefId": "rApp as AEF",
-      "description": "Example B rApp as AEF",
+      "aefId": "sklearn-iris as AEF",
+      "description": "sklearn-iris API",
       "versions": [
         {
           "apiVersion": "v1",
           "resources": [
             {
-              "resourceName": "exampleA",
+              "resourceName": "sklearn",
               "commType": "REQUEST_RESPONSE",
-              "uri": "/exampleA/subscription/subscription_id_1",
+              "uri": "/models/sklearn-iris:predict",
               "operations": [
-                "GET"
+                "POST"
               ]
             }
           ]
         }
       ],
       "protocol": "HTTP_1_1",
-      "securityMethods": [
-        "PSK"
-      ],
       "interfaceDescriptions": [
         {
-          "ipv4Addr": "string",
-          "port": 65535,
-          "securityMethods": [
-            "PKI"
-          ]
-        },
-        {
-          "ipv4Addr": "string",
-          "port": 65535,
-          "securityMethods": [
-            "PKI"
-          ]
+          "ipv4Addr": "sklearn-iris-predictor-default.kserve-test.svc.cluster.local",
+          "port": 80
         }
       ]
     }
diff --git a/sample-rapp-generator/rapp-all/Files/Sme/serviceapis/api-set-3.json b/sample-rapp-generator/rapp-all/Files/Sme/serviceapis/api-set-3.json
new file mode 100644 (file)
index 0000000..dab491f
--- /dev/null
@@ -0,0 +1,32 @@
+{
+  "apiName": "Rapp API Set 3",
+  "description": "Example C API of rApp",
+  "aefProfiles": [
+    {
+      "aefId": "Hello World subpath as AEF",
+      "description": "Simple Hello World API for Subpath",
+      "versions": [
+        {
+          "apiVersion": "",
+          "resources": [
+            {
+              "resourceName": "helloworld",
+              "commType": "REQUEST_RESPONSE",
+              "uri": "/helloworld/v1/subpath1",
+              "operations": [
+                "GET"
+              ]
+            }
+          ]
+        }
+      ],
+      "protocol": "HTTP_1_1",
+      "interfaceDescriptions": [
+        {
+          "ipv4Addr": "hello-world-chart-service.nonrtric.svc.cluster.local",
+          "port": 8080
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file
index 462a4c2..f5bdd66 100755 (executable)
@@ -223,7 +223,7 @@ func main() {
        fmt.Println("Generating invalid rApp package without Artifacts...")
        INVALID_RAPP_PACKAGE_MISSING_ARTIFACT_FOLDER_NAME := "invalid-rapp-package-missing-artifact"
        cp.Copy(RAPP_BASE_PACKAGE, INVALID_RAPP_PACKAGE_MISSING_ARTIFACT_FOLDER_NAME)
-       os.Remove(INVALID_RAPP_PACKAGE_MISSING_ARTIFACT_FOLDER_NAME + "/Artifacts/Deployment/HELM/orufhrecovery-1.0.0.tgz")
+       os.Remove(INVALID_RAPP_PACKAGE_MISSING_ARTIFACT_FOLDER_NAME + "/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz")
        createCsarAndCopy(INVALID_RAPP_PACKAGE_MISSING_ARTIFACT_FOLDER_NAME, MODELS_TEST_RESOURCES, APPLICATION_TEST_RESOURCES)
 
        fmt.Println("Generating invalid rApp package with empty asd yaml...")