HelloWorld E2SM Dockerfile update

ISSUE-ID: RICAPP-67

Signed-off-by: sjana <sj492a@att.com>
Change-Id: I53d787737f84efa6cb6b35543441c3c8e8d5ef2d
diff --git a/Dockerfile b/Dockerfile
index fbc58bb..7da30b6 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,7 @@
 #/*
 #==================================================================================
-#        Copyright (c) 2018-2019 AT&T Intellectual Property.
+#
+#        Copyright (c) 2019-2020 AT&T Intellectual Property.
 #
 #   Licensed under the Apache License, Version 2.0 (the "License");
 #   you may not use this file except in compliance with the License.
@@ -14,12 +15,13 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 #==================================================================================
-#*/
+# */
+
 ARG SCHEMA_PATH=schemas
 ARG STAGE_DIR=/tmp/helloworld-xapp
 
 #==================================================================================
-FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu16-c-go@sha256:f4ebcc792b501f283c7848018b6f106bbcecf1f9e699035950614460b3c330f8 as ricbuild
+FROM nexus3.o-ran-sc.org:10001/ubuntu:18.04 as ricbuild
 
 # to override repo base, pass in repo argument when running docker build:
 # docker build --build-arg REPOBASE=http://abc.def.org . ....
@@ -32,8 +34,6 @@
 WORKDIR ${STAGE_DIR}
 RUN apt-get update  \
      && apt-get install -y \
-     libcurl4-openssl-dev \
-     libcurl3 \
      cmake \
      git \
      build-essential \
@@ -50,33 +50,36 @@
 
 # Install mdclog using debian package hosted at packagecloud.io
 ARG MDC_VER=0.0.4-1
-RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/mdclog_${MDC_VER}_amd64.deb/download.deb
-RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/mdclog-dev_${MDC_VER}_amd64.deb/download.deb
+RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/mdclog_${MDC_VER}_amd64.deb/download.deb
+RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/mdclog-dev_${MDC_VER}_amd64.deb/download.deb
 RUN dpkg -i mdclog_${MDC_VER}_amd64.deb
 RUN dpkg -i mdclog-dev_${MDC_VER}_amd64.deb
 
 # Install RMr using debian package hosted at packagecloud.io
-ARG RMR_VER=3.6.5
-RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb
-RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb
+ARG RMR_VER=4.0.2
+RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb
+RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb
 RUN dpkg -i rmr_${RMR_VER}_amd64.deb
 RUN dpkg -i rmr-dev_${RMR_VER}_amd64.deb
 
+#Install RNIB libraries
+ARG RNIB_VER=1.0.0
+RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rnib_${RNIB_VER}_all.deb/download.deb
+RUN dpkg -i rnib_${RNIB_VER}_all.deb
+
 ## Install SDL Libraries
 WORKDIR ${STAGE_DIR}
 RUN apt-get install -y cpputest
 RUN apt-get remove -y libboost-all-dev
 RUN apt-get install -y  libboost-all-dev
 RUN apt-get install -y libhiredis-dev
-RUN apt-get install -y valgrind
+#RUN apt-get install -y valgrind
 
-RUN git config --global http.proxy http://one.proxy.att.com:8080
 RUN git clone https://gerrit.o-ran-sc.org/r/ric-plt/dbaas
 RUN cd dbaas/redismodule && \
     ./autogen.sh && \
     ./configure && \
     make all && \
-#    make test && \
     make install
 
 WORKDIR ${STAGE_DIR}
@@ -85,14 +88,11 @@
     ./autogen.sh && \
     ./configure && \
     make all && \
-#    make test && \
     make install
 
-RUN git config --global --unset http.proxy
 
 WORKDIR ${STAGE_DIR}
 ## Install rapidjson
-    #git checkout tags/v1.1.0 && \
 
 RUN git clone https://github.com/Tencent/rapidjson && \
     cd rapidjson && \
@@ -103,36 +103,32 @@
     cd ${STAGE_DIR} && \
     rm -rf rapidjson
 
-### Copy RNIB library and include rnib.
-RUN mkdir /usr/local/include/rnib
-
 ##-----------------------------------
 # Now install the program
 #------------------------------------
 COPY ./ ${STAGE_DIR}
 RUN ls -al
-COPY ${STAGE}/rnib/*.h /usr/local/include/rnib/
-COPY ${STAGE}/rnibreader_old.a /usr/local/lib/
+
 
 RUN export CPATH=$CPATH:/usr/local/include && \ 
     cd src && \
+#    source ./xapp_env.sh \
     make clean && \
     make install 
 
 COPY ${SCHEMA_PATH}/* /etc/xapp/ 
 COPY init/init_script.py /etc/xapp/init_script.py
-
+COPY init/routes.txt  /etc/xapp/routes.txt
 #---------------------------------------------
 # #Build the final version
 
-FROM ubuntu:16.04
+FROM ubuntu:18.04
 
 ARG SCHEMA_PATH
 ARG STAGE_DIR
 
 ## copy just the needed libraries install it into the final image
 COPY --from=ricbuild ${STAGE_DIR}/*.deb /tmp/
-#COPY --from=ricbuild /usr/local/libexec/. /usr/local/libexec/.
 COPY --from=ricbuild /usr/local/lib/librmr_si* /usr/local/lib/
 COPY --from=ricbuild /usr/local/lib/libsdl* /usr/local/lib/
 COPY --from=ricbuild /usr/local/libexec/redismodule/libredis* /usr/local/libexec/redismodule/
@@ -143,14 +139,8 @@
     apt-get clean
 COPY --from=ricbuild /etc/xapp/* /etc/xapp/
 COPY --from=ricbuild /usr/local/bin/hw_xapp_main /usr/local/bin/hw_xapp_main
-COPY --from=ricbuild ${STAGE_DIR}/rnib/*.h /usr/local/include/rnib/
-COPY --from=ricbuild ${STAGE_DIR}/rnibreader_old.a /usr/local/lib/
-
-##COPY --from=ricbuild /usr/local/bin/e2e-test-client /usr/local/bin/e2e-test-client
-##COPY --from=ricbuild /usr/local/bin/mock-e2term-server /usr/local/bin/mock-e2term-server
-##COPY --from=ricbuild /usr/local/bin/e2e-perf-client /usr/local/bin/e2e-perf-client
-##COPY --from=ricbuild /usr/local/bin/e2e-perf-server /usr/local/bin/e2e-perf-server
-##COPY --from=ricbuild /usr/local/bin/mock-a1-server /usr/local/bin/mock-a1-server
+COPY --from=ricbuild /usr/local/include/rnib/*.h /usr/local/include/rnib/
+COPY --from=ricbuild /usr/local/include/rnib/rnibreader.a /usr/local/include/rnib/
 
 
 RUN ldconfig
@@ -159,13 +149,9 @@
 ##ENV  PYTHONHOME=/opt/python3 \
 ##     PYTHONPATH=/opt/python3 \
 ENV  RMR_RTG_SVC="9999" \
+     RMR_SEED_RT="/etc/xapp/routes.txt" \
      LD_LIBRARY_PATH="/usr/local/lib:/usr/local/libexec" \
-     NAME=ADM_CTRL_XAPP \
-     PORT=tcp:4560 \
-     THREADS=1\
      VERBOSE=0 \
-     MESSAGE_TYPE=10002 \
-     RATE=1 \
      CONFIG_FILE=/opt/ric/config/config-file.json
      
       
diff --git a/Dockerfile-Unit-Tests b/Dockerfile-Unit-Tests
index 60efaca..dca0abc 100755
--- a/Dockerfile-Unit-Tests
+++ b/Dockerfile-Unit-Tests
@@ -1,25 +1,27 @@
 #/*
-#==================================================================================
-#        Copyright (c) 2018-2019 AT&T Intellectual Property.
-#
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
-#==================================================================================
-#*/
+##==================================================================================
+##
+##        Copyright (c) 2019-2020 AT&T Intellectual Property.
+##
+##   Licensed under the Apache License, Version 2.0 (the "License");
+##   you may not use this file except in compliance with the License.
+##   You may obtain a copy of the License at
+##
+##       http://www.apache.org/licenses/LICENSE-2.0
+##
+##   Unless required by applicable law or agreed to in writing, software
+##   distributed under the License is distributed on an "AS IS" BASIS,
+##   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+##   See the License for the specific language governing permissions and
+##   limitations under the License.
+##==================================================================================
+## */
+
 ARG SCHEMA_PATH=schemas
 ARG STAGE_DIR=/tmp/helloworld-xapp
 
 #==================================================================================
-FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu16-c-go@sha256:f4ebcc792b501f283c7848018b6f106bbcecf1f9e699035950614460b3c330f8 as ricbuild
+FROM nexus3.o-ran-sc.org:10001/ubuntu:18.04 as ricbuild
 
 # to override repo base, pass in repo argument when running docker build:
 # docker build --build-arg REPOBASE=http://abc.def.org . ....
@@ -32,8 +34,6 @@
 WORKDIR ${STAGE_DIR}
 RUN apt-get update  \
      && apt-get install -y \
-     libcurl4-openssl-dev \
-     libcurl3 \
      cmake \
      git \
      build-essential \
@@ -50,27 +50,32 @@
 
 # Install mdclog using debian package hosted at packagecloud.io
 ARG MDC_VER=0.0.4-1
-RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/mdclog_${MDC_VER}_amd64.deb/download.deb
-RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/mdclog-dev_${MDC_VER}_amd64.deb/download.deb
+RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/mdclog_${MDC_VER}_amd64.deb/download.deb
+RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/mdclog-dev_${MDC_VER}_amd64.deb/download.deb
 RUN dpkg -i mdclog_${MDC_VER}_amd64.deb
 RUN dpkg -i mdclog-dev_${MDC_VER}_amd64.deb
 
 # Install RMr using debian package hosted at packagecloud.io
-ARG RMR_VER=3.6.2
-RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb
-RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb
+ARG RMR_VER=4.0.2
+RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb
+RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb
 RUN dpkg -i rmr_${RMR_VER}_amd64.deb
 RUN dpkg -i rmr-dev_${RMR_VER}_amd64.deb
 
 ##Iinstall Google test
 
 WORKDIR ${STAGE_DIR}
-RUN apt-get install libgtest-dev
+RUN apt-get install -y libgtest-dev
 RUN cd /usr/src/gtest \
     && cmake CMakeLists.txt \
     && make \
     && cp *.a /usr/local/lib
 
+#Install RNIB libraries
+ARG RNIB_VER=1.0.0
+RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rnib_${RNIB_VER}_all.deb/download.deb
+RUN dpkg -i rnib_${RNIB_VER}_all.deb
+
 
 ## Install SDL Libraries
 WORKDIR ${STAGE_DIR}
@@ -78,15 +83,12 @@
 RUN apt-get remove -y libboost-all-dev
 RUN apt-get install -y  libboost-all-dev
 RUN apt-get install -y libhiredis-dev
-RUN apt-get install -y valgrind
 
-RUN git config --global http.proxy http://one.proxy.att.com:8080
 RUN git clone https://gerrit.o-ran-sc.org/r/ric-plt/dbaas
 RUN cd dbaas/redismodule && \
     ./autogen.sh && \
     ./configure && \
     make all && \
-##    make test && \
     make install
 
 WORKDIR ${STAGE_DIR}
@@ -95,14 +97,11 @@
     ./autogen.sh && \
     ./configure && \
     make all && \
-#    make test && \
     make install
 
-RUN git config --global --unset http.proxy
 
 WORKDIR ${STAGE_DIR}
 ## Install rapidjson
-    #git checkout tags/v1.1.0 && \
 
 RUN git clone https://github.com/Tencent/rapidjson && \
     cd rapidjson && \
@@ -113,16 +112,11 @@
     cd ${STAGE_DIR} && \
     rm -rf rapidjson
 
-### Copy RNIB library and include rnib.
-RUN mkdir /usr/local/include/rnib
-
 ##-----------------------------------
 # Now install the program
 #------------------------------------
 COPY ./ ${STAGE_DIR}
 RUN ls -al
-COPY ${STAGE}/rnib/*.h /usr/local/include/rnib/
-COPY ${STAGE}/rnibreader_old.a /usr/local/lib/
 
 RUN export CPATH=$CPATH:/usr/local/include && \ 
     cd test && \
@@ -131,20 +125,18 @@
 
 COPY ${SCHEMA_PATH}/* /etc/xapp/
 COPY init/init_script.py /etc/xapp/init_script.py
-
+COPY init/routes.txt /etc/xapp/routes.txt
 
 #---------------------------------------------
 # #Build the final version
-##FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu16-c-go:1-u16.04-nng1.1.1
 
-FROM ubuntu:16.04
+FROM ubuntu:18.04
 
 ARG SCHEMA_PATH
 ARG STAGE_DIR
 
 ## copy just the needed libraries install it into the final image
 COPY --from=ricbuild ${STAGE_DIR}/*.deb /tmp/
-#COPY --from=ricbuild /usr/local/libexec/. /usr/local/libexec/.
 COPY --from=ricbuild /usr/local/lib/librmr_si* /usr/local/lib/
 COPY --from=ricbuild /usr/local/lib/libgtest* /usr/local/lib/
 COPY --from=ricbuild /usr/local/lib/libsdl* /usr/local/lib/
@@ -156,14 +148,8 @@
     apt-get clean
 COPY --from=ricbuild /etc/xapp/* /etc/xapp/
 COPY --from=ricbuild /usr/local/bin/hw_unit_tests /usr/local/bin/hw_unit_tests
-COPY --from=ricbuild ${STAGE_DIR}/rnib/*.h /usr/local/include/rnib/
-COPY --from=ricbuild ${STAGE_DIR}/rnibreader_old.a /usr/local/lib/
-
-##COPY --from=ricbuild /usr/local/bin/e2e-test-client /usr/local/bin/e2e-test-client
-##COPY --from=ricbuild /usr/local/bin/mock-e2term-server /usr/local/bin/mock-e2term-server
-##COPY --from=ricbuild /usr/local/bin/e2e-perf-client /usr/local/bin/e2e-perf-client
-##COPY --from=ricbuild /usr/local/bin/e2e-perf-server /usr/local/bin/e2e-perf-server
-##COPY --from=ricbuild /usr/local/bin/mock-a1-server /usr/local/bin/mock-a1-server
+COPY --from=ricbuild /usr/local/include/rnib/*.h /usr/local/include/rnib/
+COPY --from=ricbuild /usr/local/include/rnib/rnibreader.a /usr/local/include/rnib/
 
 
 RUN ldconfig
@@ -172,13 +158,8 @@
 ##ENV  PYTHONHOME=/opt/python3 \
 ##     PYTHONPATH=/opt/python3 \
 ENV  RMR_RTG_SVC="9999" \
+     RMR_SEED_RT="/etc/xapp/routes.txt" \
      LD_LIBRARY_PATH="/usr/local/lib:/usr/local/libexec" \
-     NAME=ADM_CTRL_XAPP \
-     PORT=tcp:4560 \
-     THREADS=1\
-     VERBOSE=0 \
-     MESSAGE_TYPE=10002 \
-     RATE=1 \
      CONFIG_FILE=/opt/ric/config/config-file.json \
      EXE_FILE=/usr/local/bin/hw_unit_tests     
       
diff --git a/README b/README
index 9945315..c81cc68 100644
--- a/README
+++ b/README
@@ -1 +1,41 @@
-#Future directory for HELLOWORLD
+==================================================================================
+
+        Copyright (c) 2019-2020 AT&T Intellectual Property.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================================
+
+This repository consists of HelloWorld Xapp developed in C++. Its envisioned to be the most simplest example Xapp. 
+It is required to have following features
+
+1) E2 Subscription Handling
+2) A1 Policy Handling
+3) DB Access: SDL and RNIB
+4) RMR Health Check/A1 Health Check
+5) Helloworld E2SM
+6) ...
+
+
+
+
+Steps for installation/running HWXapp.
+$ cd init
+$ source ./xapp_env.sh
+$cd ../src
+$ make
+$ ./hw_xapp_main
+
+Steps for running test scripts.
+$cd test
+$make
+$./hw_unit_tests