From 67040a5ee4d153ef4a7ae1c342ceac24ddde472f Mon Sep 17 00:00:00 2001 From: remzi <13716567376yh@gmail.com> Date: Tue, 5 Mar 2024 18:14:06 +0800 Subject: [PATCH] rename to rucat server Signed-off-by: remzi <13716567376yh@gmail.com> --- Cargo.toml | 2 +- rucat_cluster_manager/Cargo.toml | 9 ------ rucat_cluster_manager/src/main.rs | 50 ------------------------------- 3 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 rucat_cluster_manager/Cargo.toml delete mode 100644 rucat_cluster_manager/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index 602058f..6576a29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,6 @@ resolver = "2" members = [ "rucat_client", "rucat_cluster", - "rucat_cluster_manager", + "rucat_server", "rucat_common", "rucat_job"] diff --git a/rucat_cluster_manager/Cargo.toml b/rucat_cluster_manager/Cargo.toml deleted file mode 100644 index 8eda35d..0000000 --- a/rucat_cluster_manager/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "rucat_cluster_manager" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -"rucat_cluster" = {path = "../rucat_cluster"} diff --git a/rucat_cluster_manager/src/main.rs b/rucat_cluster_manager/src/main.rs deleted file mode 100644 index c0257d0..0000000 --- a/rucat_cluster_manager/src/main.rs +++ /dev/null @@ -1,50 +0,0 @@ -use std::process::Command; - -// Clients-server -// This is like the Spark master - -fn main() { - println!("Hello, world!"); - create_cluster((), &[()]); -} -// the cluster driver -type Driver = (); - -// anything that can run rust code -type Machine = (); - -/* - * Create a driver and zero or more workers. (zero worker means local mode) - * Return the Driver so that users can run program on it. - * - * I deside to use socket to achieve the communication between driver and executors. - * So driver should know addresses of all executors and all executors should know driver's address. - */ -fn create_cluster(driver: Machine, workers: &[Machine]) -> Driver { - println!("Create one driver with {} workers", workers.len()); - let driver = Command::new("./rucat_cluster/target/debug/rucat_cluster") - .arg("driver") - .output() - .unwrap(); - let worker = Command::new("./rucat_cluster/target/debug/rucat_cluster") - .arg("worker") - .output() - .unwrap(); - - match (driver.status.success(), worker.status.success()) { - (false, _) => println!("driver error: {}", String::from_utf8_lossy(&driver.stderr)), - (_, false) => println!("worker error: {}", String::from_utf8_lossy(&worker.stderr)), - (true, true) => println!( - "driver opt: {}\nworker opt: {}", - String::from_utf8_lossy(&driver.stdout), - String::from_utf8_lossy(&worker.stdout) - ), - } -} - -/* - * Delete the cluster (driver and workers). (driver should know its workers) - */ -// fn delete_cluster(driver: Driver) -> bool { -// todo!() -// }