Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔥 Remove Celery and Flower, they are currently not used nor recommended #694

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

tiangolo
Copy link
Member

@tiangolo tiangolo commented Mar 12, 2024

🔥 Remove Celery and Flower, they are currently not used nor recommended

When choosing Celery I evaluated RQ, Dramatiq, and a couple of other options, but Celery was the only one at the time that would allow having workers running externally with potentially different dependencies (e.g. TensorFlow models), as there was a way to make Celery not import everything for the client sending a job.

Nevertheless, that is not the default or documented behavior in Celery. And Celery also has many features that I don't use, or would not suggest using, like chains and chords, as they became quite difficult to debug and handle when I used that.

I would prefer something different, but I don't know yet what would be the best alternative. I wanted to try ARQ, as it's from the same author of Pydantic, but that's also a smaller library without any type of dashboard/observability, etc.

I want to try Prefect, Hatchet, and maybe others (Dask, Ray, Dagster?). I still don't know what is the best option.

For things that are not resource-intensive and are expected to be done very fast, a simple integrated BackgroundTask from FastAPI would be enough. For heavier problems that require distributed tasks running in the background, I think there might be alternatives better than Celery. I have to investigate the subject more before deciding and implementing anything here.

For now, I just don't want to suggest using something that I currently don't endorse, and that is also not really needed in this repo as it is. 😅

@PierrickLP
Copy link

🔥 Remove Celery and Flower, they are currently not used nor recommended

Why are they not recommended ?

@tiangolo
Copy link
Member Author

@PierrickLP I was just writing all the descriptions above. 😅

Once I figure out what would be the approach I would recommend, I would update it in this repo. 🤓

@tiangolo tiangolo marked this pull request as ready for review March 12, 2024 18:18
@tiangolo tiangolo merged commit 1e256bc into master Mar 12, 2024
3 checks passed
@tiangolo tiangolo deleted the rm-celery branch March 12, 2024 18:19
@tiangolo tiangolo mentioned this pull request Mar 12, 2024
12 tasks
@Haiz14
Copy link

Haiz14 commented Mar 15, 2024

There's a celery file not deleted
https://github.com/tiangolo/full-stack-fastapi-template/blob/master/backend/app/celeryworker_pre_start.py

@copdips
Copy link

copdips commented Mar 29, 2024

maybe it's time to build something called fastflow

@flying-sheep
Copy link

flying-sheep commented Apr 18, 2024

Maybe check this out:
https://github.com/taskiq-python/taskiq

I don’t know if it fits the bill, but it at least is built with async support. It has quite some plugins that make it support all important queues, as well as things like FastAPI integration:

@PhilippWu
Copy link
Contributor

PhilippWu commented Apr 21, 2024

@tiangolo do you have new insights about Task Queueing and the tooling you will add for that? I am building up ab project witch needs queing and delaying and prioitising of queues with workers. Is there any desiccion with tool you may use in the future?

@copdips
Copy link

copdips commented Apr 21, 2024

If a beautiful UI matters, both Airflow and Prefect are excellent choices.

@Ccolina03
Copy link

@tiangolo Do you have any recommendations yet? :)

@qiangxinglin
Copy link

@tiangolo Bump, any news?

@CIRDL
Copy link

CIRDL commented Jun 21, 2024

@tiangolo Also very curious if you have any updates 😁

francisco-rma pushed a commit to francisco-rma/web-tvl that referenced this pull request Jul 24, 2024
@wkirby
Copy link

wkirby commented Jul 24, 2024

@tiangolo just a heads up, the FastApi documentation still says:

To see an example, check the Project Generators, they all include Celery already configured.

A bit confusing to arrive here and find Celery has been removed and is not recommended.

gusevyaroslove pushed a commit to gusevyaroslove/fastapi-template that referenced this pull request Aug 4, 2024
@wang-h
Copy link

wang-h commented Aug 24, 2024

I'm also confused about the missing celery. I use Celery for scheduled tasks, after all it is the only independent one can fit well with my fastapi server and deployed as docker within the cluster. So for docker clustering, I feel celery is a good solution at so far.

However, the learning slope (difficulty) of celery is suddenly too high, so I have to discard it.
If you can find an alternative, it will be great and waiting for your news.

BTW, please update the document and remove the paragraphs about celery....

david-caro added a commit to david-caro/fastapi that referenced this pull request Nov 1, 2024
In fastapi/full-stack-fastapi-template#694
celery was removed from the template project, it makes no sense
anymore mentioning in the docs that is an example on how to use
celery.

Signed-off-by: David Caro <me@dcaro.es>
@nadavof
Copy link

nadavof commented Nov 7, 2024

FYI, the official docs still mention that Celery is configurated in the project generator:

https://fastapi.tiangolo.com/tutorial/background-tasks/#technical-details:~:text=To%20see%20an%20example%2C%20check%20the%20Project%20Generators%2C%20they%20all%20include%20Celery%20already%20configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.