diff options
-rw-r--r-- | src/fuel-plugin/Dockerfile | 2 | ||||
-rw-r--r-- | src/fuel-plugin/README.md | 16 | ||||
-rwxr-xr-x | src/fuel-plugin/build-collectd.sh | 22 | ||||
-rwxr-xr-x | src/fuel-plugin/build_fuel_plugin.sh (renamed from src/fuel-plugin/vagrant/build_fuel_plugin.sh) | 4 | ||||
-rwxr-xr-x | src/fuel-plugin/deployment_scripts/install.sh | 12 | ||||
-rw-r--r-- | src/fuel-plugin/enable_pqos.diff | 27 | ||||
-rwxr-xr-x | src/fuel-plugin/pre_build_hook | 18 | ||||
-rw-r--r-- | src/fuel-plugin/vagrant/Vagrantfile | 2 |
8 files changed, 66 insertions, 37 deletions
diff --git a/src/fuel-plugin/Dockerfile b/src/fuel-plugin/Dockerfile index 301d796a..a7b1593c 100644 --- a/src/fuel-plugin/Dockerfile +++ b/src/fuel-plugin/Dockerfile @@ -4,5 +4,3 @@ FROM ubuntu:16.04 RUN apt-get update -y RUN apt-get install -y sudo - -ADD ./build-collectd.sh /build-collectd.sh diff --git a/src/fuel-plugin/README.md b/src/fuel-plugin/README.md index 8c6d5a25..0a44a9c0 100644 --- a/src/fuel-plugin/README.md +++ b/src/fuel-plugin/README.md @@ -55,19 +55,3 @@ step 1, 2, 3 may be bypassed if fuel plugin is installed from /opt/opnfv in fuel SSH to openstack controller node: source openrc ceilometer sample-list --meter interface.if_packets - -9) known issues - -a) connection aborted - root@node-11:~# ceilometer sample-list --meter interface.if_packets -('Connection aborted.', BadStatusLine("''",)) - - workaround: - root@node-11:~# sudo service ceilometer-api restart - -b) Service Unavailable - root@node-11:~# ceilometer sample-list --meter interface.if_packets -Service Unavailable (HTTP 503) - - workaround: - root@node-11:~# sudo service ceilometer-api restart diff --git a/src/fuel-plugin/build-collectd.sh b/src/fuel-plugin/build-collectd.sh index 0ef3136d..72097d20 100755 --- a/src/fuel-plugin/build-collectd.sh +++ b/src/fuel-plugin/build-collectd.sh @@ -1,8 +1,13 @@ #!/bin/bash -BUILD_HOME="$(pwd)" +BUILD_HOME=/tmp/collectd-build set -eux + +sudo rm -rf $BUILD_HOME +sudo mkdir -p $BUILD_HOME +sudo chmod 777 $BUILD_HOME + sudo apt-get -y install build-essential dh-autoreconf fakeroot devscripts dpkg-dev git wget sudo apt-get -y install \ @@ -62,15 +67,24 @@ sudo apt-get -y install \ python-dev + +cd ${BUILD_HOME} +git clone https://github.com/01org/intel-cmt-cat.git +cd intel-cmt-cat/ +git checkout c194e3a14d5efc1bd05a8ef7a49cfaf689f66937 +make +sudo make install PREFIX=/fuel-plugin/build/qpos + cd ${BUILD_HOME} rm -rf collectd -git clone https://github.com/collectd/collectd; cd collectd; git checkout 797ed5e5bee9ee89361f12e447ffc6ceb6ef79d2 +git clone https://github.com/collectd/collectd; cd collectd; git checkout 786a6be461cf58ef2b8c57974cad2a79ba2ee82c git clone https://github.com/collectd/pkg-debian; cd pkg-debian; git checkout 549d3caba74210ad762fe8c556801d9c11ab9876 -mv debian .. +patch -p1 < /fuel-plugin/enable_pqos.diff +cp -r debian .. cd ${BUILD_HOME}/collectd ./build.sh debian/rules build || true debian/rules build fakeroot debian/rules binary -cp ${BUILD_HOME}/*.deb /build +cp ${BUILD_HOME}/*.deb /fuel-plugin/build diff --git a/src/fuel-plugin/vagrant/build_fuel_plugin.sh b/src/fuel-plugin/build_fuel_plugin.sh index ea77b075..9d96e201 100755 --- a/src/fuel-plugin/vagrant/build_fuel_plugin.sh +++ b/src/fuel-plugin/build_fuel_plugin.sh @@ -3,8 +3,4 @@ sudo apt-get update -y sudo apt-get install -y ruby-dev rubygems-integration python-pip rpm createrepo dpkg-dev git docker.io sudo gem install fpm sudo pip install fuel-plugin-builder -cp -r /fuel-plugin /home/vagrant -cd /home/vagrant/fuel-plugin; -rm -rf vagrant/.vagrant fpb --debug --build . -cp *.rpm /vagrant diff --git a/src/fuel-plugin/deployment_scripts/install.sh b/src/fuel-plugin/deployment_scripts/install.sh index 0bcb4008..e602e9c8 100755 --- a/src/fuel-plugin/deployment_scripts/install.sh +++ b/src/fuel-plugin/deployment_scripts/install.sh @@ -11,19 +11,25 @@ OS_PASSWORD=$4 CEILOMETER_URL_TYPE=${CEILOMETER_URL_TYPE:-internalURL} CEILOMETER_TIMEOUT=${CEILOMETER_TIMEOUT:-1000} -apt-get install -y collectd python-dev libpython2.7 - rm -rf $INSTALL_HOME; mkdir -p $INSTALL_HOME cd $INSTALL_HOME curl http://$HOST:8080/plugins/fuel-plugin-collectd-ceilometer-1.0/repositories/ubuntu/collectd-ceilometer.tgz | tar xzvf - +cat << EOF > /etc/ld.so.conf.d/pqos.conf +$INSTALL_HOME/lib +EOF +ldconfig +modprobe msr + +apt-get install -y --allow-unauthenticated collectd python-dev libpython2.7 + cat << EOF > /etc/collectd/collectd.conf.d/collectd-ceilometer-plugin.conf <LoadPlugin python> Globals true </LoadPlugin> <Plugin python> - ModulePath "$INSTALL_HOME" + ModulePath "$INSTALL_HOME/collectd-ceilometer-plugin" LogTraces true Interactive false Import "collectd_ceilometer.plugin" diff --git a/src/fuel-plugin/enable_pqos.diff b/src/fuel-plugin/enable_pqos.diff new file mode 100644 index 00000000..1224a1f1 --- /dev/null +++ b/src/fuel-plugin/enable_pqos.diff @@ -0,0 +1,27 @@ +diff --git a/debian/changelog b/debian/changelog +index 88d2293..fa6bce1 100644 +--- a/debian/changelog ++++ b/debian/changelog +@@ -1,3 +1,10 @@ ++collectd (5.7.0-1) UNRELEASED; urgency=medium ++ ++ * debian/rules: ++ - enable ppos ++ ++ -- Ruijing Guo <ruijing.guo@intel.com> Thu, 22 Dec 2016 13:24:11 -0500 ++ + collectd (5.5.0-4) UNRELEASED; urgency=medium + + * debian/collectd-core.overrides: +diff --git a/debian/rules b/debian/rules +index ba7cfc0..d876e12 100755 +--- a/debian/rules ++++ b/debian/rules +@@ -168,6 +168,7 @@ config.status: configure + + PKG_CONFIG_PATH="$(CURDIR)/debian/pkgconfig:$$PKG_CONFIG_PATH" \ + ./configure $(confflags) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ ++ --enable-syslog --enable-logfile --with-libpqos=/opt/pqos/--enable-debug \ + || ( status=$$?; cat config.log; exit $$status ) + + build: build-arch build-indep diff --git a/src/fuel-plugin/pre_build_hook b/src/fuel-plugin/pre_build_hook index c0d35d4f..d264d0bf 100755 --- a/src/fuel-plugin/pre_build_hook +++ b/src/fuel-plugin/pre_build_hook @@ -13,19 +13,23 @@ DIR="$(dirname `readlink -f $0`)" function build_pkg { case $1 in ubuntu) - cd ${DIR} - rm -rf ${DIR}/repositories/ubuntu; mkdir -p ${DIR}/repositories/ubuntu - rm -rf collectd-ceilometer-plugin + sudo rm -rf ${DIR}/build; mkdir -p ${DIR}/build + + cd ${DIR}/build git clone https://github.com/openstack/collectd-ceilometer-plugin cd collectd-ceilometer-plugin git checkout 73372f2eb86c81f12bc10b392f75050a401107db - tar cfvz ${DIR}/repositories/ubuntu/collectd-ceilometer.tgz . --exclude=collectd-ceilometer.tgz - cd ..; rm -rf collectd-ceilometer-plugin # build collectd cd ${DIR} - sudo docker build -t collectd_build . - sudo docker run -v${DIR}/repositories/ubuntu:/build -t collectd_build /build-collectd.sh + sudo docker build -t collectd_build . + sudo docker run -v ${DIR}:/fuel-plugin -t collectd_build /fuel-plugin/build-collectd.sh + + rm -rf ${DIR}/repositories/ubuntu; mkdir -p ${DIR}/repositories/ubuntu + cd ${DIR}/build + mv *.deb ${DIR}/repositories/ubuntu + tar cfvz ${DIR}/repositories/ubuntu/collectd-ceilometer.tgz . + cd ..; sudo rm -rf ${DIR}/build ;; *) echo "Not supported system"; exit 1;; esac diff --git a/src/fuel-plugin/vagrant/Vagrantfile b/src/fuel-plugin/vagrant/Vagrantfile index 8e2d9db1..ba237d79 100644 --- a/src/fuel-plugin/vagrant/Vagrantfile +++ b/src/fuel-plugin/vagrant/Vagrantfile @@ -10,7 +10,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "fuel" do | h | h.vm.host_name = "fuel" - h.vm.provision :shell, :inline => "/vagrant/build_fuel_plugin.sh", privileged: false + h.vm.provision :shell, :inline => "cd /fuel-plugin; ./build_fuel_plugin.sh", privileged: false h.vm.synced_folder "..", "/fuel-plugin" h.vm.provider :virtualbox do |v| v.customize ["modifyvm", :id, "--memory", 4096] |