sintonia/worker
Jonas L 2edbf15bf4
feat(worker): rename service and package to libretime-worker (#2065)
BREAKING CHANGE: The `libretime-celery` python package and service was renamed to `libretime-worker`. Make sure to remove the old python package and service.
2022-08-20 08:13:30 +02:00
..
install/systemd feat(worker): rename service and package to libretime-worker (#2065) 2022-08-20 08:13:30 +02:00
libretime_worker feat(shared): pass config data via init (#2042) 2022-08-12 15:12:39 +02:00
Makefile chore: install local python deps in editable mode 2022-07-27 15:35:57 +02:00
README.md feat: change config filename to config.yml 2022-06-08 23:23:08 +02:00
pyproject.toml chore: pin setuptools to <64.0.0 for build backend 2022-08-11 22:16:00 +02:00
requirements.txt chore: update requests version range 2022-07-17 21:25:37 +02:00
setup.py feat(worker): rename service and package to libretime-worker (#2065) 2022-08-20 08:13:30 +02:00

README.md

airtime-celery

airtime-celery is a Celery daemon for handling backend tasks asynchronously. Communication and the Celery results backend are both handled with amqp (RabbitMQ).

Installation

sudo python3 setup.py install

Each instance of airtime-celery has its own worker, and multiple instances can be run in parallel. Celery is thread-safe, so this parallelization won't cause conflicts.

Developers

To debug, you can run celery directly from the command line:

RMQ_CONFIG_FILE=${LIBRETIME_CONF_DIR}/config.yml celery -A libretime_worker.tasks worker --loglevel=info

This worker can be run alongside the service without issue.

You may want to use the setuptools develop target to install:

sudo python setup.py develop

You will need to allow the "airtime" RabbitMQ user to access all exchanges and queues within the /airtime vhost:

sudo rabbitmqctl set_permissions -p /airtime airtime .\* .\* .\*

Logging

By default, logs are saved to:

/var/log/airtime/airtime-celery[-DEV_ENV].log

Troubleshooting

If you run into issues getting Celery to accept tasks from Airtime:

  1. Make sure Celery is running ($ sudo service airtime-celery status).
  2. Check the log file (/var/log/airtime/airtime-celery[-DEV_ENV].log) to make sure Celery started correctly.
  3. Check your $LIBRETIME_CONF_DIR/config.yml rabbitmq settings. Make sure the settings here align with $LIBRETIME_CONF_DIR/$ENVIRONMENT/rabbitmq.ini.
  4. Check RabbitMQ to make sure the celeryresults and task queues were created in the correct vhost.
  5. Make sure the RabbitMQ user (the default is airtime) has permissions on all vhosts being used.