[INTDIST-37] need mechanism to get ODL version Created: 11/Sep/15  Updated: 20/Oct/17  Resolved: 04/Jan/17

Status: Resolved
Project: integration-distribution
Component/s: Version
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Giles Heron Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
is blocked by CONTROLLER-1522 config-parent: Substitute properties ... Resolved
External issue ID: 4296

 Description   

We need a mechanism to get the ODL version from:
1) karaf CLI
2) REST (or RESTCONF)
3) NETCONF/YANG

I'm not sure where this should live - odlparent, controller (does that still exist as a project post-Lithium), or md-sal (but then you need to have md-sal to make this work - though does a controller with no md-sal make sense?)



 Comments   
Comment by Vratko Polak [ 29/Jan/16 ]

It looks like Restconf already exposes some statistics [0], perhaps a Restconf version string can be added there.

Netconf is the most sure place to put such addition. Odlparent does not depend on mdsal, so there is no easy way to expose anything.
On the other hand, integration/distribution may have the most direct version interpretation, but it has no Yang model yet for such additions.

[0] https://git.opendaylight.org/gerrit/gitweb?p=netconf.git;a=blob;f=opendaylight/restconf/sal-rest-connector/src/main/yang/opendaylight-rest-connector.yang;h=c6c7c87115956d0324de34cbe0942043330f0e84;hb=refs/heads/master#l63

Comment by Robert Varga [ 09/Feb/16 ]

The concept of 'the ODL version' makes sense in terms of a Simultaneous Release, and thus can be exposed only by the leaf (distribution) project. All other projects have independent versioning.

Comment by Giles Heron [ 16/Mar/16 ]

Is it possible to get this fixed by Beryllium-SR2?

Comment by Vratko Polak [ 16/Mar/16 ]

> Is it possible to get this fixed by Beryllium-SR2?

>> 1) karaf CLI

It is already there:
feature:repo-list
It outputs a long list, but you can use "| grep <something>" to narrow the list down. For example, current post-SR1 Beryllium snapshots contains these:
odl-integration-0.4.1-SNAPSHOT | mvn:org.opendaylight.integration/features-integration-index/0.4.1-SNAPSHOT/xml/features
odlparent-1.6.1-SNAPSHOT | mvn:org.opendaylight.odlparent/features-odlparent/1.6.1-SNAPSHOT/xml/features

>> 2) REST (or RESTCONF)
>> 3) NETCONF/YANG

The simplest workaround is GET to <host>:8181/restconf/modules and classify modules (and revisions) present there. For example this one is in Beryllium but not in Lithium:

{"name":"aaa-authn-netconf-plugin","revision":"2015-07-15","namespace":"config:aaa:authn:netconf:plugin"}

and this one is in Beryllium-SR1 (possibly by an oversight) but not in Beryllium release:

{"name":"instance-identifier-patch-module","revision":"2015-11-21","namespace":"instance:identifier:patch:module"}

The downside is that presence of modules depends on features installed.

As integration/distribution projects does not currently contain any yang models or config files, it is not probable to have a more straightforward solution before Beryllium-SR2.

Comment by Giles Heron [ 16/Mar/16 ]

Hi Vratko,

thanks for the info re Karaf. That's helpful.

re REST and NETCONF/YANG yes, I've already suggested that people use the method you suggested. However it does feel like something of a hack to have to find a module that is in e.g. Beryllium but not in Lithium, and as you say it depends on features installed. So far I'm using ietf-inet-types

Giles

Comment by Vratko Polak [ 17/Mar/16 ]

> As integration/distribution projects does not currently contain any yang
> models or config files, it is not probable to have a more straightforward
> solution before Beryllium-SR2.

I gave it a try anyway.
https://git.opendaylight.org/gerrit/#/c/36311/
You would need odl-restconf, odl-netconf-connector-ssh and the new odl-integration-version feature installed.

Still, it may take some time to merge that, as there are not many committers familiar with Java in integration/distribution.

Comment by Giles Heron [ 22/Mar/16 ]

looks good to me

any value in me reviewing the code?

Comment by Vratko Polak [ 23/Mar/16 ]

> any value in me reviewing the code?

Yes, there are several string identifiers visible, and I am not sure my chosen values are systematic enough. This includes module name "odl-distribution-version", XML namespace "urn:opendaylight:params:xml:ns:yang:integration:distribution:version", type identity "odl-version", leaf name "version", config file name "odl-version.xml" and the two config-module names defined in it "odl-distribution-version" and "odl-odlparent-version".

I should also find someone who is familiar with config subsystem to decide whether I got all the dependencies right (or whether it only works by accident).

Comment by Vratko Polak [ 23/Mar/16 ]

> there are several string identifiers visible

I forgot the feature name, currently "odl-distribution-version".

Comment by Giles Heron [ 23/Mar/16 ]

the default-config.xml is hand-generated, right?

is there any way to auto-generate it? that way there'd be no risk of the versions being out of sync between what we report and what we've actually built (if that makes sense...)

Comment by Vratko Polak [ 23/Mar/16 ]

> the default-config.xml is hand-generated, right?

Yes, and further manual edits are expected, as other projects may want to add their version.

I am not expert enough to figure a way to make config-parent do replacements from defined properties (such as ${feature.odlparent.version}) before packaging the config file into the jar bundle. (I can open improvement Bug when this gets merged.)

So far I am only trying to make sure that version bumping scripts will bump the value too. https://git.opendaylight.org/gerrit/#/c/36408

Comment by Vratko Polak [ 26/May/16 ]

> the default-config.xml is hand-generated, right?

Currently, I favor using property values from pom file (where they would get bumped by current version bumping script).

https://git.opendaylight.org/gerrit/#/c/37210/6 (current Boron integration/distribution patch)
https://git.opendaylight.org/gerrit/#/c/39427/1 (required patch in controller)

Comment by Vratko Polak [ 03/Jun/16 ]

Merged: https://git.opendaylight.org/gerrit/37210
Still waiting for: https://git.opendaylight.org/gerrit/39427
That is for Boron, backport to Beryllium will be the next step.

Comment by Vratko Polak [ 31/Aug/16 ]

So, Beryllium-SR3 and (almost surely) Boron do have the most of functionality, but user has to edit config file (or use restonf at runtime) to modify version values, due to CONTROLLER-1522 fix still not being merged.

Comment by Vratko Polak [ 26/Sep/16 ]

Carbon is on its way to get fixed: https://git.opendaylight.org/gerrit/46198
Boron may take longer time, Beryllium will probably be never fixed.

Comment by Vratko Polak [ 14/Nov/16 ]

Carbon is fixed.
Boron: https://git.opendaylight.org/gerrit/48328

Comment by Vratko Polak [ 04/Jan/17 ]

Boron change merged, test [0] passes.
As Beryllium will not get fixed, this Bug can be considered FIXED.

[0] https://jenkins.opendaylight.org/releng/view/distribution/job/distribution-csit-1node-userfeatures-only-boron/lastSuccessfulBuild/robot/distribution-userfeatures.txt/Version/

Generated at Wed Feb 07 20:02:37 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.