Fuel plugin to deploy OpenStack Telemetry services (Ceilometer, Aodh)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pre_build_hook 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash
  2. set -eux
  3. . "$(dirname "$(readlink -f "$0")")"/functions.sh
  4. HEKA_VERSION="0.10.0"
  5. COLLECTOR_TAG="0.10.0"
  6. REPO_URL="http://mirror.fuel-infra.org/mos-repos/ubuntu/snapshots/9.0-latest/pool/main"
  7. # Hindsight packages
  8. download_packages \
  9. $REPO_URL/h/hindsight/hindsight_0.9.0-1~ub14.04%2bmos2_amd64.deb \
  10. $REPO_URL/libr/librdkafka/librdkafka1_0.9.1-1~ub14.04%2bmos1_amd64.deb \
  11. $REPO_URL/l/lua-sandbox/libluasandbox1_1.0.3-5~ub14.04%2bmos1_amd64.deb \
  12. $REPO_URL/l/lua-sandbox/libluasandbox-dev_1.0.3-5~ub14.04%2bmos1_amd64.deb \
  13. $REPO_URL/l/lua-sandbox-extensions/lua-sandbox-extensions_0.0~git20160812.98065e76-1~ub14.04%2bmos3_amd64.deb \
  14. $REPO_URL/p/python-elasticsearch/python-elasticsearch_1.6.0-1~u14.04%2bmos1_all.deb \
  15. $REPO_URL/i/influxdb-python/python-influxdb_2.12.0-1~u14.04%2bmos1_all.deb
  16. # Oslo messaging
  17. OSLO_REPO_URL="http://mirror.fuel-infra.org/mos-repos/ubuntu/snapshots/9.0-latest/pool/main"
  18. download_packages $OSLO_REPO_URL/p/python-oslo.messaging.kafka/python-oslo.messaging.kafka_0.0.1-1~u14.04%2bmos2_all.deb
  19. download_packages $OSLO_REPO_URL/p/python-kafka/python-kafka_1.2.5-1~u14.04%2bmos1_all.deb
  20. # Download Heka deb package
  21. download_packages \
  22. https://github.com/elemoine/heka/releases/download/ratelimit-1/heka_${HEKA_VERSION}_amd64.deb
  23. check_md5sum heka_${HEKA_VERSION}_amd64.deb 69514d94173181a8d1dcab769062fdac
  24. # Lua scripts from lma-collector plugin
  25. # TODO use version 1.0 after release (not master)
  26. URL="https://github.com/openstack/fuel-plugin-lma-collector/archive/master.tar.gz"
  27. SCRIPT_PATH="fuel-plugin-lma-collector-master/deployment_scripts/puppet/modules/lma_collector/files/plugins"
  28. DESTINATION="deployment_scripts/puppet/modules/telemetry/files/import"
  29. TEMP_DIR=`mktemp -u`
  30. download_file $URL master.tar.gz $TEMP_DIR
  31. tar -xf $TEMP_DIR/master.tar.gz -C $TEMP_DIR --strip-components=7 $SCRIPT_PATH
  32. mkdir -p $DESTINATION/common/
  33. cp -f $TEMP_DIR/common/lma_utils.lua $DESTINATION/common/
  34. cp -f $TEMP_DIR/common/patterns.lua $DESTINATION/common/
  35. cp -f $TEMP_DIR/common/influxdb.lua $DESTINATION/common/
  36. cp -f $TEMP_DIR/common/accumulator.lua $DESTINATION/common/
  37. mkdir -p $DESTINATION/filters/
  38. cp -f $TEMP_DIR/filters/influxdb_accumulator.lua $DESTINATION/filters/
  39. mkdir -p $DESTINATION/encoders/
  40. cp -f $TEMP_DIR/encoders/es_ceilometer_resources.lua $DESTINATION/encoders/
  41. rm -fr $TEMP_DIR
  42. # Download Heka puppet module from lma collector plugin
  43. URL="https://github.com/openstack/fuel-plugin-lma-collector/archive/${COLLECTOR_TAG}.tar.gz"
  44. HEKA_MODULE_PATH="fuel-plugin-lma-collector-${COLLECTOR_TAG}/deployment_scripts/puppet/modules/heka"
  45. DESTINATION=deployment_scripts/puppet/modules
  46. TEMP_DIR=`mktemp -u`
  47. download_file $URL $COLLECTOR_TAG.tar.gz $TEMP_DIR
  48. tar -xf $TEMP_DIR/$COLLECTOR_TAG.tar.gz -C $DESTINATION --strip-components=4 $HEKA_MODULE_PATH
  49. rm -fr $TEMP_DIR
  50. env | grep BUILD_ID > env.txt || true