Skip to content

Commit

Permalink
fix(risedev): correct docker schema registry configurations (#17653)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhao-su authored Jul 11, 2024
1 parent d5fc35c commit 87a2909
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/risedevtool/src/bin/risedev-dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,15 @@ fn task_main(
ExecuteContext::new(&mut logger, manager.new_progress(), status_dir.clone());
let mut service = SchemaRegistryService::new(c.clone());
service.execute(&mut ctx)?;
let mut task =
risedev::TcpReadyCheckTask::new(c.address.clone(), c.port, c.user_managed)?;
task.execute(&mut ctx)?;
if c.user_managed {
let mut task =
risedev::TcpReadyCheckTask::new(c.address.clone(), c.port, c.user_managed)?;
task.execute(&mut ctx)?;
} else {
let mut task =
risedev::LogReadyCheckTask::new("Server started, listening for requests")?;
task.execute(&mut ctx)?;
}
ctx.pb
.set_message(format!("schema registry http://{}:{}", c.address, c.port));
}
Expand Down
5 changes: 5 additions & 0 deletions src/risedevtool/src/task/kafka_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ impl DockerServiceConfig for KafkaConfig {
"KAFKA_INTER_BROKER_LISTENER_NAME".to_owned(),
"HOST".to_owned(),
),
// https://docs.confluent.io/platform/current/installation/docker/config-reference.html#example-configurations
(
"KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR".to_owned(),
"1".to_owned(),
),
("CLUSTER_ID".to_owned(), "RiseDevRiseDevRiseDev1".to_owned()),
]
}
Expand Down
10 changes: 8 additions & 2 deletions src/risedevtool/src/task/schema_registry_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
use super::docker_service::{DockerService, DockerServiceConfig};
use crate::SchemaRegistryConfig;

/// Schema Registry listener port in the container.
const SCHEMA_REGISTRY_LISTENER_PORT: &str = "8081";

impl DockerServiceConfig for SchemaRegistryConfig {
fn id(&self) -> String {
self.id.clone()
Expand Down Expand Up @@ -43,7 +46,7 @@ impl DockerServiceConfig for SchemaRegistryConfig {
("SCHEMA_REGISTRY_HOST_NAME".to_owned(), self.address.clone()),
(
"SCHEMA_REGISTRY_LISTENERS".to_owned(),
format!("http://{}:{}", self.address, self.port),
format!("http://{}:{}", "0.0.0.0", SCHEMA_REGISTRY_LISTENER_PORT),
),
(
"SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS".to_owned(),
Expand All @@ -53,7 +56,10 @@ impl DockerServiceConfig for SchemaRegistryConfig {
}

fn ports(&self) -> Vec<(String, String)> {
vec![(self.port.to_string(), "8081".to_owned())]
vec![(
self.port.to_string(),
SCHEMA_REGISTRY_LISTENER_PORT.to_owned(),
)]
}

fn data_path(&self) -> Option<String> {
Expand Down

0 comments on commit 87a2909

Please sign in to comment.