diff --git a/.gitignore b/.gitignore index 45f1f59..a923341 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,6 @@ src/hope_payment_gateway/static .vscode .pdm-python -pdm.toml \ No newline at end of file +pdm.toml + +/__pypackages__ \ No newline at end of file diff --git a/compose.yml b/compose.yml index 1c4a7a1..f270154 100644 --- a/compose.yml +++ b/compose.yml @@ -81,6 +81,7 @@ services: command: | sh -c " entrypoint.sh ./docker/wait-for-it.sh db:5432 + entrypoint.sh ./docker/wait-for-it.sh redis:6379 entrypoint.sh celery_worker " environment: *django-env @@ -101,6 +102,7 @@ services: command: | sh -c " entrypoint.sh ./docker/wait-for-it.sh db:5432 + entrypoint.sh ./docker/wait-for-it.sh redis:6379 entrypoint.sh celery_beat " environment: *django-env @@ -111,4 +113,19 @@ services: db: condition: service_healthy redis: - condition: service_healthy \ No newline at end of file + condition: service_healthy + + celery_flower: + build: + context: . + dockerfile: docker/Dockerfile + target: dev + ports: + - 5555:5555 + environment: + - CELERY_BROKER_URL=redis://redis:6379/0 + command: | + sh -c " + entrypoint.sh ./docker/wait-for-it.sh redis:6379 + entrypoint.sh celery_flower + " \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 5da3598..d5e1589 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -35,6 +35,9 @@ case "$1" in celery_beat) celery -A hope_payment_gateway.celery beat -l info ;; + celery_flower) + celery flower -A hope_payment_gateway.celery --address=0.0.0.0 --broker=$CELERY_BROKER_URL + ;; *) exec "$@" ;; diff --git a/pdm.lock b/pdm.lock index 543eba3..09961a2 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev"] strategy = [] lock_version = "4.5.0" -content_hash = "sha256:8fd12e40a14b344bcacafd20c499d52390a32b70ec6b0cf05e1dc8ed07b56725" +content_hash = "sha256:3f7f071898468a068fe3fa50ae8b8abbbd2064e94a7f3ac99267ce7cc1af329d" [[metadata.targets]] requires_python = ">=3.11" @@ -1174,6 +1174,23 @@ files = [ {file = "flake8_html-0.4.3-py2.py3-none-any.whl", hash = "sha256:8f126748b1b0edd6cd39e87c6192df56e2f8655b0aa2bb00ffeac8cf27be4325"}, ] +[[package]] +name = "flower" +version = "2.0.1" +requires_python = ">=3.7" +summary = "Celery Flower" +dependencies = [ + "celery>=5.0.5", + "humanize", + "prometheus-client>=0.8.0", + "pytz", + "tornado<7.0.0,>=5.0.0", +] +files = [ + {file = "flower-2.0.1-py2.py3-none-any.whl", hash = "sha256:9db2c621eeefbc844c8dd88be64aef61e84e2deb29b271e02ab2b5b9f01068e2"}, + {file = "flower-2.0.1.tar.gz", hash = "sha256:5ab717b979530770c16afb48b50d2a98d23c3e9fe39851dcf6bc4d01845a02a0"}, +] + [[package]] name = "freezegun" version = "1.5.1" @@ -1223,6 +1240,16 @@ files = [ {file = "html_json_forms-1.1.1-py3-none-any.whl", hash = "sha256:51e7e9088bc88e324027144ca25d8bcdd37da28f311a8436bfd88944138ed409"}, ] +[[package]] +name = "humanize" +version = "4.10.0" +requires_python = ">=3.8" +summary = "Python humanize utilities" +files = [ + {file = "humanize-4.10.0-py3-none-any.whl", hash = "sha256:39e7ccb96923e732b5c2e27aeaa3b10a8dfeeba3eb965ba7b74a3eb0e30040a6"}, + {file = "humanize-4.10.0.tar.gz", hash = "sha256:06b6eb0293e4b85e8d385397c5868926820db32b9b654b932f57fa41c23c9978"}, +] + [[package]] name = "identify" version = "2.5.36" @@ -1788,6 +1815,16 @@ files = [ {file = "pre_commit-3.8.0.tar.gz", hash = "sha256:8bb6494d4a20423842e198980c9ecf9f96607a07ea29549e180eef9ae80fe7af"}, ] +[[package]] +name = "prometheus-client" +version = "0.20.0" +requires_python = ">=3.8" +summary = "Python client for the Prometheus monitoring system." +files = [ + {file = "prometheus_client-0.20.0-py3-none-any.whl", hash = "sha256:cde524a85bce83ca359cc837f28b8c0db5cac7aa653a588fd7e84ba061c329e7"}, + {file = "prometheus_client-0.20.0.tar.gz", hash = "sha256:287629d00b147a32dcb2be0b9df905da599b2d82f80377083ec8463309a4bb89"}, +] + [[package]] name = "prompt-toolkit" version = "3.0.43" @@ -2492,6 +2529,25 @@ files = [ {file = "termcolor-2.4.0.tar.gz", hash = "sha256:aab9e56047c8ac41ed798fa36d892a37aca6b3e9159f3e0c24bc64a9b3ac7b7a"}, ] +[[package]] +name = "tornado" +version = "6.4.1" +requires_python = ">=3.8" +summary = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed." +files = [ + {file = "tornado-6.4.1-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:163b0aafc8e23d8cdc3c9dfb24c5368af84a81e3364745ccb4427669bf84aec8"}, + {file = "tornado-6.4.1-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:6d5ce3437e18a2b66fbadb183c1d3364fb03f2be71299e7d10dbeeb69f4b2a14"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e2e20b9113cd7293f164dc46fffb13535266e713cdb87bd2d15ddb336e96cfc4"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ae50a504a740365267b2a8d1a90c9fbc86b780a39170feca9bcc1787ff80842"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:613bf4ddf5c7a95509218b149b555621497a6cc0d46ac341b30bd9ec19eac7f3"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:25486eb223babe3eed4b8aecbac33b37e3dd6d776bc730ca14e1bf93888b979f"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:454db8a7ecfcf2ff6042dde58404164d969b6f5d58b926da15e6b23817950fc4"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a02a08cc7a9314b006f653ce40483b9b3c12cda222d6a46d4ac63bb6c9057698"}, + {file = "tornado-6.4.1-cp38-abi3-win32.whl", hash = "sha256:d9a566c40b89757c9aa8e6f032bcdb8ca8795d7c1a9762910c722b1635c9de4d"}, + {file = "tornado-6.4.1-cp38-abi3-win_amd64.whl", hash = "sha256:b24b8982ed444378d7f21d563f4180a2de31ced9d8d84443907a0a64da2072e7"}, + {file = "tornado-6.4.1.tar.gz", hash = "sha256:92d3ab53183d8c50f8204a51e6f91d18a15d5ef261e84d452800d4ff6fc504e9"}, +] + [[package]] name = "traitlets" version = "5.14.3" diff --git a/pyproject.toml b/pyproject.toml index f4601dc..9a23410 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,7 @@ dev = [ "types-redis", "unittest-xml-reporting", "watchdog", + "flower>=2.0.1", ] [project] authors = [