apluslms / radar

Web service for analyzing program code similarity
4 stars 10 forks source link

Update Radar deployment docs: Celery command-line arguments change in Celery 5 #17

Closed markkuriekkinen closed 3 years ago

markkuriekkinen commented 3 years ago

We must upgrade Celery to the latest v5 series. Old Celery v4.1 does not work in Python 3.7: #14.

Celery v5 changes the command-line arguments. We should update the deployments docs accordingly, e.g., https://github.com/apluslms/radar/blob/96ccbcb165bc77dddd6a0d71a8494ecb0c42c304/doc/celery-systemd/radar-celery.service#L14-L20

With Celery v5 and old configuration files, I got this error from the "Radar Celery main service" (systemd):

systemd[1]: Started Radar Celery main service.
radar_celery_main[3070251]: You are using `--app` as an option of the worker sub-command:
radar_celery_main[3070251]: celery worker --app celeryapp <...>
radar_celery_main[3070251]: The support for this usage was removed in Celery 5.0. Instead you should use `--app` as a global option:
radar_celery_main[3070251]: celery --app celeryapp worker <...>
radar_celery_main[3070251]: Usage: celery worker [OPTIONS]
radar_celery_main[3070251]: Try 'celery worker --help' for help.
radar_celery_main[3070251]: Error: no such option: --app
systemd[1]: radar-celery.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
systemd[1]: radar-celery.service: Failed with result 'exit-code'.
markkuriekkinen commented 3 years ago

For your info, @Gehock

markkuriekkinen commented 3 years ago

Simple and small change seems to be enough:

ExecStart=/srv/radar/venv/bin/celery \
    --app radar \ 
    worker \ 
     --pidfile=/run/radar/celery_main.pid \ 
     --loglevel=info \ 
     --concurrency 1 \ 
     --queues celery \ 
     --hostname worker_main@radar 

The --app radar option is moved before worker.