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