-
Notifications
You must be signed in to change notification settings - Fork 81
Transform GNMI module to ODL karaf feature #2435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5122ebd to
53fde6b
Compare
710eedc to
ba5b31b
Compare
1762ddd to
9801f2d
Compare
ihrasko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disable maven-dependency plugin and make cleanups.
33839dc to
2d5fa35
Compare
...i/lighty-gnmi-commons/src/main/java/io/lighty/modules/gnmi/commons/util/models/ModuleId.java
Outdated
Show resolved
Hide resolved
| this.gnmiExecutorService, this.appModuleConfig.getGnmiConfiguration(), encryptionService, | ||
| this.customReactor); | ||
| startAndWaitLightyModule(this.gnmiSouthboundModule); | ||
| gnmiSouthboundModule.init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the next logical step would be to translate this module to OSGI and use @reference gnmiSouthboundModule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? RcGnmiAppModule starts lighty restconf and controller. When we want to start the feature we do it just by starting the gnmi plugin, not the entire lighty controller. Now its done the same way as for example OpenApi in ODL
...ighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/lightymodule/GnmiSouthboundModule.java
Show resolved
Hide resolved
...ighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/lightymodule/GnmiSouthboundModule.java
Outdated
Show resolved
Hide resolved
...ighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/lightymodule/GnmiSouthboundModule.java
Show resolved
Hide resolved
| .YangModuleInfoImpl.getInstance() | ||
| ); | ||
|
|
||
| public static final Set<YangModuleInfo> OPENCONFIG_YANG_MODELS = Set.of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: in follow-up patches we can use dependency on mdsal/ietf features
d3ed735 to
1381fca
Compare
5757572 to
b5575a0
Compare
|
How to use:
|
...lator/src/main/java/io/lighty/modules/gnmi/simulatordevice/utils/GnmiSimulatorConfUtils.java
Outdated
Show resolved
Hide resolved
...ighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/lightymodule/GnmiSouthboundModule.java
Show resolved
Hide resolved
...ighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/lightymodule/GnmiSouthboundModule.java
Outdated
Show resolved
Hide resolved
| .build(); | ||
| Boolean gnmiStartSuccessfully = gnmiSouthboundModule.start().get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); | ||
| assertTrue(gnmiStartSuccessfully); | ||
| gnmiSouthboundModule = new GnmiSouthboundModule(lightyController.getServices().getBindingDataBroker(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is parserFactory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.beust</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need? separate test deps
| <maven.install.skip>true</maven.install.skip> | ||
| </properties> | ||
|
|
||
| <modules> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <module>lighty-modules</module> | ||
| <module>lighty-resources</module> | ||
| <module>lighty-tests-report</module> | ||
| <module>bnd-parent</module> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably not needed as we will be using gnmi from ODL, from now build in karaf should do it all
| } | ||
| if (this.gnmiSouthboundModule != null) { | ||
| success &= gnmiSouthboundModule.shutdown(lightyModuleTimeout, DEFAULT_LIGHTY_MODULE_TIME_UNIT); | ||
| gnmiSouthboundModule.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about to update success result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is void
...hty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/schema/impl/SchemaContextHolderImpl.java
Show resolved
Hide resolved
...-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/codecs/TestSchemaContextProvider.java
Outdated
Show resolved
Hide resolved
| encryptionService, parserFactory, xpathParserFactory, null); | ||
| } | ||
|
|
||
| public GnmiSouthboundModule(DataBroker dataBroker, RpcProviderService rpcProviderService, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
GnmiSouthboundProvider expected to be provided a path to initial models from json configuration. Since we are no longer relying on json configuration, we need to provide them manually. Signed-off-by: tobias.pobocik <[email protected]>
Convert GnmiSouthboundModule as osgi component to allow it to run using karaf. Signed-off-by: tobias.pobocik <[email protected]>
We do not need this since GnmiSouthboundModule is now component Signed-off-by: tobias.pobocik <[email protected]>
The point of this rework is to not rely on other lighty modules to run gnmi. Let's rather use what is available from opendaylight instead. Signed-off-by: tobias.pobocik <[email protected]>
The point of this rework is to not rely on other lighty modules to run gnmi. Let's rather use what is available from opendaylight instead. Signed-off-by: tobias.pobocik <[email protected]>
Introduce features to run the gnmi feature. Signed-off-by: tobias.pobocik <[email protected]>
Introduce bnd-parent as a substitute to lighty-app-parent. We are no longer depending on lighty-core, so we need to create our own parent. Signed-off-by: tobias.pobocik <[email protected]>
Just like all other ODL components, introduce parent for gnmi. Signed-off-by: tobias.pobocik <[email protected]>
Convert the gnmi module to rely on the previously created bnd-parent instead of lighty parent. Signed-off-by: tobias.pobocik <[email protected]>
Lighty.io does not have modernizer-maven-plugin and modernizer-maven-plugin so its code was not made with it in mind. Signed-off-by: tobias.pobocik <[email protected]>
Gnmi module no longer requires json configuration to start. The json configuration is used only to configure rcgnmi app which starts gnmi. Move all the code needed for json configuration to rcgnmi utils instead of being in gnmi module since it needs lighty- core dependencies. Signed-off-by: tobias.pobocik <[email protected]>
Introduce gnmi-karaf Signed-off-by: tobias.pobocik <[email protected]>
Karaf does not support using impl injection Signed-off-by: tobias.pobocik <[email protected]>
Lighty.io uses versions which are not supported by karaf, exclude them Signed-off-by: tobias.pobocik <[email protected]>
Fix simulator to generate fat zip and all resources just like it did when it had lighty-app-parent. Signed-off-by: tobias.pobocik <[email protected]>
Implement changes made in GnmiSouthboundModule into tests. Signed-off-by: tobias.pobocik <[email protected]>
Refactored `GnmiSouthboundModule` to support initialization via dependency injection (OSGi) or manual configuration (Standalone/Test). This change was necessary mostly for tests which are not running using karaf and thus rely on json configuration. Signed-off-by: tobias.pobocik <[email protected]>
Since this module no longer depends on lighty-core and its dependency management, we need to specify the dependencies and versions of pekko we want to use. Signed-off-by: tobias.pobocik <[email protected]>
Modernize our code in lighty-gnmi-sb with: - use orElseThrow instead of get - use java.nio.Path instead of Paths Signed-off-by: Ivan Hrasko <[email protected]>
Modernize our code in lighty-gnmi-device-simulator with: - use orElseThrow instead of get - use java.nio.Path instead of Paths Signed-off-by: Ivan Hrasko <[email protected]>
Modernize our code in lighty-gnmi-test with: - use orElseThrow instead of get - use java.nio.Path instead of Paths Signed-off-by: Ivan Hrasko <[email protected]>
We do not need this file since the correct feature.xml is generated according to pom.xml. Signed-off-by: Ivan Hrasko <[email protected]>
We are going to be an ODL project, rename our feature accordingly with human readable name as well. Signed-off-by: Ivan Hrasko <[email protected]>
Do not skip dependency check, instead fix used/unused dependencies, order them alphabetically and applied test scope. Signed-off-by: Ivan Hrasko <[email protected]>
No description provided.