Remove eelf dependency
[dmaap/buscontroller.git] / README.md
1
2 #
3 # ============LICENSE_START==========================================
4 # org.onap.dmaap
5 # ===================================================================
6 # Copyright © 2018 AT&T Intellectual Property. All rights reserved.
7 # ===================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #
12 #        http://www.apache.org/licenses/LICENSE-2.0
13 #
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ============LICENSE_END============================================
20 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
21 #
22 #
23
24 DMaaP Bus Controller API
25 =======================
26
27 Data Movement as a Platform (DMaaP) Bus Controller provides an API for other ONAP infrastructure components to provision DMaaP resources.
28 A typical DMaaP resource is a Data Router Feed or a Message Router Topic, and their associated publishers and subscribers.
29 Other infrastucture resources such as DR Nodes and MR Clusters are also provisioned through this API.
30
31 ### Build Instructions for a Continuous Integration environment using Jenkins
32
33 When this component is included in a Continuous Integration environment, such as structured by the Linux Foundation, the artifacts can be created and deployed via Jenkins.  The following maven targets are currently supported in the Build step:
34 ```
35 clean install
36 ```
37
38
39 ### Build Instructions for external developers
40
41 This project is organized as a mvn project for a jar package.
42 After cloning from this git repo:
43
44 ```
45 mvn clean install 
46 ```
47
48
49 ### Docker Packaging
50
51 We can utilize docker to build and register the buscontroller container in a local dev repository.
52 Note the Dockerfile follows ONAP convention of running app as root.
53
54 ```
55
56 <assuming DOCKER_HOST is set appropriately for your environment>
57
58 $ mvn -P docker docker:build
59 ```
60
61
62 ### ONAP deployment
63
64 Two styles of deployment are supported for ONAP.
65 1. OOM - by the time of Release Casablanca, this is the preferred deployment method which relies on a kubernetes environment, and uses helm charts.  Buscontroller is part of a larger overall dmaap chart which also deploys Message Router and Data Router.  See https://gerrit.onap.org/r/#/admin/projects/oom
66 2. HEAT - an older style deployment which assumes VM running docker.
67
68 #### ONAP OOM Deployment
69
70 The default DMaaP charts for an OOM deployment should be able to be used without modification because the interdependencies between components rely on kubernetes service names.
71 However, overrides can be made to the buscontroller values.yaml file (found in oom/kubernetes/dmaap/charts/dmaap-bus-controller/values.yaml) as needed.
72
73 Following a convention where Release is set to the component name (--name=dmaap) and using a dev namespace:
74 ```
75 <clone oom>
76 cd kubernetes
77 <edit values.yaml if necessary>
78 make dmaap
79 helm install dmaap --debug --name=dmaap --namespace=dev
80
81 ```
82
83 #### ONAP Heat deployment
84 Prior to starting container, place environment specific vars in /tmp/docker-databus-controller.conf on the Docker host,
85 and map that file to /opt/app/config/conf.
86 Run the buscontroller image which starts execution of the dmaapbc deploy command, which will update the container runtime properties appropriately, and start the Bus Controller.
87
88 For example, in ONAP Future Lab environment, /tmp/docker-databus-controller.conf looks like:
89 ```
90
91 # DMaaP Bus Controller OpenSource environment vars
92 CONT_DOMAIN=demo.dmaap.onap.org
93 DMAAPBC_INSTANCE_NAME=ONAPfuture
94
95 #   The https port
96 #   set to 0 if certificate is not ready
97 DMAAPBC_INT_HTTPS_PORT=0
98
99 DMAAPBC_KSTOREFILE=/opt/app/dcae-certificates
100 DMAAPBC_KSTOREPASS=foofoofoo
101 DMAAPBC_PVTKEYPASS=barbarbar
102
103 DMAAPBC_PG_ENABLED=true
104 DMAAPBC_PGHOST=zldciad1vipstg00.simpledemo.openecomp.org
105 DMAAPBC_PGCRED=test234-ftl
106
107 DMAAPBC_DRPROV_FQDN=zldciad1vidrps00.simpledemo.openecomp.org
108
109 DMAAPBC_AAF_URL=https://aafapi.${CONT_DOMAIN}:8095/proxy/
110
111 DMAAPBC_TOPICMGR_USER=m99751@dmaapBC.openecomp.org
112 DMAAPBC_TOPICMGR_PWD=enc:zyRL9zbI0py3rJAjMS0dFOnYfEw_mJhO
113 DMAAPBC_ADMIN_USER=m99501@dcae.openecomp.org
114 DMAAPBC_ADMIN_PWD=enc:YEaHwOJrwhDY8a6usetlhbB9mEjUq9m
115
116 DMAAPBC_PE_ENABLED=false
117 DMAAPBC_PE_AAF_ENV=TBD
118 ```
119 Then the following steps could be used to pull and run the Bus Controller.  (onap-nexus is just an example)
120 ```
121
122 $ docker pull nexus3.onap.org:10003/onap/dmaap/buscontroller:latest
123 $ docker run -d -p 18080:8080 -p 18443:8443 -v /tmp/docker-databus-controller.conf:/opt/app/config/conf nexus3.onap.org:10003/onap/dmaap/buscontroller:latest
124 ```
125
126 ### Properties
127
128 This section is intended to describe the behavior customization of Bus Controller that can be obtained via properties file used by the dbcapi library.
129 By default, this file is located in etc/dmaapbc.properties.
130 However, a java argument -DConfigFile  can be set to a different path.  (Our kubernetes deployment relies on this and points to a configmap, for example.)
131
132 The table below lists all the settings, default values (if not set), and shows any explicit setting in ONAP oom kubernetes deployment.
133
134 |-|-|-|-|
135 | Property | Description | Default | Kubernetes Setting | 
136 |-|-|-|-|
137 |UseAAF                | Flag for whether AAF authz API is to be used            | false                                  | false |
138 |-|-|-|-|
139 |csit                  | Flag for stubbing out many southbound calls in a CSIT environment | No                           | No |
140 |-|-|-|-|
141 |DR.provhost           | FQDN of Data Router Provisioning Server (deprecated - now set via API) | notSet                  | dcae-drps.domain.not.set |
142 |-|-|-|-|
143 |ProvisioningURI       | URI to retrieve dynamic DR configuration                | /internal/prov                         | /internal/prov |
144 |-|-|-|-|
145 |Feed.deleteHandling   | indicator for handling feed delete request              | DeleteOnDR                             | SimulateDelete |
146 |                      | DeleteOnDR - means use the DR API to DELETE a feed.  (default for backwards compatibility) | | |
147 |                      | SimulateDelete - means preserve the feed on DR (after cleaning it up), and mark as DELETED in DBCL. | | |
148 |-|-|-|-|
149 |UsePGSQL              | flag indicates whether to retain data in Postgresql     | false                                  | true |
150 |                      | when false, objects will be kept in memory but will be  |                                        | |
151 |                      | lost on restart and not shared between instances        |                                        | |
152 |-|-|-|-|
153 |DB.host               | FQDN or service name of Postresql host                  | dcae-pstg-write-ftl.domain.notset.com  | dbc-pg-primary |
154 |-|-|-|-|
155 |DB.name               | name of Postresql database                              | dmaap                                  | |
156 |-|-|-|-|
157 |DB.schema             | name of database schema                                 | public                                 | |
158 |-|-|-|-|
159 |DB.user               | username for Postgresql access                          | dmaap_admin                            | |
160 |-|-|-|-|
161 |DB.cred               | password for Postrgresql access                         | test234-ftl                            | onapdemodb |
162 |-|-|-|-|
163 |MR.multisite          | Indicates if there can be multiple sites (locations) where MR is deployed | true                 | false |
164 |-|-|-|-|
165 |MR.CentralCname       |  FQDN or service name of MR (deployed in central if multilocation is true) | MRcname.not.set     | message-router |
166 |-|-|-|-|
167 |MR ClientDeleteLevel  | MR Client Delete thoroughness                           | 0                                      |  1 |
168 |                      | 0 = don't delete | | |
169 |                      | 1 = delete from persistent store (PG) | | |
170 |                      | 2 = delete from persistent store (PG) and authorization store (AAF) | | |
171 |-|-|-|-|
172 |MR.TopicFactoryNS     | AAF namespace used to create perms for MR topics        | MR.topicFactoryNS.not.set              | org.onap.dmaap.mr.topicFactory |
173 |-|-|-|-|
174 |MR.TopicMgrRole       | AAF Role used by Buscontroller to create topics on MR   | MR.TopicMgrRole.not.set                | org.onap.dmaap-bc-topic-mgr.client |
175 |-|-|-|-|
176 |MR.projectID          | Value for some constructs of fully qualified topic names | 99999                                 | ONAP |
177 |-|-|-|-|
178 |cadi.properties       | Path to CADI properties file                            | /opt/app/osaaf/local/org.onap.dmaap-bc.props | /opt/app/osaaf/lcoal/org.onap.dmaap-bc.props |
179 |-|-|-|-|
180 |aaf.URL               | URL of the AAF server                                   | https://authentication.domain.netset.com:8095/proxy/ | https://aaf-authz/ |
181 |-|-|-|-|
182 |aaf.TopicMgrUser      | AAF Identity of Topic Mgr                               | noMechId@domain.netset.com             | dmaap-bc-topic-mgr@dmaap-bc-topic-mgr.onap.org | 
183 |-|-|-|-|
184 |aaf.TopicMgrPassword  | AAF Credential for Topic Mgr                            | notSet                                 | demo123456! |
185 |-|-|-|-|
186 |aaf.AdminUser         | AAF Identity of user with Admin role for API namespace  | noMechId@domain.netset.com             | aaf_admin@people.osaaf.org |
187 |-|-|-|-|
188 |aaf.AdminPassword     | AAF credential of AdminUser                             | notSet                                 | demo123456! |
189 |-|-|-|-|
190 |CredentialCodeKeyfile | location of the codec keyfile used to decrypt passwords | LocalKey                               | etc/LocalKey |
191 |                      | in this properties file before they are passed to AAF   | LocalKey                               | etc/LocalKey |
192 |-|-|-|-|
193 |AafDecryption.Class   | Specifies the Class to be used for decryption           | org.onap.dmaap.dbcapi.aaf.ClearDecrypt | |
194 |-|-|-|-|
195 |ApiNamespace          | Root namespace for AAF perms related to dbcapi access   | apiNamespace.not.set                   | org.onap.dmaap-bc.api |
196 |-|-|-|-|
197 |ApiPermission.Class   | the Class that determines if a call to API is authorized| allow                                  | | 
198 |-|-|-|-|
199 |MM.ProvRole           | AAF Role of client publishing MM prov cmds              | notSet                                 | org.onap.dmaap-bc-mm-prov.prov |
200 |-|-|-|-|
201 |MM.ProvUserMechId     | AAF Identity when publishing to MM command topic        | notSet                                 | dmaap-bc-mm-prov@dmaap-bc-mm-prov.onap.org|
202 |-|-|-|-|
203 |MM.ProvUserPwd        | AAF credenital for ProvUserMechId                       | notSet                                 | demo123456! | 
204 |-|-|-|-|
205 |MM.AgentRole          | AAF Role of client susbcribing to MM command topic      | notSet                                 | org.onal.dmaap-bc-mm-prov.agent |
206 |-|-|-|-|
207 |HttpAllowed           | flag indicating whether http is supported               | false                                  | true |
208 |-|-|-|-|
209 |IntHttpPort           | Internal port for http service                          | 80                                     | 8080 |
210 |-|-|-|-|
211 |IntHttpsPort          | Internal port for https service (0 if no cert is avail) | 443                                    | 8443 |
212 |-|-|-|-|
213 |ExtHttpsPort          | Externally advertised port for https service (deprecated)| 443                                   | 443 |
214 |-|-|-|-|
215 |KeyStoreType          | Format of Java keystore                                 | jks                                    | jks |
216 |-|-|-|-|
217 |KeyStoreFile          | Path to java keystore                                   | etc/keystore                           | etc/keystore |
218 |-|-|-|-|
219 |KeyStorePassword      | Password for keystore                                   | changeit                               | <provided by Certificate Authority> |
220 |-|-|-|-|
221 |KeyPassword           | Password for private key in the https keystore          | changeit                               | <provided by Certificate Authority> |
222 |-|-|-|-|
223 |TrustStoreType        | Format of Trust Store file                              | jks                                    | jks |
224 |-|-|-|-|
225 |TrustStoreFile        | Path to Trust Store file                                |                                        | etc/org.onap.dmaap-bc.trust.jks |
226 |-|-|-|-|
227 |TrustStorePassword    | Password for Trust Store                                |                                        | <provided by Certificate Authority> |
228 |-|-|-|-|
229 |QuiesceFile           | Path to file which signals needs to queiesce            |                                        | etc/SHUTDOWN |
230 |-|-|-|-|
231
232 ### Environment Variables
233 The following environment variables can be set in the container environment to further effect behavior:
234 - DMAAPBC_WAIT_TOEXIT=Y   when set this will attempt to keep the dmaap-bc container running.  Sometimes needed to get a better look at logs when the main proces is exiting for some reason.
235
236 - CONFIGMAP_ROOT defaults to /opt/app/config/conf  but can be overwritten if needed.  This value serves as the root to where the buscontroller.env file is found.
237
238 - CONFIGMAP_PROPS defaults to /opt/app/config/conf/dmaapbc.properties but can be overwritten if needed