From: Marco Platania Date: Tue, 30 Jul 2019 19:25:58 +0000 (-0400) Subject: Build artifacts for vLB use case X-Git-Tag: 1.5.0~40 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=demo.git;a=commitdiff_plain;h=17b851b0c50b52bea6f8d8b88ed389d4d925a0f2 Build artifacts for vLB use case - Change the POM file of the distribution plugin - Modify istall/init scripts to download artifacts - Delete mvn compile process from istall/init scripts Issue-ID: INT-1166 Signed-off-by: Marco Platania Change-Id: I02feb19b6531ea5ca583343f7f724bc496d1d1b7 --- diff --git a/vnfs/honeycomb_plugin/parent-pom/pom.xml b/vnfs/honeycomb_plugin/parent-pom/pom.xml index f368d543..25065119 100644 --- a/vnfs/honeycomb_plugin/parent-pom/pom.xml +++ b/vnfs/honeycomb_plugin/parent-pom/pom.xml @@ -66,6 +66,11 @@ done ../stream-count/stream-count-api ../stream-count/stream-count-impl ../stream-count/stream-count-distribution + ../../vLBMS/apis/vlb-business-vnf-onap-plugin/vlb-business-vnf-onap-plugin-api + ../../vLBMS/apis/vlb-business-vnf-onap-plugin/vlb-business-vnf-onap-plugin-impl + ../../vLBMS/apis/health-vnf-onap-plugin/health-vnf-onap-plugin-api + ../../vLBMS/apis/health-vnf-onap-plugin/health-vnf-onap-plugin-impl + ../../vLBMS/apis/vlb-vnf-onap-distribution diff --git a/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/pom.xml b/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/pom.xml index 1e2d1c03..9fc59f59 100644 --- a/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/pom.xml +++ b/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/pom.xml @@ -1,25 +1,33 @@ + + + - io.fd.honeycomb.common - minimal-distribution-parent - 1.17.07 + hc-onap + 1.5.0-SNAPSHOT + org.onap.demo.vnf + ../../../honeycomb_plugin/parent-pom/pom.xml 4.0.0 - org.onap.demo.vnf.vlb vlb-vnf-onap-distribution - 1.2.0 - + http://nexus.fd.io/content #!/bin/sh - %s - -Xms128m -Xmx128m + -Xms256m -Xmx256m + + -client -Xms20m -Xmx32m -XX:MetaspaceSize=5m -XX:MaxMetaspaceSize=32m -XX:MaxMetaspaceExpansion=1m -Xss512k -XX:+UseSerialGC -Djava.compiler=NONE -Xverify:none -noverify + + /dev/./urandom io.fd.honeycomb.infra.distro.Main 1.17.07 1.17.07 @@ -37,153 +45,156 @@ - + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + ${main.class} + true + lib/ + false + true + + + config/ cert/ modules/ yang-mapping/ + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.10 + + + + unpack-configuration + prepare-package + + unpack-dependencies + + + **/honeycomb-minimal-resources/ + ${project.build.outputDirectory}/ + + + + + + + + org.codehaus.gmaven + groovy-maven-plugin + + + + distribution-module-assembly + + prepare-package + + execute + + + + io.fd.honeycomb.common.scripts.ModulesListGenerator.generate(project, properties, log) + + + + + generate-module-to-yang-index + prepare-package + + execute + + + + io.fd.honeycomb.common.scripts.ModuleYangIndexGenerator.pairDistributionModulesWithYangModules(project, log) + + + + + + + io.fd.honeycomb.common + common-scripts + 1.17.07 + + + + + + maven-assembly-plugin + 2.5.3 + + + io.fd.honeycomb.common + minimal-assembly-descriptor + 1.17.07 + + + + + create-archive + package + + single + + + + honeycomb-minimal + + + + + + + maven-surefire-plugin + + + + ${argLine} -Djava.security.egd=file:${random.seed.file} + + + + + + - org.apache.maven.plugins maven-compiler-plugin - 3.3 - - - javac-with-errorprone - true - true - 1.8 - 1.8 - - - - org.codehaus.plexus - plexus-compiler-javac-errorprone - 2.5 - - - - com.google.errorprone - error_prone_core - 2.0.9 - - + + + org.codehaus.gmaven + groovy-maven-plugin org.apache.maven.plugins maven-jar-plugin - - - - ${main.class} - true - lib/ - false - true - - - config/ cert/ modules/ yang-mapping/ - - - org.apache.maven.plugins maven-dependency-plugin - - - copy-dependencies - package - - copy-dependencies - - - ${project.build.directory}/lib - true - true - yang-jmx-generator - - - - unpack-configuration - prepare-package - - unpack-dependencies - - - **/honeycomb-minimal-resources/ - ${project.build.outputDirectory}/ - - - - - - - - org.codehaus.gmaven - groovy-maven-plugin - 2.0 - - - package - - execute - - - - import java.nio.file.Paths - - log.info "Generating shell exec script" - def scriptTemplate = properties.getOrDefault("start.script.template", "") - def args = properties.getOrDefault("exec.parameters", "") - log.debug "Additional shell exec script properties: ${args}" - def javaArgs = "${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar" - def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources") - scriptParent.toFile().mkdirs() - def scriptContent = "java " + javaArgs - log.info "Generating shell exec script as ${scriptContent}" - def scriptPath = Paths.get(scriptParent.toString(), "honeycomb") - log.info "Writing shell exec script to ${scriptPath}" - scriptPath.toFile().text = String.format(scriptTemplate, scriptContent) - scriptPath.toFile().setExecutable(true) - - scriptPath = Paths.get(scriptParent.toString(), "honeycomb-start") - log.info "Writing shell exec script to ${scriptPath}" - scriptPath.toFile().text = "\$(dirname \$0)/honeycomb &" - scriptPath.toFile().setExecutable(true) - - def debug_args = properties.getOrDefault("debug.parameters", "") - def debugScriptContent = "java" + " ${debug_args} " + javaArgs - log.info "Generating shell debug script as ${debugScriptContent}" - scriptPath = Paths.get(scriptParent.toString(), "honeycomb-debug") - log.info "Writing shell debug script to ${scriptPath}" - scriptPath.toFile().text = String.format(scriptTemplate, debugScriptContent) - scriptPath.toFile().setExecutable(true) - - - - maven-assembly-plugin - - - io.fd.honeycomb.common - minimal-assembly-descriptor - 1.17.07 - - - - - create-archive - package - - single - - - - honeycomb-minimal - - - - org.apache.maven.plugins @@ -199,24 +210,6 @@ false - - org.codehaus.mojo - exec-maven-plugin - - - none - - - - true - - - - maven-checkstyle-plugin - - true - - @@ -232,11 +225,22 @@ health-vnf-onap-plugin-impl ${interfaces.mapping.version} + + com.google.guava + guava + 18.0 + io.fd.honeycomb minimal-distribution ${honeycomb.min.distro.version} + + + com.google.guava + guava + + - + \ No newline at end of file diff --git a/vnfs/vLBMS/scripts/v_dns_init.sh b/vnfs/vLBMS/scripts/v_dns_init.sh index 6073ff95..e9b08bf6 100644 --- a/vnfs/vLBMS/scripts/v_dns_init.sh +++ b/vnfs/vLBMS/scripts/v_dns_init.sh @@ -1,9 +1,9 @@ #!/bin/bash # Start Honeycomb -VERSION=$(cat /opt/config/nb_api_version.txt) +VERSION=$(cat /opt/config/demo_artifacts_version.txt) cd /opt -./honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$VERSION-hc/vlb-vnf-onap-distribution-$VERSION/honeycomb &>/var/log/honeycomb.log &disown +./honeycomb/vlb-vnf-onap-distribution-$VERSION/honeycomb &>/var/log/honeycomb.log &disown sleep 10 #Set GRE tunnel diff --git a/vnfs/vLBMS/scripts/v_dns_install.sh b/vnfs/vLBMS/scripts/v_dns_install.sh index 9f48b391..2223e7e7 100644 --- a/vnfs/vLBMS/scripts/v_dns_install.sh +++ b/vnfs/vLBMS/scripts/v_dns_install.sh @@ -61,131 +61,16 @@ unzip -p -j /opt/vlbms-scripts-$INSTALL_SCRIPT_VERSION.zip run_health_vdns.sh > sed -i 's/primary=.*/primary=false/g' /opt/config/properties.conf sed -i 's/vnfc=.*/vnfc=vDNS/g' /opt/config/properties.conf -# Clone Honeycomb interface for the VNF component -mkdir honeycomb-api -git init honeycomb-api -cd honeycomb-api -git remote add origin https://gerrit.onap.org/r/demo.git -git config core.sparsecheckout true -echo "vnfs/vLBMS/apis" >> .git/info/sparse-checkout -git pull --depth=1 origin master - -mkdir ~/.m2 -cat > ~/.m2/settings.xml << EOF - - - - - - - fd.io-release - - - fd.io-mirror - fd.io-mirror - https://nexus.fd.io/content/groups/public/ - - true - never - - - false - - - - - - fd.io-mirror - fd.io-mirror - https://nexus.fd.io/content/repositories/public/ - - true - never - - - false - - - - - - - fd.io-snapshots - - - fd.io-snapshot - fd.io-snapshot - https://nexus.fd.io/content/repositories/fd.io.snapshot/ - - false - - - true - - - - - - fd.io-snapshot - fd.io-snapshot - https://nexus.fd.io/content/repositories/fd.io.snapshot/ - - false - - - true - - - - - - opendaylight-snapshots - - - opendaylight-snapshot - opendaylight-snapshot - https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ - - false - - - true - - - - - - opendaylight-shapshot - opendaylight-snapshot - https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ - - false - - - true - - - - - - - - fd.io-release - fd.io-snapshots - opendaylight-snapshots - - -EOF - -cd /opt/honeycomb-api/vnfs/vLBMS/apis -mvn clean install - -sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' /opt/honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$NB_API_VERSION-hc/vlb-vnf-onap-distribution-$NB_API_VERSION/config/honeycomb.json -sed -i 's/"netconf-tcp-binding-address": "127.0.0.1",/"netconf-tcp-binding-address": "0.0.0.0",/g' /opt/honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$NB_API_VERSION-hc/vlb-vnf-onap-distribution-$NB_API_VERSION/config/honeycomb.json +# Download Honeycomb artifacts +wget -O vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz "${NEXUS_ARTIFACT_REPO}/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf&a=vlb-vnf-onap-distribution&c=hc&e=tar.gz&v=$DEMO_ARTIFACTS_VERSION" +tar -zmxvf sample-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz +mv sample-distribution-$DEMO_ARTIFACTS_VERSION honeycomb + +sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' honeycomb/vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION/config/honeycomb.json +sed -i 's/"netconf-tcp-binding-address": "127.0.0.1",/"netconf-tcp-binding-address": "0.0.0.0",/g' honeycomb/vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION/config/honeycomb.json + +rm *.tar.gz -cd /opt chmod +x v_dns_init.sh chmod +x vdns.sh chmod +x set_gre_tunnel.sh diff --git a/vnfs/vLBMS/scripts/v_lb_init.sh b/vnfs/vLBMS/scripts/v_lb_init.sh index 51e88a87..9c9fce25 100644 --- a/vnfs/vLBMS/scripts/v_lb_init.sh +++ b/vnfs/vLBMS/scripts/v_lb_init.sh @@ -76,9 +76,9 @@ vppctl set interface proxy-arp tap-0 enable vppctl set ip arp tap-0 $PKTGEN_IPADDR $PKTGEN_MAC # Start Honeycomb and initialize the vLB with information about vDNS -VERSION=$(cat /opt/config/nb_api_version.txt) +VERSION=$(cat /opt/config/demo_artifacts_version.txt) cd /opt -./honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$VERSION-hc/vlb-vnf-onap-distribution-$VERSION/honeycomb &>/var/log/honeycomb.log &disown +./honeycomb/vlb-vnf-onap-distribution-$VERSION/honeycomb &>/var/log/honeycomb.log &disown sleep 10 OAM_VDNS_IP=$(cat /opt/config/oam_vdns_ip.txt) diff --git a/vnfs/vLBMS/scripts/v_lb_install.sh b/vnfs/vLBMS/scripts/v_lb_install.sh index 18b00d1e..83c1bbb1 100644 --- a/vnfs/vLBMS/scripts/v_lb_install.sh +++ b/vnfs/vLBMS/scripts/v_lb_install.sh @@ -78,132 +78,16 @@ tar -zmxvf ves_vlb_reporting-$DEMO_ARTIFACTS_VERSION-demo.tar.gz mv ves_vlb_reporting-$DEMO_ARTIFACTS_VERSION VESreporting_vLB mv VESreporting_vLB /opt/VES/evel/evel-library/code/VESreporting -# Clone Honeycomb interface for the VNF component -mkdir honeycomb-api -git init honeycomb-api -cd honeycomb-api -git remote add origin https://gerrit.onap.org/r/demo.git -git config core.sparsecheckout true -echo "vnfs/vLBMS/apis" >> .git/info/sparse-checkout -git pull --depth=1 origin master - -mkdir ~/.m2 -cat > ~/.m2/settings.xml << EOF - - - - - - - fd.io-release - - - fd.io-mirror - fd.io-mirror - https://nexus.fd.io/content/groups/public/ - - true - never - - - false - - - - - - fd.io-mirror - fd.io-mirror - https://nexus.fd.io/content/repositories/public/ - - true - never - - - false - - - - - - - fd.io-snapshots - - - fd.io-snapshot - fd.io-snapshot - https://nexus.fd.io/content/repositories/fd.io.snapshot/ - - false - - - true - - - - - - fd.io-snapshot - fd.io-snapshot - https://nexus.fd.io/content/repositories/fd.io.snapshot/ - - false - - - true - - - - - - opendaylight-snapshots - - - opendaylight-snapshot - opendaylight-snapshot - https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ - - false - - - true - - - - - - opendaylight-shapshot - opendaylight-snapshot - https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ - - false - - - true - - - - - - - - fd.io-release - fd.io-snapshots - opendaylight-snapshots - - -EOF - -cd /opt/honeycomb-api/vnfs/vLBMS/apis -mvn clean install - -sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' /opt/honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$NB_API_VERSION-hc/vlb-vnf-onap-distribution-$NB_API_VERSION/config/honeycomb.json -sed -i 's/"netconf-tcp-binding-address": "127.0.0.1",/"netconf-tcp-binding-address": "0.0.0.0",/g' /opt/honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$NB_API_VERSION-hc/vlb-vnf-onap-distribution-$NB_API_VERSION/config/honeycomb.json +# Download Honeycomb artifacts +wget -O vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz "${NEXUS_ARTIFACT_REPO}/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf&a=vlb-vnf-onap-distribution&c=hc&e=tar.gz&v=$DEMO_ARTIFACTS_VERSION" +tar -zmxvf sample-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz +mv sample-distribution-$DEMO_ARTIFACTS_VERSION honeycomb + +sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' honeycomb/vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION/config/honeycomb.json +sed -i 's/"netconf-tcp-binding-address": "127.0.0.1",/"netconf-tcp-binding-address": "0.0.0.0",/g' honeycomb/vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION/config/honeycomb.json + rm *.tar.gz -cd /opt chmod +x v_lb_init.sh chmod +x vlb.sh chmod +x /opt/VES/evel/evel-library/code/VESreporting/go-client.sh diff --git a/vnfs/vLBMS/scripts/v_packetgen_init.sh b/vnfs/vLBMS/scripts/v_packetgen_init.sh index f6144dee..e15b2e0a 100644 --- a/vnfs/vLBMS/scripts/v_packetgen_init.sh +++ b/vnfs/vLBMS/scripts/v_packetgen_init.sh @@ -95,9 +95,9 @@ vppctl set int ip address pg0 $(cat /opt/config/pg_int.txt)"/"$IPADDR1_CIDR sleep 1 # Start Honeycomb -VERSION=$(cat /opt/config/nb_api_version.txt) +VERSION=$(cat /opt/config/demo_artifacts_version.txt) cd /opt -./honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$VERSION-hc/vlb-vnf-onap-distribution-$VERSION/honeycomb &>/var/log/honeycomb.log &disown +./honeycomb/vlb-vnf-onap-distribution-$VERSION/honeycomb &>/var/log/honeycomb.log &disown sleep 10 chmod +x run_streams_dns.sh diff --git a/vnfs/vLBMS/scripts/v_packetgen_install.sh b/vnfs/vLBMS/scripts/v_packetgen_install.sh index fe035cef..26a4f551 100644 --- a/vnfs/vLBMS/scripts/v_packetgen_install.sh +++ b/vnfs/vLBMS/scripts/v_packetgen_install.sh @@ -67,131 +67,14 @@ sed -i 's/vnfc=.*/vnfc=vPacketGen/g' /opt/config/properties.conf tar -zmxvf vlb_dns_streams-$DEMO_ARTIFACTS_VERSION-demo.tar.gz mv vlb_dns_streams-$DEMO_ARTIFACTS_VERSION dns_streams -# Clone Honeycomb interface for the VNF component -mkdir honeycomb-api -git init honeycomb-api -cd honeycomb-api -git remote add origin https://gerrit.onap.org/r/demo.git -git config core.sparsecheckout true -echo "vnfs/vLBMS/apis" >> .git/info/sparse-checkout -git pull --depth=1 origin master - -mkdir ~/.m2 -cat > ~/.m2/settings.xml << EOF - - - - - - - fd.io-release - - - fd.io-mirror - fd.io-mirror - https://nexus.fd.io/content/groups/public/ - - true - never - - - false - - - - - - fd.io-mirror - fd.io-mirror - https://nexus.fd.io/content/repositories/public/ - - true - never - - - false - - - - - - - fd.io-snapshots - - - fd.io-snapshot - fd.io-snapshot - https://nexus.fd.io/content/repositories/fd.io.snapshot/ - - false - - - true - - - - - - fd.io-snapshot - fd.io-snapshot - https://nexus.fd.io/content/repositories/fd.io.snapshot/ - - false - - - true - - - - - - opendaylight-snapshots - - - opendaylight-snapshot - opendaylight-snapshot - https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ - - false - - - true - - - - - - opendaylight-shapshot - opendaylight-snapshot - https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ - - false - - - true - - - - - - - - fd.io-release - fd.io-snapshots - opendaylight-snapshots - - -EOF - -cd /opt/honeycomb-api/vnfs/vLBMS/apis -mvn clean install - -sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' /opt/honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$NB_API_VERSION-hc/vlb-vnf-onap-distribution-$NB_API_VERSION/config/honeycomb.json -sed -i 's/"netconf-tcp-binding-address": "127.0.0.1",/"netconf-tcp-binding-address": "0.0.0.0",/g' /opt/honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$NB_API_VERSION-hc/vlb-vnf-onap-distribution-$NB_API_VERSION/config/honeycomb.json +# Download Honeycomb artifacts +wget -O vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz "${NEXUS_ARTIFACT_REPO}/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf&a=vlb-vnf-onap-distribution&c=hc&e=tar.gz&v=$DEMO_ARTIFACTS_VERSION" +tar -zmxvf sample-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz +mv sample-distribution-$DEMO_ARTIFACTS_VERSION honeycomb + +sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' honeycomb/vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION/config/honeycomb.json +sed -i 's/"netconf-tcp-binding-address": "127.0.0.1",/"netconf-tcp-binding-address": "0.0.0.0",/g' honeycomb/vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION/config/honeycomb.json -cd /opt rm *.tar.gz chmod +x v_packetgen_init.sh chmod +x vpacketgen.sh