automate lighty.io build process 43/82443/2
authorguillaume.lambert <guillaume.lambert@orange.com>
Fri, 7 Jun 2019 09:55:13 +0000 (11:55 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Fri, 7 Jun 2019 12:25:02 +0000 (14:25 +0200)
in the lighty folder
- create a patch file to remove deviations from ordm 4.1 network models:
    org-openroadm-otn-network-topology@2018-11-30.yang
    org-openroadm-network-topology@2018-11-30.yang
    org-openroadm-network@2018-11-30.yang
- script the lighty.io build process described in the README file
    - patch ordm 4.1 network models mentionned above
    - build transportPCE with karaf
    - download and build lighty-core 10.x.x
    - build transportPCE with lighty.io
    - comment out patch and lighty-core folder clean-up
- mention the script in the README file

JIRA: TRNSPRTPCE-126
Change-Id: I6bfedb2f9424304d4f86f8ede8bc49521c3cb185
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
lighty/README.md
lighty/build.sh [new file with mode: 0755]
lighty/patch_ordm41_deviations.diff [new file with mode: 0644]

index e1c5d47..5ecfd64 100644 (file)
@@ -44,6 +44,7 @@ unzip lighty-transportpce-10.0.1-SNAPSHOT-bin.zip
 cd lighty-transportpce-10.0.1-SNAPSHOT
 ./start-controller.sh
 ```
+* The whole build process described here and in the previous section can be performed automatically by launching the script build.sh from lighty folder.
 
 ## TransportPCE lighty.io - karaf comparison
 
diff --git a/lighty/build.sh b/lighty/build.sh
new file mode 100755 (executable)
index 0000000..86d2781
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+cd ..
+patch -p0 <lighty/patch_ordm41_deviations.diff
+mvn clean install -DskipTests
+#git checkout -- ordmodels/network/src/main/yang/org-openroadm-network-topology@2018-11-30.yang ordmodels/network/src/main/yang/org-openroadm-network@2018-11-30.yang ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2018-11-30.yang
+git clone https://github.com/PantheonTechnologies/lighty-core.git
+cd lighty-core
+git checkout 10.0.x
+mvn clean install -DskipTests
+cd ../lighty
+mvn clean install
+cd  target
+unzip lighty-transportpce-10.0.1-SNAPSHOT-bin.zip
+cd ..
+# rm -rf ../lighty-core
diff --git a/lighty/patch_ordm41_deviations.diff b/lighty/patch_ordm41_deviations.diff
new file mode 100644 (file)
index 0000000..1650677
--- /dev/null
@@ -0,0 +1,141 @@
+diff --git ordmodels/network/src/main/yang/org-openroadm-network-topology@2018-11-30.yang ordmodels/network/src/main/yang/org-openroadm-network-topology@2018-11-30.yang
+index 9928281..3ad3749 100644
+--- ordmodels/network/src/main/yang/org-openroadm-network-topology@2018-11-30.yang
++++ ordmodels/network/src/main/yang/org-openroadm-network-topology@2018-11-30.yang
+@@ -110,64 +110,6 @@ module org-openroadm-network-topology {
+       "Version 2.0";
+   }
+
+-  deviation "/nd:networks/nd:network/nd:node/cnet:node-type" {
+-    deviate add {
+-      must
+-        "(not /nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology) or
+-         (/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology and
+-         (../cnet:node-type = 'DEGREE' or ../cnet:node-type = 'SRG' or ../cnet:node-type = 'TPDR' or ../cnet:node-type = 'SWITCH' or
+-          ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI' or ../cnet:node-type = 'EXT-PLUGGABLE' or
+-          ../cnet:node-type = 'MUXPDR'))" {
+-        error-message "Invalid node type for openroadm-topology";
+-        description
+-          "The valid node types in the ROADM topology are 'SRG', 'DEGREE',
+-           'TPDR', 'SWITCH', 'REGEN', 'REGEN-UNI', 'EXT-PLUGGABLE' and 'MUXPDR'";
+-      }
+-    }
+-  }
+-  deviation "/nd:networks/nd:network/nd:node/nwt:termination-point/cnet:tp-type" {
+-    description
+-      "Defines which TP types can be instantiated on which Node types";
+-    deviate add {
+-      must
+-        "/nd:network/nd:node/cnet:node-type != 'DEGREE' or (../../cnet:node-type = 'DEGREE'  and
+-         (../cnet:tp-type = 'DEGREE-TX-TTP' or ../cnet:tp-type = 'DEGREE-RX-TTP' or  ../cnet:tp-type = 'DEGREE-TXRX-TTP' or
+-         ../cnet:tp-type = 'DEGREE-TX-CTP' or ../cnet:tp-type = 'DEGREE-RX-CTP' or ../cnet:tp-type = 'DEGREE-TXRX-CTP'))" {
+-        error-message "Invalid TP for node type 'DEGREE'";
+-      }
+-      must
+-        "/nd:network/nd:node/cnet:node-type != 'SRG' or (../../cnet:node-type = 'SRG' and
+-         (../cnet:tp-type = 'SRG-TX-CP' or ../cnet:tp-type = 'SRG-RX-CP' or ../cnet:tp-type = 'SRG-TXRX-CP' or
+-         ../cnet:tp-type = 'SRG-RX-PP' or ../cnet:tp-type = 'SRG-TX-PP' or ../cnet:tp-type = 'SRG-TXRX-PP'))" {
+-        error-message "Invalid TP for node type 'SRG'";
+-      }
+-      must
+-        " (/nd:network/nd:node/cnet:node-type != 'TPDR' and ../../cnet:node-type != 'MUXPDR' and ../../cnet:node-type != 'REGEN' and
+-         ../../cnet:node-type != 'REGEN-UNI' and ../../cnet:node-type != 'SWITCH')
+-         or ((../../cnet:node-type = 'TPDR' or ../../cnet:node-type = 'MUXPDR' or ../../cnet:node-type = 'REGEN' or
+-         ../../cnet:node-type = 'REGEN-UNI' or ../../cnet:node-type = 'SWITCH') and
+-         (../cnet:tp-type = 'XPONDER-NETWORK' or ../cnet:tp-type = 'XPONDER-CLIENT' or ../cnet:tp-type = 'XPONDER-PORT'))" {
+-        error-message "Invalid TP for node type 'XPONDER'";
+-      }
+-      must "/nd:network/nd:node/cnet:node-type != 'EXT-PLUGGABLE' or (../../cnet:node-type = 'EXT-PLUGGABLE' and ../cnet:tp-type = 'EXT-PLUGGABLE-TP')" {
+-        error-message "Invalid TP for node type 'EXT-PLUGGABLE'";
+-      }
+-    }
+-  }
+-  deviation "/nd:networks/nd:network/nwt:link/cnet:link-type" {
+-    deviate add {
+-      must
+-        "(not /nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology) or
+-         (/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology and
+-         (../cnet:link-type = 'ROADM-TO-ROADM' or ../cnet:link-type = 'ADD-LINK' or ../cnet:link-type = 'DROP-LINK' or
+-          ../cnet:link-type = 'EXPRESS-LINK' or ../cnet:link-type = 'XPONDER-INPUT' or ../cnet:link-type = 'XPONDER-OUTPUT'))" {
+-        error-message "Invalid link type for openroadm-topology";
+-        description
+-          "The valid link types in the ROADM topology are 'ROADM-TO-ROADM', 'ADD-LINK',
+-           'DROP-LINK', 'EXPRESS-LINK', 'XPONDER-INPUT', 'XPONDER-OUTPUT'";
+-      }
+-    }
+-  }
+   augment "/nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network" {
+     description
+       "Introduce new network type for the Open ROADM optical
+diff --git ordmodels/network/src/main/yang/org-openroadm-network@2018-11-30.yang ordmodels/network/src/main/yang/org-openroadm-network@2018-11-30.yang
+index a236b88..ce5a8d9 100644
+--- ordmodels/network/src/main/yang/org-openroadm-network@2018-11-30.yang
++++ ordmodels/network/src/main/yang/org-openroadm-network@2018-11-30.yang
+@@ -104,18 +104,6 @@ module org-openroadm-network {
+       "Version 1.2";
+   }
+
+-  deviation "/nd:networks/nd:network/nd:node/cnet:node-type" {
+-    deviate add {
+-      must
+-        "(not /nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-network) or
+-         (/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-network and
+-         (../cnet:node-type = 'ROADM' or ../cnet:node-type = 'XPONDER' or ../cnet:node-type = 'EXT-PLUGGABLE'))" {
+-        error-message "Invalid node type for openroadm-network";
+-        description
+-          "The valid node types in the ROADM network are XPONDER, EXT-PLUGGABLE and ROADM.";
+-      }
+-    }
+-  }
+   augment "/nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network" {
+     description
+       "Introduce new network type for the Open ROADM optical network";
+diff --git ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2018-11-30.yang ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2018-11-30.yang
+index 756f4df..fd2d1f1 100644
+--- ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2018-11-30.yang
++++ ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2018-11-30.yang
+@@ -90,44 +90,6 @@ module org-openroadm-otn-network-topology {
+       "Version 2.1";
+   }
+
+-  deviation "/nd:networks/nd:network/nd:node/cnet:node-type" {
+-    deviate add {
+-      must
+-        "(not /nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology) or
+-         (/nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology and
+-         (../cnet:node-type = 'SWITCH' or ../cnet:node-type = 'MUXPDR' or ../cnet:node-type = 'TPDR' or
+-          ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI'))" {
+-        error-message "Invalid node type for otn-topology";
+-        description
+-          "The type of a node in the OTN topology. Valid node types are 'MUXPDR', 'TPDR' and 'SWITCH'";
+-      }
+-    }
+-  }
+-  deviation "/nd:networks/nd:network/nd:node/nwt:termination-point/cnet:tp-type" {
+-    description
+-      "Defines which TP types can be instantiated on which Node types";
+-    deviate add {
+-      must
+-        "(/nd:network/nd:node/cnet:node-type != 'MUXPDR' and ../../cnet:node-type != 'SWITCH' and ../../cnet:node-type != 'TPDR'
+-         and ../cnet:node-type != 'REGEN' and ../cnet:node-type != 'REGEN-UNI') or
+-         ((../../cnet:node-type = 'MUXPDR' or ../../cnet:node-type = 'SWITCH' or ../../cnet:node-type = 'TPDR' or
+-         ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI') and
+-         (../cnet:tp-type = 'XPONDER-NETWORK' or ../cnet:tp-type = 'XPONDER-CLIENT' or ../cnet:tp-type = 'XPONDER-PORT'))" {
+-        error-message "Invalid TP for node type Xponder";
+-      }
+-    }
+-  }
+-  deviation "/nd:networks/nd:network/nwt:link/cnet:link-type" {
+-    deviate add {
+-      must
+-        "(not /nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology) or
+-         (/nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology and ../cnet:link-type = 'OTN-LINK')" {
+-        error-message "Invalid link type for otn-topology";
+-        description
+-          "The valid link type in the OTN topology is 'OTN-LINK'";
+-      }
+-    }
+-  }
+   augment "/nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network" {
+     description
+       "Introduce new network type for the Open ROADM OTN network topology";