-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Allow developer to use system property to override default kafka image for embedded tests #18739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow developer to use system property to override default kafka image for embedded tests #18739
Conversation
|
Have a use for this as well – thanks. |
jtuglu1
left a comment
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.
LGTM
kfaraz
left a comment
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.
Thanks for adding this, @capistrant !
Left a couple of non blocking suggestions.
| { | ||
| private static final String KAFKA_IMAGE = "apache/kafka:4.0.0"; | ||
| // Offering an opportunity to override can help some local devs whose system struggles to run apache/kafka. Overriding with apache/kafka-native can help. | ||
| private static final String KAFKA_IMAGE = System.getProperty("druid.kafka.test.image", "apache/kafka:4.0.0"); |
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.
Nit: Should we use the name druid.testing.kafka.image to align with the Druid image property name used in DruidContainerResource?
| public class KafkaResource extends TestcontainerResource<KafkaContainer> | ||
| { | ||
| private static final String KAFKA_IMAGE = "apache/kafka:4.0.0"; | ||
| // Offering an opportunity to override can help some local devs whose system struggles to run apache/kafka. Overriding with apache/kafka-native can help. |
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.
Let's convert this to a javadoc.
It would be nice to link it in the class level javadoc too.
Also maybe rephrase to something like:
| // Offering an opportunity to override can help some local devs whose system struggles to run apache/kafka. Overriding with apache/kafka-native can help. | |
| /** | |
| * Kafka Docker image used in embedded tests. The image name is | |
| * read from the system property {@code druid.testing.kafka.image} and | |
| * defaults to {@code apache/kafka}. Environments that cannot run that | |
| * image should set the system property to {@code apache/kafka-native}. | |
| */ |
Description
Some docker runtime setups can struggle to run the Apache Kafka image. Switching to something like Apache kafka-native can work (it works for my apple silicon + colima docker runtime). This change allows using test configurations locally to switch the image without changing source files. It will leave the default to the same image that KafkaResource already uses
apache/kafka:4.0.0Key changed/added classes in this PR
KafkaResourceThis PR has: