-
Notifications
You must be signed in to change notification settings - Fork 1
Use redis as Airflow broker #49
Use redis as Airflow broker #49
Conversation
Intrigued to know why we are using |
The name of the docker-compose service needs changing as a Message Bus enables separate applications to integrate, whereas this broker is internal to the |
(the answer then being, we should not be using redis as a message bus) |
docker-compose.yml
Outdated
@@ -26,6 +26,11 @@ services: | |||
AWS_ACCESS_KEY_ID: longkey | |||
AWS_SECRET_ACCESS_KEY: verysecretkey | |||
|
|||
message-bus: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this should be private to Celery, as we don't write or read values from the DAGs code for example. Possibilities for a service name?
celery-broker
(not very precise because brokers usually have their own protocol like AMQP, this is just part of the broker concept)celery-broker- backend
(matchesdb
as that doesn't mentionpostgres
, and Celery's terminology)celery-broker-redis
(to communicate what this is)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name updated to airflow-broker
Not targeting High Availability at the moment as that would require redundancy for all containers and multiple nodes, plus unclear if it's a requirement of Libero demo deployments. |
Trying to verify how values are cleared from Redis, not sure if we need to setup a TTL for them. |
@petereast is the in-house redis expert... my understanding is that its up to the app adding the data to set the TTL |
My current understanding is that this PR should stop the |
@giorgiosironi @diversemix My original thought was to use RabbitMQ as it is likely (but not defined yet) we may need to implement a message bus for sending messages/events/commands between Libero Publisher services. Therefore, why not use the same message bus to handle messages for celery. My discussion with @giorgiosironi before actioning this task lead me to believe that this is an area of uncertainty and, as a result, the decision to use redis at this time was based on the ease of setup and maintenance. Perhaps the task needs further discussion and a separate issue/ticket? |
@GiancarloFusiello @giorgiosironi ... my preference is to raise a ticket too... and keep this ticket moving forward with what was intended 😉 |
Just verified that this is working well. On the On the Redis side, there is a small space of Redis keys (4 to 6) such as |
Adding more information. If I'm reading the following documents correctly, it seems that Kombu uses redis pub/sub by default. If this is the case then data sent (published) to redis will not be retained when pushed to subscribers: |
Not sure what would be the title of a follow-up, can you suggest one? 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empirically works as intended, sorting out the naming before merge
"Decide what Message Bus to use in Libero" |
Is that libero/community#10 (outdated in requirements but not in technology understanding)? |
@@ -379,7 +379,7 @@ worker_log_server_port = 8793 | |||
# information. | |||
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#broker-settings | |||
# broker_url = sqla+mysql://airflow:airflow@localhost:3306/airflow | |||
broker_url = sqla+postgresql+psycopg2://postgres:example@db/airflow-db | |||
broker_url = redis://airflow-broker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to change the result_backend
setting as well? Not sure what the impact would be, and The use of a database is highly recommended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Using a relational database is best for this.
Some log messages I've seen:
|
Just seen these also... will address separately:
|
I got Peter to comment on this with the state of where we are with PubSweet/reviewer 😄 |
Feel free to open tickets and tag them with |
Will create a new ticket regarding the airflow worker logs.
As it's related, i'll use the same pattern of linking the main issue to the PR. |
In reference to libero/publisher#247
Adds
redis
image todocker-compose.yml
and update config files to use redis broker.