Skip to content

Commit

Permalink
chore(playground): remove connector service from playground (#13114)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzl25 authored Oct 27, 2023
1 parent 72d9765 commit c694542
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 47 deletions.
6 changes: 1 addition & 5 deletions src/cmd_all/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub enum RisingWaveService {
Frontend(Vec<OsString>),
#[allow(dead_code)]
Compactor(Vec<OsString>),
ConnectorNode(Vec<OsString>),
}

impl RisingWaveService {
Expand All @@ -34,10 +33,7 @@ impl RisingWaveService {
RisingWaveService::Compute(args0)
| RisingWaveService::Meta(args0)
| RisingWaveService::Frontend(args0)
| RisingWaveService::Compactor(args0)
| RisingWaveService::ConnectorNode(args0) => {
args0.extend(args.iter().map(|s| s.into()))
}
| RisingWaveService::Compactor(args0) => args0.extend(args.iter().map(|s| s.into())),
}
}
}
42 changes: 0 additions & 42 deletions src/cmd_all/src/playground.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ use std::sync::LazyLock;
use anyhow::Result;
use clap::Parser;
use tempfile::TempPath;
use tokio::io::{AsyncBufReadExt, BufReader};
use tokio::process::Command;
use tokio::signal;

use crate::common::{osstrs as common_osstrs, RisingWaveService};
Expand Down Expand Up @@ -62,7 +60,6 @@ fn get_services(profile: &str) -> (Vec<RisingWaveService>, bool) {
])),
RisingWaveService::Compute(osstrs([])),
RisingWaveService::Frontend(osstrs([])),
RisingWaveService::ConnectorNode(osstrs([])),
],
"playground-3cn" => vec![
RisingWaveService::Meta(osstrs([
Expand Down Expand Up @@ -120,7 +117,6 @@ fn get_services(profile: &str) -> (Vec<RisingWaveService>, bool) {
"--advertise-addr",
"127.0.0.1:4566",
])),
RisingWaveService::ConnectorNode(osstrs([])),
],
_ => {
tracing::warn!("Unknown playground profile. All components will be started using the default command line options.");
Expand Down Expand Up @@ -196,44 +192,6 @@ pub async fn playground(opts: PlaygroundOpts) -> Result<()> {
let _compactor_handle =
tokio::spawn(async move { risingwave_compactor::start(opts).await });
}
// connector node only supports in docker-playground profile
RisingWaveService::ConnectorNode(_) => {
let prefix_bin = match profile.as_str() {
"docker-playground" | "online-docker-playground" => {
"/risingwave/bin".to_string()
}
"playground" => std::env::var("PREFIX_BIN").unwrap_or_default(),
_ => "".to_string(),
};
let cmd_path = Path::new(&prefix_bin)
.join("connector-node")
.join("start-service.sh");
if cmd_path.exists() {
tracing::info!("start connector-node with prefix_bin {}", prefix_bin);
let mut child = Command::new(cmd_path)
.arg("-p")
.arg("50051")
.stderr(std::process::Stdio::piped())
.spawn()?;
let stderr = child.stderr.take().unwrap();

let _child_handle = tokio::spawn(async move {
signal::ctrl_c().await.unwrap();
let _ = child.start_kill();
});
let _stderr_handle = tokio::spawn(async move {
let mut reader = BufReader::new(stderr).lines();
while let Ok(Some(line)) = reader.next_line().await {
tracing::info!(target: "risingwave_connector_node", "{}", line);
}
});
} else {
tracing::warn!(
"Will not start connector node since `{}` does not exist.",
cmd_path.display()
);
}
}
}
}

Expand Down

0 comments on commit c694542

Please sign in to comment.