From 0941e45b7a5b986f74704fe964d051bd0c733c5c Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 17 Jul 2018 16:34:31 -0400 Subject: [PATCH] Install features at build time 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) Former-commit-id: 86a008a5b0f0f22356f64b86d9c4c51f9cf09cdc --- installation/sdnc/pom.xml | 87 +++++++++++--------------- installation/sdnc/src/main/docker/Dockerfile | 11 ++++ installation/sdnc/src/main/scripts/startODL.sh | 23 +++---- 3 files changed, 56 insertions(+), 65 deletions(-) diff --git a/installation/sdnc/pom.xml b/installation/sdnc/pom.xml index 3566e27e..538e1239 100644 --- a/installation/sdnc/pom.xml +++ b/installation/sdnc/pom.xml @@ -20,43 +20,43 @@ onap/sdnc-image ${project.version} - 1.3.4 + 1.4.0-SNAPSHOT ${https_proxy} + deploy + true yyyyMMdd'T'HHmmss'Z' - - - org.onap.sdnc.northbound - generic-resource-api-installer - ${sdnc.northbound.version} - zip - - - org.onap.sdnc.northbound - vnfapi-installer - ${sdnc.northbound.version} - zip - - - org.onap.sdnc.northbound - vnftools-installer - ${sdnc.northbound.version} - zip - - - org.onap.ccsdk.sli.adaptors - ansible-adapter-installer - ${ccsdk.sli.adaptors.version} - zip - - - org.onap.ccsdk.sli.northbound - lcm-installer - ${ccsdk.sli.northbound.version} - zip - - + + + org.onap.sdnc.northbound + generic-resource-api-installer + ${sdnc.northbound.version} + repo + zip + + + org.onap.sdnc.northbound + vnfapi-installer + ${sdnc.northbound.version} + repo + zip + + + org.onap.sdnc.northbound + vnftools-installer + ${sdnc.northbound.version} + repo + zip + + + org.onap.sdnc.northbound + sdnc-northbound-features-installer + ${sdnc.northbound.version} + repo + zip + + @@ -125,7 +125,7 @@ push-images - deploy + ${docker.push.phase} build push @@ -266,26 +266,13 @@ 3.0.2 - unpack-sdnc-features + unpack sdnc features generate-sources unpack-dependencies - ${basedir}/target/docker-stage/opt/onap/sdnc/features - org.onap.sdnc - true - - - - unpack-extra-ccsdk-features - generate-sources - - unpack-dependencies - - - ${basedir}/target/docker-stage/opt/onap/ccsdk/features - org.onap.ccsdk + ${basedir}/target/docker-stage true @@ -343,6 +330,6 @@ - openECOMP + ONAP diff --git a/installation/sdnc/src/main/docker/Dockerfile b/installation/sdnc/src/main/docker/Dockerfile index 3cd107dc..13a644e4 100755 --- a/installation/sdnc/src/main/docker/Dockerfile +++ b/installation/sdnc/src/main/docker/Dockerfile @@ -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 diff --git a/installation/sdnc/src/main/scripts/startODL.sh b/installation/sdnc/src/main/scripts/startODL.sh index fa1810b3..55c04a15 100755 --- a/installation/sdnc/src/main/scripts/startODL.sh +++ b/installation/sdnc/src/main/scripts/startODL.sh @@ -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 -- 2.16.6