[DCAEGEN2] Release dcaegen2-services-mapper container
[dcaegen2/services/mapper.git] / snmpmapper / README.md
1 # SNMP Mapper
2
3 # Summary
4 snmpmapper is just helper application for uploading the mapping file to DB. Here simple web page is given to upload file in DB 
5
6 ### Build Instructions
7
8 This project is organized as a mvn project and has "org.onap.dcaegen2" as parent project. The build generate a jar and package into docker container. 
9
10 ```
11 git clone https://gerrit.onap.org/r/p/dcaegen2/services/mapper.git
12 mvn clean install
13 ```
14
15 ### Build Docker image
16
17 The following Maven command will build the JAR, build the Docker image to the local machine registry and then push the same image to the specified remote registry.
18
19 ```
20 mvn clean package docker:build -DpushImageTag
21 ```
22
23
24 ### Run via Docker
25
26 Execute this to run.
27
28 ####snmpmapper
29
30 ```
31  sudo docker run -d -p 8084:8080/tcp -e URL_JDBC=jdbc:postgresql://10.53.172.138:5432/postgres -e JDBC_USERNAME=postgres -e JDBC_PASSWORD=root -e DMAAPHOST=10.53.172.156 -e CONSUL_HOST=10.53.172.109 -e HOSTNAME=static-dcaegen2-services-msnmp -e MR_DEFAULT_PORT_NUMBER=3904 -e CONFIG_BINDING_SERVICE=config_binding_service nexus3.onap.org:10003/onap/org.onap.dcaegen2.services.mapper.snmpmapper:latest
32 ```
33
34 ### Environment variables in Docker Container
35 Most of the configuration of how UniversalVesAdapter should be started and managed is done through environment variables.
36 Some of them are set during the image build process and some of them are defined manually or by
37 a particular deployment system.
38
39 Variables set manually / coming from deployment system:
40 - DMAAPHOST-should contain an address to DMaaP, so that event publishing can work
41 - MR_PORT - DMaaP Exposed Port
42 - URL_JDBC- JDBC URL
43 - JDBC_USERNAME- Username for DB user
44 - JDBC_PASSWORD-Password for DB user
45 - CONSUL_HOST - 
46 - CBS_PROTOCOL - Config Binding Service protocol by default set to **http**, if it is need to change it then that can be set to different value
47 - CONFIG_BINDING_SERVICE - 
48 - HOSTNAME -
49
50
51
52 ### Docker file system layout
53 The main directory where all code resides in docker container
54 looks like this and is located in /opt/app/VESAdapter
55 ```
56 <host>:/opt/app/SnmpMapper# ls
57 Dockerfile  bin  lib  logs
58 ```
59 - bin contains startup script for running the application
60 - lib contains all libraries that are pulled into the app during maven build
61 - logs contains application logs
62
63 ```nexus3.onap.org:10003/snapshots/onap/org.onap.dcaegen2.services.mapper.vesadapter.snmpmapper:latest
64 ```