Skip to content

Transformer Infra sonic yang singleton container support#87

Merged
kwangsuk merged 8 commits intosonic-net:masterfrom
amrutasali:transformerinfra_sonicyang_singleton_container_support
Jun 12, 2023
Merged

Transformer Infra sonic yang singleton container support#87
kwangsuk merged 8 commits intosonic-net:masterfrom
amrutasali:transformerinfra_sonicyang_singleton_container_support

Conversation

@ranjinidn
Copy link
Copy Markdown
Contributor

@ranjinidn ranjinidn commented May 25, 2023

What are the changes
Transformer changes to support sonic singleton container. The changes involve the following

  • Transformer spec generation, SET and GET flow to support sonic yang singleton container support.
  • Added singleton container in sonic test yang and the corresponding mappings from oc to sonic singleton container
  • Added UT cases to exercise the CRUD and GET cases for oc and sonic URIs

Singleton container refers to YANG container mapped to a singleton table.
e.g.

               container TEST_SENSOR_GLOBAL {
                       container global_sensor {
                                leaf mode {
                                       type string;
                                }
                                leaf description {
                                       type string;
                               }
                       }
               }

The above sonic yang structure translates to the following ConfigDB key -
"TEST_SENSOR_GLOBAL|global_sensor"

Why the changes are required
To support singleton container in community sonic yangs.
sflow app will be supported in mgmt-framework soon which uses the sonic-sflow.yang from community containing singleton container.

How did I verify the changes
Verified using the singleton container in transformer sonic test yang.
Attached are the UT results and log.
transformer.out.txt
transformer.log

PS: The changes are dependent on the CVL changes for a successful write to DB which will be in a separate PR.

As mentioned in PR #89 this PR also addresses the below.
This is the first step towards addressing sonic-net/sonic-buildimage#15183 requirement. We cannot support all yangs from sonic-buildimage/src/sonic-yang-models as of now due to limitations in UMF code generators, cvl & transformer components. They will be enhanced gradually later.

ranjinidn and others added 4 commits May 25, 2023 12:18
	-Changes in DbSpec creation, inherit db-name from sonic table, use cvl db-name annotation for sonic yang, utility function changes
	-Support exclusion of sonic yangs xfmr support from models list
…ang table containing a singleton container and UT cases exercising this mapping using table-name and key-name annotations
@ranjinidn ranjinidn closed this Jun 7, 2023
@ranjinidn ranjinidn reopened this Jun 7, 2023
@kwangsuk kwangsuk merged commit b64a80e into sonic-net:master Jun 12, 2023
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.

4 participants