diff --git a/Cargo.lock b/Cargo.lock index 5cd7c60..9f6cd31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,9 +46,9 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.4.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92ef85799cba03f76e4f7c10f533e66d87c9a7e7055f3391f09000ad8351bc9" +checksum = "129d4c88e98860e1758c5de288d1632b07970a16d59bdf7b8d66053d582bb71f" dependencies = [ "actix-codec", "actix-rt", @@ -90,14 +90,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] name = "actix-router" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" +checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511" dependencies = [ "bytestring", "http", @@ -181,9 +181,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.4.0" +version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4a5b5e29603ca8c94a77c65cf874718ceb60292c5a5c3e5f4ace041af462b9" +checksum = "e43428f3bf11dee6d166b00ec2df4e3aa8cc1606aaa0b7433c146852e2f4e03b" dependencies = [ "actix-codec", "actix-http", @@ -228,7 +228,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] @@ -239,7 +239,7 @@ checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] @@ -259,9 +259,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if 1.0.0", "getrandom", @@ -368,9 +368,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.76" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "async-compression" @@ -391,13 +391,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.75" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] @@ -419,9 +419,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "awc" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa3c705a9c7917ac0f41c0757a0a747b43bbc29b0b364b081bd7c5fc67fb223" +checksum = "b625cad34428b3b82d0bd548b26a1cd0a3d70b6109e9b4e3355d8f1802a8b1c6" dependencies = [ "actix-codec", "actix-http", @@ -550,9 +550,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "serde", @@ -682,9 +682,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.11" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" dependencies = [ "clap_builder", "clap_derive", @@ -692,9 +692,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstream", "anstyle", @@ -711,7 +711,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] @@ -788,9 +788,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" +checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -798,9 +798,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if 1.0.0", ] @@ -817,9 +817,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -1044,9 +1044,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1059,9 +1059,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1069,15 +1069,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1086,38 +1086,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures 0.1.31", "futures-channel", @@ -1174,12 +1174,12 @@ dependencies = [ [[package]] name = "gftp" version = "0.4.0" -source = "git+https://github.com/golemfactory/yagna.git?rev=6fd7b003e3d0947284d47d99b2944d293d329c53#6fd7b003e3d0947284d47d99b2944d293d329c53" +source = "git+https://github.com/golemfactory/yagna.git?rev=1428ffe17b5ebf679863fb84576a6e8a7fe97c9a#1428ffe17b5ebf679863fb84576a6e8a7fe97c9a" dependencies = [ "actix-rt", "anyhow", "digest 0.8.1", - "futures 0.3.29", + "futures 0.3.30", "log", "rand 0.8.5", "serde", @@ -1217,7 +1217,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] @@ -1394,9 +1394,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1459,13 +1459,13 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi 0.3.3", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1606,9 +1606,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "metrics" @@ -1747,9 +1747,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -1768,9 +1768,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "openssl" -version = "0.10.61" +version = "0.10.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" +checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" dependencies = [ "bitflags 2.4.1", "cfg-if 1.0.0", @@ -1789,7 +1789,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] @@ -1800,9 +1800,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.97" +version = "0.9.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" +checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" dependencies = [ "cc", "libc", @@ -1962,9 +1962,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db" dependencies = [ "unicode-ident", ] @@ -2077,9 +2077,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2343,11 +2343,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2415,38 +2415,38 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.193" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "8bb1879ea93538b78549031e2d54da3e901fd7e75f2e4dc758d760937b123d10" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "6fbd975230bada99c8bb618e0c365c2eefa219158d5c6c29610fd09ff1833257" dependencies = [ "itoa", "ryu", @@ -2627,9 +2627,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.42" +version = "2.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d0a2c048d661a1a59fcd7355baa232f7ed34e0ee4df2eef3c1c1c0d3852d8" +checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e" dependencies = [ "proc-macro2", "quote", @@ -2669,15 +2669,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if 1.0.0", "fastrand", "redox_syscall 0.4.1", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2700,22 +2700,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.51" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.51" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] @@ -2809,7 +2809,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] @@ -3092,7 +3092,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", "wasm-bindgen-shared", ] @@ -3126,7 +3126,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3198,11 +3198,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -3339,9 +3339,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.30" +version = "0.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" +checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" dependencies = [ "memchr", ] @@ -3358,9 +3358,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dae5072fe1f8db8f8d29059189ac175196e410e40ba42d5d4684ae2f750995" +checksum = "914566e6413e7fa959cc394fb30e563ba80f3541fbd40816d4c05a0fc3f2a0f1" dependencies = [ "libc", "linux-raw-sys", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "ya-core-model" version = "0.9.0" -source = "git+https://github.com/golemfactory/yagna.git?rev=6fd7b003e3d0947284d47d99b2944d293d329c53#6fd7b003e3d0947284d47d99b2944d293d329c53" +source = "git+https://github.com/golemfactory/yagna.git?rev=1428ffe17b5ebf679863fb84576a6e8a7fe97c9a#1428ffe17b5ebf679863fb84576a6e8a7fe97c9a" dependencies = [ "chrono", "derive_more", @@ -3475,11 +3475,11 @@ dependencies = [ "actix-rt", "anyhow", "chrono", - "clap 4.4.11", + "clap 4.4.12", "dotenv", "env_logger", "flexi_logger", - "futures 0.3.29", + "futures 0.3.30", "log", "regex", "reqwest", @@ -3489,7 +3489,7 @@ dependencies = [ "winapi", "ya-agreement-utils", "ya-client-model", - "ya-core-model 0.9.0 (git+https://github.com/golemfactory/yagna.git?rev=6fd7b003e3d0947284d47d99b2944d293d329c53)", + "ya-core-model 0.9.0 (git+https://github.com/golemfactory/yagna.git?rev=1428ffe17b5ebf679863fb84576a6e8a7fe97c9a)", "ya-runtime-api", "ya-service-bus", "ya-transfer", @@ -3499,11 +3499,11 @@ dependencies = [ [[package]] name = "ya-runtime-api" version = "0.7.1" -source = "git+https://github.com/golemfactory/yagna.git?rev=6fd7b003e3d0947284d47d99b2944d293d329c53#6fd7b003e3d0947284d47d99b2944d293d329c53" +source = "git+https://github.com/golemfactory/yagna.git?rev=1428ffe17b5ebf679863fb84576a6e8a7fe97c9a#1428ffe17b5ebf679863fb84576a6e8a7fe97c9a" dependencies = [ "anyhow", "bytes 1.5.0", - "futures 0.3.29", + "futures 0.3.30", "log", "prost 0.10.4", "prost-build 0.10.4", @@ -3538,7 +3538,7 @@ checksum = "c525504f7ca7d13825ef10a44005663b91b4b9f3eeebd6768188884bec78a37d" dependencies = [ "actix", "bitflags 1.3.2", - "futures 0.3.29", + "futures 0.3.30", "pin-project", ] @@ -3550,7 +3550,7 @@ checksum = "0f791365387355ca43c844e3709bb72e5538db1009ece21cc2ea538a2bb63722" dependencies = [ "actix", "flexbuffers", - "futures 0.3.29", + "futures 0.3.30", "lazy_static", "log", "miniz_oxide 0.5.4", @@ -3570,7 +3570,7 @@ dependencies = [ [[package]] name = "ya-transfer" version = "0.3.0" -source = "git+https://github.com/golemfactory/yagna.git?rev=6fd7b003e3d0947284d47d99b2944d293d329c53#6fd7b003e3d0947284d47d99b2944d293d329c53" +source = "git+https://github.com/golemfactory/yagna.git?rev=1428ffe17b5ebf679863fb84576a6e8a7fe97c9a#1428ffe17b5ebf679863fb84576a6e8a7fe97c9a" dependencies = [ "actix", "actix-http", @@ -3581,7 +3581,7 @@ dependencies = [ "async-trait", "awc", "bytes 1.5.0", - "futures 0.3.29", + "futures 0.3.30", "gftp", "globset", "h2", @@ -3612,16 +3612,16 @@ dependencies = [ [[package]] name = "ya-utils-futures" version = "0.3.0" -source = "git+https://github.com/golemfactory/yagna.git?rev=6fd7b003e3d0947284d47d99b2944d293d329c53#6fd7b003e3d0947284d47d99b2944d293d329c53" +source = "git+https://github.com/golemfactory/yagna.git?rev=1428ffe17b5ebf679863fb84576a6e8a7fe97c9a#1428ffe17b5ebf679863fb84576a6e8a7fe97c9a" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "tokio", ] [[package]] name = "ya-utils-path" version = "0.1.0" -source = "git+https://github.com/golemfactory/yagna.git?rev=6fd7b003e3d0947284d47d99b2944d293d329c53#6fd7b003e3d0947284d47d99b2944d293d329c53" +source = "git+https://github.com/golemfactory/yagna.git?rev=1428ffe17b5ebf679863fb84576a6e8a7fe97c9a#1428ffe17b5ebf679863fb84576a6e8a7fe97c9a" dependencies = [ "anyhow", "directories", @@ -3660,7 +3660,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.46", ] [[package]] @@ -3681,20 +3681,19 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "6.0.6" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" dependencies = [ - "libc", "zstd-sys", ] diff --git a/Cargo.toml b/Cargo.toml index a2ccd0a..012cb22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,12 +11,12 @@ members = [ ] [dependencies] -ya-core-model = { git = "https://github.com/golemfactory/yagna.git", rev = "6fd7b003e3d0947284d47d99b2944d293d329c53", features = ["activity", "appkey"] } -ya-runtime-api = { git = "https://github.com/golemfactory/yagna.git", rev = "6fd7b003e3d0947284d47d99b2944d293d329c53" } +ya-core-model = { git = "https://github.com/golemfactory/yagna.git", rev = "1428ffe17b5ebf679863fb84576a6e8a7fe97c9a", features = ["activity", "appkey"] } +ya-runtime-api = { git = "https://github.com/golemfactory/yagna.git", rev = "1428ffe17b5ebf679863fb84576a6e8a7fe97c9a" } ya-service-bus = "0.6.1" ya-client-model = "0.5.0" ya-agreement-utils = "0.5" -ya-transfer = { git = "https://github.com/golemfactory/yagna.git", rev = "6fd7b003e3d0947284d47d99b2944d293d329c53" } +ya-transfer = { git = "https://github.com/golemfactory/yagna.git", rev = "1428ffe17b5ebf679863fb84576a6e8a7fe97c9a" } actix = "0.13" actix-rt = "2" diff --git a/src/batches.rs b/src/batches.rs new file mode 100644 index 0000000..d4d1ae4 --- /dev/null +++ b/src/batches.rs @@ -0,0 +1,91 @@ +use chrono::Utc; +use std::cell::RefCell; +use std::collections::HashMap; +use std::rc::Rc; +use ya_client_model::activity::{CommandResult, ExeScriptCommandResult}; +use ya_transfer::transfer::Progress; + +#[derive(Clone, Default)] +pub struct Batches { + pub results: Rc>>>, +} + +#[derive(Clone)] +pub struct Batch { + id: String, + pub(crate) results: Rc>>>, +} + +impl Batches { + pub fn start_batch(&self, id: &str) -> Batch { + let _ = self + .results + .borrow_mut() + .entry(id.to_string()) + .or_insert(vec![]); + Batch { + id: id.to_string(), + results: self.results.clone(), + } + } + + pub fn results(&self, id: &str) -> Option> { + self.results.borrow().get(id).cloned() + } +} + +impl Batch { + pub fn id(&self) -> String { + self.id.clone() + } + pub fn finish(&self) { + if let Some(results) = self.results.borrow_mut().get_mut(&self.id) { + if let Some(last) = results.last_mut() { + last.is_batch_finished = true; + } else { + results.push(ExeScriptCommandResult { + index: results.len() as u32, + result: CommandResult::Error, + stdout: None, + stderr: None, + message: None, + is_batch_finished: true, + event_date: Utc::now(), + }) + } + } + } + + pub fn ok_result(&self) -> usize { + self.add_result(CommandResult::Ok, None) + } + pub fn err_result(&self, message: Option) -> usize { + self.add_result(CommandResult::Ok, message) + } + + pub fn update_progress(&self, index: usize, progress: &Progress) { + if let Some(results) = self.results.borrow_mut().get_mut(&self.id) { + if let Some(result) = results.get_mut(index) { + if let Ok(message) = serde_json::to_string(&progress) { + result.message = Some(message); + } + } + } + } + fn add_result(&self, result: CommandResult, message: Option) -> usize { + if let Some(results) = self.results.borrow_mut().get_mut(&self.id) { + let index = results.len() as u32; + results.push(ExeScriptCommandResult { + index, + result, + stdout: None, + stderr: None, + message, + is_batch_finished: false, + event_date: Utc::now(), + }); + return index as usize; + } + 0 + } +} diff --git a/src/main.rs b/src/main.rs index f7d4c37..c0bee10 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,8 @@ #![allow(dead_code)] -use std::cell::RefCell; -use std::collections::HashMap; use std::io; use std::io::Write; use std::pin::pin; -use std::rc::Rc; use std::time::Duration; use actix::prelude::*; @@ -14,19 +11,23 @@ use clap::Parser; use futures::prelude::*; use ya_client_model::activity::activity_state::*; +use ya_client_model::activity::ActivityUsage; use ya_client_model::activity::ExeScriptCommand; -use ya_client_model::activity::{ActivityUsage, CommandResult, ExeScriptCommandResult}; use ya_core_model::activity; use ya_core_model::activity::RpcMessageError; use ya_service_bus::typed as gsb; -use ya_transfer::transfer::{DeployImage, Shutdown, TransferService, TransferServiceContext}; +use ya_transfer::transfer::{ + DeployImage, Progress, Shutdown, TransferService, TransferServiceContext, +}; use crate::agreement::AgreementDesc; +use crate::batches::Batches; use crate::cli::*; use crate::logger::*; use crate::process::ProcessController; mod agreement; +mod batches; mod cli; mod logger; mod offer_template; @@ -141,7 +142,7 @@ struct ExeUnitContext { pub transfers: Addr, pub process_controller: ProcessController, - pub batches: Rc>>>, + pub batches: Batches, } async fn run(cli: Cli) -> anyhow::Result<()> { @@ -184,11 +185,11 @@ async fn run(cli: Cli) -> any transfers: TransferService::new(TransferServiceContext { work_dir: args.work_dir.clone(), cache_dir: args.cache_dir.clone(), - task_package: None, + ..TransferServiceContext::default() }) .start(), process_controller: process::ProcessController::::new(), - batches: Rc::new(RefCell::new(Default::default())), + batches: Batches::default(), }; let activity_pinger = activity_loop( @@ -208,19 +209,12 @@ async fn run(cli: Cli) -> any gsb::bind(&exe_unit_url, move |exec: activity::Exec| { let ctx = ctx.clone(); let exec = exec.clone(); - let batch = batch.clone(); let batch_id = exec.batch_id.clone(); - let batch_id_ = exec.batch_id.clone(); - { - let _ = ctx - .batches - .borrow_mut() - .insert(exec.batch_id.clone(), vec![]); - } + let batch = ctx.batches.start_batch(&exec.batch_id); + let batch_ = batch.clone(); let script_future = async move { - let mut result = Vec::new(); for exe in &exec.exe_script { match exe { ExeScriptCommand::Deploy { .. } => { @@ -239,9 +233,32 @@ async fn run(cli: Cli) -> any ctx.agreement.model ); + let index = batch.ok_result(); + let (tx, mut rx) = + tokio::sync::watch::channel::(Progress::default()); + + let batch_ = batch.clone(); + tokio::task::spawn_local(async move { + while let Ok(_) = rx.changed().await { + let progress = { rx.borrow_and_update().clone() }; + let percent = 100.0 * progress.progress as f64 + / progress.size.unwrap_or(1) as f64; + + log::info!( + "Deploy progress: {percent}% ({}/{})", + progress.progress, + progress.size.unwrap_or(0) + ); + batch_.update_progress(index, &progress); + + tokio::time::sleep(Duration::from_secs(1)).await; + } + }); + ctx.transfers .send(DeployImage { task_package: Some(ctx.agreement.model.clone()), + progress: Some(tx), }) .await .map_err(|e| format!("Failed to send DeployImage: {e}")) @@ -255,16 +272,6 @@ async fn run(cli: Cli) -> any send_state(&ctx, ActivityState::from(StatePair(State::Deployed, None))) .await .map_err(|e| RpcMessageError::Service(e.to_string()))?; - - result.push(ExeScriptCommandResult { - index: result.len() as u32, - result: CommandResult::Ok, - stdout: None, - stderr: None, - message: None, - is_batch_finished: false, - event_date: Utc::now(), - }); } ExeScriptCommand::Start { args, .. } => { log::debug!("Raw Start cmd args: {args:?}"); @@ -291,15 +298,7 @@ async fn run(cli: Cli) -> any .map_err(|e| RpcMessageError::Service(e.to_string()))?; log::info!("Got start command, changing state of exe unit to ready",); - result.push(ExeScriptCommandResult { - index: result.len() as u32, - result: CommandResult::Ok, - stdout: None, - stderr: None, - message: None, - is_batch_finished: false, - event_date: Utc::now(), - }) + batch.ok_result(); } ExeScriptCommand::Terminate { .. } => { ctx.process_controller.stop().await; @@ -310,15 +309,7 @@ async fn run(cli: Cli) -> any ) .await .map_err(|e| RpcMessageError::Service(e.to_string()))?; - result.push(ExeScriptCommandResult { - index: result.len() as u32, - result: CommandResult::Ok, - stdout: None, - stderr: None, - message: None, - is_batch_finished: false, - event_date: Utc::now(), - }); + batch.ok_result(); } cmd => { return Err(RpcMessageError::Activity(format!( @@ -335,37 +326,20 @@ async fn run(cli: Cli) -> any exec.exe_script ); - { - let _ = ctx - .batches - .borrow_mut() - .insert(exec.batch_id.clone(), result); - } - + batch.finish(); Ok(exec.batch_id) } .map_err(move |e| { - let mut bind_batch = batch.borrow_mut(); - let result = bind_batch.entry(batch_id_).or_insert(vec![]); - - let index = result.len() as u32; - result.push(ExeScriptCommandResult { - index, - result: CommandResult::Error, - stdout: None, - stderr: None, - message: Some(e.to_string()), - is_batch_finished: true, - event_date: Utc::now(), - }); + batch_.err_result(Some(e.to_string())); + batch_.finish(); }); tokio::task::spawn_local(script_future); future::ok(batch_id) }); gsb::bind(&exe_unit_url, move |exec: activity::GetExecBatchResults| { - if let Some(result) = batch_results.borrow().get(&exec.batch_id) { - future::ok(result.clone()) + if let Some(result) = batch_results.results(&exec.batch_id) { + future::ok(result) } else { future::err(RpcMessageError::NotFound(format!( "Batch id={}",