2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
16 # install_dependencies() - Install required dependencies
17 function install_dependencies {
19 apt-get install -y -qq wget openjdk-8-jre bridge-utils net-tools bsdmainutils make gcc libcurl4-gnutls-dev unzip
22 # install_vpp() - Install VPP
23 function install_vpp {
24 local RELEASE=".stable.1609"
27 apt-get install -y -qq apt-transport-https
28 echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io$RELEASE.ubuntu.$(lsb_release -c -s).main/ ./" | tee -a /etc/apt/sources.list.d/99fd.io.list
30 apt-get install -y -qq vpp vpp-lib vpp-plugins vpp-dpdk-dkms
34 local repo_url="https://nexus.onap.org/content/repositories/staging/org/onap/demo/vnf/"
37 wget -q -O tmp_file.tar.gz "${repo_url}/${file_subpath}"
38 sha1=$(wget ${repo_url}/${file_subpath}.sha1 -q -O -)
39 if [[ $(sha1sum tmp_file.tar.gz | awk '{print $1}') != "$sha1" ]]; then
40 echo "The downloaded file is corrupted"
43 tar -zmxf tmp_file.tar.gz
47 # install_vfw_scripts() -
48 function install_vfw_scripts {
49 local version=$(cat /opt/config/demo_artifacts_version.txt)
51 local ves_reporting_path="${ves_path}/evel/evel-library"
54 wget -q "https://nexus.onap.org/content/repositories/staging/org/onap/demo/vnf/vfw/vfw-scripts/${version}/vfw-scripts-${version}.zip"
55 unzip "vfw-scripts-${version}.zip"
58 _untar_url "sample-distribution/${version}/sample-distribution-${version}-hc.tar.gz"
60 mv sample-distribution-$version honeycomb
62 _untar_url "ves5/ves/${version}/ves-${version}-demo.tar.gz"
63 mv ves-$version $ves_path
65 _untar_url "ves5/ves_vfw_reporting/${version}/ves_vfw_reporting-${version}-demo.tar.gz"
66 mkdir -p $ves_reporting_path/code
67 mv ves_vfw_reporting-$version $ves_reporting_path/code/VESreporting
69 chmod +x $ves_reporting_path/code/VESreporting/go-client.sh
70 pushd $ves_reporting_path/bldjobs/
76 # TODO(electrocucaracha) Fix it in upstream
77 sed -i 's/start vpp/systemctl start vpp/g' v_firewall_init.sh
78 mv vfirewall.sh /etc/init.d
79 update-rc.d vfirewall.sh defaults
80 systemctl start firewall
85 echo "$protected_net_cidr" > /opt/config/protected_net_cidr.txt
86 echo "$vfw_private_ip_0" > /opt/config/fw_ipaddr.txt
87 echo "$vsn_private_ip_0" > /opt/config/sink_ipaddr.txt
88 echo "$demo_artifacts_version" > /opt/config/demo_artifacts_version.txt
89 echo "$dcae_collector_ip" > /opt/config/dcae_collector_ip.txt
90 echo "$dcae_collector_port" > /opt/config/dcae_collector_port.txt
92 echo 'vm.nr_hugepages = 1024' >> /etc/sysctl.conf