Skip to content

Commit

Permalink
allow specifying image
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed May 24, 2024
1 parent 3d113c1 commit 71ea57f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion risedev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/risedevtool/src/service_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
8 changes: 3 additions & 5 deletions src/risedevtool/src/task/kafka_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)> {
Expand Down Expand Up @@ -60,15 +60,13 @@ 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<String> {
self.persist_data.then(|| "/var/lib/kafka/data".to_owned())
}
}

/// Docker-backed Kafka service.
pub type KafkaService = DockerService<KafkaConfig>;

0 comments on commit 71ea57f

Please sign in to comment.