Convert project from AJSC to Spring Boot
[aai/model-loader.git] / Readme.md
1 # Introduction
2
3 The A&AI Model Loader Service is an application that facilitates
4 distribution and ingestion of new service and resource models from SDC to A&AI.
5
6 ## Features
7
8 The Model Loader:
9
10 * registers with the SDC to receive notification events 
11 * polls the UEB/DMaap cluster for notification events
12 * downloads artifacts from SDC upon receipt of a distribution event
13 * pushes distribution components to A&AI
14                     
15 ## Compiling Model Loader
16
17 Model Loader can be compiled by running `mvn clean install`
18 A Model Loader docker image can be created by running `docker build -t onap/model-loader target`
19
20 ## Running Model Loader 
21
22 ### Deploying The MicroService 
23
24 Push the Docker image to your Docker repository. Pull this down to the host machine.
25
26 **Create the following directories on the host machine:**
27
28     ./logs
29     ./opt/app/model-loader/appconfig
30     ./opt/app/model-loader/appconfig/auth
31     
32 You will be mounting these as data volumes when you start the Docker container.  For examples of the files required in these directories, see the aai/test/config repository (https://gerrit.onap.org/r/#/admin/projects/aai/test-config)
33
34 **Populate these directories as follows:**
35
36 #### Contents of /opt/app/model-loader/appconfig
37
38 The following file must be present in this directory on the host machine:
39     
40 _model-loader.properties_  
41     # Always false.  TLS Auth currently not supported 
42     ml.distribution.ACTIVE_SERVER_TLS_AUTH=false
43     
44     # Address/port of the SDC
45     ml.distribution.ASDC_ADDRESS=<SDC-Hostname>:8443
46     
47     # DMaaP consumer group.  
48     ml.distribution.CONSUMER_GROUP=aai-ml-group
49     
50     # DMaaP consumer ID
51     ml.distribution.CONSUMER_ID=aai-ml
52     
53     # SDC Environment Name.  This must match the environment name configured on the SDC
54     ml.distribution.ENVIRONMENT_NAME=<Environment Name>
55     
56     # Currently not used
57     ml.distribution.KEYSTORE_PASSWORD=
58     
59     # Currently not used
60     ml.distribution.KEYSTORE_FILE=
61     
62     # Obfuscated password to connect to the SDC.  To obtain this value, use the following Jetty library to 
63     # obfuscate the cleartext password:  http://www.eclipse.org/jetty/documentation/9.4.x/configuring-security-secure-passwords.html
64     ml.distribution.PASSWORD=OBF:<password>
65     
66     # How often (in seconds) to poll the DMaaP cluster for new model events
67     ml.distribution.POLLING_INTERVAL=<integer>
68     
69     # Timeout value (in seconds) when polling DMaaP for new model events
70     ml.distribution.POLLING_TIMEOUT=<integer>
71     
72     # Username to use when connecting to the SDC
73     ml.distribution.USER=<username>
74     
75     # Artifact type we want to download from the SDC (the values below will typically suffice)
76     ml.distribution.ARTIFACT_TYPES=MMODEL_QUERY_SPEC,TOSCA_CSAR
77     
78     # List of message bus addresses on which to listen for distribution events
79     ml.distribution.MSG_BUS_ADDRESSES=<host1>,<host2>
80
81     # URL of the A&AI
82     ml.aai.BASE_URL=https://<AAI-Hostname>:8443
83     
84     # A&AI endpoint to post models
85     ml.aai.MODEL_URL=/aai/v*/service-design-and-creation/models/model/
86     
87     # A&AI endpoint to post named queries
88     ml.aai.NAMED_QUERY_URL=/aai/v*/service-design-and-creation/named-queries/named-query/
89     
90     # A&AI endpoint to post vnf images
91     ml.aai.VNF_IMAGE_URL=/aai/v*/service-design-and-creation/vnf-images
92     
93     # Name of certificate to use in connecting to the A&AI
94     ml.aai.KEYSTORE_FILE=aai-os-cert.p12
95     
96     # Obfuscated keystore password to connect to the A&AI.  This is only required if using 2-way SSL (not basic auth).
97     # To obtain this value, use the following Jetty library to obfuscate the cleartext password:
98     # http://www.eclipse.org/jetty/documentation/9.4.x/configuring-security-secure-passwords.html
99     ml.aai.KEYSTORE_PASSWORD=OBF:<password>
100     
101     # Name of user to use when connecting to the A&AI.  This is only required if using basic auth (not 2-way SSL).
102     ml.aai.AUTH_USER=<username>
103     
104     # Obfuscated password to connect to the A&AI.  This is only required if using basic auth (not 2-way SSL).
105     # To obtain this value, use the following Jetty library to obfuscate the cleartext password:
106     # http://www.eclipse.org/jetty/documentation/9.4.x/configuring-security-secure-passwords.html
107     ml.aai.AUTH_PASSWORD=OBF:<password>
108     
109
110
111 ##### Contents of the /opt/app/model-loader/app-config/auth Directory
112
113 The following files must be present in this directory on the host machine:
114
115 _aai-os-cert.p12_
116
117 The certificate used to connected to the A&AI
118
119 **Start the service:**
120
121 You can now start the Docker container for the _Search Data Service_, in the following manner:
122
123         docker run -d \
124                 -e CONFIG_HOME=/opt/app/model-loader/config/ \
125             -v /logs:/logs \
126             -v /opt/app/model-loader/appconfig:/opt/app/model-loader/config \
127             --name model-loader \
128             {{your docker repo}}/model-loader
129     
130 Where,
131
132     {{your docker repo}} = The Docker repository you have published your image to.