From 55378e7480442b8cee46d215a85e194c56b38f36 Mon Sep 17 00:00:00 2001 From: Hesam Rahimi Date: Mon, 7 Jun 2021 20:02:32 +0000 Subject: Effort to reduce image layer and size Removing few ENV version variable and those should be read from pom properties (maven-resource-plugin filtering true) Combined Dockerfile and Standalone.Dockerfile Adding Docker build arg AAF which will decide whether to add aaa-app-config.xml in docker image or not for standalone Updated docker-maven-plugin to 0.34.0 to have noCache true Removing start-it-container execution as it's being tested by CSIT Replacing maven-exec-plugin with maven-antrun-plugin Updating latest base docker images versions Updating parent version to 2.1.7 Issue-ID: CCSDK-3226 Signed-off-by: Singal, Kapil (ks220y) Change-Id: I68f8f4780804a2014b73b5eeb9dba29d1896a602 Former-commit-id: 866ddebbcac80c38c79c46bb37373123a0c678f0 --- installation/admportal/pom.xml | 4 +- installation/ansible-server/pom.xml | 23 +- installation/dmaap-listener/pom.xml | 65 ++--- installation/pom.xml | 5 +- installation/sdnc-web/pom.xml | 23 +- installation/sdnc/pom.xml | 288 ++++++--------------- installation/sdnc/src/main/dc/docker-compose.yaml | 40 ++- installation/sdnc/src/main/docker/Dockerfile | 78 ++++-- .../sdnc/src/main/docker/standalone.Dockerfile | 61 ----- .../sdnc/src/main/scripts/installFeatures.sh | 5 +- installation/sdnc/src/main/scripts/installZips.sh | 21 +- installation/sdnc/src/main/scripts/startODL.sh | 48 ++-- installation/src/main/yaml/docker-compose.yml | 14 +- installation/src/main/yaml/sdnc-basic.yml | 8 +- installation/ueb-listener/pom.xml | 67 ++--- 15 files changed, 261 insertions(+), 489 deletions(-) delete mode 100755 installation/sdnc/src/main/docker/standalone.Dockerfile (limited to 'installation') diff --git a/installation/admportal/pom.xml b/installation/admportal/pom.xml index f70ebb05..34e44b62 100644 --- a/installation/admportal/pom.xml +++ b/installation/admportal/pom.xml @@ -5,12 +5,12 @@ org.onap.sdnc.oam installation - 2.0.1-SNAPSHOT + 2.2.0-SNAPSHOT org.onap.sdnc.oam installation-admportal - 2.0.1-SNAPSHOT + 2.2.0-SNAPSHOT pom sdnc-oam :: installation :: ${project.artifactId} diff --git a/installation/ansible-server/pom.xml b/installation/ansible-server/pom.xml index b4f9d0dc..bb11792e 100644 --- a/installation/ansible-server/pom.xml +++ b/installation/ansible-server/pom.xml @@ -8,9 +8,7 @@ 2.2.0-SNAPSHOT - org.onap.sdnc.oam installation-ansible-server - 2.2.0-SNAPSHOT pom sdnc-oam :: installation :: ${project.artifactId} @@ -33,6 +31,7 @@ org.codehaus.groovy.maven gmaven-plugin + 1.0 validate @@ -64,7 +63,7 @@ **/* - false + true @@ -82,7 +81,7 @@ io.fabric8 docker-maven-plugin - 0.28.0 + 0.34.0 false @@ -90,7 +89,8 @@ ${image.name} try - ${basedir}/target/docker-stage + true + ${basedir}/target/docker-stage Dockerfile ${project.docker.latestminortag.version} @@ -100,19 +100,12 @@ + ${docker.verbose} + ${docker.skip.push} - generate-images - package - - build - - - - - push-images - deploy + build-push-images build push diff --git a/installation/dmaap-listener/pom.xml b/installation/dmaap-listener/pom.xml index 75490cdd..08afb99f 100644 --- a/installation/dmaap-listener/pom.xml +++ b/installation/dmaap-listener/pom.xml @@ -8,9 +8,7 @@ 2.2.0-SNAPSHOT - org.onap.sdnc.oam installation-dmaap-listener - 2.2.0-SNAPSHOT pom sdnc-oam :: installation :: ${project.artifactId} @@ -30,11 +28,10 @@ - - org.codehaus.groovy.maven gmaven-plugin + 1.0 validate @@ -47,9 +44,6 @@ - - - maven-resources-plugin 2.6 @@ -73,7 +67,6 @@ - copy-scripts @@ -88,12 +81,11 @@ *.sh - false + true - copy-properties @@ -108,12 +100,11 @@ * - false + true - @@ -143,34 +134,22 @@ - - org.codehaus.mojo - exec-maven-plugin - 1.5.0 + org.apache.maven.plugins + maven-antrun-plugin + 1.8 - - - - change shell permissions + change-shell-permissions process-sources - - exec - - /usr/bin/find - - ${basedir}/target/docker-stage/opt/onap/sdnc - -name - *.sh - -exec - chmod - +x - {} - ; - + + + + + run + @@ -185,7 +164,7 @@ io.fabric8 docker-maven-plugin - 0.28.0 + 0.34.0 false @@ -193,7 +172,8 @@ ${image.name} try - ${basedir}/target/docker-stage + true + ${basedir}/target/docker-stage Dockerfile ${project.docker.latestminortag.version} @@ -203,19 +183,12 @@ + ${docker.verbose} + ${docker.skip.push} - generate-images - package - - build - - - - - push-images - deploy + build-push-images build push diff --git a/installation/pom.xml b/installation/pom.xml index 2d9e254c..4ca97f45 100644 --- a/installation/pom.xml +++ b/installation/pom.xml @@ -8,9 +8,7 @@ 2.2.0-SNAPSHOT - org.onap.sdnc.oam installation - 2.2.0-SNAPSHOT pom sdnc-oam :: installation @@ -30,5 +28,8 @@ ${maven.build.timestamp} UTF-8 UTF-8 + + false + true diff --git a/installation/sdnc-web/pom.xml b/installation/sdnc-web/pom.xml index 5da89768..135b62ca 100644 --- a/installation/sdnc-web/pom.xml +++ b/installation/sdnc-web/pom.xml @@ -8,9 +8,7 @@ 2.2.0-SNAPSHOT - org.onap.sdnc.oam installation-sdnc-web - 2.2.0-SNAPSHOT pom sdnc-oam :: installation :: ${project.artifactId} @@ -23,8 +21,6 @@ ${maven.build.timestamp} ${https_proxy} yyyyMMdd'T'HHmmss'Z' - deploy - true @@ -142,7 +138,7 @@ io.fabric8 docker-maven-plugin - 0.16.5 + 0.34.0 false @@ -150,8 +146,9 @@ ${image.name} try - ${basedir}/target/docker-stage - ${basedir}/target/docker-stage/Dockerfile + true + ${basedir}/target/docker-stage + Dockerfile ${project.docker.latestminortag.version} ${project.docker.latestfulltag.version} @@ -160,18 +157,12 @@ + ${docker.verbose} + ${docker.skip.push} - generate-images - package - - build - - - - push-images - ${docker.push.phase} + build-push-images build push diff --git a/installation/sdnc/pom.xml b/installation/sdnc/pom.xml index 74231066..43d60015 100644 --- a/installation/sdnc/pom.xml +++ b/installation/sdnc/pom.xml @@ -8,9 +8,7 @@ 2.2.0-SNAPSHOT - org.onap.sdnc.oam installation-sdnc - 2.2.0-SNAPSHOT pom sdnc-oam :: installation :: ${project.artifactId} @@ -22,17 +20,16 @@ onap/sdnc-aaf-image onap/sdnc-image - ${project.version} - ${maven.build.timestamp} ${ccsdk.docker.odlsli.alpine.version} org.onap.sdnc.p12 8443 + + yyyyMMdd'T'HHmmss'Z' + ${maven.build.timestamp} + ${https_proxy} - deploy - true true - yyyyMMdd'T'HHmmss'Z' @@ -43,7 +40,7 @@ zip repo - + org.onap.sdnc.northbound optical-service-installer ${sdnc.northbound.version} @@ -68,11 +65,10 @@ - - org.codehaus.groovy.maven gmaven-plugin + 1.0 validate @@ -89,183 +85,56 @@ io.fabric8 docker-maven-plugin - 0.28.0 + 0.34.0 false + + + + ${image.name} + + try + true + ${basedir}/target/docker-stage + Dockerfile + + true + + + ${project.docker.latestminortag.version} + ${project.docker.latestfulltag.version} + ${project.docker.latesttagtimestamp.version} + + + + + ${standalone.image.name} + + try + true + ${basedir}/target/docker-stage + Dockerfile + + false + + + ${project.docker.latestminortag.version} + ${project.docker.latestfulltag.version} + ${project.docker.latesttagtimestamp.version} + + + + + ${docker.verbose} + ${docker.skip.push} + - generate-images - package + build-push-images build + push - - - - ${image.name} - - try - ${basedir}/target/docker-stage - Dockerfile - - ${project.docker.latestminortag.version} - ${project.docker.latestfulltag.version} - ${project.docker.latesttagtimestamp.version} - - - - - - - start-it-instance - pre-integration-test - - start - - - - - mariadb:10.5 - sdnc-db - - - itsASecret - sdnctl - gamma - sdnctl - - - custom - sdnc - dbhost - sdnctldb01 - sdnctldb02 - - - sdncdb.port:3306 - - - true - - - - - ${image.name}:${project.docker.latesttagtimestamp.version} - sdnc-container - - - admin - itsASecret - sdnctl - gamma - sdnctl - /opt/onap/sdnc/data/properties - INFO - - - sdnc-db - - - custom - sdnc - sdnc - > - - sdnc.port:8181 - - - all warp coils are now operating at peak efficiency - - - - true - - - - - - - - stop-it-instance - post-integration-test - - stop - - - - push-images - ${docker.push.phase} - - build - push - - - - - ${image.name} - - try - ${basedir}/target/docker-stage - Dockerfile - - ${project.docker.latestminortag.version} - ${project.docker.latestfulltag.version} - ${project.docker.latesttagtimestamp.version} - - - - - - - - generate-standalone-images - package - - build - - - - - ${standalone.image.name} - - try - ${basedir}/target/docker-stage - standalone.Dockerfile - - ${project.docker.latestminortag.version} - ${project.docker.latestfulltag.version} - ${project.docker.latesttagtimestamp.version} - - - - - - - - push-standalone-images - ${docker.push.phase} - - build - push - - - - - ${standalone.image.name} - - try - ${basedir}/target/docker-stage - standalone.Dockerfile - - ${project.docker.latestminortag.version} - ${project.docker.latestfulltag.version} - ${project.docker.latesttagtimestamp.version} - - - - - - @@ -285,7 +154,6 @@ src/main/docker Dockerfile - standalone.Dockerfile true @@ -307,7 +175,7 @@ *.py *.sh - false + true @@ -403,7 +271,7 @@ 3.0.2 - unpack sdnc features + unpack-sdnc-features generate-sources unpack-dependencies @@ -414,7 +282,7 @@ - unpack dgs + unpack-platform-logic generate-sources unpack @@ -432,7 +300,7 @@ - unpack migration utility + unpack-data-migrator generate-sources unpack @@ -452,29 +320,21 @@ - org.codehaus.mojo - exec-maven-plugin - 1.5.0 + org.apache.maven.plugins + maven-antrun-plugin + 1.8 - change shell permissions + change-shell-permissions process-sources - - exec - - /usr/bin/find - - ${basedir}/target/docker-stage/opt/onap/sdnc - -name - *.sh - -exec - chmod - +x - {} - ; - + + + + + run + @@ -482,20 +342,20 @@ org.apache.maven.plugins maven-failsafe-plugin - - - integration-test - verify - - + + + integration-test + verify + + - false - - ${sdnc.port} - + false + + ${sdnc.port} + - + diff --git a/installation/sdnc/src/main/dc/docker-compose.yaml b/installation/sdnc/src/main/dc/docker-compose.yaml index 1eece804..71f28159 100644 --- a/installation/sdnc/src/main/dc/docker-compose.yaml +++ b/installation/sdnc/src/main/dc/docker-compose.yaml @@ -7,11 +7,14 @@ services: ports: - "3306" environment: - - MYSQL_ROOT_PASSWORD=MySecretPassword + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - MYSQL_ROOT_HOST=% - logging: + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + logging: driver: "json-file" - options: + options: max-size: "30m" max-file: "5" @@ -29,13 +32,33 @@ services: - db:sdnctldb01 - db:sdnctldb02 environment: - - MYSQL_ROOT_PASSWORD=MySecretPassword + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} - SDNC_CONFIG_DIR=/opt/onap/sdnc/data/properties - SDNC_REPLICAS=1 - - SDNC_DB_USER=sdnctl - - SDNC_DB_PASSWORD=gamma - - MYSQL_DATABASE=sdnctl + - SDNC_BIN=/opt/onap/sdnc/bin + - ODL_CERT_DIR=/tmp + - ODL_ADMIN_USERNAME=${ODL_USER} + - ODL_ADMIN_PASSWORD=${ODL_PASSWORD} + - ODL_USER=${ODL_USER} + - ODL_PASSWORD=${ODL_PASSWORD} - SDNC_DB_INIT=true + - HONEYCOMB_USER=${HONEYCOMB_USER} + - HONEYCOMB_PASSWORD=${HONEYCOMB_PASSWORD} + - TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD} + - KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD} + - SO_USER=${SO_USER} + - SO_PASSWORD=${SO_PASSWORD} + - NENG_USER=${NENG_USER} + - NENG_PASSWORD=${NENG_PASSWORD} + - CDS_USER=${CDS_USER} + - CDS_PASSWORD=${CDS_PASSWORD} + - ANSIBLE_USER=${ANSIBLE_USER} + - ANSIBLE_PASSWORD=${ANSIBLE_PASSWORD} + - SQL_CRYPTKEY=${SQL_CRYPTKEY} + - A1_TRUSTSTORE_PASSWORD=a1adapter - KARAF_CONSOLE_LOG_LEVEL=info logging: driver: "json-file" @@ -43,7 +66,6 @@ services: max-size: "30m" max-file: "5" extra_hosts: - aaf.osaaf.org: 10.12.6.214 - + aaf.osaaf.org: 10.12.6.214 diff --git a/installation/sdnc/src/main/docker/Dockerfile b/installation/sdnc/src/main/docker/Dockerfile index 5a495f2c..65b908ce 100755 --- a/installation/sdnc/src/main/docker/Dockerfile +++ b/installation/sdnc/src/main/docker/Dockerfile @@ -1,45 +1,47 @@ # Prepare stage for multistage image build ## START OF STAGE0 ## FROM onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version} AS stage0 - USER root -# copy onap -COPY opt /opt -RUN test -L /opt/sdnc || ln -s /opt/onap/sdnc /opt/sdnc -RUN mkdir $ODL_HOME/current/certs - -# copy SDNC mvn artifacts to ODL repository -COPY system /tmp/system -RUN rsync -a /tmp/system $ODL_HOME -## END OF STAGE0 ## - -FROM onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version} - -LABEL maintainer="SDN-C Team (sdnc@lists.onap.org)" +ENV JAVA_HOME /opt/java/openjdk +ENV PATH $PATH:/opt/java/openjdk/bin -ENV PATH=$PATH:/opt/java/openjdk/bin 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 +ENV JAVA_SECURITY_DIR /etc/ssl/certs/java + ENV SDNC_KEYSTORE ${sdnc.keystore} ENV SDNC_KEYPASS ${sdnc.keypass} ENV SDNC_SECUREPORT ${sdnc.secureport} -USER root -COPY --from=stage0 --chown=odl:odl /opt /opt +ARG AAF=false -# Add SDNC repositories to boot repositories +# Copy onap +COPY opt /opt +RUN test -L /opt/sdnc || ln -s /opt/onap/sdnc /opt/sdnc +RUN mkdir $ODL_HOME/current/certs + +# Copy SDNC mvn artifacts to ODL repository +COPY system /tmp/system +RUN rsync -a /tmp/system $ODL_HOME + +# Add odl-netconf-topology to boot repositories RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.orig -RUN sed -i -e "\|featuresRepositories|s|$|,${SDNC_NORTHBOUND_REPO}|" $ODL_HOME/etc/org.apache.karaf.features.cfg -RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,sdnc-northbound-all|" $ODL_HOME/etc/org.apache.karaf.features.cfg RUN sed -i "s/odl-restconf-all/odl-restconf-all,odl-netconf-topology/g" $ODL_HOME/etc/org.apache.karaf.features.cfg -# install AAF configs -COPY aaa-app-config.xml $ODL_HOME/etc/opendaylight/datastore/initial/config/ -RUN echo "cadi_prop_files=$SDNC_CONFIG_DIR/org.onap.sdnc.props" >> $ODL_HOME/etc/system.properties +# Add SDNC repositories to boot repositories +ENV SDNC_NORTHBOUND_REPO mvn:org.onap.sdnc.northbound/sdnc-northbound-all/${sdnc.northbound.version}/xml/features +RUN sed -i -e "\|featuresRepositories|s|$|,${SDNC_NORTHBOUND_REPO}|" $ODL_HOME/etc/org.apache.karaf.features.cfg +RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,sdnc-northbound-all|" $ODL_HOME/etc/org.apache.karaf.features.cfg + + +# Add aaa-app-config.xml Only if AAF is set to true (being passed as an argument in docker-maven-plugin configuration) +COPY aaa-app-config.xml /tmp/aaa-app-config.xml +RUN if "${AAF}" ; then \ + mkdir -p $ODL_HOME/etc/opendaylight/datastore/initial/config ;\ + mv /tmp/aaa-app-config.xml $ODL_HOME/etc/opendaylight/datastore/initial/config/. ;\ + echo "cadi_prop_files=$SDNC_CONFIG_DIR/org.onap.sdnc.props" >> $ODL_HOME/etc/system.properties ;\ + fi # Install ssl and java certificates COPY truststoreONAPall.jks $SDNC_STORE_DIR @@ -56,9 +58,29 @@ RUN echo org.ops4j.pax.web.ssl.keypassword=$SDNC_KEYPASS >> $ODL_HOME/etc/custom # Overwrite svclogic compiler properties RUN cp /opt/onap/sdnc/data/properties/svclogic-compiler.properties /opt/onap/sdnc/svclogic/config/svclogic.properties -RUN chown -R odl:odl /opt +# Changing ownership and permission of /opt +RUN chown -R odl:odl /opt && chmod -R 755 /opt -USER odl +## END OF STAGE0 ## +################################################# + +## This will create actual image +FROM scratch +LABEL maintainer="SDN-C Team (sdnc@lists.onap.org)" +USER root + +ENV JAVA_HOME /opt/java/openjdk +ENV PATH $PATH:/opt/java/openjdk/bin + +ENV ODL_HOME /opt/opendaylight/current +ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties +ENV SDNC_KEYSTORE ${sdnc.keystore} +ENV SDNC_KEYPASS ${sdnc.keypass} + +# Copy Everything from stage0 +COPY --from=stage0 / / + +USER odl ENTRYPOINT /opt/onap/sdnc/bin/startODL.sh EXPOSE 8181 diff --git a/installation/sdnc/src/main/docker/standalone.Dockerfile b/installation/sdnc/src/main/docker/standalone.Dockerfile deleted file mode 100755 index 1dc26cf4..00000000 --- a/installation/sdnc/src/main/docker/standalone.Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -# Prepare stage for multistage image build -## START OF STAGE0 ## -FROM onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version} AS stage0 - -USER root - -# copy onap -COPY opt /opt -RUN test -L /opt/sdnc || ln -s /opt/onap/sdnc /opt/sdnc -RUN mkdir $ODL_HOME/current/certs - -# copy SDNC mvn artifacts to ODL repository -COPY system /tmp/system -RUN rsync -a /tmp/system $ODL_HOME -## END OF STAGE0 ## - -FROM onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version} - -LABEL maintainer="SDN-C Team (sdnc@lists.onap.org)" - -ENV PATH=$PATH:/opt/java/openjdk/bin -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 -ENV SDNC_KEYSTORE ${sdnc.keystore} -ENV SDNC_KEYPASS ${sdnc.keypass} -ENV SDNC_SECUREPORT ${sdnc.secureport} - -USER root - -COPY --from=stage0 --chown=odl:odl /opt /opt - -# 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 sed -i -e "\|featuresRepositories|s|$|,${SDNC_NORTHBOUND_REPO}|" $ODL_HOME/etc/org.apache.karaf.features.cfg -RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,sdnc-northbound-all|" $ODL_HOME/etc/org.apache.karaf.features.cfg -RUN sed -i "s/odl-restconf-all/odl-restconf-all,odl-netconf-topology/g" $ODL_HOME/etc/org.apache.karaf.features.cfg - -# Install ssl and java certificates -COPY truststoreONAPall.jks $SDNC_STORE_DIR -RUN if [ -f $JAVA_SECURITY_DIR}/cacerts ] ; then keytool -importkeystore -srckeystore $SDNC_STORE_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore $JAVA_SECURITY_DIR/cacerts -deststorepass changeit -noprompt ; fi -RUN keytool -importkeystore -srckeystore $SDNC_STORE_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore /opt/java/openjdk/lib/security/cacerts -deststorepass changeit -noprompt - - -# Secure with TLS -RUN echo org.osgi.service.http.secure.enabled=true >> $ODL_HOME/etc/custom.properties -RUN echo org.osgi.service.http.secure.port=$SDNC_SECUREPORT >> $ODL_HOME/etc/custom.properties -RUN echo org.ops4j.pax.web.ssl.keystore=$SDNC_STORE_DIR/$SDNC_KEYSTORE >> $ODL_HOME/etc/custom.properties -RUN echo org.ops4j.pax.web.ssl.password=$SDNC_KEYPASS >> $ODL_HOME/etc/custom.properties -RUN echo org.ops4j.pax.web.ssl.keypassword=$SDNC_KEYPASS >> $ODL_HOME/etc/custom.properties - -# Overwrite svclogic compiler properties -RUN cp /opt/onap/sdnc/data/properties/svclogic-compiler.properties /opt/onap/sdnc/svclogic/config/svclogic.properties -RUN chown -R odl:odl /opt - -USER odl - -ENTRYPOINT /opt/onap/sdnc/bin/startODL.sh -EXPOSE 8181 diff --git a/installation/sdnc/src/main/scripts/installFeatures.sh b/installation/sdnc/src/main/scripts/installFeatures.sh index 1fe10819..ac38568d 100755 --- a/installation/sdnc/src/main/scripts/installFeatures.sh +++ b/installation/sdnc/src/main/scripts/installFeatures.sh @@ -34,15 +34,12 @@ CCSDK_EXTRAS=" \ netbox-client" - SDNC_NORTHBOUND_FEATURES=" \ generic-resource-api \ vnfapi \ vnftools" -SDNC_NORTHBOUND_VERSION=${SDNC_NORTHBOUND_VERSION:-1.3.1-SNAPSHOT} - # Install CCSDK features ${CCSDK_HOME}/bin/installCcsdkFeatures.sh @@ -54,7 +51,7 @@ do then ${CCSDK_FEATURE_DIR}/ccsdk-${feature}/install-feature.sh else - echo "No installer found for ${feature}" + echo "No installer found for ${feature}" fi done diff --git a/installation/sdnc/src/main/scripts/installZips.sh b/installation/sdnc/src/main/scripts/installZips.sh index e8789bee..3b3c37a3 100644 --- a/installation/sdnc/src/main/scripts/installZips.sh +++ b/installation/sdnc/src/main/scripts/installZips.sh @@ -41,9 +41,6 @@ SDNC_NORTHBOUND_FEATURES=" \ -SDNC_NORTHBOUND_VERSION=${SDNC_NORTHBOUND_VERSION:-1.2.0} -SDNC_OAM_VERSION=${SDNC_OAM_VERSION:-1.2.0} - if [ ! -d ${targetDir} ] then mkdir -p ${targetDir} @@ -59,35 +56,35 @@ cwd=$(pwd) mavenOpts=${2:-"-s ${SETTINGS_FILE} -gs ${GLOBAL_SETTINGS_FILE}"} cd /tmp -echo "Installing SDN-C core version ${SDNC_CORE_VERSION}" +echo "Installing SDN-C core version ${ccsdk.sli.version}" for feature in ${SDNC_CORE_FEATURES} do rm -f /tmp/${feature}-installer*.zip -mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.core:${feature}-installer:${SDNC_CORE_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true +mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.core:${feature}-installer:${ccsdk.sli.version}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true unzip -d ${featureDir} /tmp/${feature}-installer*zip done -echo "Installing SDN-C adaptors version ${SDNC_ADAPTORS_VERSION}" +echo "Installing SDN-C adaptors version ${ccsdk.sli.version}" for feature in ${SDNC_ADAPTORS_FEATURES} do rm -f /tmp/${feature}-installer*.zip -mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.adaptors:${feature}-installer:${SDNC_ADAPTORS_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true +mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.adaptors:${feature}-installer:${ccsdk.sli.version}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true unzip -d ${featureDir} /tmp/${feature}-installer*zip done -echo "Installing SDN-C northbound version ${SDNC_NORTHBOUND_VERSION}" +echo "Installing SDN-C northbound version ${sdnc.northbound.version}" for feature in ${SDNC_NORTHBOUND_FEATURES} do rm -f /tmp/${feature}-installer*.zip -mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.northbound:${feature}-installer:${SDNC_NORTHBOUND_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true +mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.northbound:${feature}-installer:${sdnc.northbound.version}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true unzip -d ${featureDir} /tmp/${feature}-installer*zip done -echo "Installing SDN-C plugins version ${SDNC_PLUGINS_VERSION}" +echo "Installing SDN-C plugins version ${ccsdk.sli.version}" for feature in ${SDNC_PLUGINS_FEATURES} do rm -f /tmp/${feature}-installer*.zip -mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.plugins:${feature}-installer:${SDNC_PLUGINS_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true +mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.plugins:${feature}-installer:${ccsdk.sli.version}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true unzip -d ${featureDir} /tmp/${feature}-installer*zip done @@ -95,7 +92,7 @@ done echo "Installing platform-logic" rm -f /tmp/platform-logic-installer*.zip -mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.oam:platform-logic-installer:${SDNC_OAM_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true +mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.onap.sdnc.oam:platform-logic-installer:${sdnc.project.version}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true unzip -d ${targetDir} /tmp/platform-logic-installer*.zip find ${targetDir} -name '*.sh' -exec chmod +x '{}' \; diff --git a/installation/sdnc/src/main/scripts/startODL.sh b/installation/sdnc/src/main/scripts/startODL.sh index ee4e19f5..a0acc311 100755 --- a/installation/sdnc/src/main/scripts/startODL.sh +++ b/installation/sdnc/src/main/scripts/startODL.sh @@ -30,7 +30,7 @@ isRepoExisting() { REPO=$(echo "$1" | sed -E "s#mvn:(.*)/xml/features\$#\1#") OIFS="$IFS" - IFS='/' + IFS='/' set parts $REPO IFS="$OIFS" path="$ODL_HOME/system/$(echo "$2" | tr '.' '/')/$3/$4" @@ -85,7 +85,7 @@ cleanupFeatureBoot() { initialize_sdnrdb() { printf "SDN-R Database Initialization" INITCMD="$JAVA_HOME/bin/java -jar " - FN=$(find "$ODL_HOME/system" -name "sdnr-wt-data-provider-setup-$CCSDKFEATUREVERSION.jar") + FN=$(find "$ODL_HOME/system" -name "sdnr-wt-data-provider-setup-${ccsdk.features.version}.jar") INITCMD="${INITCMD} ${FN} $SDNRDBCOMMAND" printf "%s\n" "Execute: $INITCMD" n=0 @@ -100,7 +100,6 @@ initialize_sdnrdb() { install_sdnrwt_features() { # Repository setup provided via sdnc dockerfile if $SDNRWT; then - if $SDNRONLY; then cleanupFeatureBoot fi @@ -117,7 +116,7 @@ install_sdnr_oauth_features() { addToFeatureBoot "$SDNROAUTH_BOOTFEATURES" } install_sdnr_northbound_features() { - addToFeatureBoot "$SDNR_NORTHBOUND_BOOTFEATURES" + addToFeatureBoot "$SDNR_NORTHBOUND_BOOTFEATURES" } install_a1_northbound_features() { addToFeatureBoot "$A1_ADAPTER_NORTHBOUND_BOOTFEATURES" @@ -132,7 +131,7 @@ enable_odl_cluster() { # ODL NETCONF setup printf "Installing Opendaylight cluster features for mdsal and netconf\n" - + #Be sure to remove feature odl-netconf-connector-all from list replaceFeatureBoot "odl-netconf-connector-all," @@ -144,7 +143,7 @@ enable_odl_cluster() { #${ODL_HOME}/bin/client feature:install odl-jolokia # ODL Cluster or Geo cluster configuration - + printf "Update cluster information statically\n" fqdn=$(hostname -f) printf "%s\n" "Get current fqdn ${fqdn}" @@ -198,7 +197,7 @@ enable_odl_cluster() { done "${ODL_HOME}"/bin/configure_cluster.sh $((node_index+1)) "${node_list}" else - printf "Unhandled cluster scenario. Terminating the container\n" + printf "Unhandled cluster scenario. Terminating the container\n" printf "Any one of the below 2 conditions should be satisfied for successfully enabling cluster mode : \n" printf "1. OOM Environment - Both SERVICE_NAME and NAMESPACE environment variables have to be set.\n" printf "2. Docker (standalone) Environment - Neither of SERVICE_NAME and NAMESPACE have to be set.\n" @@ -218,37 +217,43 @@ ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} ODL_FEATURES_BOOT_FILE=$ODL_HOME/etc/org.apache.karaf.features.cfg ODL_ADMIN_USERNAME=${ODL_ADMIN_USERNAME:-admin} +ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-admin} ODL_REMOVEIDMDB=${ODL_REMOVEIDMDB:-true} if $ODL_REMOVEIDMDB ; then - if [ -f $ODL_HOME/data/idmlight.db.mv.db ]; then + if [ -f $ODL_HOME/data/idmlight.db.mv.db ]; then rm $ODL_HOME/data/idmlight.db.mv.db fi fi +CCSDK_HOME=${CCSDK_HOME:-/opt/onap/ccsdk} SDNC_HOME=${SDNC_HOME:-/opt/onap/sdnc} SDNC_BIN=${SDNC_BIN:-/opt/onap/sdnc/bin} +JDEBUG=${JDEBUG:-false} +SDNC_AAF_ENABLED=${SDNC_AAF_ENABLED:-false} +INSTALLED_DIR=${INSTALLED_FILE:-/opt/opendaylight/current/daexim} + # Whether to intialize MYSql DB or not. Default is to initialize SDNC_DB_INIT=${SDNC_DB_INIT:-false} -CCSDK_HOME=${CCSDK_HOME:-/opt/onap/ccsdk} -JDEBUG=${JDEBUG:-false} MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-openECOMP1.0} + +IS_PRIMARY_CLUSTER=${IS_PRIMARY_CLUSTER:-false} +MY_ODL_CLUSTER=${MY_ODL_CLUSTER:-127.0.0.1} ENABLE_ODL_CLUSTER=${ENABLE_ODL_CLUSTER:-false} ENABLE_OAUTH=${ENABLE_OAUTH:-false} ENABLE_ODLUX_RBAC=${ENABLE_ODLUX_RBAC:-false} GEO_ENABLED=${GEO_ENABLED:-false} -SDNC_AAF_ENABLED=${SDNC_AAF_ENABLED:-false} -IS_PRIMARY_CLUSTER=${IS_PRIMARY_CLUSTER:-false} -MY_ODL_CLUSTER=${MY_ODL_CLUSTER:-127.0.0.1} -INSTALLED_DIR=${INSTALLED_FILE:-/opt/opendaylight/current/daexim} + SDNRWT=${SDNRWT:-false} +SDNRDM=${SDNRDM:-false} SDNRODLUX_BOOTFEATURES=${SDNRODLUX_BOOTFEATURES:-sdnr-wt-helpserver-feature,sdnr-wt-odlux-core-feature,sdnr-wt-odlux-apps-feature} SDNROAUTH_BOOTFEATURES=${SDNROAUTH_BOOTFEATURES:-sdnr-wt-feature-aggregator-oauth} -SDNRDM=${SDNRDM:-false} SDNR_NETCONF_CALLHOME_ENABLED=${SDNR_NETCONF_CALLHOME_ENABLED:-false} + # Add devicemanager features SDNRDM_SDM_LIST=${SDNRDM_SDM_LIST:-sdnr-wt-feature-aggregator-devicemanager} SDNRDM_BOOTFEATURES=${SDNRDM_BOOTFEATURES:-sdnr-wt-feature-aggregator-devicemanager-base,${SDNRDM_SDM_LIST}} + # Whether to Initialize the ElasticSearch DB. SDNRINIT=${SDNRINIT:-false} SDNRONLY=${SDNRONLY:-false} @@ -258,6 +263,7 @@ SDNRDBCOMMAND=${SDNRDBCOMMAND:--c init -db $SDNRDBURL -dbu $SDNRDBUSERNAME -dbp SDNR_NORTHBOUND=${SDNR_NORTHBOUND:-false} SDNR_NORTHBOUND_BOOTFEATURES=${SDNR_NORTHBOUND_BOOTFEATURES:-sdnr-northbound-all} SDNR_NETCONF_CALLHOME_FEATURE=${SDNR_NETCONF_CALLHOME_FEATURE:-odl-netconf-callhome-ssh} + # if only SDNR features then do not start A1 adapter if $SDNRONLY ; then A1_ADAPTER_NORTHBOUND=false @@ -291,7 +297,6 @@ printf "%s\n" " SDNC_BIN=$SDNC_BIN" printf "%s\n" " SDNC_HOME=$SDNC_HOME" printf "%s\n" " SDNC_DB_INIT=$SDNC_DB_INIT" printf "%s\n" " ODL_CERT_DIR=$ODL_CERT_DIR" -printf "%s\n" " CCSDKFEATUREVERSION=$CCSDKFEATUREVERSION" printf "%s\n" " ENABLE_ODL_CLUSTER=$ENABLE_ODL_CLUSTER" printf "%s\n" " ODL_REMOVEIDMDB=$ODL_REMOVEIDMDB" printf "%s\n" " SDNC_REPLICAS=$SDNC_REPLICAS" @@ -347,13 +352,13 @@ if [ -z "$ODL_ADMIN_PASSWORD" ]; then exit 1 fi -# Check for MySQL DB connectivity only if SDNC_DB_INIT is set to "true" +# Check for MySQL DB connectivity only if SDNC_DB_INIT is set to "true" if $SDNC_DB_INIT; then # # Wait for database # printf "Waiting for mysql" - until mysql -h dbhost -u root -p"${MYSQL_ROOT_PASSWORD}" -e "select 1" > /dev/null 2>&1 + until mysql -h dbhost -u root -p"${MYSQL_ROOT_PASSWORD}" -e "select 1" > /dev/null 2>&1 do printf "." sleep 1 @@ -388,15 +393,15 @@ then if $SDNRWT ; then install_sdnrwt_features ; fi if $ENABLE_OAUTH ; then cp $SDNC_HOME/data/oauth-aaa-app-config.xml $ODL_HOME/system/org/opendaylight/aaa/aaa-shiro/0.12.1/aaa-shiro-0.12.1-aaa-app-config.xml - install_sdnr_oauth_features + install_sdnr_oauth_features fi - + # The enable_odl_cluster call should not be moved above this line as the cleanFeatureBoot will overwrite entries. Ex: odl-jolokia if $ENABLE_ODL_CLUSTER ; then enable_odl_cluster ; fi if $SDNR_NORTHBOUND ; then install_sdnr_northbound_features ; fi if $A1_ADAPTER_NORTHBOUND ; then install_a1_northbound_features ; fi - + printf "%s" "Installed at $(date)" > "${SDNC_HOME}"/.installed fi @@ -428,4 +433,5 @@ fi printf "Startup opendaylight\n" printf "%s\n" "$ODL_REPOSITORIES_BOOT" printf "%s\n" "$ODL_FEATURES_BOOT" + exec "${ODL_HOME}"/bin/karaf server diff --git a/installation/src/main/yaml/docker-compose.yml b/installation/src/main/yaml/docker-compose.yml index 6a2e3ff0..110f940b 100644 --- a/installation/src/main/yaml/docker-compose.yml +++ b/installation/src/main/yaml/docker-compose.yml @@ -20,9 +20,9 @@ services: - MYSQL_USER=${MYSQL_USER} - MYSQL_PASSWORD=${MYSQL_PASSWORD} - MYSQL_DATABASE=${MYSQL_DATABASE} - logging: + logging: driver: "json-file" - options: + options: max-size: "30m" max-file: "5" @@ -55,7 +55,7 @@ services: depends_on : - db - ansible - container_name: sdnc_controller_container + container_name: sdnc_controller entrypoint: ["/opt/onap/sdnc/bin/startODL.sh"] ports: - "8282:8181" @@ -76,7 +76,7 @@ services: - ODL_ADMIN_PASSWORD=${ODL_PASSWORD} - ODL_USER=${ODL_USER} - ODL_PASSWORD=${ODL_PASSWORD} - - SDNC_DB_INIT=true + - SDNC_DB_INIT=true - HONEYCOMB_USER=${HONEYCOMB_USER} - HONEYCOMB_PASSWORD=${HONEYCOMB_PASSWORD} - TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD} @@ -110,7 +110,7 @@ services: image: onap/ccsdk-dgbuilder-image:latest depends_on: - db - container_name: sdnc_dgbuilder_container + container_name: sdnc_dgbuilder_container entrypoint: - "/bin/bash" - "-c" @@ -138,7 +138,7 @@ services: image: onap/sdnc-ueb-listener-image:latest depends_on: - db - container_name: sdnc_ueblistener_container + container_name: sdnc_ueblistener_container entrypoint: ["/opt/onap/sdnc/ueb-listener/bin/start-ueb-listener.sh" ] links: - db:dbhost @@ -165,7 +165,7 @@ services: image: onap/sdnc-dmaap-listener-image:latest depends_on: - db - container_name: sdnc_dmaaplistener_container + container_name: sdnc_dmaaplistener_container entrypoint: ["/opt/onap/sdnc/dmaap-listener/bin/start-dmaap-listener.sh" ] links: - db:dbhost diff --git a/installation/src/main/yaml/sdnc-basic.yml b/installation/src/main/yaml/sdnc-basic.yml index f68e07d9..4a9d47ca 100644 --- a/installation/src/main/yaml/sdnc-basic.yml +++ b/installation/src/main/yaml/sdnc-basic.yml @@ -20,9 +20,9 @@ services: - MYSQL_USER=${MYSQL_USER} - MYSQL_PASSWORD=${MYSQL_PASSWORD} - MYSQL_DATABASE=${MYSQL_DATABASE} - logging: + logging: driver: "json-file" - options: + options: max-size: "30m" max-file: "5" @@ -30,7 +30,7 @@ services: image: onap/sdnc-image:latest depends_on : - db - container_name: sdnc_controller_container + container_name: sdnc_controller entrypoint: ["/opt/onap/sdnc/bin/startODL.sh"] ports: - "8282:8181" @@ -50,7 +50,7 @@ services: - ODL_ADMIN_PASSWORD=${ODL_PASSWORD} - ODL_USER=${ODL_USER} - ODL_PASSWORD=${ODL_PASSWORD} - - SDNC_DB_INIT=true + - SDNC_DB_INIT=true - HONEYCOMB_USER=${HONEYCOMB_USER} - HONEYCOMB_PASSWORD=${HONEYCOMB_PASSWORD} - TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD} diff --git a/installation/ueb-listener/pom.xml b/installation/ueb-listener/pom.xml index b488302d..4f6ec418 100644 --- a/installation/ueb-listener/pom.xml +++ b/installation/ueb-listener/pom.xml @@ -8,9 +8,7 @@ 2.2.0-SNAPSHOT - org.onap.sdnc.oam installation-ueb-listener - 2.2.0-SNAPSHOT pom sdnc-oam :: installation :: ${project.artifactId} @@ -25,17 +23,15 @@ ${maven.build.timestamp} ${ccsdk.docker.alpine.j11.version} ${https_proxy} - deploy yyyyMMdd'T'HHmmss'Z' - - org.codehaus.groovy.maven gmaven-plugin + 1.0 validate @@ -48,9 +44,6 @@ - - - maven-resources-plugin 2.6 @@ -74,7 +67,6 @@ - copy-scripts @@ -89,12 +81,11 @@ *.sh - false + true - copy-properties @@ -109,12 +100,11 @@ * - false + true - @@ -144,34 +134,22 @@ - - org.codehaus.mojo - exec-maven-plugin - 1.5.0 + org.apache.maven.plugins + maven-antrun-plugin + 1.8 - - - - change shell permissions + change-shell-permissions process-sources - - exec - - /usr/bin/find - - ${basedir}/target/docker-stage/opt/onap/sdnc - -name - *.sh - -exec - chmod - +x - {} - ; - + + + + + run + @@ -186,7 +164,7 @@ io.fabric8 docker-maven-plugin - 0.28.0 + 0.34.0 false @@ -194,7 +172,8 @@ ${image.name} try - ${basedir}/target/docker-stage + true + ${basedir}/target/docker-stage Dockerfile ${project.docker.latestminortag.version} @@ -204,20 +183,12 @@ + ${docker.verbose} + ${docker.skip.push} - generate-images - package - - build - - - - - push-images - - ${docker.push.phase} + build-push-images build push -- cgit 1.2.3-korg