From c4a3c03c8756a98b3b74a7eb81cdb5f4fa05a9ce Mon Sep 17 00:00:00 2001 From: xqtc Date: Wed, 11 Sep 2024 19:10:12 +0200 Subject: [PATCH] uwusched -> yoitei --- Cargo.lock | 50 +++++++++---------- Cargo.toml | 2 +- {uwusched-nodes => yotei-nodes}/.gitignore | 0 {uwusched-nodes => yotei-nodes}/Cargo.lock | 0 {uwusched-nodes => yotei-nodes}/Cargo.toml | 2 +- {uwusched-nodes => yotei-nodes}/build.rs | 0 .../src/compute.rs | 26 +++++----- {uwusched-nodes => yotei-nodes}/src/config.rs | 0 .../src/grpc/mod.rs | 0 {uwusched-nodes => yotei-nodes}/src/head.rs | 11 ++++ 10 files changed, 50 insertions(+), 41 deletions(-) rename {uwusched-nodes => yotei-nodes}/.gitignore (100%) rename {uwusched-nodes => yotei-nodes}/Cargo.lock (100%) rename {uwusched-nodes => yotei-nodes}/Cargo.toml (97%) rename {uwusched-nodes => yotei-nodes}/build.rs (100%) rename {uwusched-nodes => yotei-nodes}/src/compute.rs (70%) rename {uwusched-nodes => yotei-nodes}/src/config.rs (100%) rename {uwusched-nodes => yotei-nodes}/src/grpc/mod.rs (100%) rename {uwusched-nodes => yotei-nodes}/src/head.rs (81%) diff --git a/Cargo.lock b/Cargo.lock index c80aa58..56e0c36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1459,31 +1459,6 @@ dependencies = [ "serde", ] -[[package]] -name = "uwusched" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bson", - "clap", - "colorful", - "lazy_static", - "log", - "lz4_flex", - "pretty_env_logger", - "prost", - "prost-types", - "serde", - "serde_json", - "tokio", - "toml", - "tonic", - "tonic-build", - "tonic-reflection", - "uuid", -] - [[package]] name = "version_check" version = "0.9.5" @@ -1669,6 +1644,31 @@ dependencies = [ "tap", ] +[[package]] +name = "yotei" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bson", + "clap", + "colorful", + "lazy_static", + "log", + "lz4_flex", + "pretty_env_logger", + "prost", + "prost-types", + "serde", + "serde_json", + "tokio", + "toml", + "tonic", + "tonic-build", + "tonic-reflection", + "uuid", +] + [[package]] name = "zerocopy" version = "0.7.35" diff --git a/Cargo.toml b/Cargo.toml index 688fccc..0cbf743 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,4 @@ [workspace] -members = ["./uwusched-nodes"] +members = ["./yotei-nodes"] resolver = "2" diff --git a/uwusched-nodes/.gitignore b/yotei-nodes/.gitignore similarity index 100% rename from uwusched-nodes/.gitignore rename to yotei-nodes/.gitignore diff --git a/uwusched-nodes/Cargo.lock b/yotei-nodes/Cargo.lock similarity index 100% rename from uwusched-nodes/Cargo.lock rename to yotei-nodes/Cargo.lock diff --git a/uwusched-nodes/Cargo.toml b/yotei-nodes/Cargo.toml similarity index 97% rename from uwusched-nodes/Cargo.toml rename to yotei-nodes/Cargo.toml index 598564b..ca8326f 100644 --- a/uwusched-nodes/Cargo.toml +++ b/yotei-nodes/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["xqtc"] description = "Distributed computing with abstract data" -name = "uwusched" +name = "yotei" version = "0.1.0" edition = "2021" diff --git a/uwusched-nodes/build.rs b/yotei-nodes/build.rs similarity index 100% rename from uwusched-nodes/build.rs rename to yotei-nodes/build.rs diff --git a/uwusched-nodes/src/compute.rs b/yotei-nodes/src/compute.rs similarity index 70% rename from uwusched-nodes/src/compute.rs rename to yotei-nodes/src/compute.rs index 2d93016..9a47a74 100644 --- a/uwusched-nodes/src/compute.rs +++ b/yotei-nodes/src/compute.rs @@ -15,27 +15,23 @@ pub mod sched { async fn main() -> Result<(), Box> { std::env::set_var("RUST_LOG", CONFIG.log.level.clone()); pretty_env_logger::init(); + use colorful::Color; use colorful::Colorful; use colorful::HSL; + println!(" {}", "+--------------+".color(Color::LightBlue)); + println!(" {}", "| 予定 |".color(Color::LightPink1)); println!( - "{}", - " -,--. ,--. ,--. ,--. ,--. ,--. -| | | | ,--. ,--. | | | | ,---. ,---. | ,---. ,---. ,-| | -| | | | | |.'.| | | | | | ( .-' | .--' | .-. | | .-. : ' .-. | -' '-' ' | .'. | ' '-' ' .-' `) \\ `--. | | | | \\ --. \\ `-' | - `-----' '--' '--' `-----' `----' `---' `--' `--' `----' `---' - Compute Node - " - .gradient_with_color(HSL::new(0.0, 1.0, 0.5), HSL::new(0.833, 1.0, 0.5)) + " {}", + "+--------------+".color(colorful::RGB::new(252, 252, 252)) ); + println!(" {}", "YOITEI SCHEDULER".color(Color::LightPink1)); + println!(" {}", " COMPUTE NODE\n".color(Color::LightBlue)); let server_addr = "http://[::1]:50051"; - let addr: SocketAddr = "[::1]:50052".parse()?; + let addr: SocketAddr = "[::1]:50053".parse()?; let data = sched::data_client::DataClient::connect(server_addr).await?; let mut auth = sched::auth_client::AuthClient::connect(server_addr).await?; - debug!("{:#?}", &data); - debug!("{:#?}", &auth); - // alive_check_serve(addr).await?; + // Start server here + let alive_check_server = alive_check_serve(addr); debug!( "{:#?}", auth.login(tonic::Request::new(LoginRequest { @@ -43,6 +39,8 @@ async fn main() -> Result<(), Box> { })) .await? ); + // Await server at end + alive_check_server.await?; Ok(()) } diff --git a/uwusched-nodes/src/config.rs b/yotei-nodes/src/config.rs similarity index 100% rename from uwusched-nodes/src/config.rs rename to yotei-nodes/src/config.rs diff --git a/uwusched-nodes/src/grpc/mod.rs b/yotei-nodes/src/grpc/mod.rs similarity index 100% rename from uwusched-nodes/src/grpc/mod.rs rename to yotei-nodes/src/grpc/mod.rs diff --git a/uwusched-nodes/src/head.rs b/yotei-nodes/src/head.rs similarity index 81% rename from uwusched-nodes/src/head.rs rename to yotei-nodes/src/head.rs index bd63a10..00fae28 100644 --- a/uwusched-nodes/src/head.rs +++ b/yotei-nodes/src/head.rs @@ -70,6 +70,17 @@ fn get_type_of(_: &T) -> &'static str { async fn main() -> Result<(), Box> { std::env::set_var("RUST_LOG", CONFIG.log.level.clone()); pretty_env_logger::init(); + use colorful::Color; + use colorful::Colorful; + use colorful::HSL; + println!(" {}", "+--------------+".color(Color::LightBlue)); + println!(" {}", "| 予定 |".color(Color::LightPink1)); + println!( + " {}", + "+--------------+".color(colorful::RGB::new(252, 252, 252)) + ); + println!(" {}", "YOITEI SCHEDULER".color(Color::LightPink1)); + println!(" {}", " HEAD NODE \n".color(Color::LightBlue)); let cli = Cli::parse(); match &cli.command { Some(Commands::Start { role }) => {