Skip to content

Commit 1e256bc

Browse files
authored
🔥 Remove Celery and Flower, they are currently not used nor recommended (fastapi#694)
1 parent 63eb8b5 commit 1e256bc

20 files changed

+3
-466
lines changed

‎.env

-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ POSTGRES_PASSWORD=changethis
3333

3434
SENTRY_DSN=
3535

36-
# Flower
37-
FLOWER_BASIC_AUTH=admin:changethis
38-
3936
# Configure these with your own Docker registry images
4037
DOCKER_IMAGE_BACKEND=backend
41-
DOCKER_IMAGE_CELERYWORKER=celery
4238
DOCKER_IMAGE_FRONTEND=frontend

‎.github/workflows/deploy-production.yml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
EMAILS_FROM_EMAIL: ${{ secrets.EMAILS_FROM_EMAIL }}
2323
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
2424
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
25-
FLOWER_BASIC_AUTH: ${{ secrets.FLOWER_BASIC_AUTH }}
2625
steps:
2726
- name: Checkout
2827
uses: actions/checkout@v4

‎.github/workflows/deploy-staging.yml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
EMAILS_FROM_EMAIL: ${{ secrets.EMAILS_FROM_EMAIL }}
2323
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
2424
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
25-
FLOWER_BASIC_AUTH: ${{ secrets.FLOWER_BASIC_AUTH }}
2625
steps:
2726
- name: Checkout
2827
uses: actions/checkout@v4

‎README.md

-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ The input variables, with their default values (some auto generated) are:
155155
- `emails_from_email`: (default: `"[email protected]"`) The email account to send emails from, you can set it later in .env.
156156
- `postgres_password`: (default: `"changethis"`) The password for the PostgreSQL database, stored in .env, you can generate one with the method above.
157157
- `sentry_dsn`: (default: "") The DSN for Sentry, if you are using it, you can set it later in .env.
158-
- `flower_basic_auth`: (default: `"admin:changethis"`) The basic auth for Flower, you can set it later in .env.
159158

160159
## Release Notes
161160

File renamed without changes.

‎backend/README.md

+1-17
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ Automatic interactive documentation with Swagger UI (from the OpenAPI backend):
2323

2424
Adminer, database web administration: http://localhost:8080
2525

26-
Flower, administration of Celery tasks: http://localhost:5555
27-
2826
Traefik UI, to see how the routes are being handled by the proxy: http://localhost:8090
2927

3028
**Note**: The first time you start your stack, it might take a minute for it to be ready. While the backend waits for the database to be ready and configures everything. You can check the logs to monitor it.
@@ -65,8 +63,6 @@ Make sure your editor is using the correct Python virtual environment.
6563

6664
Modify or add SQLModel models for data and SQL tables in `./backend/app/models.py`, API endpoints in `./backend/app/api/`, CRUD (Create, Read, Update, Delete) utils in `./backend/app/crud.py`.
6765

68-
Add and modify tasks to the Celery worker in `./backend/app/worker.py`.
69-
7066
### VS Code
7167

7268
There are already configurations in place to run the backend through the VS Code debugger, so that you can use breakpoints, pause and explore variables, etc.
@@ -157,19 +153,7 @@ docker compose exec backend bash /app/tests-start.sh -x
157153

158154
#### Test Coverage
159155

160-
Because the test scripts forward arguments to `pytest`, you can enable test coverage HTML report generation by passing `--cov-report=html`.
161-
162-
To run the local tests with coverage HTML reports:
163-
164-
```Bash
165-
DOMAIN=backend sh ./scripts/test-local.sh --cov-report=html
166-
```
167-
168-
To run the tests in a running stack with coverage HTML reports:
169-
170-
```bash
171-
docker compose exec backend bash /app/tests-start.sh --cov-report=html
172-
```
156+
When the tests are run, a file `htmlcov/index.html` is generated, you can open it in your browser to see the coverage of the tests.
173157

174158
### Migrations
175159

‎backend/app/api/routes/utils.py

-14
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,12 @@
22
from pydantic.networks import EmailStr
33

44
from app.api.deps import get_current_active_superuser
5-
from app.core.celery_app import celery_app
65
from app.models import Message
76
from app.utils import generate_test_email, send_email
87

98
router = APIRouter()
109

1110

12-
@router.post(
13-
"/test-celery/",
14-
dependencies=[Depends(get_current_active_superuser)],
15-
status_code=201,
16-
)
17-
def test_celery(body: Message) -> Message:
18-
"""
19-
Test Celery worker.
20-
"""
21-
celery_app.send_task("app.worker.test_celery", args=[body.message])
22-
return Message(message="Word received")
23-
24-
2511
@router.post(
2612
"/test-email/",
2713
dependencies=[Depends(get_current_active_superuser)],

‎backend/app/core/celery_app.py

-5
This file was deleted.

‎backend/app/tests/api/routes/test_celery.py

-16
This file was deleted.

‎backend/app/tests/scripts/test_celery_pre_start.py

-33
This file was deleted.

‎backend/app/worker.py

-12
This file was deleted.

‎backend/celeryworker.dockerfile

-32
This file was deleted.

0 commit comments

Comments
 (0)