diff options
author | jhinman1 <john.hinman@intel.com> | 2017-07-14 20:28:14 -0400 |
---|---|---|
committer | jhinman1 <john.hinman@intel.com> | 2017-07-31 19:39:38 -0400 |
commit | 2622e8417a9fca67fb0cac480410cf9c5912725a (patch) | |
tree | 1753756c27f75a54a83180056be0b6543ee1dc8c /build | |
parent | 64e055560e1f3ed47805d921541d884ea79624cf (diff) |
Adds Barometer service
Adds Barometer service as a deploy option to Compute nodes by specifying
barometer as true in deploy settings.
Barometer packages are installed only for x86_64.
Adds scenarios os-nosdn-bar-ha and os-nosdn-bar-noha.
Add scenarios to opnfv-apex-common.spec.
Temporarily remove references to snmp packages.
apex-tripleo-heat-templates: I397d2557639c87ab8afacd076a5b9fd7c056dce7
apex-puppet-tripleo: I878ff8d1e0a8b96f3380bb77f168cd5a4c3f6543
Puppet module is at: https://github.com/johnhinman/puppet-barometer.
Change-Id: Ic087c2052f7849ee2cf6c63224558c2b36a8ca1f
Signed-off-by: jhinman1 <john.hinman@intel.com>
Diffstat (limited to 'build')
-rwxr-xr-x | build/barometer-install.sh | 129 | ||||
-rw-r--r-- | build/opnfv-environment.yaml | 1 | ||||
-rwxr-xr-x | build/overcloud-full.sh | 7 | ||||
-rwxr-xr-x | build/overcloud-opendaylight.sh | 1 | ||||
-rw-r--r-- | build/rpm_specs/opnfv-apex-common.spec | 4 |
5 files changed, 141 insertions, 1 deletions
diff --git a/build/barometer-install.sh b/build/barometer-install.sh new file mode 100755 index 00000000..f4df8539 --- /dev/null +++ b/build/barometer-install.sh @@ -0,0 +1,129 @@ +#!/usr/bin/env bash + +# Copyright 2017 Intel Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Get and install packages needed for Barometer service. +# These are: collectd rpm's and dependencies, collectd-ceilometer-plugin, +# puppet-barometer module. + +# Versions/branches +COLLECTD_CEILOMETER_PLUGIN_BRANCH="stable/ocata" +INTEL_CMT_CAT_VER="1.0.1-1.el7.centos.x86_64.rpm" + +ARCH="6.el7.centos.x86_64.rpm" +# don't fail because of missing certificate +GETFLAG="--no-check-certificate" + +# Locations of repos +ARTIFACTS_BAROM="artifacts.opnfv.org/barometer" +COLLECTD_CEILOMETER_REPO="https://github.com/openstack/collectd-ceilometer-plugin" +PUPPET_BAROMETER_REPO="https://github.com/johnhinman/puppet-barometer" + +# upload barometer packages tar, extract, and install + +function barometer_pkgs { + OVERCLOUD_IMAGE=$1 + + # get collectd packages and upload to image + echo "adding barometer to " $1 + rm -rf barometer + mkdir barometer + pushd barometer > /dev/null + + # get version of barometer packages to download + wget $GETFLAG $ARTIFACTS_BAROM/latest.properties + BAROMETER_VER=$(grep OPNFV_ARTIFACT_VERSION ./latest.properties | cut -d'=' -f2) + echo "BAROMETER version = $BAROMETER_VER" + + # get collectd version from HTML + wget $GETFLAG $ARTIFACTS_BAROM.html + COLLECTD_VER=$(grep "$BAROMETER_VER/collectd-debuginfo" ./barometer.html | cut -d'-' -f7) + SUFFIX=$COLLECTD_VER-$ARCH + + 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 + wget $GETFLAG $ARTIFACTS_BAROM/$BAROMETER_VER/collectd-utils-$SUFFIX + 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/collectd-python-$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 + popd > /dev/null + + # get the barometer puppet module and tar it + rm -rf puppet-barometer + git clone $PUPPET_BAROMETER_REPO + pushd puppet-barometer/ > /dev/null + git archive --format=tar.gz HEAD > ${BUILD_DIR}/puppet-barometer.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}/puppet-barometer.tar.gz:/etc/puppet/modules/ \ + --run-command 'tar xfz /opt/collectd.tar.gz -C /opt' \ + --install libstatgrab,log4cplus,rrdtool,rrdtool-devel \ + --install mcelog,python34,python34-libs,python34-devel \ + --install libvirt,libvirt-devel,gcc \ + -a $OVERCLOUD_IMAGE + + LIBGUESTFS_BACKEND=direct virt-customize \ + --run-command 'python3.4 /opt/get-pip.py' \ + --run-command 'pip3 install requests libvirt-python pbr babel future six' \ + -a $OVERCLOUD_IMAGE + + LIBGUESTFS_BACKEND=direct virt-customize \ + --run-command "yum install -y \ + /opt/libcollectdclient-${SUFFIX} \ + /opt/libcollectdclient-devel-${SUFFIX} \ + /opt/collectd-${SUFFIX} \ + /opt/collectd-utils-${SUFFIX} \ + /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}" \ + -a $OVERCLOUD_IMAGE + + # install collectd-ceilometer plugin + # install puppet-barometer module + # make directory for config files + 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 "cd /etc/puppet/modules/ && mkdir barometer && \ + tar xzf puppet-barometer.tar.gz -C barometer" \ + --run-command 'mkdir -p /etc/collectd/collectd.conf.d' \ + -a $OVERCLOUD_IMAGE +} + diff --git a/build/opnfv-environment.yaml b/build/opnfv-environment.yaml index 79b9542e..a6bd7378 100644 --- a/build/opnfv-environment.yaml +++ b/build/opnfv-environment.yaml @@ -128,6 +128,7 @@ parameter_defaults: - OS::TripleO::Services::OVNDBs # - OS::TripleO::Services::Vpp ComputeServices: + - OS::TripleO::Services::Barometer - OS::TripleO::Services::CACerts - OS::TripleO::Services::CephClient - OS::TripleO::Services::CephOSD diff --git a/build/overcloud-full.sh b/build/overcloud-full.sh index cb1b94bc..e8697925 100755 --- a/build/overcloud-full.sh +++ b/build/overcloud-full.sh @@ -10,6 +10,7 @@ set -xe source ./cache.sh source ./variables.sh +source ./barometer-install.sh populate_cache "$rdo_images_uri/overcloud-full.tar" @@ -53,6 +54,7 @@ LIBGUESTFS_BACKEND=direct virt-customize \ --upload ${BUILD_DIR}/apex-os-net-config.tar.gz:/usr/lib/python2.7/site-packages \ --run-command "cd /usr/lib/python2.7/site-packages/ && rm -rf os_net_config && tar xzf apex-os-net-config.tar.gz" \ --run-command "if ! rpm -qa | grep python-redis; then yum install -y python-redis; fi" \ + --install epel-release \ --run-command "sed -i 's/^#UseDNS.*$/UseDNS no/' /etc/ssh/sshd_config" \ --run-command "sed -i 's/^GSSAPIAuthentication.*$/GSSAPIAuthentication no/' /etc/ssh/sshd_config" \ --run-command "yum install -y etcd" \ @@ -142,5 +144,10 @@ LIBGUESTFS_BACKEND=direct virt-customize \ -a overcloud-full_build.qcow2 fi + # upload and install barometer packages +if [ "$(uname -i)" == 'x86_64' ]; then + barometer_pkgs overcloud-full_build.qcow2 +fi + mv -f overcloud-full_build.qcow2 overcloud-full.qcow2 popd > /dev/null diff --git a/build/overcloud-opendaylight.sh b/build/overcloud-opendaylight.sh index 12b47f1e..9c8a82eb 100755 --- a/build/overcloud-opendaylight.sh +++ b/build/overcloud-opendaylight.sh @@ -62,7 +62,6 @@ LIBGUESTFS_BACKEND=direct virt-customize \ --upload ${BUILD_DIR}/puppet-opendaylight-carbon.tar.gz:/root/ \ --upload ${BUILD_DIR}/puppet-gluon.tar.gz:/etc/puppet/modules/ \ --run-command "cd /etc/puppet/modules/ && tar xzf puppet-gluon.tar.gz" \ - --install epel-release \ --install python-click \ --upload ${CACHE_DIR}/$gluon_rpm:/root/\ --install /root/$gluon_rpm \ diff --git a/build/rpm_specs/opnfv-apex-common.spec b/build/rpm_specs/opnfv-apex-common.spec index 97a44779..da2d4a04 100644 --- a/build/rpm_specs/opnfv-apex-common.spec +++ b/build/rpm_specs/opnfv-apex-common.spec @@ -38,6 +38,8 @@ install build/bash_completion_apex %{buildroot}%{_sysconfdir}/bash_completion.d/ mkdir -p %{buildroot}%{_sysconfdir}/opnfv-apex/ install config/deploy/os-nosdn-nofeature-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-nofeature-noha.yaml +install config/deploy/os-nosdn-bar-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-bar-noha.yaml +install config/deploy/os-nosdn-bar-ha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-bar-ha.yaml install config/deploy/os-nosdn-fdio-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-fdio-noha.yaml install config/deploy/os-nosdn-fdio-ha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-fdio-ha.yaml install config/deploy/os-nosdn-ovs_dpdk-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-ovs_dpdk-noha.yaml @@ -121,6 +123,8 @@ install config/inventory/pod_example_settings.yaml %{buildroot}%{_docdir}/opnfv/ %{_var}/opt/opnfv/lib/installer/domain.xml %{_sysconfdir}/bash_completion.d/apex %{_sysconfdir}/opnfv-apex/os-nosdn-nofeature-noha.yaml +%{_sysconfdir}/opnfv-apex/os-nosdn-bar-noha.yaml +%{_sysconfdir}/opnfv-apex/os-nosdn-bar-ha.yaml %{_sysconfdir}/opnfv-apex/os-nosdn-fdio-noha.yaml %{_sysconfdir}/opnfv-apex/os-nosdn-fdio-ha.yaml %{_sysconfdir}/opnfv-apex/os-nosdn-ovs_dpdk-noha.yaml |