Fix ceilosca.sh vagrant env setup

monasca-ceilometer repo now gets
copied into the vagrant VM, and
local.conf gets updated with
location and branch information,
so that any change can be
tested.

Also made following two changes:

1.)
Fix auth_url property being set in the
service_credentials section.

2.)
Create pipeline yaml with meters which
match monasca_definitions yaml.

Change-Id: I24da3b0df73079e03ff3f8a210851394a31c9c25
This commit is contained in:
Ashwin Agate 2017-06-28 15:01:16 -07:00
parent 1e36f23561
commit 4775598b8a
5 changed files with 68 additions and 4 deletions

15
devstack/Vagrantfile vendored
View File

@ -36,9 +36,22 @@ Vagrant.configure(2) do |config|
vb.memory = "12800"
vb.cpus = 4
# vb.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
# bento box bug workaround - https://github.com/chef/bendo/issues/688
# bento box bug workaround - https://github.com/chef/bento/issues/688
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
end
if !ENV['LOCAL_REPO'] || ENV['LOCAL_REPO'].empty?
puts "Using default repo"
local_repo_location = "../."
else
puts "Getting repo from ENV"
local_repo_location = ENV['LOCAL_REPO']
end
repo_path = File.expand_path(local_repo_location)
puts "Resolved repo at #{repo_path}"
# push up our monasca-transform code
config.vm.synced_folder local_repo_location, "/monasca-ceilometer-source"
config.vm.provision "shell", privileged: false, path: "ceilosca.sh"
end

View File

@ -1,5 +1,11 @@
#!/bin/bash -xe
echo "going to copy /monasca-ceilometer-source to /home/vagrant ..."
rsync -a --exclude='tools/vagrant/.vagrant' /monasca-ceilometer-source /home/vagrant/
echo "going to move /home/vagrant/monasca-ceilometer-source /home/vagrant/monasca-ceilometer..."
mv /home/vagrant/monasca-ceilometer-source /home/vagrant/monasca-ceilometer
#Change to Home directory
cd $HOME
@ -85,11 +91,34 @@ MONASCA_PERSISTER_IMPLEMENTATION_LANG=${MONASCA_PERSISTER_IMPLEMENTATION_LANG:-p
# This line will enable all of Monasca.
enable_plugin monasca-api https://git.openstack.org/openstack/monasca-api stable/newton
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer stable/newton
enable_plugin ceilosca https://github.com/openstack/monasca-ceilometer master
# Optional
#enable_plugin monasca-transform https://git.openstack.org/openstack/monasca-transform master
' > local.conf
pushd /home/vagrant/monasca-ceilometer
echo "creating a local commit..."
git config --global user.email "local.devstack.committer@hpe.com"
git config --global user.name "Local devstack committer"
git add --all
git commit -m "Local commit"
echo "creating a local commit done."
CURRENT_BRANCH=`git status | grep 'On branch' | sed 's/On branch //'`
if [ ${CURRENT_BRANCH} != 'master' ]
then
echo "Maintaining current branch ${CURRENT_BRANCH}"
# set the branch to what we're using in local.conf
if [[ -z `grep ${CURRENT_BRANCH} /home/vagrant/devstack/local.conf` ]]; then
sed -i "s/enable_plugin ceilosca \/home\/vagrant\/monasca-ceilometer//g" /home/vagrant/devstack/local.conf
sed -i "s/# END DEVSTACK LOCAL.CONF CONTENTS//g" /home/vagrant/devstack/local.conf
printf "enable_plugin ceilosca /home/vagrant/monasca-ceilometer ${CURRENT_BRANCH}\n" >> /home/vagrant/devstack/local.conf
printf "# END DEVSTACK LOCAL.CONF CONTENTS" >> /home/vagrant/devstack/local.conf
fi
fi
popd
#Run the stack.sh
./unstack.sh | true
./stack.sh

View File

@ -35,7 +35,7 @@ function configure_ceilosca {
if [[ -n "$auth_url" ]]; then
# Go direct to the port
auth_url=${auth_url/%\/identity/:35357\/v3}
iniset $CEILOMETER_CONF service_credentials ${auth_url}
iniset $CEILOMETER_CONF service_credentials auth_url ${auth_url}
fi
}

View File

@ -7,5 +7,5 @@ enable_service ceilosca
MONASCA_API_URL=http://$SERVICE_HOST:8070/v2.0
CEILOSCA_DIR=$DEST/ceilosca
CEILOSCA_FILES='ceilometer/monasca_client.py ceilometer/publisher/monasca_data_filter.py ceilometer/publisher/monclient.py ceilometer/storage/impl_monasca.py ../devstack/setup.cfg:.'
CEILOSCA_CONF_FILES='monasca_pipeline.yaml:pipeline.yaml monasca_field_definitions.yaml'
CEILOSCA_CONF_FILES='ceilosca_pipeline.yaml:pipeline.yaml monasca_field_definitions.yaml'
CEILOSCA_USER=$USER

View File

@ -0,0 +1,22 @@
---
sources:
- name: meter_source
interval: 60
meters:
- "instance"
- "image"
- "image.size"
- "image.update"
- "image.upload"
- "image.delete"
- "snapshot"
- "snapshot.size"
- "volume"
- "volume.size"
sinks:
- meter_sink
sinks:
- name: meter_sink
transformers:
publishers:
- monasca://http://192.168.10.6:8070/v2.0