[VES-OPENAPI] Update docs with kafka
[dcaegen2.git] / docs / sections / design-components / requirements-guidelines.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 Onboarding Pre-requisite
5 ========================
6
7 Before a component is onboarded into DCAE, the component developer must ensure it
8 is compliant with ONAP & DCAE goals and requirement in order to correctly be deployed and be managed.
9
10
11 .. _config_binding_service:
12
13 Config Binding Service SDK Integration
14 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
16 With Jakarta release, Consul and ConfigBindingService interface has been deprecated from DCAE
17 All Microservice configuration are resolved through files mounted via Configmap created part of 
18 dcae-services helm chart deployment. 
19
20 CBS SDK library are available within DCAE which can be used by DCAE Microservices for configuration
21 retrieval. For details on the API - refer  `CBS SDK Java Library 
22 <https://docs.onap.org/projects/onap-dcaegen2/en/latest/sections/sdk/api.html>`__
23
24 Its strongly recommended to use CBS SDK library for consistency across DCAE services to retrieve  both static and policy driven configuration. 
25
26 Topic Configuration
27 ~~~~~~~~~~~~~~~~~~~
28
29 With Helm flow integration in MOD, topic generation feature is not supported.
30
31 Applications are required to identify the topic and feed information as application 
32 configuration.
33
34 For application onboarded through MOD, these should be included in the specification file under **parameters**
35 ::
36
37   "parameters": [{
38     "name": "streams_publishes",
39      "value": "{\"ves-3gpp-fault-supervision\":{\"dmaap_info\":{\"topic_url\":\"http:\/\/message-router:3904\/events\/unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT\"},\"type\":\"message_router\"},\"ves-3gpp-heartbeat\":{\"dmaap_info\":{\"topic_url\":\"http:\/\/message-router:3904\/events\/unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT\"},\"type\":\"message_router\"},\"ves-3gpp-performance-assurance\":{\"dmaap_info\":{\"topic_url\":\"http:\/\/message-router:3904\/events\/unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT\"},\"type\":\"message_router\"},\"ves-3gpp-provisioning\":{\"dmaap_info\":{\"topic_url\":\"http:\/\/message-router:3904\/events\/unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT\"},\"type\":\"message_router\"},\"ves-fault\":{\"dmaap_info\":{\"topic_url\":\"http:\/\/message-router:3904\/events\/unauthenticated.SEC_FAULT_OUTPUT\"},\"type\":\"message_router\"},\"ves-heartbeat\":{\"dmaap_info\":{\"topic_url\":\"http:\/\/message-router:3904\/events\/unauthenticated.SEC_HEARTBEAT_OUTPUT\"},\"type\":\"message_router\"},\"ves-measurement\":{\"dmaap_info\":{\"topic_url\":\"http:\/\/message-router:3904\/events\/unauthenticated.VES_MEASUREMENT_OUTPUT\"},\"type\":\"message_router\"},\"ves-notification\":{\"dmaap_info\":{\"topic_url\":\"http:\/\/message-router:3904\/events\/unauthenticated.VES_NOTIFICATION_OUTPUT\"},\"type\":\"message_router\"},\"ves-other\":{\"dmaap_info\":{\"topic_url\":\"http:\/\/message-router:3904\/events\/unauthenticated.SEC_OTHER_OUTPUT\"},\"type\":\"message_router\"},\"ves-pnfRegistration\":{\"dmaap_info\":{\"topic_url\":\"http:\/\/message-router:3904\/events\/unauthenticated.VES_PNFREG_OUTPUT\"},\"type\":\"message_router\"}}",
40      "description": "standard http port collector will open for listening;",
41      "sourced_at_deployment": false,
42      "policy_editable": false,
43      "designer_editable": false
44    }]
45
46 For components delivered as Helm directly, it should be specified under **applicationConfig** section in values.yaml
47 ::
48
49   streams_publishes:
50     ves-fault:
51       dmaap_info:
52         topic_url:"http://message-router:3904/events/unauthenticated.SEC_FAULT_OUTPUT"
53       type: message_router
54     ves-measurement:
55       dmaap_info:
56         topic_url: "http://message-router:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT"
57       type: message_router
58
59
60 You can find  examples of topic and feed configuration used in DCAE components from charts under OOM repository - 
61 https://github.com/onap/oom/tree/master/kubernetes/dcaegen2-services/components
62
63 Its recommended to follow similar topic construct for consistency across all DCAE Services. This will also enable using 
64  `SDK DMAAP Java Library 
65 <https://docs.onap.org/projects/onap-dcaegen2/en/latest/sections/sdk/api.html>`__
66 for easier integration.
67
68
69 DCAE SDK
70 ~~~~~~~~
71
72 DCAE has SDK/libraries which can be used for service components for easy integration.
73
74 - `Java Library <https://docs.onap.org/projects/onap-dcaegen2/en/latest/sections/sdk/architecture.html>`__
75 - `Python Modules <https://git.onap.org/dcaegen2/utils/tree/onap-dcae-cbs-docker-client>`__
76
77
78
79 .. _policy_reconfiguration:
80
81 Policy Reconfiguration
82 ----------------------
83
84
85 Policy Framework based reconfiguration is supported via sidecar. The component owners are responsible for
86 loading the required model and creating policies required. 
87
88 Once the policies are created, the corresponding policy_id should be listed in the component_spec or helm charts override as below
89
90 Component spec must include the policy_info object and list of policy_id to be retrieved 
91 ::
92   "policy_info":{
93     "policy": [
94     {
95       "node_label": "tca_policy_00",
96       "policy_model_id": "onap.policies.monitoring.cdap.tca.hi.lo.app",
97       "policy_id": "onap.vfirewall.tca"
98         },
99     {
100       "node_label":"tca_policy_01", 
101       "policy_model_id":"onap.policies.monitoring.cdap.tca.hi.lo.app",
102       "policy_id":"onap.vdns.tca"
103     }
104     ]
105   }
106
107 "node_label" is optional and can be ignored
108 "policy_model_id" refers to model uploaded into policy framework
109 "policy_id" refers to the instance of policy created for model specified.
110
111 When the helm-charts are generated by DCAEMOD/Runtime, the charts will have following property defined in the values.yaml
112
113 ::
114   dcaePolicySyncImage: onap/org.onap.dcaegen2.deployments.dcae-services-policy-sync:1.0.1
115   policies:
116      policyID: |
117         '["onap.vfirewall.tca","onap.vdns.tca"]'
118
119 When using dcaegen2-services-common templates, the presence of **policies** property will deploy policy-sidecar automatically which will 
120 periodically pull configuration from Policy framework and make it available shared mountpoint to microservice container. 
121
122 More information on Policy side car can be found on this wiki - https://wiki.onap.org/display/DW/Policy+function+as+Sidecar
123  
124 .. note:: 
125   When using DCAE CBS SDK, policy config retrieval is supported natively by the library
126   
127
128
129 .. _docker_images:
130
131 Docker Images
132 -------------
133
134 Docker images must be pushed to the environment specific Nexus
135 repository. This requires tagging your build with the full name of you
136 image which includes the Nexus repository name.
137
138 For ONAP microservices, the components images are expected to pushed into ONAP nexus
139 part of `ONAP CI jobs <https://wiki.onap.org/display/DW/Using+Standard+Jenkins+Job+%28JJB%29+Templates>`__
140
141
142 Helm Chart
143 ----------
144
145 Components being delivered under ONAP/OOM must adopt dcaegen2-common-services template.
146 Information about using the common templates to deploy a microservice can be
147 found in :doc:`Helm to deploy DCAE Microservices <./dcaeservice_helm_template>`.
148
149 .. _operation_requirement:
150
151 Operational Requirement
152 -----------------------
153
154 Logging
155 ~~~~~~~
156
157 All ONAP MS logging should follow logging specification defined by `SECCOM <https://wiki.onap.org/display/DW/Jakarta+Best+Practice+Proposal+for+Standardized+Logging+Fields+-+v2>`__
158
159 The application log configuration must enable operation to choose if to be written into file or stdout or both during deployment.
160
161
162 S3P
163 ~~~
164 ONAP S3P (all scaling/resiliency/security/maintainability) goals should meet at the minimum level defined for DCAE project for the targeted release
165
166 If the component is stateful, it should persist its state on external store (eg. pg, redis) to allow support for scaling and
167 resiliency. This should be important design criteria for the component.