gayming
This commit is contained in:
parent
b4a78bd726
commit
acfa7b0dfb
|
@ -15,6 +15,8 @@ jobs:
|
|||
with:
|
||||
command: build
|
||||
args: --release --bins
|
||||
- name: Install Protoc
|
||||
uses: arduino/setup-protoc@v3
|
||||
- uses: https://github.com/actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
|
@ -32,6 +34,8 @@ jobs:
|
|||
- uses: https://github.com/actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
- name: Install Protoc
|
||||
uses: arduino/setup-protoc@v3
|
||||
- uses: https://github.com/actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[workspace]
|
||||
members = ["./uwusched-head-node"]
|
||||
members = ["./uwusched-nodes"]
|
||||
resolver = "2"
|
||||
|
||||
|
|
|
@ -25,8 +25,18 @@ service Auth {
|
|||
|
||||
message LoginRequest {
|
||||
string node_id = 1;
|
||||
message specs {
|
||||
uint32 threads = 1;
|
||||
float clock = 2;
|
||||
uint32 mem_mib = 3;
|
||||
uint32 net_speed_mib = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message LoginResponse {
|
||||
|
||||
string node_id = 1;
|
||||
enum status {
|
||||
ACCEPTED = 0;
|
||||
REJECTED = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
mod config;
|
||||
|
||||
use crate::config::CONFIG;
|
||||
use bson::{bson, Bson};
|
||||
use clap::{Parser, Subcommand};
|
||||
use log::debug;
|
||||
use lz4_flex::block::{compress_prepend_size, decompress_size_prepended};
|
||||
use tonic::*;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(author, version, about)]
|
||||
#[command(propagate_version = true)]
|
||||
struct Cli {
|
||||
#[command(subcommand)]
|
||||
command: Option<Commands>,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum Commands {
|
||||
/// Starts uwusched
|
||||
Start { role: Option<String> },
|
||||
}
|
||||
fn get_type_of<T>(_: &T) -> &'static str {
|
||||
std::any::type_name::<T>()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
std::env::set_var("RUST_LOG", CONFIG.log.level.clone());
|
||||
pretty_env_logger::init();
|
||||
// debug!("{:?}", CONFIG.node);
|
||||
let cli = Cli::parse();
|
||||
match &cli.command {
|
||||
Some(Commands::Start { role }) => {
|
||||
debug!("{:#?}", role)
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
}
|
69
uwusched-nodes/src/head.rs
Normal file
69
uwusched-nodes/src/head.rs
Normal file
|
@ -0,0 +1,69 @@
|
|||
mod config;
|
||||
|
||||
use crate::config::CONFIG;
|
||||
use bson::{bson, Bson};
|
||||
use clap::{Parser, Subcommand};
|
||||
use log::debug;
|
||||
use lz4_flex::block::{compress_prepend_size, decompress_size_prepended};
|
||||
use tonic::{transport::Server, Request, Response, Status};
|
||||
// Import generated protobuf
|
||||
mod sched {
|
||||
tonic::include_proto!("sched");
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(author, version, about)]
|
||||
#[command(propagate_version = true)]
|
||||
struct Cli {
|
||||
#[command(subcommand)]
|
||||
command: Option<Commands>,
|
||||
|
||||
#[arg(short, long)]
|
||||
/// Optional path to config file
|
||||
config_file: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum Commands {
|
||||
/// Starts uwusched
|
||||
Start { role: Option<String> },
|
||||
}
|
||||
|
||||
fn get_type_of<T>(_: &T) -> &'static str {
|
||||
std::any::type_name::<T>()
|
||||
}
|
||||
|
||||
// impl sched::data_server::Data for sched::DataResponse {
|
||||
// fn data<'life0, 'async_trait>(
|
||||
// &'life0 self,
|
||||
// request: tonic::Request<sched::DataRequest>,
|
||||
// ) -> ::core::pin::Pin<
|
||||
// Box<
|
||||
// dyn ::core::future::Future<
|
||||
// Output = std::result::Result<
|
||||
// tonic::Response<sched::DataResponse>,
|
||||
// tonic::Status,
|
||||
// >,
|
||||
// > + ::core::marker::Send
|
||||
// + 'async_trait,
|
||||
// >,
|
||||
// >
|
||||
// where
|
||||
// 'life0: 'async_trait,
|
||||
// Self: 'async_trait,
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
|
||||
fn main() {
|
||||
std::env::set_var("RUST_LOG", CONFIG.log.level.clone());
|
||||
pretty_env_logger::init();
|
||||
debug!("{:?}", CONFIG.node);
|
||||
let cli = Cli::parse();
|
||||
match &cli.command {
|
||||
Some(Commands::Start { role }) => {
|
||||
debug!("{:#?}", role)
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue