From dd90783e0170c8ef3dd63ea80f16ee6053aef5b5 Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Fri, 20 Oct 2023 04:05:12 +0200 Subject: [PATCH 01/16] Windows specific dependencies. Fmt. --- Cargo.toml | 12 +++++++----- README.md | 2 +- src/logs.rs | 2 +- src/offer-template.json | 2 +- src/process/win.rs | 2 ++ 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ab06c3a..5614f49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,11 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +ya-core-model = { git = "https://github.com/golemfactory/yagna.git", branch="release/v0.13", features = ["activity", "appkey"] } +ya-runtime-api= { git = "https://github.com/golemfactory/yagna.git", branch="release/v0.13" } ya-service-bus = "0.6.1" +ya-client-model = "0.5.0" + actix-rt="2" log = "0.4.8" serde = { version = "^1.0", features = ["derive"] } @@ -18,10 +22,8 @@ yansi = "0.5.0" chrono = "0.4" tokio = { version = "1.32", features = ["macros"] } futures = "0.3.28" - -ya-core-model = { git = "https://github.com/golemfactory/yagna.git", branch="release/v0.13", features = ["activity", "appkey"] } -ya-runtime-api= { git = "https://github.com/golemfactory/yagna.git", branch="release/v0.13" } -ya-client-model = "0.5.0" - regex = "1" reqwest="0.11.22" + +[target.'cfg(target_os = "windows")'.dependencies] +winapi = "0.3.9" diff --git a/README.md b/README.md index e034bc7..6da4fd7 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# ya-runtime-ai \ No newline at end of file +# ya-runtime-ai diff --git a/src/logs.rs b/src/logs.rs index c9c55e0..40ece67 100644 --- a/src/logs.rs +++ b/src/logs.rs @@ -31,4 +31,4 @@ pub fn init() -> anyhow::Result<()> { log::warn!("Switched to fallback logging method"); } Ok(()) -} \ No newline at end of file +} diff --git a/src/offer-template.json b/src/offer-template.json index 18580df..357faaa 100644 --- a/src/offer-template.json +++ b/src/offer-template.json @@ -11,4 +11,4 @@ "golem.usage.mining.hash-rate" ]}, "constraints":"" -} \ No newline at end of file +} diff --git a/src/process/win.rs b/src/process/win.rs index 75b232f..3911b80 100644 --- a/src/process/win.rs +++ b/src/process/win.rs @@ -7,6 +7,8 @@ use winapi::um::handleapi::INVALID_HANDLE_VALUE; #[cfg(target_os = "windows")] use winapi::um::winnt::HANDLE; +use std::{mem, ptr}; + #[cfg(target_os = "windows")] #[derive(Clone, Debug)] pub struct JobObject { From 2fe08cdc83d7f8b6087ad9ac9377283ced43a03d Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Fri, 20 Oct 2023 04:35:22 +0200 Subject: [PATCH 02/16] Windows specific dependencies. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5614f49..86b6404 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,4 +26,4 @@ regex = "1" reqwest="0.11.22" [target.'cfg(target_os = "windows")'.dependencies] -winapi = "0.3.9" +winapi = { version = "0.3.9", features = ["jobapi2", "processthreadsapi"] } From f600ee9ca212d5f302f340afd8c18adc37f70c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Walski?= Date: Mon, 23 Oct 2023 01:06:49 +0200 Subject: [PATCH 03/16] from-file command (disabled) --- src/cli.rs | 17 ++++++++++++++++- src/main.rs | 25 +++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index 9f70049..750bebc 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -16,6 +16,21 @@ pub struct Cli { #[derive(Subcommand, Debug)] pub enum Command { + /* + /// Execute commands from file + FromFile { + /// ExeUnit daemon GSB URL + #[arg(long)] + report_url: Option, + /// ExeUnit service ID + #[arg(long)] + service_id: Option, + /// Command file path + input: PathBuf, + #[command(flatten)] + args: RunArgs, + }, + */ /// Bind to Service Bus ServiceBus { /// ExeUnit service ID @@ -54,7 +69,7 @@ mod test { #[test] fn test_args() { let cli = Cli::parse_from(["-b", "/tmp/false-runtime", "offer-template"]); - assert_eq!(cli.binary, Some(Path::new("/tmp/false-runtime"))); + assert_eq!(cli.binary, Some(PathBuf::from(Path::new("/tmp/false-runtime")))); assert!(matches!(cli.command, Command::OfferTemplate)); } } diff --git a/src/main.rs b/src/main.rs index dc01e6f..accd641 100644 --- a/src/main.rs +++ b/src/main.rs @@ -139,6 +139,31 @@ async fn run() -> anyhow::Res let cli = Cli::parse(); let (exe_unit_url, report_url, activity_id, agreement_path) = match &cli.command { + /* + Command::FromFile { + report_url, + service_id, + input, + args, + } => { + let contents = std::fs::read_to_string(input).map_err(|e| { + anyhow::anyhow!("Cannot read commands from file {}: {e}", input.display()) + })?; + let contents = serde_json::from_str(&contents).map_err(|e| { + anyhow::anyhow!( + "Cannot deserialize commands from file {}: {e}", + input.display(), + ) + })?; + //TODO use file content + ( + ya_core_model::activity::exeunit::bus_id(&service_id), + report_url.unwrap(), + service_id.unwrap(), + args.agreement, + ) + } + */ Command::ServiceBus { service_id, report_url, From 89d8543118c9b1aeea3efb52470311676ed822ff Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Mon, 23 Oct 2023 17:41:52 +0200 Subject: [PATCH 04/16] Dummy runtime. Miners removed. --- Cargo.toml | 5 ++ runtimes/dummy/Cargo.toml | 8 ++ runtimes/dummy/src/main.rs | 3 + src/main.rs | 54 ++++------- src/offer-template.json | 9 +- src/process.rs | 89 ++++-------------- src/process/dummy.rs | 43 +++++++++ src/process/phoenix.rs | 179 ------------------------------------- src/process/trex.rs | 137 ---------------------------- src/process/win.rs | 8 +- 10 files changed, 96 insertions(+), 439 deletions(-) create mode 100644 runtimes/dummy/Cargo.toml create mode 100644 runtimes/dummy/src/main.rs create mode 100644 src/process/dummy.rs delete mode 100644 src/process/phoenix.rs delete mode 100644 src/process/trex.rs diff --git a/Cargo.toml b/Cargo.toml index 86b6404..a6e069e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,11 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[workspace] +members = [ + "runtimes/dummy" +] + [dependencies] ya-core-model = { git = "https://github.com/golemfactory/yagna.git", branch="release/v0.13", features = ["activity", "appkey"] } ya-runtime-api= { git = "https://github.com/golemfactory/yagna.git", branch="release/v0.13" } diff --git a/runtimes/dummy/Cargo.toml b/runtimes/dummy/Cargo.toml new file mode 100644 index 0000000..55ab73a --- /dev/null +++ b/runtimes/dummy/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "dummy" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/runtimes/dummy/src/main.rs b/runtimes/dummy/src/main.rs new file mode 100644 index 0000000..7527576 --- /dev/null +++ b/runtimes/dummy/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("hello"); +} diff --git a/src/main.rs b/src/main.rs index accd641..23da201 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,7 +41,7 @@ async fn send_state( .await??) } -async fn activity_loop( +async fn activity_loop( report_url: &str, activity_id: &str, mut process: ProcessController, @@ -51,35 +51,14 @@ async fn activity_loop( let start = Utc::now(); let mut current_usage = agreement.clean_usage_vector(); let duration_idx = agreement.resolve_counter("golem.usage.duration_sec"); - let shares_idx = agreement.resolve_counter("golem.usage.mining.hash"); - let hrate_idx = agreement.resolve_counter("golem.usage.mining.hash-rate"); - let raw_shares_idx = agreement.resolve_counter("golem.usage.mining.share"); - let raw_stale_shares_idx = agreement.resolve_counter("golem.usage.mining.stale-share"); - let raw_invalid_shares_idx = agreement.resolve_counter("golem.usage.mining.invalid-share"); - while let Some((shares, stale_shares, invalid_shares, speed, diff_shares)) = process.report() { + while let Some(()) = process.report() { let now = Utc::now(); let duration = now - start; if let Some(idx) = duration_idx { current_usage[idx] = duration.to_std()?.as_secs_f64(); } - if let Some(idx) = shares_idx { - current_usage[idx] = diff_shares; - } - if let Some(idx) = hrate_idx { - current_usage[idx] = speed; - } - if let Some(idx) = raw_shares_idx { - current_usage[idx] = shares as f64; - } - if let Some(idx) = raw_stale_shares_idx { - current_usage[idx] = stale_shares as f64; - } - if let Some(idx) = raw_invalid_shares_idx { - current_usage[idx] = invalid_shares as f64; - } - match report_service .call(activity::local::SetUsage { activity_id: activity_id.to_string(), @@ -114,26 +93,25 @@ async fn activity_loop( }) .await; log::error!("process exit: {:?}", status); - anyhow::bail!("Miner app exited") + anyhow::bail!("Runtime exited") } } } Ok(()) } -const ENV_MINER: &str = "MINER_NAME"; +const ENV_MINER: &str = "FRAMEWORK_NAME"; #[actix_rt::main] async fn main() -> anyhow::Result<()> { - let miner = env::var(ENV_MINER).unwrap_or("Phoenix".to_string()); - match miner.as_str() { - "Phoenix" => run::().await, - "TRex" => run::().await, - _ => anyhow::bail!("Miner not found {}", miner), + let framework = env::var(ENV_MINER).unwrap_or("Dummy".to_string()); + match framework.as_str() { + "Dummy" => run::().await, + _ => anyhow::bail!("Unsupported framework {}", framework), } } -async fn run() -> anyhow::Result<()> { +async fn run() -> anyhow::Result<()> { let args: Vec = env::args().collect(); let cli = Cli::parse(); @@ -170,7 +148,7 @@ async fn run() -> anyhow::Res args, .. } => ( - ya_core_model::activity::exeunit::bus_id(&service_id), + ya_core_model::activity::exeunit::bus_id(service_id), report_url, service_id, &args.agreement, @@ -193,15 +171,15 @@ async fn run() -> anyhow::Res let process_controller = process::ProcessController::::new(); let agreement = AgreementDesc::load(agreement_path)?; let activity_pinger = activity_loop( - &report_url, - &activity_id, + report_url, + activity_id, process_controller.clone(), agreement, ); #[cfg(target_os = "windows")] let _job = process::win::JobObject::new()?; - let _ = { + { let report_url = report_url.clone(); let activity_id = activity_id.clone(); let batch: Rc>>> = Default::default(); @@ -239,7 +217,7 @@ async fn run() -> anyhow::Res }); } ExeScriptCommand::Start { args, .. } => { - let args = process::MiningAppArgs::new(&args).map_err(|e| { + let args = process::RuntimeArgs::new(args).map_err(|e| { RpcMessageError::Activity(format!("invalid args: {}", e)) })?; @@ -326,8 +304,8 @@ async fn run() -> anyhow::Res }); }; send_state( - &report_url, - &activity_id, + report_url, + activity_id, ActivityState::from(StatePair(State::Initialized, None)), ) .await?; diff --git a/src/offer-template.json b/src/offer-template.json index 357faaa..250fa3b 100644 --- a/src/offer-template.json +++ b/src/offer-template.json @@ -1,14 +1,7 @@ { "properties": { - "golem.activity.mining.algo":"ethash", - "golem.activity.mining.app":"claymore", "golem.com.usage.vector":[ - "golem.usage.duration_sec", - "golem.usage.mining.hash", - "golem.usage.mining.share", - "golem.usage.mining.stale-share", - "golem.usage.mining.invalid-share", - "golem.usage.mining.hash-rate" + "golem.usage.duration_sec" ]}, "constraints":"" } diff --git a/src/process.rs b/src/process.rs index 8def804..5b75316 100644 --- a/src/process.rs +++ b/src/process.rs @@ -11,47 +11,31 @@ use std::task::{Context, Poll}; use tokio::process::*; -pub use self::phoenix::Phoenix; -pub use self::trex::Trex; - -mod phoenix; -mod trex; pub mod win; +pub mod dummy; #[derive(Default, Clone)] pub struct Shares { - pub cnt: u64, - pub stale_cnt: u64, - pub invalid_cnt: u64, - pub new_speed: f64, - pub difficulty: f64, + pub cnt: u64 } -pub trait MinerEngine { - fn start(args: &MiningAppArgs) -> anyhow::Result; +pub trait Runtime { + fn start(args: &RuntimeArgs) -> anyhow::Result; fn run(stdout: ChildStdout, report_fn: ReportFn); } -const ENV_EXTRA_PARAMS: &str = "EXTRA_MINER_PARAMS"; #[derive(Parser)] #[cfg_attr(test, derive(Debug, Eq, PartialEq))] -pub struct MiningAppArgs { - #[arg(long)] - pub pool: String, - #[arg(long)] - pub wallet: String, - #[arg(long)] - pub worker_name: Option, +pub struct RuntimeArgs { #[arg(long)] - pub password: Option, + pub model: String, } -impl MiningAppArgs { +impl RuntimeArgs { pub fn new(args: &[String]) -> anyhow::Result { - let me = "gminer".to_string(); - Ok(Self::try_parse_from(std::iter::once(&me).chain(args))?) + Ok(Self::try_parse_from(args)?) } } @@ -66,16 +50,8 @@ enum ProcessControllerInner { Deployed {}, Working { child: Child, - shares: u64, - stale_shares: u64, - invalid_shares: u64, - speed: f64, - diff_share: f64, }, Stopped { - shares: u64, - stale_shares: u64, - invalid_shares: u64, }, } @@ -96,7 +72,7 @@ pub fn find_exe(file_name: impl AsRef) -> std::io::Result { .ok_or_else(|| std::io::ErrorKind::NotFound.into()) } -impl ProcessController { +impl ProcessController { pub fn new() -> Self { ProcessController { inner: Rc::new(RefCell::new(ProcessControllerInner::Deployed {})), @@ -104,70 +80,39 @@ impl ProcessController { } } - pub fn report(&self) -> Option<(u64, u64, u64, f64, f64)> { + pub fn report(&self) -> Option<()> { match *self.inner.borrow_mut() { - ProcessControllerInner::Deployed { .. } => Some((0, 0, 0, 0.0, 0.0)), + ProcessControllerInner::Deployed { .. } => Some(()), ProcessControllerInner::Working { - ref shares, - ref stale_shares, - ref invalid_shares, - ref speed, - ref diff_share, .. - } => Some((*shares, *stale_shares, *invalid_shares, *speed, *diff_share)), + } => Some(()), _ => None, } } pub async fn stop(&self) { - let (shares, stale_shares, invalid_shares, _, _) = self.report().unwrap_or_default(); + let () = self.report().unwrap_or_default(); let old = self.inner.replace(ProcessControllerInner::Stopped { - shares, - stale_shares, - invalid_shares, }); if let ProcessControllerInner::Working { mut child, .. } = old { let _ = child.kill().await; } } - pub async fn start(&self, args: &MiningAppArgs) -> anyhow::Result<()> { + pub async fn start(&self, args: &RuntimeArgs) -> anyhow::Result<()> { let mut child = T::start(args)?; let opt_stdout = child.stdout.take(); self.inner.replace(ProcessControllerInner::Working { - child, - shares: 0, - stale_shares: 0, - invalid_shares: 0, - speed: 0.0, - diff_share: 0.0, + child }); if let Some(stdout) = opt_stdout { - let me: ProcessController = self.clone(); - T::run(stdout, move |shares| me.new_shares(shares)); + let _me: ProcessController = self.clone(); + T::run(stdout, move |_| {}); } Ok(()) } - - fn new_shares(&self, new_shares: Shares) { - if let ProcessControllerInner::Working { - ref mut shares, - ref mut stale_shares, - ref mut invalid_shares, - ref mut speed, - ref mut diff_share, - .. - } = *self.inner.borrow_mut() - { - *shares += new_shares.cnt; - *stale_shares += new_shares.stale_cnt; - *invalid_shares += new_shares.invalid_cnt; - *speed = new_shares.new_speed; - *diff_share += new_shares.difficulty * 0.001 * new_shares.cnt as f64; - } - } } impl Future for ProcessController { diff --git a/src/process/dummy.rs b/src/process/dummy.rs new file mode 100644 index 0000000..6c66c39 --- /dev/null +++ b/src/process/dummy.rs @@ -0,0 +1,43 @@ +use std::process::Stdio; + +use tokio::io::{AsyncBufReadExt, BufReader}; +use tokio::process::{Child, ChildStdout, Command}; + +use super::{Runtime, RuntimeArgs, Shares}; + +#[derive(Clone)] +pub struct Dummy {} + +impl Unpin for Dummy {} + +impl Runtime for Dummy { + fn start(_args: &RuntimeArgs) -> anyhow::Result { + let exe = super::find_exe("dummy.exe")?; + let mut cmd = Command::new(&exe); + let work_dir = exe.parent().unwrap(); + cmd.stdout(Stdio::piped()) + .stdin(Stdio::null()) + .current_dir(work_dir); + + Ok(cmd.kill_on_drop(true).spawn()?) + } + + fn run(stdout: ChildStdout, _report_fn: ReportFn) { + tokio::task::spawn_local(async move { + let mut stdout = BufReader::new(stdout); + loop { + let mut line_buf = String::new(); + match stdout.read_line(&mut line_buf).await { + Err(e) => { + log::error!("no line: {}", e); + break; + } + Ok(0) => break, + Ok(_) => (), + } + let line = line_buf.trim_end(); + log::info!("dummy response: {line}"); + } + }); + } +} diff --git a/src/process/phoenix.rs b/src/process/phoenix.rs deleted file mode 100644 index feb722a..0000000 --- a/src/process/phoenix.rs +++ /dev/null @@ -1,179 +0,0 @@ -use std::env; -use std::process::Stdio; - -use regex::Regex; -use tokio::io::{AsyncBufReadExt, BufReader}; -use tokio::process::{Child, ChildStdout, Command}; - -use super::{MinerEngine, MiningAppArgs, Shares, ENV_EXTRA_PARAMS}; - -#[derive(Clone)] -pub struct Phoenix {} - -impl Unpin for Phoenix {} - -impl MinerEngine for Phoenix { - fn start(args: &MiningAppArgs) -> anyhow::Result { - let exe = super::find_exe("phoenix\\EthDcrMiner64.exe")?; - let mut cmd = Command::new(&exe); - let work_dir = exe.parent().unwrap(); - cmd.stdout(Stdio::piped()) - .stdin(Stdio::null()) - .current_dir(work_dir) - .arg("-epool") - .arg(&args.pool) - .arg("-ewal") - .arg(&args.wallet); - - if let Some(ref worker_name) = args.worker_name { - cmd.arg("-eworker").arg(worker_name); - } - - if let Some(ref pw) = args.password { - cmd.arg("-epsw").arg(pw); - } - - if let Ok(param) = env::var(ENV_EXTRA_PARAMS) { - cmd.args(param.split(' ')); - } - - Ok(cmd.kill_on_drop(true).spawn()?) - } - - fn run(stdout: ChildStdout, report_fn: ReportFn) { - tokio::task::spawn_local(async move { - let re = Regex::new(RE_PHOENIX_MATCH_ETH).unwrap(); - let re_new_job = Regex::new(RE_PHOENIX_MATCH_NEW_JOB).unwrap(); - let mut stdout = BufReader::new(stdout); - let mut prev_shares: u64 = 0; - let mut prev_stale_shares: u64 = 0; - let mut prev_invalid_shares: u64 = 0; - let mut difficulty: f64 = 0.0; - loop { - let mut line_buf = String::new(); - match stdout.read_line(&mut line_buf).await { - Err(e) => { - log::error!("no line: {}", e); - break; - } - Ok(0) => break, - Ok(_) => (), - } - let line = line_buf.trim_end(); - if let Some(it) = re.captures(&line) { - log::info!("matched: {}", line); - match (|| -> anyhow::Result<(u64, u64, u64, f64)> { - let speed: f64 = it[1].parse()?; - let shares: u64 = it[2].parse()?; - let stale_shares: u64 = it[3].parse()?; - let invalid_shares: u64 = it[4].parse()?; - Ok((shares, stale_shares, invalid_shares, speed)) - })() { - Ok((shares, stale_shares, invalid_shares, speed)) => { - if shares >= prev_shares - || stale_shares >= prev_stale_shares - || invalid_shares >= prev_invalid_shares - { - report_fn(Shares { - cnt: shares - prev_shares, - stale_cnt: stale_shares - prev_stale_shares, - invalid_cnt: invalid_shares - prev_invalid_shares, - new_speed: speed, - difficulty, - }); - prev_shares = shares; - prev_stale_shares = stale_shares; - prev_invalid_shares = invalid_shares; - } else { - log::error!( - "invalid shares decoded: ({},{},{})/{}", - shares, - stale_shares, - invalid_shares, - prev_shares - ); - } - } - Err(e) => log::error!("failed to parse line: {}", e), - } - } - if let Some(it) = re_new_job.captures(&line) { - let difficulty_str = &it[1]; - difficulty = match difficulty_str.parse() { - Ok(v) => v, - Err(e) => { - log::error!("invalid dificulty: {}", e); - break; - } - } - } else { - log::info!("stdout: {}", line); - } - } - }); - } -} - -const RE_PHOENIX_MATCH_ETH: &str = - r"^Eth speed: ([0-9]*\.[0-9]*) MH/s, shares: ([0-9]+)/([0-9]+)/([0-9]+), time: "; - -// -const RE_PHOENIX_MATCH_NEW_JOB: &str = r"^Eth: New job .*; diff: ([0-9]+(.[0-9]+)?)MH"; - -#[cfg(test)] -mod test { - use regex::Regex; - use structopt::StructOpt; - - use super::*; - - #[test] - fn parse_output() { - let re = Regex::new(RE_PHOENIX_MATCH_ETH).unwrap(); - let line = "Eth speed: 25.355 MH/s, shares: 5/0/0, time: 1:00\r\n"; - for it in re.captures_iter(line) { - println!("[{}] {} - {} - {}", &it[1], &it[2], &it[3], &it[4]); - } - } - - #[test] - fn parse_new_job() { - let re = Regex::new(RE_PHOENIX_MATCH_NEW_JOB).unwrap(); - let line = - "Eth: New job #00ADFC28 from staging-backend.chessongolem.app:3334; diff: 4295MH"; - let cap = re.captures(line).unwrap(); - assert_eq!(&cap[1], "4295"); - } - - #[test] - fn parse_args() { - assert!(MiningAppArgs::from_iter_safe(&["self"]).is_err()); - assert_eq!( - MiningAppArgs::from_iter_safe(&[ - "self", - "--pool", - "staging-backend.chessongolem.app:3334", - "--wallet", - "0xa1a7c282badfa6bd188a6d42b5bc7fa1e836d1f8" - ]) - .unwrap(), - MiningAppArgs { - pool: "staging-backend.chessongolem.app:3334".to_string(), - wallet: "0xa1a7c282badfa6bd188a6d42b5bc7fa1e836d1f8".to_string(), - worker_name: None, - password: None - } - ); - assert_eq!(MiningAppArgs::from_iter_safe(&[ - "self", - "--pool", "staging-backend.chessongolem.app:3334", - "--worker-name", "0x246337ff755379bdbfd4381e35937526c150e541/0x34f24b55755de03984b55d1c650092c5e34d610d/82398862214e4c09854eededf2ad37c4", - "--wallet", "0xa1a7c282badfa6bd188a6d42b5bc7fa1e836d1f8"]).unwrap(), - MiningAppArgs { - pool: "staging-backend.chessongolem.app:3334".to_string(), - wallet: "0xa1a7c282badfa6bd188a6d42b5bc7fa1e836d1f8".to_string(), - worker_name: Some("0x246337ff755379bdbfd4381e35937526c150e541/0x34f24b55755de03984b55d1c650092c5e34d610d/82398862214e4c09854eededf2ad37c4".into()), - password: None - }); - } -} diff --git a/src/process/trex.rs b/src/process/trex.rs deleted file mode 100644 index 765f4f7..0000000 --- a/src/process/trex.rs +++ /dev/null @@ -1,137 +0,0 @@ -use std::env; -use std::process::Stdio; - -use serde::{Deserialize, Serialize}; -use tokio::io::{AsyncBufReadExt, BufReader}; -use tokio::process::{Child, ChildStdout, Command}; -use tokio::time::Duration; - -use super::{MiningAppArgs, Shares, ENV_EXTRA_PARAMS}; - -#[derive(Serialize, Deserialize)] -struct TRexMinerDataActivePool { - difficulty: String, //"difficulty":"4.00 G", -} - -#[derive(Serialize, Deserialize)] -struct TRexMinerData { - accepted_count: u64, - invalid_count: u64, - rejected_count: u64, - active_pool: TRexMinerDataActivePool, - hashrate: u64, - hashrate_hour: u64, - hashrate_minute: u64, -} - -async fn get_trex_info() -> anyhow::Result { - let content = reqwest::get("http://localhost:4067/summary") - .await? - .text_with_charset("utf-8") - .await?; - - let trex_miner_data = serde_json::from_str::(&content)?; - - Ok(trex_miner_data) -} - -#[derive(Clone)] -pub struct Trex {} - -impl super::MinerEngine for Trex { - fn start(args: &MiningAppArgs) -> anyhow::Result { - let exe = super::find_exe("t-rex\\t-rex.exe")?; - let _cmd = Command::new(&exe); - let work_dir = exe.parent().unwrap(); - - let mut cmd = Command::new(&exe); - cmd.stdout(Stdio::piped()) - .stdin(Stdio::null()) - .current_dir(work_dir) - .arg("--no-watchdog") - .arg("-o") - .arg(&args.pool) - .arg("-u") - .arg(&args.wallet); - - if let Some(ref worker_name) = args.worker_name { - cmd.arg("-w").arg(worker_name); - } - - if let Ok(param) = env::var(ENV_EXTRA_PARAMS) { - cmd.args(param.split(' ')); - } - - Ok(cmd.kill_on_drop(true).spawn()?) - } - - fn run(stdout: ChildStdout, report_fn: ReportFn) { - tokio::task::spawn_local(async move { - let mut stdout = BufReader::new(stdout); - let mut line_buf = String::new(); - loop { - match stdout.read_line(&mut line_buf).await { - Err(e) => { - log::error!("no line: {}", e); - break; - } - Ok(0) => break, - Ok(_) => (), - } - let line = line_buf.trim_end(); - log::info!("trex: {}", line); - } - }); - tokio::task::spawn_local(async move { - let mut prev_shares: u64 = 0; - let mut prev_stale_shares: u64 = 0; - let mut prev_invalid_shares: u64 = 0; - let mut difficulty: f64; - loop { - tokio::time::sleep(Duration::from_secs(10)).await; - let trex_miner_data = match get_trex_info().await { - Ok(t) => t, - Err(e) => { - log::error!("Failed to parse rexMinerData {}", e); - break; - } - }; - let speed: f64 = trex_miner_data.hashrate_minute as f64 / 1000000.0; - let shares: u64 = trex_miner_data.accepted_count; - let stale_shares: u64 = trex_miner_data.rejected_count; - let invalid_shares: u64 = trex_miner_data.invalid_count; - let difficulty_str = trex_miner_data.active_pool.difficulty.replace(" G", ""); - difficulty = match difficulty_str.parse::() { - Ok(val) => val * 1000.0, //convert to Mh - Err(e) => { - log::error!("Failed to parse difficulty {}", e); - break; - } - }; - if shares >= prev_shares - || stale_shares >= prev_stale_shares - || invalid_shares >= prev_invalid_shares - { - report_fn(Shares { - cnt: shares - prev_shares, - stale_cnt: stale_shares - prev_stale_shares, - invalid_cnt: invalid_shares - prev_invalid_shares, - new_speed: speed, - difficulty, - }); - prev_shares = shares; - prev_stale_shares = stale_shares; - prev_invalid_shares = invalid_shares; - } else { - log::error!( - "invalid shares decoded: ({},{},{})/{}", - shares, - stale_shares, - invalid_shares, - prev_shares - ); - } - } - }); - } -} diff --git a/src/process/win.rs b/src/process/win.rs index 3911b80..64c1412 100644 --- a/src/process/win.rs +++ b/src/process/win.rs @@ -52,11 +52,9 @@ impl JobObject { impl Drop for JobObject { fn drop(&mut self) { let handle = mem::replace(&mut self.handle, INVALID_HANDLE_VALUE); - if handle != INVALID_HANDLE_VALUE { - if unsafe { um::handleapi::CloseHandle(self.handle) } == 0 { - let code = unsafe { um::errhandlingapi::GetLastError() }; - log::error!("winapi: {}", code); - } + if handle != INVALID_HANDLE_VALUE && unsafe { um::handleapi::CloseHandle(self.handle) } == 0 { + let code = unsafe { um::errhandlingapi::GetLastError() }; + log::error!("winapi: {}", code); } } } From 3f05d0ef15cf3af4dc00e7ac60b919d20f8373fe Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Tue, 24 Oct 2023 00:33:02 +0200 Subject: [PATCH 05/16] Runtime name CLI param. Runtime name in offer. README. --- README.md | 24 ++++++++++++++++++++++++ src/cli.rs | 8 +++++++- src/main.rs | 17 +++++++---------- src/offer_template.rs | 11 +++++++---- src/process.rs | 24 ++++++++---------------- src/process/win.rs | 3 ++- 6 files changed, 55 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 6da4fd7..b5186c8 100644 --- a/README.md +++ b/README.md @@ -1 +1,25 @@ # ya-runtime-ai + +## Provider setup + +Run `cargo build --workspace`. +Create sample `exeunits-descriptor.json` (with correct `supervisor-path`): + +```json +[ + { + "name": "ai-dummy", + "version": "0.1.0", + "supervisor-path": "[..]\\ya-runtime-ai\\target\\debug\\ya-runtime-ai.exe", + "extra-args": ["--runtime", "dummy"], + "description": "dummy ai runtime", + "properties": { + } + } +] +``` + +Point `ya-provider` to exeunits descriptor using `EXE_UNIT_PATH` variable. + +`ya-provider` creates on startup a `default` preset for `wasmtime` runtime. +Update it: `ya-provider.exe preset update --name default --no-interactive --exe-unit ai-dummy --price Duration=1.2 CPU=3.4 "Init price=0.00001"` diff --git a/src/cli.rs b/src/cli.rs index 750bebc..35cb55c 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -10,6 +10,9 @@ pub struct Cli { /// Runtime binary path #[arg(long, short)] pub binary: Option, + /// Runtime pavkage name + #[arg(long, short)] + pub runtime: String, #[command(subcommand)] pub command: Command, } @@ -69,7 +72,10 @@ mod test { #[test] fn test_args() { let cli = Cli::parse_from(["-b", "/tmp/false-runtime", "offer-template"]); - assert_eq!(cli.binary, Some(PathBuf::from(Path::new("/tmp/false-runtime")))); + assert_eq!( + cli.binary, + Some(PathBuf::from(Path::new("/tmp/false-runtime"))) + ); assert!(matches!(cli.command, Command::OfferTemplate)); } } diff --git a/src/main.rs b/src/main.rs index 23da201..390cf69 100644 --- a/src/main.rs +++ b/src/main.rs @@ -100,22 +100,18 @@ async fn activity_loop( Ok(()) } -const ENV_MINER: &str = "FRAMEWORK_NAME"; - #[actix_rt::main] async fn main() -> anyhow::Result<()> { - let framework = env::var(ENV_MINER).unwrap_or("Dummy".to_string()); - match framework.as_str() { - "Dummy" => run::().await, - _ => anyhow::bail!("Unsupported framework {}", framework), + let cli = Cli::parse(); + match cli.runtime.to_lowercase().as_str() { + "dummy" => run::(cli).await, + _ => anyhow::bail!("Unsupported framework {}", cli.runtime), } } -async fn run() -> anyhow::Result<()> { +async fn run(cli: Cli) -> anyhow::Result<()> { let args: Vec = env::args().collect(); - let cli = Cli::parse(); - let (exe_unit_url, report_url, activity_id, agreement_path) = match &cli.command { /* Command::FromFile { @@ -154,7 +150,8 @@ async fn run() -> anyhow::Result< &args.agreement, ), Command::OfferTemplate => { - io::stdout().write_all(offer_template::template()?.as_ref())?; + let template = offer_template::template(cli.runtime)?; + io::stdout().write_all(template.as_ref())?; return Ok(()); } Command::Test => { diff --git a/src/offer_template.rs b/src/offer_template.rs index c080ad1..0b53f39 100644 --- a/src/offer_template.rs +++ b/src/offer_template.rs @@ -58,13 +58,17 @@ struct OfferTemplate { constraints: String, } -pub fn template() -> anyhow::Result> { +pub fn template(runtime_name: String) -> anyhow::Result> { let offer_template = include_bytes!("offer-template.json"); + let mut template: OfferTemplate = serde_json::from_slice(offer_template.as_ref())?; + template.properties.insert( + "golem.inf.ai.runtime".to_string(), + serde_json::Value::String(runtime_name), + ); let devices = parse_devices_info()?; if devices.is_empty() { - return Ok(Cow::Borrowed(offer_template.as_ref())); + return Ok(Cow::Owned(serde_json::to_vec_pretty(&template)?)); } - let mut template: OfferTemplate = serde_json::from_slice(offer_template.as_ref())?; template.properties.insert( "golem.inf.gpu.card".to_string(), serde_json::Value::Array( @@ -78,6 +82,5 @@ pub fn template() -> anyhow::Result> { "golem.inf.gpu.mem".to_string(), serde_json::Value::Array(devices.iter().map(|&(_, mem)| mem.into()).collect()), ); - Ok(Cow::Owned(serde_json::to_vec_pretty(&template)?)) } diff --git a/src/process.rs b/src/process.rs index 5b75316..9eabe5f 100644 --- a/src/process.rs +++ b/src/process.rs @@ -11,12 +11,12 @@ use std::task::{Context, Poll}; use tokio::process::*; -pub mod win; pub mod dummy; +pub mod win; #[derive(Default, Clone)] pub struct Shares { - pub cnt: u64 + pub cnt: u64, } pub trait Runtime { @@ -25,7 +25,6 @@ pub trait Runtime { fn run(stdout: ChildStdout, report_fn: ReportFn); } - #[derive(Parser)] #[cfg_attr(test, derive(Debug, Eq, PartialEq))] pub struct RuntimeArgs { @@ -48,11 +47,8 @@ pub struct ProcessController { #[allow(clippy::large_enum_variant)] enum ProcessControllerInner { Deployed {}, - Working { - child: Child, - }, - Stopped { - }, + Working { child: Child }, + Stopped {}, } pub fn find_exe(file_name: impl AsRef) -> std::io::Result { @@ -83,17 +79,14 @@ impl ProcessController { pub fn report(&self) -> Option<()> { match *self.inner.borrow_mut() { ProcessControllerInner::Deployed { .. } => Some(()), - ProcessControllerInner::Working { - .. - } => Some(()), + ProcessControllerInner::Working { .. } => Some(()), _ => None, } } pub async fn stop(&self) { let () = self.report().unwrap_or_default(); - let old = self.inner.replace(ProcessControllerInner::Stopped { - }); + let old = self.inner.replace(ProcessControllerInner::Stopped {}); if let ProcessControllerInner::Working { mut child, .. } = old { let _ = child.kill().await; } @@ -103,9 +96,8 @@ impl ProcessController { let mut child = T::start(args)?; let opt_stdout = child.stdout.take(); - self.inner.replace(ProcessControllerInner::Working { - child - }); + self.inner + .replace(ProcessControllerInner::Working { child }); if let Some(stdout) = opt_stdout { let _me: ProcessController = self.clone(); diff --git a/src/process/win.rs b/src/process/win.rs index 64c1412..cbb480f 100644 --- a/src/process/win.rs +++ b/src/process/win.rs @@ -52,7 +52,8 @@ impl JobObject { impl Drop for JobObject { fn drop(&mut self) { let handle = mem::replace(&mut self.handle, INVALID_HANDLE_VALUE); - if handle != INVALID_HANDLE_VALUE && unsafe { um::handleapi::CloseHandle(self.handle) } == 0 { + if handle != INVALID_HANDLE_VALUE && unsafe { um::handleapi::CloseHandle(self.handle) } == 0 + { let code = unsafe { um::errhandlingapi::GetLastError() }; log::error!("winapi: {}", code); } From 8c321b371184e5fe4f032dee30abc70a27417feb Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Tue, 24 Oct 2023 02:42:19 +0200 Subject: [PATCH 06/16] Cleanup. CI --- .github/workflows/ci.yml | 58 ++++++++++++++++++++++++++++++++++++++++ src/cli.rs | 16 ----------- src/process/win.rs | 2 -- 3 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a1d4043 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +on: + push: + branches: [ "main" ] + tags: + - v* + - pre-rel-* + pull_request: + branches: [ "main" ] +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: windows-latest + + steps: + - name: Check lockfile + uses: actions-rs/cargo@v1 + with: + command: tree + args: --locked + + - name: Check formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + - uses: actions/checkout@v3 + + - name: Build + run: cargo build --verbose + + - name: Check clippy lints + uses: actions-rs/cargo@v1 + with: + command: Clippy + args: --all-targets --all-features --workspace -- -D warnings + + - name: Run tests + run: cargo test --verbose + + - uses: actions/checkout@v3 + + - name: Build Release + if: startsWith(github.ref, 'refs/tags/') + run: cargo build --release + + - name: Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: target/release/*.exe + prerelease: ${{ startsWith(github.ref, 'refs/tags/pre-rel-v') }} diff --git a/src/cli.rs b/src/cli.rs index 35cb55c..a3fc781 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -63,19 +63,3 @@ pub struct RunArgs { #[arg(long, short)] pub cache_dir: Option, } - -#[cfg(test)] -mod test { - use super::*; - use std::path::Path; - - #[test] - fn test_args() { - let cli = Cli::parse_from(["-b", "/tmp/false-runtime", "offer-template"]); - assert_eq!( - cli.binary, - Some(PathBuf::from(Path::new("/tmp/false-runtime"))) - ); - assert!(matches!(cli.command, Command::OfferTemplate)); - } -} diff --git a/src/process/win.rs b/src/process/win.rs index cbb480f..8b229ed 100644 --- a/src/process/win.rs +++ b/src/process/win.rs @@ -7,8 +7,6 @@ use winapi::um::handleapi::INVALID_HANDLE_VALUE; #[cfg(target_os = "windows")] use winapi::um::winnt::HANDLE; -use std::{mem, ptr}; - #[cfg(target_os = "windows")] #[derive(Clone, Debug)] pub struct JobObject { From 133a185935faadca45bb8f3f4ca6838192fd9087 Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Tue, 24 Oct 2023 03:11:31 +0200 Subject: [PATCH 07/16] CI. Cargo.lock --- .github/workflows/ci.yml | 70 +- .gitignore | 2 +- Cargo.lock | 2394 ++++++++++++++++++++++++++++++++++++++ src/process/win.rs | 2 + 4 files changed, 2426 insertions(+), 42 deletions(-) create mode 100644 Cargo.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1d4043..0a9b816 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,47 +12,35 @@ env: CARGO_TERM_COLOR: always jobs: - build: + test: + name: CI runs-on: windows-latest - + steps: - - name: Check lockfile - uses: actions-rs/cargo@v1 - with: - command: tree - args: --locked - - - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - - uses: actions/checkout@v3 - - - name: Build - run: cargo build --verbose - - - name: Check clippy lints - uses: actions-rs/cargo@v1 - with: - command: Clippy - args: --all-targets --all-features --workspace -- -D warnings - - - name: Run tests - run: cargo test --verbose - - - uses: actions/checkout@v3 - - - name: Build Release - if: startsWith(github.ref, 'refs/tags/') - run: cargo build --release - - - name: Release - if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - files: target/release/*.exe - prerelease: ${{ startsWith(github.ref, 'refs/tags/pre-rel-v') }} + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.71.0 + components: clippy, rustfmt + + - run: cargo tree --locked + + - run: cargo fmt --all -- --check + + - run: cargo clippy --all-targets --all-features --workspace -- -D warnings + + - run: cargo test --all-features --workspace + + - name: Release Build + if: startsWith(github.ref, 'refs/tags/') + run: cargo build --workspace --release + + - name: Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: target/release/*.exe + prerelease: ${{ startsWith(github.ref, 'refs/tags/pre-rel-v') }} diff --git a/.gitignore b/.gitignore index 196e176..00ae12c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ target/ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock +# Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..700f4f6 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2394 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "actix" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cba56612922b907719d4a01cf11c8d5b458e7d3dba946d0435f20f58d6795ed2" +dependencies = [ + "actix-macros", + "actix-rt", + "actix_derive", + "bitflags 2.4.1", + "bytes", + "crossbeam-channel", + "futures-core", + "futures-sink", + "futures-task", + "futures-util", + "log", + "once_cell", + "parking_lot", + "pin-project-lite", + "smallvec", + "tokio", + "tokio-util", +] + +[[package]] +name = "actix-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" +dependencies = [ + "quote", + "syn 2.0.38", +] + +[[package]] +name = "actix-rt" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" +dependencies = [ + "actix-macros", + "futures-core", + "tokio", +] + +[[package]] +name = "actix_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anstream" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anstyle-parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.7.1", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" + +[[package]] +name = "bigdecimal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1e50562e37200edf7c6c43e54a08e64a5553bfb59d9c297d5572512aa517256" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim 0.8.0", + "textwrap", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clap" +version = "4.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.10.0", +] + +[[package]] +name = "clap_derive" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "clap_lex" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "dummy" +version = "0.1.0" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "fixedbitset" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flexbuffers" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15d14128f06405808ce75bfebe11e9b0f9da18719ede6d7bdb1702d6bfe0f7e8" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "num_enum", + "serde", + "serde_derive", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + +[[package]] +name = "h2" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.4.9", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +dependencies = [ + "equivalent", + "hashbrown 0.14.1", +] + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.3", + "rustix", + "windows-sys", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" + +[[package]] +name = "linux-raw-sys" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "openssl" +version = "0.10.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +dependencies = [ + "bitflags 2.4.1", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.4.1", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pest" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +dependencies = [ + "fixedbitset 0.2.0", + "indexmap 1.9.3", +] + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset 0.4.2", + "indexmap 2.0.2", +] + +[[package]] +name = "pin-project" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef0f924a5ee7ea9cbcea77529dba45f8a9ba9f622419fe3386ca581a3ae9d5a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "851c8d0ce9bebe43790dedfc86614c23494ac9f423dd618d3a61fc693eafe61e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" +dependencies = [ + "bytes", + "prost-derive 0.7.0", +] + +[[package]] +name = "prost" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" +dependencies = [ + "bytes", + "prost-derive 0.10.1", +] + +[[package]] +name = "prost-build" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" +dependencies = [ + "bytes", + "heck 0.3.3", + "itertools 0.9.0", + "log", + "multimap", + "petgraph 0.5.1", + "prost 0.7.0", + "prost-types 0.7.0", + "tempfile", + "which", +] + +[[package]] +name = "prost-build" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" +dependencies = [ + "bytes", + "cfg-if", + "cmake", + "heck 0.4.1", + "itertools 0.10.5", + "lazy_static", + "log", + "multimap", + "petgraph 0.6.4", + "prost 0.10.4", + "prost-types 0.10.1", + "regex", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" +dependencies = [ + "anyhow", + "itertools 0.9.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-derive" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" +dependencies = [ + "bytes", + "prost 0.7.0", +] + +[[package]] +name = "prost-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" +dependencies = [ + "bytes", + "prost 0.10.4", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.20", +] + +[[package]] +name = "rustix" +version = "0.38.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "structopt" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" +dependencies = [ + "clap 2.34.0", + "lazy_static", + "structopt-derive", +] + +[[package]] +name = "structopt-derive" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" +dependencies = [ + "heck 0.3.3", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "strum" +version = "0.19.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b89a286a7e3b5720b9a477b23253bc50debac207c8d21505f8e70b36792f11b5" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum_macros" +version = "0.19.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e61bb0be289045cb80bfce000512e32d09f8337e54c186725da381377ad1f8d5" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys", +] + +[[package]] +name = "termcolor" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.5.4", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.0.2", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.38", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys", +] + +[[package]] +name = "ya-client-model" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a4a2f46bc12b1c747495c7911a844e7dc2c879826993426d568b9b594c26a1" +dependencies = [ + "bigdecimal", + "chrono", + "derive_more", + "rand", + "serde", + "serde_json", + "strum 0.19.5", + "strum_macros 0.19.4", + "thiserror", +] + +[[package]] +name = "ya-core-model" +version = "0.9.0" +source = "git+https://github.com/golemfactory/yagna.git?branch=release/v0.13#f2ba2f1adebf1afc865faee236ff59ff8cdd305c" +dependencies = [ + "chrono", + "derive_more", + "log", + "serde", + "serde_bytes", + "structopt", + "strum 0.24.1", + "strum_macros 0.24.3", + "thiserror", + "ya-client-model", + "ya-service-bus", +] + +[[package]] +name = "ya-packet-trace" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a9e5444475d519a584d2adaf6f281cb3deeb0ceb41503db28be4d081afb714c" +dependencies = [ + "chrono", + "fxhash", + "log", +] + +[[package]] +name = "ya-runtime-ai" +version = "0.1.0" +dependencies = [ + "actix-rt", + "anyhow", + "chrono", + "clap 4.4.6", + "env_logger", + "futures", + "log", + "regex", + "reqwest", + "serde", + "serde_json", + "tokio", + "winapi", + "ya-client-model", + "ya-core-model", + "ya-runtime-api", + "ya-service-bus", + "yansi", +] + +[[package]] +name = "ya-runtime-api" +version = "0.7.1" +source = "git+https://github.com/golemfactory/yagna.git?branch=release/v0.13#f2ba2f1adebf1afc865faee236ff59ff8cdd305c" +dependencies = [ + "anyhow", + "bytes", + "futures", + "log", + "prost 0.10.4", + "prost-build 0.10.4", + "serde", + "serde_json", + "tokio", + "tokio-util", + "url", +] + +[[package]] +name = "ya-sb-proto" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368d7e4b74c11137caa9a1cd2c590459581ea0d1ee5f7dc7c56082476cd38ce6" +dependencies = [ + "bytes", + "prost 0.10.4", + "prost-build 0.7.0", + "thiserror", + "tokio", + "tokio-util", + "url", +] + +[[package]] +name = "ya-sb-util" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c525504f7ca7d13825ef10a44005663b91b4b9f3eeebd6768188884bec78a37d" +dependencies = [ + "actix", + "bitflags 1.3.2", + "futures", + "pin-project", +] + +[[package]] +name = "ya-service-bus" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f791365387355ca43c844e3709bb72e5538db1009ece21cc2ea538a2bb63722" +dependencies = [ + "actix", + "flexbuffers", + "futures", + "lazy_static", + "log", + "miniz_oxide 0.5.4", + "rand", + "semver 0.11.0", + "serde", + "thiserror", + "tokio", + "tokio-util", + "url", + "uuid", + "ya-packet-trace", + "ya-sb-proto", + "ya-sb-util", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" diff --git a/src/process/win.rs b/src/process/win.rs index 8b229ed..cbb480f 100644 --- a/src/process/win.rs +++ b/src/process/win.rs @@ -7,6 +7,8 @@ use winapi::um::handleapi::INVALID_HANDLE_VALUE; #[cfg(target_os = "windows")] use winapi::um::winnt::HANDLE; +use std::{mem, ptr}; + #[cfg(target_os = "windows")] #[derive(Clone, Debug)] pub struct JobObject { From 3c84c3c83e17a35ce31964e67b24d3af5e522a58 Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Tue, 24 Oct 2023 03:28:09 +0200 Subject: [PATCH 08/16] CI cache --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a9b816..f711fd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,8 @@ jobs: toolchain: 1.71.0 components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 + - run: cargo tree --locked - run: cargo fmt --all -- --check From 9ade19440b03ef4ce4726d834d9456e6dc3fdcc7 Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Tue, 24 Oct 2023 23:17:23 +0200 Subject: [PATCH 09/16] Offer with runtime capabilities. Dummy runtime waiting for . --- runtimes/dummy/src/main.rs | 24 +++++++++++++++++++++++- src/offer_template.rs | 5 +++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/runtimes/dummy/src/main.rs b/runtimes/dummy/src/main.rs index 7527576..1ad1f6f 100644 --- a/runtimes/dummy/src/main.rs +++ b/runtimes/dummy/src/main.rs @@ -1,3 +1,25 @@ +use std::io; + fn main() { - println!("hello"); + let mut input = String::new(); + + println!("Dummy"); + + loop { + input.clear(); + + match io::stdin().read_line(&mut input) { + Ok(_) => { + let trimmed_input = input.trim(); + if trimmed_input == "stop" { + println!("Stopping."); + break; + } + } + Err(error) => { + eprintln!("Error reading input: {}", error); + break; + } + } + } } diff --git a/src/offer_template.rs b/src/offer_template.rs index 0b53f39..f50a9b7 100644 --- a/src/offer_template.rs +++ b/src/offer_template.rs @@ -61,9 +61,10 @@ struct OfferTemplate { pub fn template(runtime_name: String) -> anyhow::Result> { let offer_template = include_bytes!("offer-template.json"); let mut template: OfferTemplate = serde_json::from_slice(offer_template.as_ref())?; + let capabilities = vec![serde_json::Value::String(runtime_name)]; template.properties.insert( - "golem.inf.ai.runtime".to_string(), - serde_json::Value::String(runtime_name), + "golem.runtime.capabilities".to_string(), + serde_json::Value::Array(capabilities), ); let devices = parse_devices_info()?; if devices.is_empty() { From 8818d5a310834deba0b9bf1986536fa785213bbd Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Wed, 25 Oct 2023 04:10:21 +0200 Subject: [PATCH 10/16] README.md update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b5186c8..f5fc28d 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,4 @@ Create sample `exeunits-descriptor.json` (with correct `supervisor-path`): Point `ya-provider` to exeunits descriptor using `EXE_UNIT_PATH` variable. `ya-provider` creates on startup a `default` preset for `wasmtime` runtime. -Update it: `ya-provider.exe preset update --name default --no-interactive --exe-unit ai-dummy --price Duration=1.2 CPU=3.4 "Init price=0.00001"` +Update it: `ya-provider.exe preset update --name default --no-interactive --exe-unit ai --price Duration=0.0001 CPU=0.0001 "Init price=0.0000000000000001"` From 6a155e7dfd140be8758501008e63de0e81cc724d Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Wed, 25 Oct 2023 22:40:50 +0200 Subject: [PATCH 11/16] Logging --- Cargo.lock | 39 +++++++++++++++++++ Cargo.toml | 16 ++++---- runtimes/dummy/src/main.rs | 2 +- src/logger.rs | 79 ++++++++++++++++++++++++++++++++++++++ src/main.rs | 30 +++++++++++++-- 5 files changed, 155 insertions(+), 11 deletions(-) create mode 100644 src/logger.rs diff --git a/Cargo.lock b/Cargo.lock index 700f4f6..b8e1f61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -395,6 +395,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + [[package]] name = "dummy" version = "0.1.0" @@ -474,6 +480,22 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "flexi_logger" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1984eeb4ccb9a6f3fa5f2a1850d34afed6fd4ffcd1513b691eef9dda0f057" +dependencies = [ + "chrono", + "glob", + "is-terminal", + "lazy_static", + "log", + "nu-ansi-term", + "regex", + "thiserror", +] + [[package]] name = "fnv" version = "1.0.7" @@ -619,6 +641,12 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "h2" version = "0.3.21" @@ -968,6 +996,15 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nu-ansi-term" +version = "0.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c073d3c1930d0751774acf49e66653acecb416c3a54c6ec095a9b11caddb5a68" +dependencies = [ + "windows-sys", +] + [[package]] name = "num-bigint" version = "0.3.3" @@ -2301,7 +2338,9 @@ dependencies = [ "anyhow", "chrono", "clap 4.4.6", + "dotenv", "env_logger", + "flexi_logger", "futures", "log", "regex", diff --git a/Cargo.toml b/Cargo.toml index a6e069e..1a35e7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,18 +17,20 @@ ya-service-bus = "0.6.1" ya-client-model = "0.5.0" actix-rt="2" -log = "0.4.8" +log = "0.4" serde = { version = "^1.0", features = ["derive"] } serde_json = "1.0" clap = { version = "4", features = ["derive", "env"] } -anyhow = "1.0.19" -env_logger="0.10.0" -yansi = "0.5.0" +dotenv = "0.15" +anyhow = "1.0" +env_logger="0.10" +yansi = "0.5" chrono = "0.4" tokio = { version = "1.32", features = ["macros"] } -futures = "0.3.28" +futures = "0.3" +flexi_logger = { version = "0.27", features = ["colors"] } regex = "1" -reqwest="0.11.22" +reqwest="0.11" [target.'cfg(target_os = "windows")'.dependencies] -winapi = { version = "0.3.9", features = ["jobapi2", "processthreadsapi"] } +winapi = { version = "0.3", features = ["jobapi2", "processthreadsapi"] } diff --git a/runtimes/dummy/src/main.rs b/runtimes/dummy/src/main.rs index 1ad1f6f..74c5ab7 100644 --- a/runtimes/dummy/src/main.rs +++ b/runtimes/dummy/src/main.rs @@ -18,7 +18,7 @@ fn main() { } Err(error) => { eprintln!("Error reading input: {}", error); - break; + // break; } } } diff --git a/src/logger.rs b/src/logger.rs new file mode 100644 index 0000000..d9cd425 --- /dev/null +++ b/src/logger.rs @@ -0,0 +1,79 @@ +use chrono::{DateTime, Local}; +use flexi_logger::{DeferredNow, Record}; +use std::time::SystemTime; + +const ENV_VAR_LOG_DIR: &str = "EXE_UNIT_LOG_DIR"; +const ENV_VAR_FILE_LOG_LEVEL: &str = "EXE_UNIT_FILE_LOG_LEVEL"; + +const DEFAULT_LOG_LEVEL: &str = "info"; +const DEFAULT_FILE_LOG_LEVEL: &str = "debug"; +const DEFAULT_LOG_DIR: &str = "logs"; +const DEFAULT_LOG_FORMAT: &str = "%Y-%m-%dT%H:%M:%S%.3f%z"; + +pub fn start_file_logger() -> anyhow::Result { + let log_dir = std::env::var(ENV_VAR_LOG_DIR).unwrap_or_else(|_| DEFAULT_LOG_DIR.to_string()); + let log_level = std::env::var(ENV_VAR_FILE_LOG_LEVEL) + .unwrap_or_else(|_| DEFAULT_FILE_LOG_LEVEL.to_string()); + + Ok(build_logger(Some(log_level))? + .log_to_file(flexi_logger::FileSpec::default().directory(log_dir)) + .duplicate_to_stderr(log_tty_dup_level()?) + .start()?) +} + +pub fn start_logger() -> anyhow::Result { + Ok(build_logger(Option::::None)?.start()?) +} + +fn build_logger(log_level: Option) -> anyhow::Result { + let level = match log_level { + Some(level) => level.to_string(), + None => std::env::var("RUST_LOG").unwrap_or_else(|_| DEFAULT_LOG_LEVEL.to_string()), + }; + + Ok(flexi_logger::Logger::try_with_str(level)? + .format(log_format) + .format_for_stderr(flexi_logger::colored_opt_format)) +} + +fn log_tty_dup_level() -> anyhow::Result { + use flexi_logger::Duplicate; + use log::LevelFilter; + + let level_filter = flexi_logger::LogSpecification::env_or_parse(DEFAULT_LOG_LEVEL)? + .module_filters() + .iter() + .find(|f| f.module_name.is_none()) + .map(|f| f.level_filter) + .unwrap_or(LevelFilter::Off); + + Ok(match level_filter { + LevelFilter::Off => Duplicate::None, + LevelFilter::Trace => Duplicate::Trace, + LevelFilter::Debug => Duplicate::Debug, + LevelFilter::Info => Duplicate::Info, + LevelFilter::Warn => Duplicate::Warn, + LevelFilter::Error => Duplicate::Error, + }) +} + +fn log_format( + w: &mut dyn std::io::Write, + now: &mut DeferredNow, + record: &Record, +) -> Result<(), std::io::Error> { + //use DateTime:: instead of DateTime:: to obtain local date + let now = SystemTime::from(*now.now()); + let local_date = DateTime::::from(now); + //format date as following: 2020-08-27T07:56:22.348+02:00 (local date + time zone with milliseconds precision) + let date_format = local_date.format(DEFAULT_LOG_FORMAT); + + write!( + w, + "[{} {:5} {}] {}", + date_format, + record.level(), + record.module_path().unwrap_or(""), + record.args() + ) +} diff --git a/src/main.rs b/src/main.rs index 390cf69..d9d7186 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,10 +20,12 @@ use ya_service_bus::typed as gsb; use crate::agreement::AgreementDesc; use crate::cli::*; +use crate::logger::*; use crate::process::ProcessController; mod agreement; mod cli; +mod logger; mod offer_template; mod process; @@ -102,14 +104,37 @@ async fn activity_loop( #[actix_rt::main] async fn main() -> anyhow::Result<()> { - let cli = Cli::parse(); + let panic_hook = std::panic::take_hook(); + std::panic::set_hook(Box::new(move |e| { + log::error!("AI Runtime panic: {e}"); + panic_hook(e) + })); + + if let Err(error) = start_file_logger() { + start_logger().expect("Failed to start logging"); + log::warn!("Using fallback logging due to an error: {:?}", error); + }; + + let cli = match Cli::try_parse() { + Ok(cli) => cli, + Err(err) => { + log::error!("Failed to parse CLI: {}", err); + err.exit(); + } + }; + match cli.runtime.to_lowercase().as_str() { "dummy" => run::(cli).await, - _ => anyhow::bail!("Unsupported framework {}", cli.runtime), + _ => { + let err = anyhow::format_err!("Unsupported framework {}", cli.runtime); + log::error!("{}", err); + anyhow::bail!(err) + } } } async fn run(cli: Cli) -> anyhow::Result<()> { + dotenv::dotenv().ok(); let args: Vec = env::args().collect(); let (exe_unit_url, report_url, activity_id, agreement_path) = match &cli.command { @@ -160,7 +185,6 @@ async fn run(cli: Cli) -> anyhow: } }; - env_logger::builder().format_indent(Some(4)).init(); log::info!("{:?}", args); log::info!("CLI args: {:?}", &cli); log::info!("Binding to GSB ..."); From d4814c70e1166b69493512557ec82e0f686d3ddd Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Fri, 27 Oct 2023 01:43:33 +0200 Subject: [PATCH 12/16] service-bus command args bugfix --- src/cli.rs | 2 -- src/main.rs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index a3fc781..15d07c6 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -37,10 +37,8 @@ pub enum Command { /// Bind to Service Bus ServiceBus { /// ExeUnit service ID - #[arg(long, short)] service_id: String, /// ExeUnit daemon GSB URL - #[arg(long, short)] report_url: String, #[command(flatten)] args: RunArgs, diff --git a/src/main.rs b/src/main.rs index d9d7186..3cd04d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -114,7 +114,7 @@ async fn main() -> anyhow::Result<()> { start_logger().expect("Failed to start logging"); log::warn!("Using fallback logging due to an error: {:?}", error); }; - + log::debug!("CLI args: {:?}", std::env::args_os()); let cli = match Cli::try_parse() { Ok(cli) => cli, Err(err) => { From 09fc708f1a8c0605ca5c32bf328ae44d5f1466b0 Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Fri, 27 Oct 2023 06:22:40 +0200 Subject: [PATCH 13/16] CLI logs --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3cd04d1..a43df34 100644 --- a/src/main.rs +++ b/src/main.rs @@ -114,7 +114,7 @@ async fn main() -> anyhow::Result<()> { start_logger().expect("Failed to start logging"); log::warn!("Using fallback logging due to an error: {:?}", error); }; - log::debug!("CLI args: {:?}", std::env::args_os()); + log::debug!("Raw CLI args: {:?}", std::env::args_os()); let cli = match Cli::try_parse() { Ok(cli) => cli, Err(err) => { @@ -238,6 +238,7 @@ async fn run(cli: Cli) -> anyhow: }); } ExeScriptCommand::Start { args, .. } => { + log::debug!("Start cmd args: {args:?}"); let args = process::RuntimeArgs::new(args).map_err(|e| { RpcMessageError::Activity(format!("invalid args: {}", e)) })?; @@ -295,7 +296,7 @@ async fn run(cli: Cli) -> anyhow: } cmd => { return Err(RpcMessageError::Activity(format!( - "invalid command for mining exe-unit: {:?}", + "invalid command for ai runtime: {:?}", cmd ))) } From 49307a5a12ec9dcea65c7049cdc03189becaaad0 Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Fri, 27 Oct 2023 08:11:46 +0200 Subject: [PATCH 14/16] Runtime framework start with '--model' arg. --- runtimes/dummy/src/main.rs | 4 +++- src/main.rs | 6 ++++-- src/process.rs | 6 ++++-- src/process/dummy.rs | 11 ++++++++--- src/process/win.rs | 1 + 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/runtimes/dummy/src/main.rs b/runtimes/dummy/src/main.rs index 74c5ab7..a83cf56 100644 --- a/runtimes/dummy/src/main.rs +++ b/runtimes/dummy/src/main.rs @@ -1,9 +1,11 @@ +use std::env; use std::io; fn main() { let mut input = String::new(); + let args: Vec = env::args().collect(); - println!("Dummy"); + println!("Dummy runtime. Args: {args:?}"); loop { input.clear(); diff --git a/src/main.rs b/src/main.rs index a43df34..efc77e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -238,10 +238,11 @@ async fn run(cli: Cli) -> anyhow: }); } ExeScriptCommand::Start { args, .. } => { - log::debug!("Start cmd args: {args:?}"); - let args = process::RuntimeArgs::new(args).map_err(|e| { + log::debug!("Raw Start cmd args: {args:?}"); + let args = T::parse_args(args).map_err(|e| { RpcMessageError::Activity(format!("invalid args: {}", e)) })?; + log::debug!("Start cmd model: {}", args.model); send_state( &report_url, @@ -255,6 +256,7 @@ async fn run(cli: Cli) -> anyhow: .start(&args) .await .map_err(|e| RpcMessageError::Activity(e.to_string()))?; + log::debug!("Started process"); send_state( &report_url, diff --git a/src/process.rs b/src/process.rs index 9eabe5f..769aeff 100644 --- a/src/process.rs +++ b/src/process.rs @@ -20,6 +20,8 @@ pub struct Shares { } pub trait Runtime { + fn parse_args(args: &[String]) -> anyhow::Result; + fn start(args: &RuntimeArgs) -> anyhow::Result; fn run(stdout: ChildStdout, report_fn: ReportFn); @@ -33,8 +35,8 @@ pub struct RuntimeArgs { } impl RuntimeArgs { - pub fn new(args: &[String]) -> anyhow::Result { - Ok(Self::try_parse_from(args)?) + pub fn new(cmd: &String, args: &[String]) -> anyhow::Result { + Ok(Self::try_parse_from(std::iter::once(cmd).chain(args))?) } } diff --git a/src/process/dummy.rs b/src/process/dummy.rs index 6c66c39..f6fdc58 100644 --- a/src/process/dummy.rs +++ b/src/process/dummy.rs @@ -11,14 +11,19 @@ pub struct Dummy {} impl Unpin for Dummy {} impl Runtime for Dummy { - fn start(_args: &RuntimeArgs) -> anyhow::Result { + fn parse_args(args: &[String]) -> anyhow::Result { + RuntimeArgs::new(&"dummy.exe".into(), args) + } + + fn start(args: &RuntimeArgs) -> anyhow::Result { let exe = super::find_exe("dummy.exe")?; let mut cmd = Command::new(&exe); let work_dir = exe.parent().unwrap(); cmd.stdout(Stdio::piped()) .stdin(Stdio::null()) - .current_dir(work_dir); - + .current_dir(work_dir) + .arg("--model") + .arg(&args.model); Ok(cmd.kill_on_drop(true).spawn()?) } diff --git a/src/process/win.rs b/src/process/win.rs index cbb480f..820c26d 100644 --- a/src/process/win.rs +++ b/src/process/win.rs @@ -7,6 +7,7 @@ use winapi::um::handleapi::INVALID_HANDLE_VALUE; #[cfg(target_os = "windows")] use winapi::um::winnt::HANDLE; +#[cfg(target_os = "windows")] use std::{mem, ptr}; #[cfg(target_os = "windows")] From ee7e9b489e2105e5bbae86ccecb9bbd814ddf2a8 Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Mon, 30 Oct 2023 19:56:47 +0100 Subject: [PATCH 15/16] Sample config update --- conf/ya-runtime-ai.json | 50 ++++++++--------------------------------- 1 file changed, 9 insertions(+), 41 deletions(-) diff --git a/conf/ya-runtime-ai.json b/conf/ya-runtime-ai.json index 0ba5819..a94a26f 100644 --- a/conf/ya-runtime-ai.json +++ b/conf/ya-runtime-ai.json @@ -1,43 +1,11 @@ [ - { - "name": "ai", - "version": "0.1.0", - "supervisor-path": "ya-runtime-ai", - "description": "Golem ai (PoC)", - "extra-args": [], - "config": { - "counters": { - "golem.usage.mining.hash": { - "name": "share", - "description": "Hash share normalized to 1GH", - "price": true - }, - "golem.usage.mining.share": { - "name": "raw-share", - "description": "Share count", - "price": false - }, - "golem.usage.mining.stale-share": { - "name": "stale-share", - "description": "Stale share count", - "price": false - }, - "golem.usage.mining.invalid-share": { - "name": "invalid-share", - "description": "Invalid share count", - "price": false - }, - "golem.usage.mining.hash-rate": { - "name": "hash-rate", - "description": "Current hashrate", - "price": false - }, - "golem.usage.duration_sec": { - "name": "duration", - "description": "Duration", - "price": true - } - } - } - } + { + "name": "ai-dummy", + "version": "0.1.0", + "supervisor-path": "[..]\\ya-runtime-ai\\target\\debug\\ya-runtime-ai.exe", + "extra-args": ["--runtime", "dummy"], + "description": "dummy ai runtime", + "properties": { + } + } ] From 4362c0cc490a59b84edca98e508e368d3278e6ac Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Mon, 30 Oct 2023 19:58:11 +0100 Subject: [PATCH 16/16] 'Usage' struct. Typo fix. --- src/cli.rs | 2 +- src/main.rs | 4 ++-- src/process.rs | 8 ++++---- src/process/dummy.rs | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 15d07c6..93167af 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -10,7 +10,7 @@ pub struct Cli { /// Runtime binary path #[arg(long, short)] pub binary: Option, - /// Runtime pavkage name + /// Runtime package name #[arg(long, short)] pub runtime: String, #[command(subcommand)] diff --git a/src/main.rs b/src/main.rs index efc77e9..e47b8cc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,7 +43,7 @@ async fn send_state( .await??) } -async fn activity_loop( +async fn activity_loop( report_url: &str, activity_id: &str, mut process: ProcessController, @@ -133,7 +133,7 @@ async fn main() -> anyhow::Result<()> { } } -async fn run(cli: Cli) -> anyhow::Result<()> { +async fn run(cli: Cli) -> anyhow::Result<()> { dotenv::dotenv().ok(); let args: Vec = env::args().collect(); diff --git a/src/process.rs b/src/process.rs index 769aeff..03b0595 100644 --- a/src/process.rs +++ b/src/process.rs @@ -15,16 +15,16 @@ pub mod dummy; pub mod win; #[derive(Default, Clone)] -pub struct Shares { +pub struct Usage { pub cnt: u64, } -pub trait Runtime { +pub trait AiFramework { fn parse_args(args: &[String]) -> anyhow::Result; fn start(args: &RuntimeArgs) -> anyhow::Result; - fn run(stdout: ChildStdout, report_fn: ReportFn); + fn run(stdout: ChildStdout, report_fn: ReportFn); } #[derive(Parser)] @@ -70,7 +70,7 @@ pub fn find_exe(file_name: impl AsRef) -> std::io::Result { .ok_or_else(|| std::io::ErrorKind::NotFound.into()) } -impl ProcessController { +impl ProcessController { pub fn new() -> Self { ProcessController { inner: Rc::new(RefCell::new(ProcessControllerInner::Deployed {})), diff --git a/src/process/dummy.rs b/src/process/dummy.rs index f6fdc58..f9d3b13 100644 --- a/src/process/dummy.rs +++ b/src/process/dummy.rs @@ -3,14 +3,14 @@ use std::process::Stdio; use tokio::io::{AsyncBufReadExt, BufReader}; use tokio::process::{Child, ChildStdout, Command}; -use super::{Runtime, RuntimeArgs, Shares}; +use super::{AiFramework, RuntimeArgs, Usage}; #[derive(Clone)] pub struct Dummy {} impl Unpin for Dummy {} -impl Runtime for Dummy { +impl AiFramework for Dummy { fn parse_args(args: &[String]) -> anyhow::Result { RuntimeArgs::new(&"dummy.exe".into(), args) } @@ -27,7 +27,7 @@ impl Runtime for Dummy { Ok(cmd.kill_on_drop(true).spawn()?) } - fn run(stdout: ChildStdout, _report_fn: ReportFn) { + fn run(stdout: ChildStdout, _report_fn: ReportFn) { tokio::task::spawn_local(async move { let mut stdout = BufReader::new(stdout); loop {