...
Typically DCAE sub-components are developed individually under their own ONAP Gerrit/Git repos. The initiation of a new repo generally starts during the release planning time, which usually starts around the code freeze time of the previous ONAP release. Normally before the functionality freeze time (M2), projects that are planned to be included in a release are determined, and infrastructure items such as repo creation for new projects are completed.
Pre-requisites
...
For community members looking to contribute new service under ONAP DCAE project, below steps outline general steps to be followed by the service owners.
- Review new service proposal with architecture team and project team. If new collectors, this typically requires review with ARC and VNFREQ team as this introduces new interface between xNF and DCAE.
- Identify usecase this service will be targeted under (optional).
- Capture external and internal dependencies and api consumed/provided .(this could be documented in wiki to start, but swagger spec required by M2)
- Repository creation (PTL will submit request to RM, who will coordinate with TSC/LF support)
- Work with PTL to scope the service and EPIC/US creations and release/sprints to target around M1
- Push seed code (if available) into gerrit
- Reference this ONAP WiKi page for details of configuring for using Gerrit: Configuring Gerrit.
- Build/enhance functional component (mS) based on the usecase requirement Setup Jenkins job
Contribution Guidelines
- Setup required Jenkins job (under ci-management repo) for building artifacts/docker images
...
- , sonar-scans, CLM. As a DCAE contributor, to create new Jenkins job will require a new JJB file being created under the jjb/dcaegen2 directory of the ci-managerment project.
...
- The status of Jenkins jobs can be viewed at http://jenkins.onap.org.
...
- Push (seed) code into gerrit on the chosen repo (Reference this ONAP WiKi page for details of configuring for using Gerrit: Configuring Gerrit)
- Ensure complaince with all NFR's (Non-Functionrequirement)
- Leverage DCAE common sdk for config retrieval/dmaap pub & sub etc (DCAESDKIntegration)
- License text included in each file. Apache 2 for coding files; CC4 for others.
- Ensure all committers and usecase owners/leads are looped into gerrit submission for review
- Once change is merged, review CLM/coverty scan report and address all CRITICAL/HIGH License/security issues identified
...
- (TSC MUST HAVE)
- Reports will be under https://nexus-iq.wl.linuxfoundation.org/assets/index.html (access is restricted; work with committers to obtain the report)
- ONAP Deployment Integration
- DCAE MOD integration support (OPTIONAL from KOHN)
- Every component to be onboarded into DCAE, should prepare a component spec (a.k.a spec) - which is meta data represented in json describing the component configuration model. The spec file should be added into component repo (under <repo><component>/dpo/spec directory). For more info on component spec, refer documentation under RTD
- Add
...
- CSIT test (How to guide → Creating a CSIT Test). This can be done under "integration" repo or within component repo itself (see dcaegen2/services/pm-mapper or dcaegen2/collectors/datafile)
- Documentation
- Demo
Non-Functional requirement
All new contribution MUST be complaint with Global requirements and approved "best Practice" requirements. Following list key NFR's
- Support Java11 (or higher) or Python 3.x (as recommended by SECCOM for targetted release) (TSC MUST HAVE)
- Code Coverage - Min 55% (updated 2/20) (Required for passing release candidate80% (DCAE MUST HAVE)
- Logging compliance to Best Practice requirement - Jakarta Best Practice Proposal for Standardized Logging Fields - v2 (old spec -
https://wiki.onap.org/pages/viewpage.action?pageId=28378955)(Required for passing release candidate - Log to be written into file and stdout (TSC MUST HAVE)
- If API's are exposed, need to conform to ONAP API Common Versioning Strategy (CVS) Guidelines
Note: All above are general ONAP requirements for any new contributions.
Once the service code is delivered and container can be built, follow below DCAE Platform Integration steps
- DCAE Platform Integration
- Documentation
- Demo
- Deployment integration.
DCAE Platform Integration
Once the main functionality is build and components is executable as docker container/jar - it should be integrated with DCAE platform to enable dynamic instantiation and configuration management by DCAE controller.
Build component spec and validate using dcae_cli (Design support)
Every component to be onboarded into DCAE, should prepare a component spec (a.k.a spec) - which is meta data represented in json describing the component configuration model. Details on spec creation can be found here - https://onap.readthedocs.io/en/beijing/submodules/dcaegen2.git/docs/sections/components/component-specification/component-specification.html?highlight=component%20spec
The dcae_cli tools enables MS owner to validate the component spec and data_Formats created and also "test" the deployment of MS itself. This allows components to mimic the configuration returned from ConfigBinding Service as expected on typical cloudify based deployment by DCAE platform (Documentation on spec format and tool usage can be found under https://onap.readthedocs.io/en/beijing/submodules/dcaegen2.git/docs/sections/components/dcae-cli/commands.html?highlight=dcae_cli )
Note Updated 1/12: For Dublin, all dynamic DCAE MS should be onboarded through SDC (which include models/blueprint generation from SDC and distributed into DCAE/CLAMP/Policy)
SDC Integration (Design support)
This has to be coordinated with SDC team esp if components has dynamic policy and required CLAMP/Policy integration. This step allows Tosca models to be generated via DCAE-DS/Tosca_Lab tool that will be used in service composition and distribution to Policy/CLAMP and DCAE.
Blueprint creation/test (Test)
If the component are onboarded via SDC flow, the blueprints will be generated by TOSCAlab tools contained with DCAE-DS in SDC. Alternatively the components developer can hand-craft the blueprints and test. The blueprint created manually if required to included part of DCAE static deployment, then blueprint itself should be templatized and added into this repo - https://gerrit.onap.org/r/#/admin/projects/dcaegen2/platform/blueprints. The blueprint can tested on any DCAE deployment by executing into DCAE bootstrap pod (Cloudify Blueprint validation under OOM)
ConfigBindingService Integration (Code enhancement required)
All configuration (identified in component spec - parameters) itself are stored under CONSUL when blueprint gets executed part of component deployment. Some configuration such as topics are dynamic and may not be known for component owner to include in the docker image. Hence an important requirement for all onboarding services is to invoke the configbindingservice api during docker init script process to fetch the required application config.
API information - https://onap.readthedocs.io/en/beijing/submodules/dcaegen2.git/docs/sections/apis/configbinding.html
For python - there are libraries available which can be used to invoke this api. For java - sample code and configuration returned can be found here MicroServices Onboarding in ONAP#CodesnippettofetchconfigurationfromConfigbindingservice
Notification mechanism (Code enhancement required)
Note: If MS has ability to periodically poll CBS api's and check for updates - support for notification mechanism is optional.
When there are configuration changes (triggered via policy/clamp), the platform will fetch the configuration and store them in consul. The platform will also notify the services indicating there is new configuration (slide below indicates the flow involved)
To support this interface, the service component should include a script within the container and specify that in component spec
Component spec
"auxilary": {
"policy": {
"trigger_type": "docker",
"script_path": "/opt/app/reconfigure.sh"
}
}
The corresponding blueprint should include following
docker_config:
policy:
script_path: /opt/app/mean/reconfigure.sh
trigger_type: docker
This script must have necessary logic to invoke CBS API and cascade the information for application processing. For components not expecting dynamic changes, this step is optional.
S3P Support (Code enhancement required)
S3P (all scaling/resiliency/security/maintainability) goals should meet at the minimum level defined for DCAE project for the targeted release
If the component is stateful, it should persist its state on external store (eg. pg, redis) to allow support for scaling and resiliency. This should be important design criteria for the component. If the component fails to meet S3P goals, it will not be release candidate. And if the components either publish/subscribe into DMAAP topic, then secure connection to DMAAP must be supported (platform will provide aaf_username/aaf_password for each topic as configuration).
Code Requirements
- License text included in each file. Apache 2 for coding files; CC4 for others.
- The Copyright line for contributing organization inserted or updated reflecting the contribution year.
- A LICENSE.txt file placed at the root of the repo to provide umbrella coverage.
- Unit testing coverage > 52% for R4
- For Java and Python code, coverage reporting: http://sonar.onap.org.
- For other languages, coverage reporting done in language native method.
- CLM reporting free of critical vulnerabilities for both security and licensing. CLM reports available at: https://nexus-iq.wl.linuxfoundation.org/assets/index.html
- & OpenAPI spec/swagger file to be defined and shared with impacted project by M2.
- Containers must have no more than one main process (TSC MUST HAVE)
- Containers must crash properly when a failure occurs (TSC MUST HAVE)
- No hardcoded password in the container (should be made configurable and set at deployment time and sourced using CBS apis') (TSC MUST HAVE)
Use ONAP-integration supported base image
Note: All above are common ONAP requirements for any new contributions. TSC MUST HAVE are required for passing release candidate.
ONAP Deployment Integration
All ONAP component deployments are through helm-charts maintained under OOM repository; refer to https://docs.onap.org/projects/onap-dcaegen2/en/latest/sections/installation_oom.html for OOM/dcae chart structure.
New DCAE Microservice chart contribution should go under https://git.onap.org/oom/tree/kubernetes/dcaegen2-services; all DCAE component charts should leverage oom/kubernetes/dcaegen2-services/common/dcaegen2-services-common templates. Refer to following link - https://docs.onap.org/projects/onap-dcaegen2/en/latest/sections/dcaeservice_helm_template.html for details on the supported features via this template.
With Kohn release, all DCAE components will be enabled for daily/weekly deployments. This is controlled by override here - https://git.onap.org/oom/tree/kubernetes/onap/resources/overrides/onap-all.yaml. New components being added under ONAP, should update this yaml for enabling automated daily/weekly deployment.
DCAE SDK Integration
With Jakarta release, Consul and ConfigBindingService interface has been deprecated from DCAE. All Microservice configuration are resolved through files mounted via Configmap created part of dcae-services helm chart deployment. CBS SDK library are available within DCAE which can be used by DCAE Microservices for configuration retrieval. For details on the API - refer CBS SDK Java Library .
Corresponding CBS library available also for python components - Python Modules
Additional DACE SDK/libraries is also available for DMAAP interface; for more info refer Java Library
Its strongly recommended to use DCAE SDK library for consistency across DCAE services
Documentation
DCAE WIKI
The project wiki space (https://wiki.onap.org/display/DW/DCAE+Documentation) can be used to documents general design about the components itself; can serve the community to know about the component itself and point to other repo/release documentation.
...
All DCAE components release specific documentation are maintained as source under https://gerrit.onap.org/r/gitweb?p=dcaegen2.git;a=tree;f=docs;h=e9ccbe4509762968a5028afb8dc55be3236beb6d;hb=refs/heads/master repository. This dcaegen2 repository. his repo has documentation build setup and generated RTD can be found here - https://onap.readthedocs.io/en/latest/submodules/dcaegen2.git/docs/index.htmlunder ONAP-RTD
Service component related RST can be added under separate directory created here - https://gerrit.onap.org/r/gitweb?p=dcaegen2.git;a=tree;f=docs/sections/services;h=06c74325e0a604772363faf2a7faecaf94a839ee;hb=refs/heads/master. under dcaegen2 repository. Post merge/build - corresponding RTD will be located here - https://onap.readthedocs.io/en/latest/submodules/dcaegen2.git/docs/sections/services/serviceindex.htmlunder DCAE-Service component page of ONAP-RTD
See Resource at the bottom for more information on RTD.
...
To be able to certify the component for release, the MS owner should present demo to project team (and integration team) using onap Jenkins build images/container and manual deployment via blueprint under DCAE platform. This demo should be ideally completed around M4 deadline to meet release timeline.
Demo Guidelines
- Each demo should is expected to be under ~20 <20 min + ~5 with ~5 min Q&A
- Demo scope to include following
- Specify Info on ONAP deployment dependencies/pre-requisite and how to validate them (can be explained from links under - DCAE R4 Service Component (On-demand) deployment Instruction)requisite
- Walkthrough component blueprint/input files and Helm-charts configuration
- Deployment Demo (though Cloudify/clihelm)
- Deployment Validation (health check/logs)
- Functional Flow simulation (using scripts/curl for mocking up feed)
- Corresponding validation (logs and/or dmaap)
- Documentation references
- Common Q&A
- Planned/Future Updates
- List
of - Features/stories/bugs (with JIRA's) deferred
for next release- Complaint with ONAP Logging guidelines/CBS integration?
- Can multiple instance be run in-parallel (for scaling)? Any external dependency for persistence?
Deployment Integration
...
- to next release
Resources
JJB - https://wiki.onap.org/display/DW/Using+Standard+Jenkins+Job+%28JJB%29+Templates
CSIT - Creating a CSIT Test
Documentation - 2017-09-19 Documentation Tutorial, Further information regarding documentation can also be found here: http://onap.readthedocs.io/en/latest/index.html.
DCAE JIRA - https://jira.onap.org/secure/RapidBoard.jspa?rapidView=49&view=planning.nodetail