mirror of
https://github.com/run-llama/llama_deploy.git
synced 2026-08-24 11:22:50 -04:00
[PR #353] [MERGED] feat: make the kafka topic configurable #413
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/run-llama/llama_deploy/pull/353
Author: @masci
Created: 11/7/2024
Status: ✅ Merged
Merged: 11/9/2024
Merged by: @logan-markewich
Base:
main← Head:massi/349📝 Commits (8)
b65ee1bfeat: make the kafka topic configurable3d3016atemporary ignore for return typeb713795mark test as e2e0426b6bremove cwda7e9b11do not use docker-compose aliasf00c538clean shutdown for message queuef9d58beaddress review feedbackac5a92aadjust unit test📊 Changes
11 files changed (+148 additions, -114 deletions)
View changed files
➕
e2e_tests/message_queues/__init__.py(+0 -0)➕
e2e_tests/message_queues/message_queue_kafka/__init__.py(+0 -0)➕
e2e_tests/message_queues/message_queue_kafka/docker-compose.yml(+25 -0)➕
e2e_tests/message_queues/message_queue_kafka/test_message_queue.py(+54 -0)📝
llama_deploy/apiserver/deployment.py(+1 -1)📝
llama_deploy/deploy/deploy.py(+8 -10)📝
llama_deploy/message_queues/__init__.py(+3 -2)📝
llama_deploy/message_queues/apache_kafka.py(+35 -85)📝
llama_deploy/message_queues/base.py(+11 -9)📝
tests/apiserver/test_deployment.py(+1 -1)📝
tests/message_queues/test_apache_kafka.py(+10 -6)📄 Description
Part of #349 (not a fix until we propagate the topic settings up to the control plane and api server)
Problem
Currently we use the name of the "message type" string to create the Kafka topic that'll be used in the message queue. Problem is that different instances of control planes using the same Kafka instances will step into each other, with catastrific effects. Note that this problem is common to other message queue brokers like S3, so eventually this fix will be rolled out for all the supported queues.
Solution
Make the Kafka topic name configurable, so that different control planes will use different topics. This PR only makes the topic configurable, another PR will make use of this new feature and resolve the original issue.
Notes
While working at the fix, I noticed a few things we can improve and already implemented in this PR in a backward compatible manner:
ABCwill make the job.if __name__ == "__main__"that was used for testing into a proper e2e test. Tests for message queues will most certainly need docker to be avaiable, I'll add the required CI bits (this part is WIP, you'll see it's done when tests are all green).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.