fix Lighty.io build 12/92812/9
authorguillaume.lambert <guillaume.lambert@orange.com>
Wed, 30 Sep 2020 14:52:25 +0000 (16:52 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Fri, 30 Oct 2020 12:14:55 +0000 (13:14 +0100)
- migrate to new lighty-core API
- migrate to new TPCE API
- fix java max heap sizes in start scripts

JIRA: TRNSPRTPCE-294
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Id8906afd05ba7bee6468992d2d255b5db4b621e3

lighty/pom.xml
lighty/src/main/assembly/resources/clean-start-controller.sh
lighty/src/main/assembly/resources/start-controller.sh
lighty/src/main/java/io/lighty/controllers/tpce/Main.java
lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java
lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java
lighty/src/test/java/io/lighty/controllers/tpce/MaintTest.java

index 184bf4d3c1ef769619039f3d99473ff6dfc93a1c..8ee8a1275341ed380a2efdae2f9186ac5779192c 100644 (file)
@@ -13,9 +13,8 @@
         <artifactId>lighty-app-parent</artifactId>
         <version>13.0.0</version>
         <!--
-        13.0.0 correspond to the master branch version on the official repo
-        that is advised for Aluminium.
-        At that date 08/2020, it seems not yet published on Nexus
+        lighty-core is usually released a few days before the official Opendaylight release.
+        13.0.0 = Aluminium release of 2020/09/18
         -->
         <relativePath />
     </parent>
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>net.jcip</groupId>
+            <artifactId>jcip-annotations</artifactId>
+            <version>1.0</version>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>com.github.spotbugs</groupId>
+            <artifactId>spotbugs-annotations</artifactId>
+            <version>3.1.3</version>
+            <optional>true</optional>
+        </dependency>
+
     </dependencies>
     <build>
         <finalName>tpce</finalName>
index e0866d9935661adbba155a198a8e6a9e3c8af1a0..07d6a2e916d5ce213f153add1ebbbad2e7e8c705 100755 (executable)
@@ -8,4 +8,4 @@ rm -rf cache
 rm -rf target
 
 #start controller
-java -ms128m -mx128m -XX:MaxMetaspaceSize=128m -jar tpce.jar
+java -ms128m -mx512m -XX:MaxMetaspaceSize=128m -jar tpce.jar
index d20baf4679f297aa5ff2d55260633d2abe1d1b35..e88e8365175e7be955efda5aadf4df55d893e596 100755 (executable)
@@ -5,4 +5,4 @@ BASEDIR=$(dirname "$0")
 cd ${BASEDIR}
 
 #start controller
-java -ms128m -mx128m -XX:MaxMetaspaceSize=128m -jar tpce.jar
+java -ms128m -mx512m -XX:MaxMetaspaceSize=128m -jar tpce.jar
index 7ad45575fb4e009a093299ea3f46dfb81b6e064a..9cba68c009e353678721847f44d3f422c18f1df0 100644 (file)
@@ -102,12 +102,11 @@ public class Main {
         lightyController.start().get();
 
         // 2. start RestConf server
-        CommunityRestConfBuilder communityRestConfBuilder = new CommunityRestConfBuilder();
         LightyServerBuilder jettyServerBuilder = new LightyServerBuilder(
                 new InetSocketAddress(restConfConfiguration.getInetAddress(), restConfConfiguration.getHttpPort()));
-        CommunityRestConf communityRestConf = communityRestConfBuilder.from(
-                RestConfConfigUtils.getRestConfConfiguration(restConfConfiguration, lightyController.getServices()))
-                .withLightyServer(jettyServerBuilder).build();
+        CommunityRestConfBuilder communityRestConfBuilder = CommunityRestConfBuilder.from(
+                RestConfConfigUtils.getRestConfConfiguration(restConfConfiguration, lightyController.getServices()));
+        CommunityRestConf communityRestConf = communityRestConfBuilder.withLightyServer(jettyServerBuilder).build();
         communityRestConf.start().get();
         communityRestConf.startServer();
 
@@ -115,7 +114,8 @@ public class Main {
         NetconfSBPlugin netconfSouthboundPlugin;
         netconfSBPConfiguration = NetconfConfigUtils.injectServicesToTopologyConfig(netconfSBPConfiguration,
                 lightyController.getServices());
-        NetconfTopologyPluginBuilder netconfSBPBuilder = new NetconfTopologyPluginBuilder();
+        NetconfTopologyPluginBuilder netconfSBPBuilder = new NetconfTopologyPluginBuilder(
+                lightyController.getServices(), netconfSBPConfiguration);
         netconfSouthboundPlugin = netconfSBPBuilder.from(netconfSBPConfiguration, lightyController.getServices())
                 .build();
         netconfSouthboundPlugin.start().get();
index 7555aad808aaf709ab5f69578b9208d7e2fb1899..eb40d203596f4b33d86be2a25448273b9e29bded 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl221;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
 import org.opendaylight.transportpce.common.fixedflex.FixedFlexImpl;
+import org.opendaylight.transportpce.common.fixedflex.FlexGridImpl;
 import org.opendaylight.transportpce.common.mapping.MappingUtils;
 import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
@@ -103,8 +104,11 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
         networkTransaction = new NetworkTransactionImpl(requestProcessor);
 
         LOG.info("Creating PCE beans ...");
-        PathComputationService pathComputationService = new PathComputationServiceImpl(networkTransaction,
-                lightyServices.getBindingNotificationPublishService());
+        PathComputationService pathComputationService = new PathComputationServiceImpl(
+                networkTransaction,
+                lightyServices.getBindingNotificationPublishService(),
+                lightyServices.getAdapterContext().currentSerializer()
+                );
         pceProvider = new PceProvider(lightyServices.getRpcProviderService(), pathComputationService);
 
         LOG.info("Creating network-model beans ...");
@@ -146,8 +150,8 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
 
         LOG.info("Creating service-handler beans ...");
         RendererServiceOperations rendererServiceOperations = new RendererServiceOperationsImpl(deviceRendererService,
-                olmPowerServiceRpc, lightyServices.getBindingDataBroker(), networkModelWavelengthService,
-                lightyServices.getBindingNotificationPublishService());
+                otnDeviceRendererService, olmPowerServiceRpc, lightyServices.getBindingDataBroker(),
+                networkModelWavelengthService, lightyServices.getBindingNotificationPublishService());
         servicehandlerProvider = new ServicehandlerProvider(lightyServices.getBindingDataBroker(),
                 lightyServices.getRpcProviderService(), lightyServices.getNotificationService(), pathComputationService,
                 rendererServiceOperations, networkModelWavelengthService,
@@ -235,8 +239,9 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
         DeviceRendererRPCImpl deviceRendererRPC = new DeviceRendererRPCImpl(deviceRendererService,
                 otnDeviceRendererService);
         RendererServiceOperationsImpl rendererServiceOperations = new RendererServiceOperationsImpl(
-                deviceRendererService, olmPowerServiceRpc, lightyServices.getBindingDataBroker(),
-                networkModelWavelengthService, lightyServices.getBindingNotificationPublishService());
+                deviceRendererService, otnDeviceRendererService, olmPowerServiceRpc,
+                lightyServices.getBindingDataBroker(), networkModelWavelengthService,
+                lightyServices.getBindingNotificationPublishService());
         return new RendererProvider(lightyServices.getRpcProviderService(), deviceRendererRPC,
                 rendererServiceOperations);
     }
@@ -253,7 +258,7 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
             OpenRoadmInterfaces openRoadmInterfaces, PortMapping portMapping) {
         OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping, openRoadmInterfaces);
         OpenRoadmInterface221 openRoadmInterface221 = new OpenRoadmInterface221(portMapping, openRoadmInterfaces,
-                new FixedFlexImpl());
+                new FixedFlexImpl(), new FlexGridImpl());
         OpenRoadmOtnInterface221 openRoadmOtnInterface221 = new OpenRoadmOtnInterface221(portMapping,
                 openRoadmInterfaces);
         return new OpenRoadmInterfaceFactory(mappingUtils, openRoadmInterface121, openRoadmInterface221,
@@ -301,4 +306,4 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
         CrossConnectImpl221 crossConnectImpl221 = new CrossConnectImpl221(deviceTransactionManager);
         return new CrossConnectImpl(deviceTransactionManager, mappingUtils, crossConnectImpl121, crossConnectImpl221);
     }
-}
\ No newline at end of file
+}
index d62a5c79245038ec80fd8d1e156e06aaa3e6a3fb..6760d4b42ecef024505403cd042a665786e87b66 100644 (file)
@@ -209,7 +209,7 @@ public final class TPCEUtils {
             org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev190103.$YangModuleInfoImpl.getInstance(),
             org.opendaylight.yang.gen.v1.gnpy.gnpy.eqpt.config.rev181119.$YangModuleInfoImpl.getInstance(),
             org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.$YangModuleInfoImpl.getInstance(),
-            org.opendaylight.yang.gen.v1.gnpy.path.rev200202.$YangModuleInfoImpl.getInstance(),
+            org.opendaylight.yang.gen.v1.gnpy.path.rev200909.$YangModuleInfoImpl.getInstance(),
             org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827
                     .$YangModuleInfoImpl.getInstance(),
             org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev200629
index bbeb8c263bd01c00bf1c0285715df4f4a48071f8..096c25d34a1bfad0b1dbc4800e7361f5d582b5eb 100644 (file)
@@ -11,7 +11,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 import java.io.File;
-
 import org.eclipse.jetty.client.HttpClient;
 import org.eclipse.jetty.client.api.ContentResponse;
 import org.junit.After;
@@ -62,4 +61,4 @@ public class MaintTest {
         ContentResponse response = client.GET("http://localhost:8888/restconfCustom/config/ietf-network:networks/network/openroadm-topology");
         assertEquals("Response code should be 200", 200, response.getStatus());
     }
-}
\ No newline at end of file
+}