restructuring
Some checks failed
/ build (push) Failing after 1m42s
/ clippy (push) Failing after 1m38s

This commit is contained in:
xqtc 2024-09-21 15:24:47 +02:00
parent c677a142dd
commit 2660e90c51
4 changed files with 5 additions and 16 deletions

View file

@ -10,10 +10,10 @@ run *ARGS:
cargo run {{ARGS}} cargo run {{ARGS}}
head-node *ARGS: head-node *ARGS:
cargo run --bin head-node --features="head" cargo run --bin head-node
worker-node *ARGS: worker-node *ARGS:
cargo run --bin worker-node --features="worker" cargo run --bin worker-node
# Run 'cargo watch' to run the project (auto-recompiles) # Run 'cargo watch' to run the project (auto-recompiles)
watch *ARGS: watch *ARGS:

View file

@ -31,16 +31,11 @@ colorful = "0.3.2"
[build-dependencies] [build-dependencies]
tonic-build = "0.12.2" tonic-build = "0.12.2"
[features]
head = []
worker = []
[[bin]] [[bin]]
name = "head-node" name = "head-node"
path = "src/head.rs" path = "src/head.rs"
required-features = [ "head" ]
[[bin]] [[bin]]
name = "worker-node" name = "worker-node"
path = "src/worker.rs" path = "src/worker.rs"
required-features = [ "worker" ]

View file

@ -16,7 +16,6 @@ mod sched {
// tonic::include_file_descriptor_set!("protocol_descriptor").into(); // tonic::include_file_descriptor_set!("protocol_descriptor").into();
} }
#[derive(Parser)] #[derive(Parser)]
#[command(author, version, about)] #[command(author, version, about)]
#[command(propagate_version = true)] #[command(propagate_version = true)]
@ -63,8 +62,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let addr = "[::1]:50051".parse()?; let addr = "[::1]:50051".parse()?;
info!("Starting gRPC server on {}", addr); info!("Starting gRPC server on {}", addr);
let data = crate::util::grpc::DataService::default(); let data = crate::util::grpc::DataService::default();
debug!("{:#?}", data);
let auth = crate::util::grpc::AuthService::default(); let auth = crate::util::grpc::AuthService::default();
debug!("{:#?}", auth);
let alive = crate::util::grpc::AliveCheckService::default(); let alive = crate::util::grpc::AliveCheckService::default();
debug!("{:#?}", alive);
let grpc_server = Server::builder() let grpc_server = Server::builder()
.add_service(sched::data_server::DataServer::new(data)) .add_service(sched::data_server::DataServer::new(data))
.add_service(sched::auth_server::AuthServer::new(auth)) .add_service(sched::auth_server::AuthServer::new(auth))

View file

@ -82,14 +82,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
})) }))
.await? .await?
); );
// debug!(
// "{:#?}",
// auth.logout(tonic::Request::new(LogoutRequest {
// node_id: "compute-1".to_string(),
// }))
// .await?
// );
// let _ = send_shutdown.send(());
alive_hand.await?; alive_hand.await?;
Ok(()) Ok(())
} }