Open sglebs opened 9 months ago
I have not been able to disable the liveness check on the exposed port on deploy. And I have not being able to bundle a tiny web server to just reply "just go away". Docker compose is experimental on Azure (compose with celery+nginx might be a valid hack).
I am willing to write my own code which is like celery-worker+FastAPI for a single stupid endpoint, but I am not sure how to achieve this.
Help is welcome. Thanks.
The current workaround I am trying requires 2 more python VMs:
Here's the supervisord.conf:
[supervisord]
# http://supervisord.org/configuration.html
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
[program:celery]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
command=celery worker --loglevel=info -E
[program:web]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
#https://realpython.com/python-http-server/
command=python3 -m http.server -b "::" -d ./app/static 80
Running into the same issue—curious if anyone has a workaround?
I ended up bundling Celery and Flower together. This way there is an http server (separate VMs, with supervisord). It sucks, but it works and I get a web viewer for Celery workers. Here:
[supervisord]
# http://supervisord.org/configuration.html
nodaemon=true
logfile=/dev/stdout
logfile_maxbytes=0
[program:celery]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
command=newrelic-admin run-program celery worker --loglevel=info -E
[program:httpd]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
#https://realpython.com/python-http-server/
#command=python3 -m http.server -b "::" -d ./app/static 80
# --basic_auth comes as default from $FLOWER_BASIC_AUTH - https://flower.readthedocs.io/en/latest/config.html#environment-variables
command=celery flower --port=80
If we could have some port that these PaaS platforms could ping to check for liveness, it would make things so much easier.
How can I run Celery in worker mode and still have a port that can be pinged for something? Even a "nothing here" reply would do.
Any tips on how to do this? Subclass? Or is it in the roadmap? Thanks!