Feature sol006 and 7184: Set new generation RO as default 02/10002/3
authortierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 25 Nov 2020 13:16:51 +0000 (13:16 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 26 Nov 2020 13:58:35 +0000 (13:58 +0000)
New Generation RO uses kafka, mongo
It manages OSMRO_ variables

Change-Id: I93c898d603af3534a5e5daf57a01fdff6f59f9fe
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
docker/RO/Dockerfile
installers/docker/docker-compose.yaml
installers/docker/osm_pods/ro.yaml
installers/full_install_osm.sh

index 299fbbe..4783c01 100644 (file)
@@ -29,14 +29,14 @@ ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
 ARG REPOSITORY=testing
 
 RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
-RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} RO IM common openvim" && apt-get update
+RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} RO IM common" && apt-get update
 
 ARG RO_VERSION
 ARG IM_VERSION
 
 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y python3-osm-im${IM_VERSION} \
     python3-osm-ro-plugin${RO_VERSION} \
-    python3-osm-ro${RO_VERSION} python3-osm-roclient${RO_VERSION} \
+    python3-osm-ro${RO_VERSION} python3-osm-roclient${RO_VERSION} python3-osm-ng-ro${RO_VERSION} \
     python3-osm-rosdn-arista-cloudvision${RO_VERSION} python3-osm-rosdn-dpb${RO_VERSION} \
     python3-osm-rosdn-dynpac${RO_VERSION} python3-osm-rosdn-floodlightof${RO_VERSION} \
     python3-osm-rosdn-ietfl2vpn${RO_VERSION}  python3-osm-rosdn-juniper-contrail${RO_VERSION} \
@@ -76,7 +76,24 @@ ENV RO_DB_NAME=mano_db
 ENV RO_DB_OVIM_NAME=mano_vim_db
 ENV OPENMANO_TENANT=osm
 
+# database
+ENV OSMRO_DATABASE_DRIVER mongo
+ENV OSMRO_DATABASE_URI mongodb://mongo:27017
+# ENV OSMRO_DATABASE_COMMONKEY  xxx
+# ENV OSMRO_DATABASE_USER  xxx
+# ENV OSMRO_DATABASE_PASSWORD  xxx
+
+# message
+ENV OSMRO_MESSAGE_DRIVER  kafka
+ENV OSMRO_MESSAGE_HOST    kafka
+ENV OSMRO_MESSAGE_PORT    9092
+
+# logs
+ENV OSMRO_LOG_LEVEL       INFO
+
 HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \
-  CMD curl --silent --fail localhost:9090/openmano/tenants || exit 1
-CMD /usr/bin/RO-start.sh
+  CMD curl --silent --fail http://localhost:9090/ro || exit 1
+  # CMD curl --silent --fail localhost:9090/openmano/tenants || exit 1
+# CMD /usr/bin/RO-start.sh
+CMD python3 -m osm_ng_ro.ro_main
 
index eba6100..ea3661e 100644 (file)
@@ -161,6 +161,7 @@ services:
       - osm_packages:/app/storage
     environment:
       OSMLCM_RO_HOST: ro
+      OSMLCM_RO_PORT: "9090"
       OSMLCM_DATABASE_HOST: mongo
       OSMLCM_MESSAGE_HOST: kafka
     env_file:
@@ -197,12 +198,13 @@ services:
       - netOSM
     environment:
       RO_DB_HOST: mysql
+      OSMRO_DATABASE_HOST: mongo
+      OSMRO_MESSAGE_HOST: kafka
     env_file:
       - ./ro.env
     #depends_on:
-    #  - mysql
-    volumes:
-      - ro:/var/log/osm
+    #  - mongo
+    #  - kafka
     ports:
       - "${OSM_RO_PORTS:-9090:9090}"
     logging:
index 6113a99..9ac2801 100644 (file)
@@ -47,7 +47,7 @@ spec:
       initContainers:
       - name: ro-db-test
         image: alpine:latest
-        command: ["sh", "-c", "until nc -zvw1 mysql 3306; do  sleep 3 ; done; exit 0"]
+        command: ["sh", "-c", "until (nc -zvw1 kafka 9092 && nc -zvw1 mongo 27017 ); do sleep 3; done; exit 0"]
       containers:
       - name: ro
         image: opensourcemano/ro:8
@@ -60,10 +60,4 @@ spec:
         envFrom:
         - secretRef:
            name: ro-secret
-        volumeMounts:
-         - name: ro
-           mountPath: /var/log/osm
-      volumes:
-      - name: ro
-        hostPath:
-         path: /var/lib/osm/osm_ro/_data
+
index 39d2850..5878ab9 100755 (executable)
@@ -698,6 +698,9 @@ function generate_docker_env_files() {
     if [ ! -f $OSM_DOCKER_WORK_DIR/ro.env ]; then
         echo "RO_DB_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}" |$WORKDIR_SUDO tee $OSM_DOCKER_WORK_DIR/ro.env
     fi
+    if ! grep -Fq "OSMRO_DATABASE_COMMONKEY" $OSM_DOCKER_WORK_DIR/ro.env; then
+        echo "OSMRO_DATABASE_COMMONKEY=${OSM_DATABASE_COMMONKEY}" | $WORKDIR_SUDO tee -a $OSM_DOCKER_WORK_DIR/ro.env
+    fi
 
     # Keystone
     KEYSTONE_DB_PASSWORD=$(generate_secret)