From cdfdc76868650771de6276d3da707a9c299dbdd4 Mon Sep 17 00:00:00 2001 From: Daniel Blair Date: Mon, 20 Aug 2018 15:01:10 +0100 Subject: [PATCH] Adds flower to backdrop. --- etc/deploy.sh | 1 + etc/run_flower.sh | 13 +++++++++++++ manifest.yml | 9 +++++++++ requirements.txt | 1 + 4 files changed, 24 insertions(+) create mode 100755 etc/run_flower.sh diff --git a/etc/deploy.sh b/etc/deploy.sh index 7eeae60b..82d85258 100644 --- a/etc/deploy.sh +++ b/etc/deploy.sh @@ -40,3 +40,4 @@ cf push -f manifest.yml # create and map routes cf map-route performance-platform-backdrop-read cloudapps.digital --hostname performance-platform-backdrop-read-$PAAS_SPACE cf map-route performance-platform-backdrop-write cloudapps.digital --hostname performance-platform-backdrop-write-$PAAS_SPACE +cf map-route performance-platform-backdrop-flower cloudapps.digital --hostname performance-platform-backdrop-flower-$PAAS_SPACE diff --git a/etc/run_flower.sh b/etc/run_flower.sh new file mode 100755 index 00000000..3b187457 --- /dev/null +++ b/etc/run_flower.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -ueo pipefail + +: "${VCAP_SERVICES:?Expecting VCAP_SERVICES to be set!}" +: "${REDIS_DATABASE_NUMBER:?Expecting REDIS_DATABASE_NUMBER to be set!}" +: "${PORT:?Expecting PORT to be set!}" +: "${FLOWER_BASIC_AUTH:?Expecting FLOWER_BASIC_AUTH to be set!}" + +export FLOWER_BROKER_API="$(echo ${VCAP_SERVICES} | jq -r '.["redis"][] | select(.name == "redis") | .credentials.uri')/${REDIS_DATABASE_NUMBER}" +export FLOWER_PORT=${PORT} + +flower --broker="${FLOWER_BROKER_API}" -A backdrop.transformers.worker diff --git a/manifest.yml b/manifest.yml index 994e2660..6f7c80ec 100644 --- a/manifest.yml +++ b/manifest.yml @@ -28,3 +28,12 @@ applications: env: BACKDROP_BROKER_SSL_CERT_REQS: CERT_NONE CELERY_CONFIG_MODULE: backdrop.celeryconfig + + - name: performance-platform-backdrop-flower + <<: *defaults + command: etc/run_flower.sh + memory: 1G + env: + DISABLE_COLLECTSTATIC: 1 + BACKDROP_BROKER_SSL_CERT_REQS: CERT_NONE + CELERY_CONFIG_MODULE: backdrop.celeryconfig diff --git a/requirements.txt b/requirements.txt index e2c8eb9f..8d4f112d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,3 +19,4 @@ xlrd==0.9.3 logstash_formatter==0.5.7 Werkzeug==0.12.2 redis==2.10.6 +flower==0.9.2