vFW CNF CDS scripts update for native Helm support 48/114648/2
authorLukasz Rajewski <lukasz.rajewski@orange.com>
Thu, 5 Nov 2020 21:55:13 +0000 (22:55 +0100)
committerMorgan Richomme <morgan.richomme@orange.com>
Mon, 9 Nov 2020 08:11:05 +0000 (08:11 +0000)
vFW CNF CDS scripts update for native Helm support

Change-Id: I34a1cc8dfb18e512edb6e2786984b683c34815e6
Issue-ID: INT-1658
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
14 files changed:
heat/vFW_CNF_CDS/README.txt
heat/vFW_CNF_CDS/templates/Makefile
heat/vFW_CNF_CDS/templates/base_dummy/MANIFEST.json [moved from heat/vFW_CNF_CDS/templates/base/MANIFEST.json with 100% similarity]
heat/vFW_CNF_CDS/templates/base_dummy/base_template.env [moved from heat/vFW_CNF_CDS/templates/base/base_template.env with 100% similarity]
heat/vFW_CNF_CDS/templates/base_dummy/base_template.yaml [moved from heat/vFW_CNF_CDS/templates/base/base_template.yaml with 100% similarity]
heat/vFW_CNF_CDS/templates/base_dummy/vfw.env [moved from heat/vFW_CNF_CDS/templates/base/vfw.env with 100% similarity]
heat/vFW_CNF_CDS/templates/base_dummy/vfw.yaml [moved from heat/vFW_CNF_CDS/templates/base/vfw.yaml with 100% similarity]
heat/vFW_CNF_CDS/templates/base_dummy/vpkg.env [moved from heat/vFW_CNF_CDS/templates/base/vpkg.env with 100% similarity]
heat/vFW_CNF_CDS/templates/base_dummy/vpkg.yaml [moved from heat/vFW_CNF_CDS/templates/base/vpkg.yaml with 100% similarity]
heat/vFW_CNF_CDS/templates/base_dummy/vsn.env [moved from heat/vFW_CNF_CDS/templates/base/vsn.env with 100% similarity]
heat/vFW_CNF_CDS/templates/base_dummy/vsn.yaml [moved from heat/vFW_CNF_CDS/templates/base/vsn.yaml with 100% similarity]
heat/vFW_CNF_CDS/templates/base_native/MANIFEST.json [new file with mode: 0644]
heat/vFW_CNF_CDS/templates/cba/Definitions/vFW_CNF_CDS.json
heat/vFW_CNF_CDS/templates/helm/Makefile

index 46a49e0..651d959 100644 (file)
@@ -1,7 +1,12 @@
 Demo directory structure:
 
-/templates/     #Base directory containing vFW resources
-    |- /base    #Directory containing base payload of CSAR package, doesn't need further proceeding
-    |- /helm    #Directory containing helm charts that need to be packaged and attached to csar package
-    \- /cba     #Directory containing CBA content to be included to csar package
-/examples/      #Directory with context-specific overrides over general resources
+/templates/           #Base directory containing vFW resources
+    |- /base_dummy    #Directory containing base payload of VSP package in OpenStack VSP format, doesn't need further proceeding
+    |- /base_native   #Directory containing base payload of VSP package in Helm VSP, doesn't need further proceeding
+    |- /helm          #Directory containing helm charts that need to be packaged and attached to VSP package
+    \- /cba           #Directory containing CBA content to be included to csar package. It is prepared for 
+/examples/            #Directory with context-specific overrides over general resources
+
+Note: Scripts  generate two VSP packages, one in Frankfurt format with helm associated with dummy heat templates and second
+with native Helm VSP format where helm packages are standalone. CBA folder contains CBA Definition for native VSP format but 
+make is coverting the definition into Frankfurt format for Frankfurt VSP. Frankfurt VSP is still supported in Guilin. 
index 38a4b38..7ca4ac0 100644 (file)
@@ -1,5 +1,6 @@
 .PHONY: all clean helm base cba clean_all
-ONBOARDING_PACKAGE_NAME ?= vfw_k8s_demo
+DUMMY_ONBOARDING_PACKAGE_NAME ?= vfw_k8s_demo
+NATIVE_ONBOARDING_PACKAGE_NAME ?= native_vfw_k8s_demo
 CBA_NAME ?= CBA
 
 clean_all:
@@ -8,23 +9,35 @@ clean_all:
 
 #Can't use .csar extension or SDC will panic
 all: package/ helm base cba
-       cd package/ && zip -r $(ONBOARDING_PACKAGE_NAME).zip .
-       mv package/$(ONBOARDING_PACKAGE_NAME).zip .
+       cd package_dummy/ && zip -r $(DUMMY_ONBOARDING_PACKAGE_NAME).zip .
+       cd package_native/ && zip -r $(NATIVE_ONBOARDING_PACKAGE_NAME).zip .
+       mv package_dummy/$(DUMMY_ONBOARDING_PACKAGE_NAME).zip .
+       mv package_native/$(NATIVE_ONBOARDING_PACKAGE_NAME).zip .
 
 helm: package/
        make -C helm
-       mv helm/*.tgz package/
+       mv helm/helm_*.tgz package_native/
+       mv helm/*.tgz package_dummy/
 
 base: package/
-       cp base/* package/
+       cp base_dummy/* package_dummy/
+       cp base_native/* package_native/
 
 cba: package/
+       cp -r cba cba_dummy
+       sed -i 's/"helm_/"/g' cba_dummy/Definitions/vFW_CNF_CDS.json
+       cd cba_dummy/ && zip -r $(CBA_NAME).zip . -x pom.xml .idea/\* target/\*
        cd cba/ && zip -r $(CBA_NAME).zip . -x pom.xml .idea/\* target/\*
-       mv cba/$(CBA_NAME).zip package/
+       mv cba/$(CBA_NAME).zip package_native/
+       mv cba_dummy/$(CBA_NAME).zip package_dummy/
 
 package/:
-       mkdir package/
+       mkdir package_dummy/
+       mkdir package_native/
 
 clean:
-       rm -rf package/
-       rm -f $(ONBOARDING_PACKAGE_NAME).zip
+       rm -rf package_dummy/
+       rm -rf package_native/
+       rm -rf cba_dummy
+       rm -f $(DUMMY_ONBOARDING_PACKAGE_NAME).zip
+       rm -f $(NATIVE_ONBOARDING_PACKAGE_NAME).zip
diff --git a/heat/vFW_CNF_CDS/templates/base_native/MANIFEST.json b/heat/vFW_CNF_CDS/templates/base_native/MANIFEST.json
new file mode 100644 (file)
index 0000000..3830c9f
--- /dev/null
@@ -0,0 +1,30 @@
+{
+    "name": "virtualFirewall",
+    "description": "",
+    "data": [
+        {
+            "file": "CBA.zip",
+            "type": "CONTROLLER_BLUEPRINT_ARCHIVE"
+        },
+        {
+            "file": "helm_base_template.tgz",
+            "type": "HELM",
+            "isBase": "true"
+        },
+        {
+            "file": "helm_vfw.tgz",
+            "type": "HELM",
+            "isBase": "false"
+        },
+        {
+            "file": "helm_vpkg.tgz",
+            "type": "HELM",
+            "isBase": "false"
+        },
+        {
+            "file": "helm_vsn.tgz",
+            "type": "HELM",
+            "isBase": "false"
+        }
+    ]
+}
index 3fa4e87..60846f6 100644 (file)
                     }
                 },
                 "artifacts": {
-                    "base_template-template": {
+                    "helm_base_template-template": {
                         "type": "artifact-template-velocity",
                         "file": "Templates/base_template-template.vtl"
                     },
-                    "base_template-mapping": {
+                    "helm_base_template-mapping": {
                         "type": "artifact-mapping-resource",
                         "file": "Templates/base_template-mapping.json"
                     },
-                    "vpkg-template": {
+                    "helm_vpkg-template": {
                         "type": "artifact-template-velocity",
                         "file": "Templates/vpkg-template.vtl"
                     },
-                    "vpkg-mapping": {
+                    "helm_vpkg-mapping": {
                         "type": "artifact-mapping-resource",
                         "file": "Templates/vpkg-mapping.json"
                     },
-                    "vfw-template": {
+                    "helm_vfw-template": {
                         "type": "artifact-template-velocity",
                         "file": "Templates/vfw-template.vtl"
                     },
-                    "vfw-mapping": {
+                    "helm_vfw-mapping": {
                         "type": "artifact-mapping-resource",
                         "file": "Templates/vfw-mapping.json"
                     },
                         "type": "artifact-mapping-resource",
                         "file": "Templates/vnf-mapping.json"
                     },
-                    "vsn-template": {
+                    "helm_vsn-template": {
                         "type": "artifact-template-velocity",
                         "file": "Templates/vsn-template.vtl"
                     },
-                    "vsn-mapping": {
+                    "helm_vsn-mapping": {
                         "type": "artifact-mapping-resource",
                         "file": "Templates/vsn-mapping.json"
                     }
index feb9208..fa0aad6 100644 (file)
@@ -6,11 +6,13 @@ build: $(vf-modules:=-build)
 clean: $(vf-modules:=-clean)
 
 $(vf-modules:=-package): %-package: %-build
-       mv $(@:package=)*.tgz $(@:-package=)_cloudtech_k8s_charts.tgz
+       mv $(@:package=)*.tgz helm_$(@:-package=).tgz
+       cp helm_$(@:-package=).tgz $(@:-package=)_cloudtech_k8s_charts.tgz
 
 $(vf-modules:=-build): %-build: %-clean
        helm package $(@:-build=)
 
 $(vf-modules:=-clean):
        rm -f $(@:-clean=)-*.tgz
+       rm -f helm_$(@:-clean=).tgz
        rm -f $(@:-clean=)_cloudtech_k8s_charts.tgz