Skip to content

Commit

Permalink
Merge pull request #378 from maykinmedia/feature/flower
Browse files Browse the repository at this point in the history
🔨 add flower
  • Loading branch information
annashamray authored Mar 22, 2024
2 parents 8440964 + b3fc3bf commit 7bba9a2
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ COPY --from=backend-build /usr/local/bin/celery /usr/local/bin/celery
WORKDIR /app
COPY ./bin/docker_start.sh /start.sh
COPY ./bin/celery_worker.sh /celery_worker.sh
COPY ./bin/celery_flower.sh /celery_flower.sh
COPY ./bin/check_celery_worker_liveness.py ./bin/
RUN mkdir /app/log /app/config

Expand Down
5 changes: 5 additions & 0 deletions bin/celery_flower.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -e

exec celery --app objects --workdir src flower
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ services:
- OBJECTS_SUPERUSER_USERNAME=admin
- OBJECTS_SUPERUSER_PASSWORD=admin
- OBJECTS_SUPERUSER_EMAIL=admin@localhost
- IS_HTTPS=no
- ALLOWED_HOSTS=*
- CACHE_DEFAULT=redis:6379/0
- CACHE_AXES=redis:6379/0
- CACHE_OIDC=redis:6379/0
- CELERY_BROKER_URL=redis://redis:6379/1
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- CELERY_LOGLEVEL=DEBUG
ports:
- 8000:8000
depends_on:
Expand All @@ -40,5 +47,15 @@ services:
- redis
volumes: *web_volumes

celery-flower:
build: *web_build
environment: *web_env
command: /celery_flower.sh
ports:
- 5555:5555
depends_on:
- redis
- celery

volumes:
media:
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ drf-spectacular # api documentation
uwsgi
sentry-sdk # error monitoring
elastic-apm # Elastic APM integration
flower # task monitoring

# Common ground libraries
notifications-api-common
Expand Down
10 changes: 10 additions & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ cbor2==5.6.1
celery==5.2.2
# via
# -r requirements/base.in
# flower
# notifications-api-common
certifi==2020.12.5
# via
Expand Down Expand Up @@ -160,6 +161,8 @@ face==20.1.1
# via glom
faker==8.1.0
# via zgw-consumers
flower==2.0.1
# via -r requirements/base.in
gemma-zds-client==1.0.1
# via
# commonground-api-common
Expand All @@ -169,6 +172,8 @@ glom==23.5.0
# via
# -r requirements/base.in
# mozilla-django-oidc-db
humanize==4.9.0
# via flower
idna==2.10
# via requests
inflection==0.5.1
Expand Down Expand Up @@ -215,6 +220,8 @@ pillow==10.2.0
# via -r requirements/base.in
polib==1.1.1
# via django-rosetta
prometheus-client==0.20.0
# via flower
prompt-toolkit==3.0.43
# via click-repl
psycopg2==2.8.6
Expand Down Expand Up @@ -247,6 +254,7 @@ pytz==2021.1
# celery
# djangorestframework
# drf-yasg
# flower
pyyaml==6.0.1
# via
# drf-spectacular
Expand Down Expand Up @@ -281,6 +289,8 @@ sqlparse==0.4.2
# via django
text-unidecode==1.3
# via faker
tornado==6.4
# via flower
typing-extensions==4.9.0
# via asgiref
uritemplate==3.0.1
Expand Down
16 changes: 16 additions & 0 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ cbor2==5.6.1
celery==5.2.2
# via
# -r requirements/base.txt
# flower
# notifications-api-common
certifi==2020.12.5
# via
Expand Down Expand Up @@ -237,6 +238,8 @@ faker==8.1.0
# -r requirements/base.txt
# factory-boy
# zgw-consumers
flower==2.0.1
# via -r requirements/base.txt
freezegun==1.1.0
# via -r requirements/test-tools.in
gemma-zds-client==1.0.1
Expand All @@ -249,6 +252,10 @@ glom==23.5.0
# via
# -r requirements/base.txt
# mozilla-django-oidc-db
humanize==4.9.0
# via
# -r requirements/base.txt
# flower
idna==2.10
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -326,6 +333,10 @@ polib==1.1.1
# via
# -r requirements/base.txt
# django-rosetta
prometheus-client==0.20.0
# via
# -r requirements/base.txt
# flower
prompt-toolkit==3.0.43
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -370,6 +381,7 @@ pytz==2021.1
# celery
# djangorestframework
# drf-yasg
# flower
pyyaml==6.0.1
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -423,6 +435,10 @@ text-unidecode==1.3
# via
# -r requirements/base.txt
# faker
tornado==6.4
# via
# -r requirements/base.txt
# flower
typing-extensions==4.9.0
# via
# -r requirements/base.txt
Expand Down
16 changes: 16 additions & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ cbor2==5.6.1
celery==5.2.2
# via
# -r requirements/ci.txt
# flower
# notifications-api-common
certifi==2020.12.5
# via
Expand Down Expand Up @@ -269,6 +270,8 @@ faker==8.1.0
# zgw-consumers
flake8==7.0.0
# via -r requirements/dev.in
flower==2.0.1
# via -r requirements/ci.txt
freezegun==1.1.0
# via -r requirements/ci.txt
gemma-zds-client==1.0.1
Expand All @@ -281,6 +284,10 @@ glom==23.5.0
# via
# -r requirements/ci.txt
# mozilla-django-oidc-db
humanize==4.9.0
# via
# -r requirements/ci.txt
# flower
idna==2.10
# via
# -r requirements/ci.txt
Expand Down Expand Up @@ -376,6 +383,10 @@ polib==1.1.1
# via
# -r requirements/ci.txt
# django-rosetta
prometheus-client==0.20.0
# via
# -r requirements/ci.txt
# flower
prompt-toolkit==3.0.43
# via
# -r requirements/ci.txt
Expand Down Expand Up @@ -431,6 +442,7 @@ pytz==2021.1
# celery
# djangorestframework
# drf-yasg
# flower
pyyaml==6.0.1
# via
# -r requirements/ci.txt
Expand Down Expand Up @@ -522,6 +534,10 @@ tomli==2.0.1
# build
# pip-tools
# pyproject-hooks
tornado==6.4
# via
# -r requirements/ci.txt
# flower
typing-extensions==4.9.0
# via
# -r requirements/ci.txt
Expand Down

0 comments on commit 7bba9a2

Please sign in to comment.