Adapt feat-gnmi to main#2630
Open
Tobianas wants to merge 16 commits into
Open
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the gNMI integration by migrating models to OpenDaylight namespaces and updating the lighty-gnmi module. Key changes include updates to Helm templates, POM dependencies, and the implementation of a new mechanism in RcGnmiAppModuleConfigUtils to load YANG modules from the classpath. Feedback points out a performance issue in the getModelsFromClasspath method, where nested iterations over the ServiceLoader lead to O(N*M) complexity, and suggests a more efficient map-based lookup approach.
b0a936c to
278903e
Compare
Everything from this module is now redundant, since its possible to get it from ODL-gnmi repository as a dependency. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
There is no need for aggregator, since all gNMI now needs is inside one module. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Just like with other lighty.io modules, rename this class to match lighty.io code-style. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Use imports and dependencies from odl gnmi repository since most of lighty.io gnmi code was removed. Also remove unused dependencies from pom.xml. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
These models were moved to ODL and thus renamed. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
GnmiConfigUtils got reworked and no longer provide configuration from JSON file, because karaf does not need JSON configuration. This patch extract everything necessary into RcGnmiAppModuleConfigUtils. https://github.com/opendaylight/gnmi/blob/master/modules/gnmi-sb/src/main/java/org/opendaylight/gnmi/southbound/yangmodule/util/GnmiConfigUtils.java JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
These classes now accept YangParserFactory in their constructor, Add DefaultYangParserFactory to it. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
The jarfile available from nexus does not work since it's not a fat jar. Use this wrapper as a workaround to get the gNMI simulator working. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Use the odl gNMI simulator from our wrapper to run the example application and the scripts used in GH workflow. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
These models can be get from ODL gnmi repository now, so there is no need to store them in Lighty.io JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Lighty.io configuration relies on having a path to directory of yang models to build effective model context. Since the models got removed from Lighty.io, they have to be included in built target directory for lighty configuration to be accessed. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Ensure LightyGnmiSouthboundModule provides a non-null reactor to the underlying OpenDaylight GnmiSouthboundProvider. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Update RcGnmiAppModuleConfigUtils to automatically share the YANG models loaded by the controller with the gNMI configuration. This resolves "Missing models" errors (iana-if-type, ietf-interfaces, etc.) during device schema context building. By injecting the controller's schema models into the GnmiConfiguration, we eliminate the need for redundant model definitions in the application's JSON configuration files. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
By default, gnmi starts with ietf-interfaces@2018-02-20 when no configuration is provided. This means that when we add ietf-interfaces@2014-05-08 we are causing two different versions of the same model to be present. This causes the controller to fail to connect to the device simulator. https://github.com/opendaylight/gnmi/blob/master/modules/gnmi-sb/src/main/java/org/opendaylight/gnmi/southbound/yangmodule/GnmiSouthboundModule.java#L136 JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
This workflow assumed that Lighty.io controller is ready to accept the downloaded yang models right after the workflow starts. This caused the requests to add the models to fail simply because the controller was not ready yet to accept them. This patch adds a check to verify that the controller is ready to accept them and then adds them via RPC. JIRA: LIGHTY-416 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
The getModelsFromClasspath method iterates over the filter set and for each element, it iterates over the entire ServiceLoader in filterYangModelBindingProviders. This results in an O(N*M) complexity. It would be more efficient to iterate over the ServiceLoader once to build a map of QName to YangModuleInfo and then look up the modules in the filter. JIRA: LIGHTY-409 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
11db5e5 to
5fecb2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapt feat-gnmi to Vanadium and merge to main.