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

[QUESTION] How to start celery beat together with workers? #46

Closed
duz-sg opened this issue Jul 31, 2019 · 4 comments
Closed

[QUESTION] How to start celery beat together with workers? #46

duz-sg opened this issue Jul 31, 2019 · 4 comments

Comments

@duz-sg
Copy link

duz-sg commented Jul 31, 2019

I'm trying to use the celery beat service to start some scheduled tasks, and publish these tasks into a different queue, so I can have a different type of worker to consume the tasks.

My current approach is to use the similar way of starting normal worker in dockerfile, however, seems I can only start the beat service, none of my workers started.

COPY ./app/worker-start.sh /worker-start.sh

RUN chmod +x /worker-start.sh

CMD ["bash", "/worker-start.sh"]

COPY ./app/checker-start.sh /checker-start.sh

RUN chmod +x /checker-start.sh

CMD ["bash", "/checker-start.sh"]

COPY ./app/beat-start.sh /beat-start.sh

RUN chmod +x /beat-start.sh

CMD ["bash", "/beat-start.sh"]

Is this the correct way of starting a new type of worker along with beat in docker? Any comment is appreciated. Thanks.

@euri10
Copy link

euri10 commented Jul 31, 2019 via email

@duz-sg
Copy link
Author

duz-sg commented Aug 1, 2019

It's not correct imho, you'd need a beat and a worker container. You can look at a working example here: https://gitlab.com/euri10/euri10_fastapi_base/tree/master/docker-compose-dev.yml Le mer. 31 juil. 2019 à 9:21 PM, Du Zheng notifications@github.com a écrit :

I'm trying to use the celery beat service to start some scheduled tasks, and publish these tasks into a different queue, so I can have a different type of worker to consume the tasks. My current approach is to use the similar way of starting normal worker in dockerfile, however, seems I can only start the beat service, none of my workers started. COPY ./app/worker-start.sh /worker-start.sh RUN chmod +x /worker-start.sh CMD ["bash", "/worker-start.sh"] COPY ./app/checker-start.sh /checker-start.sh RUN chmod +x /checker-start.sh CMD ["bash", "/checker-start.sh"] COPY ./app/beat-start.sh /beat-start.sh RUN chmod +x /beat-start.sh CMD ["bash", "/beat-start.sh"] Is this the correct way of starting a new type of worker along with beat in docker? Any comment is appreciated. Thanks. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#46?email_source=notifications&email_token=AAINSPU43XYTR73RDMJPN6DQCHX6HA5CNFSM4IIKHH22YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HCVDFZA>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAINSPUDJQ5IUU27IK7ORWDQCHX6HANCNFSM4IIKHH2Q .

Cool, will look into it. Thanks!

@duz-sg duz-sg closed this as completed Aug 3, 2019
@tiangolo
Copy link
Member

Thanks for the help @euri10 ! 🎉

And thanks @duz-sg for reporting back and closing the issue ✔️

@JennyCGT
Copy link

Hello @tiangolo Can you give me a piece of advice. I am trying to create a dynamic task scheduling system using FastAPI. On Django, before I have used 'django-celery-beats' in order to update dynamically task. There is any similar package for FastAPI. I really appreciate your help, I am new on FastAPI.

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

No branches or pull requests

4 participants