Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #481 from alphagov/add_flower
Browse files Browse the repository at this point in the history
Adds flower (monitor) to backdrop.
  • Loading branch information
tlwr committed Aug 20, 2018
2 parents 4e24c34 + cdfdc76 commit 16ca363
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions etc/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 13 additions & 0 deletions etc/run_flower.sh
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 16ca363

Please sign in to comment.