Skip to content

Adapt feat-gnmi to main#2630

Open
Tobianas wants to merge 16 commits into
PANTHEONtech:mainfrom
Tobianas:main_use_gnmi
Open

Adapt feat-gnmi to main#2630
Tobianas wants to merge 16 commits into
PANTHEONtech:mainfrom
Tobianas:main_use_gnmi

Conversation

@Tobianas

Copy link
Copy Markdown
Contributor

Adapt feat-gnmi to Vanadium and merge to main.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Tobianas Tobianas force-pushed the main_use_gnmi branch 8 times, most recently from b0a936c to 278903e Compare May 13, 2026 08:49
@Tobianas Tobianas closed this May 13, 2026
@Tobianas Tobianas reopened this May 13, 2026
Tobianas added 16 commits May 26, 2026 09:38
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>
@Tobianas Tobianas force-pushed the main_use_gnmi branch 2 times, most recently from 11db5e5 to 5fecb2a Compare May 26, 2026 08:47
@Tobianas Tobianas closed this May 26, 2026
@Tobianas Tobianas reopened this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants