Background
Multiple TOSCA Parsers have been used in ONAP across different projects.
List some projects as an example::
Project | Implementation language | Parser used |
SO | Java | SDC Tosca Parser |
VF-C | Python | NFV Tosca Parser |
UUI | Java | SDC Tosca Parser |
VNFSDK | Java/Python | NFV Tosca Parser SDC Tosca Parser |
Policy | Java | SDC Tosca Parser |
Here only list part of the projects, not all the parser consumer project.
Now, all projects consume the parser interfaces through the lib library and project chose to use different parser based on the implementation code language
In summary, currently , the same parser function has different implementations, but parser as a common service should be unified and provided as a service not the lib library.
Advantages of Parser as a Microservice
- Microservice can be decoupled from applications
Effect: The application does not need to know the implementation details of the Passer, only need to pay attention to the results of the analysis.
Current status: As a Library, an application can use parser only after understanding the internal implementation of Parser. Multi-language support
Effect: Parser provides services through restful, language-independent, and can support any language such as python and java.
Current Status: There are different Parser tools for different languages, and cross-language support is difficult.Easy to upgrade
Effect: Parser upgrades independently, only keep the external restful interface unchanged.
Current Status: The current Parser as Library, the application sees the internal implementation details of Parser, if Lib upgrade, it will affect the application.Easy to deploy, support horizontal expansion
Effect: After Parser is as a service, it conforms to Cloud Native idea, can utilize platform advantages, flexible deployment, and horizontal expansion.
Current Status: With the application deployment, it is not easy to support horizontal expansion, and there is basically no flexibility.
Disadvantages of Parser as a microservice
Performance: Compared with the Lib usage, when Parser provides services through restful, the performance will be reduced
Delay: Compared with the Lib usage, when Parser provides services through restful, the delay will increase
Note: Temporarily there is no data support for the above performance and delay
Implementation recommendations
For external interface
After the tosca parser microservice is implemented, the Lib usage will continue to be provided, and the application can select to use the microservice or the Library according to the specific requirements scenario
For Parser implementation
The first phase: collecting requirements, unifying model input and output, simultaneously implementing model output conversion from object to Json (this is the key point)
In the second stage: Providing unified restful interface to parser client.
R3 CSAR which exported by SDC in CCVPN use case and CPE use case
vCPE:
CCVPN: