diff --git a/risedev.yml b/risedev.yml index 6127eab7e8f12..65f84882c682c 100644 --- a/risedev.yml +++ b/risedev.yml @@ -1418,7 +1418,7 @@ template: # access key, secret key and region should be set in aws config (either by env var or .aws/config) - # Apache Kafka service + # Apache Kafka service backed by docker. kafka: # Id to be picked-up by services id: kafka-${port} @@ -1435,6 +1435,9 @@ template: # Listen address listen-address: ${address} + # The docker image. Can be overridden to use a different version. + image: "confluentinc/cp-kafka:7.6.1" + # If set to true, data will be persisted at data/{id}. persist-data: true diff --git a/src/risedevtool/src/service_config.rs b/src/risedevtool/src/service_config.rs index 4811ef96f5b87..88c1594fb1153 100644 --- a/src/risedevtool/src/service_config.rs +++ b/src/risedevtool/src/service_config.rs @@ -278,6 +278,7 @@ pub struct KafkaConfig { pub controller_port: u16, pub listen_address: String, + pub image: String, pub persist_data: bool, pub node_id: u32, diff --git a/src/risedevtool/src/task/kafka_service.rs b/src/risedevtool/src/task/kafka_service.rs index eac4ec20b76c4..52bdd227a72a4 100644 --- a/src/risedevtool/src/task/kafka_service.rs +++ b/src/risedevtool/src/task/kafka_service.rs @@ -25,7 +25,7 @@ impl DockerServiceConfig for KafkaConfig { } fn image(&self) -> String { - "confluentinc/cp-kafka:7.6.1".to_owned() + self.image.clone() } fn envs(&self) -> Vec<(String, String)> { @@ -60,10 +60,7 @@ impl DockerServiceConfig for KafkaConfig { } fn ports(&self) -> Vec<(String, String)> { - vec![( - format!("{}:{}", self.listen_address, self.port), - "9092".to_owned(), - )] + vec![(self.port.to_string(), "9092".to_owned())] } fn data_path(&self) -> Option { @@ -71,4 +68,5 @@ impl DockerServiceConfig for KafkaConfig { } } +/// Docker-backed Kafka service. pub type KafkaService = DockerService;