Install features at build time 57/56657/1
authorTimoney, Dan (dt5972) <dt5972@att.com>
Tue, 17 Jul 2018 20:34:31 +0000 (16:34 -0400)
committerTimoney, Dan (dt5972) <dt5972@att.com>
Tue, 17 Jul 2018 20:34:31 +0000 (16:34 -0400)
Update docker design to install features at docker build time instead of
installing features on container start up.  This avoids need to bounce
container on startup.

Change-Id: Iacfba1f8c36c7b03f23fb66e9aff910d09e7cfa4
Issue-ID: SDNC-394
Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
Former-commit-id: 86a008a5b0f0f22356f64b86d9c4c51f9cf09cdc

installation/sdnc/pom.xml
installation/sdnc/src/main/docker/Dockerfile
installation/sdnc/src/main/scripts/startODL.sh

index 3566e27..538e123 100644 (file)
        <properties>
                <image.name>onap/sdnc-image</image.name>
                <sdnc.project.version>${project.version}</sdnc.project.version>
-               <sdnc.northbound.version>1.3.4</sdnc.northbound.version>
+               <sdnc.northbound.version>1.4.0-SNAPSHOT</sdnc.northbound.version>
                <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
+               <docker.push.phase>deploy</docker.push.phase>
+               <docker.verbose>true</docker.verbose>
                <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
        </properties>
 
-    <dependencies>
-               <dependency>
-                       <groupId>org.onap.sdnc.northbound</groupId>
-                       <artifactId>generic-resource-api-installer</artifactId>
-                       <version>${sdnc.northbound.version}</version>
-                       <type>zip</type>
-               </dependency>
-               <dependency>
-                       <groupId>org.onap.sdnc.northbound</groupId>
-                       <artifactId>vnfapi-installer</artifactId>
-                       <version>${sdnc.northbound.version}</version>
-                       <type>zip</type>
-               </dependency>
-               <dependency>
-                       <groupId>org.onap.sdnc.northbound</groupId>
-                       <artifactId>vnftools-installer</artifactId>
-                       <version>${sdnc.northbound.version}</version>
-                       <type>zip</type>
-               </dependency>
-               <dependency>
-                       <groupId>org.onap.ccsdk.sli.adaptors</groupId>
-                       <artifactId>ansible-adapter-installer</artifactId>
-                       <version>${ccsdk.sli.adaptors.version}</version>
-                       <type>zip</type>
-               </dependency>
-               <dependency>
-                       <groupId>org.onap.ccsdk.sli.northbound</groupId>
-                       <artifactId>lcm-installer</artifactId>
-                       <version>${ccsdk.sli.northbound.version}</version>
-                       <type>zip</type>
-               </dependency>
-    </dependencies>
+       <dependencies>
+               <dependency>
+                       <groupId>org.onap.sdnc.northbound</groupId>
+                       <artifactId>generic-resource-api-installer</artifactId>
+                       <version>${sdnc.northbound.version}</version>
+                       <classifier>repo</classifier>
+                       <type>zip</type>
+               </dependency>
+               <dependency>
+                       <groupId>org.onap.sdnc.northbound</groupId>
+                       <artifactId>vnfapi-installer</artifactId>
+                       <version>${sdnc.northbound.version}</version>
+                       <classifier>repo</classifier>
+                       <type>zip</type>
+               </dependency>
+               <dependency>
+                       <groupId>org.onap.sdnc.northbound</groupId>
+                       <artifactId>vnftools-installer</artifactId>
+                       <version>${sdnc.northbound.version}</version>
+                       <classifier>repo</classifier>
+                       <type>zip</type>
+               </dependency>
+               <dependency>
+                       <groupId>org.onap.sdnc.northbound</groupId>
+                       <artifactId>sdnc-northbound-features-installer</artifactId>
+                       <version>${sdnc.northbound.version}</version>
+                       <classifier>repo</classifier>
+                       <type>zip</type>
+               </dependency>
+       </dependencies>
 
        <build>
                <plugins>
 
                                        <execution>
                                                <id>push-images</id>
-                                               <phase>deploy</phase>
+                                               <phase>${docker.push.phase}</phase>
                                                <goals>
                                                        <goal>build</goal>
                                                        <goal>push</goal>
                                <version>3.0.2</version>
                                <executions>
                                        <execution>
-                                               <id>unpack-sdnc-features</id>
+                                               <id>unpack sdnc features</id>
                                                <phase>generate-sources</phase>
                                                <goals>
                                                        <goal>unpack-dependencies</goal>
                                                </goals>
                                                <configuration>
-                                                       <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/features</outputDirectory>
-                                                       <includeGroupIds>org.onap.sdnc</includeGroupIds>
-                                                       <excludeTransitive>true</excludeTransitive>
-                                               </configuration>
-                                       </execution>
-                                       <execution>
-                                               <id>unpack-extra-ccsdk-features</id>
-                                               <phase>generate-sources</phase>
-                                               <goals>
-                                                       <goal>unpack-dependencies</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/features</outputDirectory>
-                                                       <includeGroupIds>org.onap.ccsdk</includeGroupIds>
+                                                       <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
                                                        <excludeTransitive>true</excludeTransitive>
                                                </configuration>
                                        </execution>
 
        </build>
        <organization>
-               <name>openECOMP</name>
+               <name>ONAP</name>
        </organization>
 </project>
index 3cd107d..13a644e 100755 (executable)
@@ -9,6 +9,8 @@ ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties
 ENV SDNC_STORE_DIR /opt/onap/sdnc/data/stores
 ENV SSL_CERTS_DIR /etc/ssl/certs
 ENV JAVA_SECURITY_DIR $SSL_CERTS_DIR/java
+ENV SDNC_NORTHBOUND_REPO mvn:org.onap.sdnc.northbound/sdnc-northbound-all/${sdnc.northbound.version}/xml/features
+
 
 
 # imstall ssl and java certificates
@@ -26,6 +28,15 @@ COPY idmlight.db.mv.db /opt/opendaylight/current/data
 COPY opt /opt
 RUN test -L /opt/sdnc || ln -s /opt/onap/sdnc /opt/sdnc
 
+# copy SDNC mvn artifacts to ODL repository
+COPY system /tmp/system
+RUN rsync -a /tmp/system $ODL_HOME && rm -rf /tmp/system
+
+# Add SDNC repositories to boot repositories
+RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.orig
+RUN cat $ODL_HOME/etc/org.apache.karaf.features.cfg.orig | sed -e "\|featuresRepositories|s|$|,${SDNC_NORTHBOUND_REPO}|" > $ODL_HOME/etc/org.apache.karaf.features.cfg.1
+RUN cat $ODL_HOME/etc/org.apache.karaf.features.cfg.1 | sed -e "\|featuresBoot=config|s|$|,sdnc-northbound-all|" > $ODL_HOME/etc/org.apache.karaf.features.cfg
+
 
 # ENTRYPOINT exec /opt/opendaylight/current/bin/karaf
 EXPOSE 8181
index fa1810b..55c04a1 100755 (executable)
@@ -28,8 +28,9 @@ function enable_odl_cluster(){
   fi
 
   echo "Installing Opendaylight cluster features"
-  ${ODL_HOME}/bin/client feature:install odl-mdsal-clustering
-  ${ODL_HOME}/bin/client feature:install odl-jolokia
+  cat $ODL_HOME/etc/org.apache.karaf.features.cfg | sed -e "\|featuresBoot=config|s|$|,odl-mdsal-clustering,odl-jolokia|" > $ODL_HOME/etc/org.apache.karaf.features.cfg
+  #${ODL_HOME}/bin/client feature:install odl-mdsal-clustering
+  #${ODL_HOME}/bin/client feature:install odl-jolokia
 
   echo "Update cluster information statically"
   hm=$(hostname)
@@ -95,26 +96,18 @@ then
        ${SDNC_HOME}/bin/installSdncDb.sh
        echo "Installing SDN-C keyStore"
        ${SDNC_HOME}/bin/addSdncKeyStore.sh
-       echo "Starting OpenDaylight"
-       ${CCSDK_HOME}/bin/installOdlHostKey.sh
-       ${ODL_HOME}/bin/start
-       echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize"
-       sleep ${SLEEP_TIME}
-       echo "Installing SDN-C platform features"
-       ${SDNC_HOME}/bin/installFeatures.sh
+
+       #${CCSDK_HOME}/bin/installOdlHostKey.sh
+
        if [ -x ${SDNC_HOME}/svclogic/bin/install.sh ]
        then
                echo "Installing directed graphs"
                ${SDNC_HOME}/svclogic/bin/install.sh
        fi
 
-        if $ENABLE_ODL_CLUSTER ; then enable_odl_cluster ; fi
+    if $ENABLE_ODL_CLUSTER ; then enable_odl_cluster ; fi
 
-       echo "Restarting OpenDaylight"
-       ${ODL_HOME}/bin/stop
-       echo "Waiting 60 seconds for OpenDaylight stop to complete"
-    sleep 60
        echo "Installed at `date`" > ${SDNC_HOME}/.installed
 fi
 
-exec ${ODL_HOME}/bin/karaf
+exec ${ODL_HOME}/bin/karaf server