X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=build%2Fbarometer-install.sh;h=9e5dfc73b631b0148399c7263b411af92ca1774f;hb=f98cffc3b73364be7ea4b105def2c8f94484571c;hp=7b7d247531e6a4d08c4682cca7a88afd8740a1fa;hpb=aff91efb27e4dbcf4ea71761cdf3c464a010a84d;p=apex.git diff --git a/build/barometer-install.sh b/build/barometer-install.sh index 7b7d2475..9e5dfc73 100755 --- a/build/barometer-install.sh +++ b/build/barometer-install.sh @@ -15,12 +15,11 @@ # limitations under the License. # Get and install packages needed for Barometer service. -# These are: collectd rpm's and dependencies, collectd-ceilometer-plugin, +# These are: collectd rpm's and dependencies, collectd-openstack-plugins, # puppet-barometer module. # Versions/branches -COLLECTD_CEILOMETER_PLUGIN_BRANCH="stable/ocata" -INTEL_CMT_CAT_VER="1.1.0-1.el7.centos.x86_64.rpm" +COLLECTD_OPENSTACK_PLUGINS_BRANCH="stable/ocata" ARCH="6.el7.centos.x86_64.rpm" # don't fail because of missing certificate @@ -28,7 +27,7 @@ GETFLAG="--no-check-certificate" # Locations of repos ARTIFACTS_BAROM="artifacts.opnfv.org/barometer" -COLLECTD_CEILOMETER_REPO="https://github.com/openstack/collectd-ceilometer-plugin" +COLLECTD_OPENSTACK_REPO="https://github.com/openstack/collectd-ceilometer-plugin" PUPPET_BAROMETER_REPO="https://github.com/johnhinman/puppet-barometer" # upload barometer packages tar, extract, and install @@ -49,9 +48,15 @@ function barometer_pkgs { # get collectd version from HTML wget $GETFLAG $ARTIFACTS_BAROM.html - COLLECTD_VER=$(grep "$BAROMETER_VER/collectd-debuginfo" ./barometer.html | cut -d'-' -f7) + COLLECTD_VER=$(grep "$BAROMETER_VER/collectd-debuginfo" ./barometer.html \ + | cut -d'-' -f7) SUFFIX=$COLLECTD_VER-$ARCH + # get intel_rdt version + INTEL_RDT_VER=$(grep "$BAROMETER_VER/intel-cmt-cat-devel" ./barometer.html \ + | cut -d'-' -f9) + RDT_SUFFIX=$INTEL_RDT_VER-1.el7.centos.x86_64.rpm + wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/libcollectdclient-$SUFFIX wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/libcollectdclient-devel-$SUFFIX wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/collectd-$SUFFIX @@ -59,21 +64,24 @@ function barometer_pkgs { wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/collectd-ovs_events-$SUFFIX wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/collectd-ovs_stats-$SUFFIX wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/collectd-virt-$SUFFIX - wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/intel-cmt-cat-$INTEL_CMT_CAT_VER - wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/intel-cmt-cat-devel-$INTEL_CMT_CAT_VER + wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/intel-cmt-cat-$RDT_SUFFIX + wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/intel-cmt-cat-devel-$RDT_SUFFIX wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/collectd-python-$SUFFIX + wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/collectd-snmp-$SUFFIX + wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/collectd-snmp_agent-$SUFFIX + wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/collectd-intel_rdt-$SUFFIX curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" tar cfz collectd.tar.gz *.rpm get-pip.py cp collectd.tar.gz ${BUILD_DIR} popd > /dev/null - # get collectd-ceilometer-plugin and tar it - rm -rf collectd-ceilometer-plugin - git clone https://github.com/openstack/collectd-ceilometer-plugin - pushd collectd-ceilometer-plugin - git checkout -b $COLLECTD_CEILOMETER_PLUGIN_BRANCH - git archive --format=tar.gz HEAD > ${BUILD_DIR}/collectd-ceilometer-plugin.tar.gz + # get collectd-openstack-plugins and tar it + rm -rf collectd-openstack-plugins + git clone $COLLECTD_OPENSTACK_REPO collectd-openstack-plugins + pushd collectd-openstack-plugins + git checkout -b $COLLECTD_OPENSTACK_PLUGINS_BRANCH + git archive --format=tar.gz HEAD > ${BUILD_DIR}/collectd-openstack-plugins.tar.gz popd > /dev/null # get the barometer puppet module and tar it @@ -83,12 +91,19 @@ function barometer_pkgs { git archive --format=tar.gz HEAD > ${BUILD_DIR}/puppet-barometer.tar.gz popd > /dev/null + # get mibs for the snmp plugin + rm -rf barometer + git clone https://gerrit.opnfv.org/gerrit/barometer + pushd barometer/mibs > /dev/null + git archive --format=tar.gz HEAD > ${BUILD_DIR}/mibs.tar.gz + popd > /dev/null + # Upload tar files to image # untar collectd packages # install dependencies LIBGUESTFS_BACKEND=direct virt-customize \ --upload ${BUILD_DIR}/collectd.tar.gz:/opt/ \ - --upload ${BUILD_DIR}/collectd-ceilometer-plugin.tar.gz:/opt/ \ + --upload ${BUILD_DIR}/collectd-openstack-plugins.tar.gz:/opt/ \ --upload ${BUILD_DIR}/puppet-barometer.tar.gz:/etc/puppet/modules/ \ --run-command 'tar xfz /opt/collectd.tar.gz -C /opt' \ --install libstatgrab,log4cplus,rrdtool,rrdtool-devel \ @@ -110,20 +125,26 @@ function barometer_pkgs { /opt/collectd-python-${SUFFIX} \ /opt/collectd-ovs_events-${SUFFIX} \ /opt/collectd-ovs_stats-${SUFFIX} \ - /opt/collectd-virt-${SUFFIX} \ - /opt/intel-cmt-cat-${INTEL_CMT_CAT_VER} \ - /opt/intel-cmt-cat-devel-${INTEL_CMT_CAT_VER} \ + /opt/intel-cmt-cat-${RDT_SUFFIX} \ + /opt/intel-cmt-cat-devel-${RDT_SUFFIX} \ + /opt/collectd-intel_rdt-${SUFFIX} \ + /opt/collectd-snmp-${SUFFIX} \ + /opt/collectd-snmp_agent-${SUFFIX} \ /opt/collectd-virt-${SUFFIX}" \ -a $OVERCLOUD_IMAGE - # install collectd-ceilometer plugin + # install collectd-openstack-plugins # install puppet-barometer module - # make directory for config files + # make directories for config files and mibs LIBGUESTFS_BACKEND=direct virt-customize \ - --run-command 'mkdir /opt/collectd-ceilometer' \ - --run-command "tar xfz /opt/collectd-ceilometer-plugin.tar.gz -C /opt/collectd-ceilometer" \ + --run-command 'mkdir /opt/stack/collectd-openstack' \ + --run-command "tar xfz /opt/collectd-openstack-plugins.tar.gz -C /opt/stack/collectd-openstack" \ --run-command "cd /etc/puppet/modules/ && mkdir barometer && \ tar xzf puppet-barometer.tar.gz -C barometer" \ + --run-command 'mkdir /usr/share/mibs/' \ + --upload ${BUILD_DIR}/mibs.tar.gz:/usr/share/snmp/mibs/ \ + --run-command 'tar xfz /usr/share/snmp/mibs/mibs.tar.gz -C /usr/share/snmp/mibs/' \ + --run-command 'ln -s /usr/share/snmp/mibs/ /usr/share/mibs/ietf' \ --run-command 'mkdir -p /etc/collectd/collectd.conf.d' \ -a $OVERCLOUD_IMAGE }