-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add kafka to docker compose #5
base: main
Are you sure you want to change the base?
Conversation
Nothing is configurable currently and it is not connected to the platform, but this will start all of the required services.
Still too many hard coded values, but it works when Kafka and the event registry actually start.
"edx-event-bus-redis==0.3.2", | ||
"edx-event-bus-kafka==v5.6.0", | ||
"openedx-events==v9.5.1", | ||
"confluent_kafka[avro,schema-registry]", |
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.
can you pin this one?
tutorevent_bus_redis/plugin.py
Outdated
# Version of https://github.com/openedx/event-bus-redis to install | ||
# This is what follows 'pip install' so you can use official versions | ||
# or install from forks / branches / PRs here | ||
("EVENT_BUS_REDIS_RELEASE", "edx-event-bus-redis=='0.3.2'"), |
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.
Can you remove this variable?
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.
Tested locally
@navinkarkera can you take a look and let me know what you think about this direction? |
@bmtcril Sure. I'll go through it tomorrow. |
@bmtcril I remember our discussion, we came to the conclusion that tutor plugin for redis event bus is not really helpful. Our reasoning was
Has something changed in tutor which allows us to install extra deps in multiple IDA's now? I can see that this can be helpful in regards to kafka as it is not included in openedx by default. |
@navinkarkera the idea is to let the plugin handle the complicated configuration bits, especially with Kafka, but also with running consumers. I think that we can work to add plugin introspection to find other plugins and extend them as necessary / use their configuration if they exist / update their configuration to use the event bus here. The hope is that with one plugin to manage the versions of things and some of the complexity of running consumers (especially multiple consumers) in k8s in one spot. I'm definitely open to hearing this is a bad idea, that's why I wanted to shop it around for feedback early. I'm not entirely convinced this will work the way I'd hope. Especially with cases like custom IDAs that this plugin wouldn't know about. |
@bmtcril Makes sense, especially for kafka and running consumers. I don't think it is a bad idea 😄 .
Yes, that will be hard. Maybe we can contribute (if possible) a feature to tutor where it will allow us to patch dependencies in all IDA's. |
This PR is preliminary work on combining the Kafka and redis implementations in one Tutor plugin, and this branch will be shared for feedback on that idea. If it passes community feedback we'll rename this repository and maintain this as a first class plugin.
Current State
Testing
Install this repo in your Tutor environment and enable it:
git clone https://github.com/openedx/tutor-contrib-event-bus-redis
cd tutor-contrib-event-bus-redis
git checkout bmtcril/add_kafka
pip install -e .
tutor plugins list
to make sure "event-bus-redis" is installedtutor plugins enable event-bus-redis
Rebuild the openedx image to get all of the dependencies:
tutor images build openedx --no-cache
(or if you are in devtutor images build openedx-dev --no-cache
)Start the services, Kafka is currently enabled by default:
tutor local start -d
Test:
[ Responses of the Open edX Event <org.openedx.learning.auth.session.login.completed.v1>](consumer.py:393 - Message from Kafka processed successfully)
Test redis:
tutor local stop
if you're still running the kafka versionEVENT_BUS_BACKEND = "redis"
RUN_KAFKA_SERVER = False
tutor config save
tutor local start -d
[ Responses of the Open edX Event <org.openedx.learning.auth.session.login.completed.v1>](consumer.py:393 - Message from redis processed successfully)
Future work
If we want to pursue this direction , there are a lot of things we could do: