-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat: add support for apache\kafka
docker image
#178
Conversation
apache\kafka
docker imageapache\kafka
docker image
1dda4af
to
7d32e47
Compare
7d32e47
to
3d435c3
Compare
I've used this commit to fix mongo example missing feature which was failing tests |
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.
Thank you for the contribution 🙏
3d435c3
to
5489051
Compare
f736fbb
to
5489051
Compare
ce75611
to
1d2d0af
Compare
thanks @CommanderStorm, I hope your comments have been addressed |
Up till now kafka test container used `confluentinc/cp-kafka`, recently kafka started producing two official images `apache\kafka` and `apache\kafka-native` which may use `kraft` protocol, thus no zookeeper instance is needed This commit exposes test container which utilizes those new containers, with `kraft` protocol enabled. Default image is `apache\kafka-native` which provide fast starting speed, low memory utilization and smaller docker image. More details: - [KIP-974: Docker Image for GraalVM based Native Kafka Broker](https://cwiki.apache.org/confluence/display/KAFKA/KIP-974%3A+Docker+Image+for+GraalVM+based+Native+Kafka+Broker) - [KIP-975: Docker Image for Apache Kafka](https://cwiki.apache.org/confluence/display/KAFKA/KIP-975%3A+Docker+Image+for+Apache+Kafka) - [Java testcontainer implementation](https://github.com/testcontainers/testcontainers-java/blob/1.20.1/modules/kafka/src/main/java/org/testcontainers/kafka/KafkaContainer.java#)
1d2d0af
to
6bc856a
Compare
I noticed that there currently is not LDAP testcontainer. Similar to the [go testontainer modules](https://github.com/testcontainers/testcontainers-go/blob/c44b1b2ed935455fa222f122a7474efe309f641c/modules/openldap/openldap.go#L128C19-L128C41), I chose the [`bitnami/openldap`](https://github.com/bitnami/containers/blob/main/bitnami/openldap/README.md) containers. Similar to #178, this PR includes the mongodb-example-fix.
src/kafka/apache.rs
Outdated
|
||
const KAFKA_NATIVE_IMAGE_NAME: &str = "apache/kafka-native"; | ||
const KAFKA_IMAGE_NAME: &str = "apache/kafka"; | ||
const TAG: &str = "latest"; |
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.
Oops, missed that part.
We do not use the latest version because it does not guarantee image stability. Users can always override it to the latest version if they want, but this easily leads to instability and the implementation can quickly become outdated.
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.
UPD: I've updated this to use 3.8.0 to speed up the PR readiness. Going to merge soon
## 🤖 New release * `testcontainers-modules`: 0.9.0 -> 0.10.0 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.10.0] - 2024-08-31 ### Bug Fixes - Doc-test failures ([#186](#186)) ### Documentation - Added docs for Apache ZooKeeper ([#184](#184)) - Documented all ports which containers at least expose ([#183](#183)) - Enable `rustfmt` for doc comments ([#187](#187)) - Fixed rustfmt violation in the `openldap` module ([#189](#189)) - Fixed a bit of missing docs in the openldap module ([#191](#191)) - Complete the documentation for the meilisearch module ([#192](#192)) - Complete the `*_PORT` documentation ([#195](#195)) - Add `pub mod` docs ([#193](#193)) - Documents the neo4j plugins ([#194](#194)) ### Features - Added an `OpenLDAP` testcontainer module ([#180](#180)) - Add support for `apache\kafka` docker image ([#178](#178)) - [**breaking**] Update `testcontainers` to 0.22.0 ([#203](#203)) ### Miscellaneous Tasks - Changed from `actions-rs` to a more maintained CI alternative ([#188](#188)) ### Refactor - [**breaking**] Changed `KAFKA_PORT` to a `ContainerPort` ([#185](#185)) <!-- generated by git-cliff --> </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Up till now kafka test container used
confluentinc/cp-kafka
, recently kafka started producing two officialimages
apache\kafka
andapache\kafka-native
which may usekraft
protocol, thus no zookeeperinstance is needed.
apache\kafka-native
image has kafka server compiled using GraalVM which decreases container startup and memory consumption.Default image is
apache\kafka-native
which provide fast starting speed.More details: