From b75871e25d39c90b7975ae51dcfa8be455f9526b Mon Sep 17 00:00:00 2001 From: plazmoid Date: Tue, 24 Oct 2023 14:42:38 +0300 Subject: [PATCH 1/4] impl scheduler --- Cargo.lock | 268 +++++++++++++-------- bin/u_agent/src/lib.rs | 156 ++++++------ integration-tests/tests/fixtures/agent.rs | 2 +- lib/u_lib/Cargo.toml | 2 + lib/u_lib/src/api.rs | 7 +- lib/u_lib/src/jobs.rs | 55 ++--- lib/u_lib/src/lib.rs | 6 +- lib/u_lib/src/models/agent.rs | 4 +- lib/u_lib/src/models/jobs/assigned.rs | 21 +- lib/u_lib/src/models/jobs/meta.rs | 9 + lib/u_lib/src/scheduler/entry.rs | 66 +++++ lib/u_lib/src/scheduler/mod.rs | 187 ++++++++++++++ lib/u_lib/src/scheduler/spawner.rs | 85 +++++++ lib/u_lib/src/{executor.rs => u_runner.rs} | 81 ++++--- 14 files changed, 695 insertions(+), 254 deletions(-) create mode 100644 lib/u_lib/src/scheduler/entry.rs create mode 100644 lib/u_lib/src/scheduler/mod.rs create mode 100644 lib/u_lib/src/scheduler/spawner.rs rename lib/u_lib/src/{executor.rs => u_runner.rs} (72%) diff --git a/Cargo.lock b/Cargo.lock index 9719584..381971d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,7 +46,7 @@ dependencies = [ "actix-utils", "ahash", "base64", - "bitflags 2.4.0", + "bitflags 2.4.1", "brotli", "bytes", "bytestring", @@ -118,7 +118,7 @@ dependencies = [ "futures-core", "futures-util", "mio", - "socket2 0.5.4", + "socket2 0.5.5", "tokio", "tracing", ] @@ -179,7 +179,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "smallvec", - "socket2 0.5.4", + "socket2 0.5.5", "time", "url", ] @@ -219,21 +219,22 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" dependencies = [ "cfg-if 1.0.0", "getrandom", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -285,9 +286,9 @@ checksum = "a26fa4d7e3f2eebadf743988fc8aec9fa9a9e82611acafd77c1462ed6262440a" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", @@ -328,9 +329,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.4" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "bincode" @@ -349,9 +350,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block-buffer" @@ -496,9 +497,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" dependencies = [ "libc", ] @@ -512,6 +513,17 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "cron" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ff76b51e4c068c52bfd2866e1567bee7c567ae8f24ada09fd4307019e25eab7" +dependencies = [ + "chrono", + "nom", + "once_cell", +] + [[package]] name = "crossbeam-channel" version = "0.5.8" @@ -634,9 +646,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] [[package]] name = "derive_more" @@ -657,7 +672,7 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2268a214a6f118fce1838edba3d1561cf0e78d8de785475957a580a7f8c69d33" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "byteorder", "diesel_derives", "itoa", @@ -775,11 +790,10 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys", ] @@ -802,9 +816,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1001,9 +1015,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "headers" @@ -1110,7 +1124,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -1132,16 +1146,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows-core", ] [[package]] @@ -1214,7 +1228,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown 0.14.2", ] [[package]] @@ -1236,9 +1250,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itoa" @@ -1248,9 +1262,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -1313,9 +1327,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "local-channel" @@ -1336,9 +1350,9 @@ checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1422,6 +1436,12 @@ dependencies = [ "unicase", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1433,9 +1453,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "log", @@ -1492,6 +1512,16 @@ dependencies = [ "void", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "ntapi" version = "0.3.7" @@ -1513,9 +1543,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -1551,7 +1581,7 @@ version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "cfg-if 1.0.0", "foreign-types", "libc", @@ -1607,13 +1637,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", "windows-targets", ] @@ -1674,6 +1704,12 @@ version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1721,9 +1757,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -1796,16 +1832,25 @@ 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.9.6" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.9", - "regex-syntax 0.7.5", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -1819,13 +1864,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] @@ -1836,9 +1881,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" @@ -1996,12 +2041,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.17" +version = "0.38.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25469e9ae0f3d0047ca8b93fc56843f38e6774f0914a107ff8b41be8be8e0b7" +checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" dependencies = [ - "bitflags 2.4.0", - "errno 0.3.4", + "bitflags 2.4.1", + "errno 0.3.5", "libc", "linux-raw-sys", "windows-sys", @@ -2109,24 +2154,24 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", @@ -2160,9 +2205,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -2252,9 +2297,9 @@ checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -2262,9 +2307,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys", @@ -2420,7 +2465,7 @@ checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if 1.0.0", "fastrand", - "redox_syscall", + "redox_syscall 0.3.5", "rustix", "windows-sys", ] @@ -2466,12 +2511,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -2509,9 +2555,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", "bytes", @@ -2521,7 +2567,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.4", + "socket2 0.5.5", "tokio-macros", "windows-sys", ] @@ -2608,9 +2654,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -2636,11 +2682,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if 1.0.0", "log", "pin-project-lite", "tracing-attributes", @@ -2660,9 +2705,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -2671,9 +2716,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -2681,12 +2726,12 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -2756,8 +2801,10 @@ name = "u_lib" version = "0.1.0" dependencies = [ "anyhow", + "async-trait", "bincode", "chrono", + "cron", "daemonize", "deadpool-diesel", "diesel", @@ -2909,9 +2956,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" dependencies = [ "getrandom", "serde", @@ -3112,10 +3159,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ "windows-targets", ] @@ -3188,9 +3235,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.16" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711d82167854aff2018dfd193aa0fef5370f456732f0d5a0c59b0f1b4b907" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" dependencies = [ "memchr", ] @@ -3205,6 +3252,26 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "zerocopy" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c19fae0c8a9efc6a8281f2e623db8af1db9e57852e04cde3e754dd2dc29340f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc56589e9ddd1f1c28d4b4b5c773ce232910a6bb67a70133d61c9e347585efe9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "zstd" version = "0.12.4" @@ -3226,11 +3293,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/bin/u_agent/src/lib.rs b/bin/u_agent/src/lib.rs index faa3d3f..7c69c2e 100644 --- a/bin/u_agent/src/lib.rs +++ b/bin/u_agent/src/lib.rs @@ -1,29 +1,29 @@ #[macro_use] extern crate log; -use std::process::exit; use tokio::runtime::Builder; use tokio::time::{sleep, Duration}; +use u_lib::models::PreparedJob; +use u_lib::scheduler::SCHEDULER; +use u_lib::u_runner::URunner; use u_lib::{ api::HttpClient, cache::JobCache, config::{get_self_id, EndpointsEnv, AGENT_ITERATION_INTERVAL}, error::ErrChan, - executor, - jobs::AnonymousJobBatch, logging::init_logger, messaging::Reportable, models::AssignedJobById, }; -async fn process_request(jobs: Vec, client: &HttpClient) { - if !jobs.is_empty() { - for jr in &jobs { - if !JobCache::contains(jr.job_id) { - info!("Fetching job: {}", &jr.job_id); +async fn process_request(assigned_jobs: Vec, client: &HttpClient) { + if !assigned_jobs.is_empty() { + for asgn_job in assigned_jobs { + if !JobCache::contains(asgn_job.job_id) { + info!("Fetching job: {}", &asgn_job.job_id); let mut fetched_job = loop { //todo: use payload cache - match client.get_full_job(jr.job_id).await { + match client.get_full_job(asgn_job.job_id).await { Ok(result) => break result, Err(err) => { debug!("{:?} \nretrying...", err); @@ -33,78 +33,72 @@ async fn process_request(jobs: Vec, client: &HttpClient) { }; if let Some(payload) = &mut fetched_job.payload { if let Err(e) = payload.maybe_split_payload() { - ErrChan::send(e, "pld").await; + ErrChan::send(e, "pay").await; + continue; } } JobCache::insert(fetched_job); } - } - info!( - "Scheduling jobs: {}", - jobs.iter() - .map(|j| j.job_id.to_string()) - .collect::>() - .join(", ") - ); - let meta_with_ids = jobs - .into_iter() - .map(|job| { - let meta = JobCache::get(job.job_id).unwrap().clone(); - (meta, job) - }) - .collect::>(); - - AnonymousJobBatch::from_meta_with_id(meta_with_ids) - .spawn() - .await; - } -} + let job = match JobCache::get(asgn_job.job_id).as_deref() { + Some(job) => job.clone(), + None => continue, + }; + + info!("Scheduling job {}", job.meta.id.to_string()); -async fn error_reporting(client: HttpClient) -> ! { - loop { - match ErrChan::recv().await { - Some(err) => { - 'retry: for _ in 0..3 { - match client.report([Reportable::Error(err.clone())]).await { - Ok(_) => break 'retry, - Err(e) => { - debug!("Reporting error: {:?}", e); - sleep(Duration::from_secs(10)).await; + let schedule = match job.meta.schedule.clone() { + Some(sched) => { + if sched.is_empty() { + None + } else { + match sched.as_str().try_into() { + Ok(s) => Some(s), + Err(err) => { + ErrChan::send(err, "sch").await; + continue; + } } } } - } - None => sleep(Duration::from_secs(3)).await, + None => None, + }; + SCHEDULER + .add_job(schedule, PreparedJob { job, ids: asgn_job }) + .await; } } } -async fn agent_loop(client: HttpClient) -> ! { +async fn error_reporting(client: HttpClient) { + while let Some(err) = ErrChan::recv().await { + let _ = client.report([Reportable::Error(err.clone())]).await; + } +} + +async fn agent_loop(client: HttpClient) { let self_id = get_self_id(); - loop { - match client.get_personal_jobs(self_id).await { - Ok(jobs) => { - process_request(jobs, &client).await; - } - Err(err) => ErrChan::send(err, "processing").await, + + match client.get_personal_jobs(self_id).await { + Ok(jobs) => { + process_request(jobs, &client).await; } + Err(err) => ErrChan::send(err, "pro").await, + } - let result: Vec = executor::pop_completed() - .await - .into_iter() - .map(|result| match result { - Ok(r) => Reportable::Assigned(r), - Err(e) => Reportable::Error(e), - }) - .collect(); - - if !result.is_empty() { - if let Err(err) = client.report(result).await { - ErrChan::send(err, "report").await; - } + let result: Vec = URunner::pop_completed() + .await + .into_iter() + .map(|result| match result { + Ok(r) => Reportable::Assigned(r), + Err(e) => Reportable::Error(e), + }) + .collect(); + + if !result.is_empty() { + if let Err(err) = client.report(result).await { + ErrChan::send(err, "rep").await; } - sleep(AGENT_ITERATION_INTERVAL).await; } } @@ -134,15 +128,33 @@ pub fn run_forever() -> ! { .build() .unwrap() .block_on(async { - match HttpClient::new(&env.u_server, None).await { - Ok(client) => { - tokio::spawn(error_reporting(client.clone())); - agent_loop(client).await - } - Err(e) => { - error!("client init failed: {}", e); - exit(7) // todo: wtf? + let client = loop { + match HttpClient::new(&env.u_server, None).await { + Ok(client) => break client, + Err(e) => { + error!("client init failed: {}", e); + sleep(Duration::from_secs(5)).await; + continue; + } } + }; + { + let client = client.clone(); + SCHEDULER + .add_job(Some("*/3 * * * * * *".try_into().unwrap()), move || { + let client = client.clone(); + error_reporting(client.clone()) + }) + .await; } + + SCHEDULER + .add_job(Some("*/3 * * * * * *".try_into().unwrap()), move || { + let client = client.clone(); + agent_loop(client) + }) + .await; + + SCHEDULER.start_blocking().await }) } diff --git a/integration-tests/tests/fixtures/agent.rs b/integration-tests/tests/fixtures/agent.rs index db67502..07d912c 100644 --- a/integration-tests/tests/fixtures/agent.rs +++ b/integration-tests/tests/fixtures/agent.rs @@ -25,7 +25,7 @@ pub fn registered_agent(client: &HttpClient) -> RegisteredAgent { assert_eq!(job.meta.alias, Some("agent_hello".to_string())); - let mut agent_data = AssignedJob::from((&job.meta, resp)); + let mut agent_data = AssignedJob::from(&PreparedJob { job, ids: resp }); agent_data.set_result(&agent); client diff --git a/lib/u_lib/Cargo.toml b/lib/u_lib/Cargo.toml index 8cf77d7..e091b62 100644 --- a/lib/u_lib/Cargo.toml +++ b/lib/u_lib/Cargo.toml @@ -33,6 +33,8 @@ uuid = { workspace = true, features = ["serde", "v4"] } parking_lot = "0.12.1" bincode = "1.3.3" sha3 = "0.10.7" +cron = "0.12.0" +async-trait = "0.1.74" [target.'cfg(unix)'.dependencies] daemonize = "0.5" diff --git a/lib/u_lib/src/api.rs b/lib/u_lib/src/api.rs index e0e9771..48ac150 100644 --- a/lib/u_lib/src/api.rs +++ b/lib/u_lib/src/api.rs @@ -233,11 +233,8 @@ impl HttpClient { &self, assigned: impl IntoIterator, ) -> Result { - self.req_with_payload( - format!("assign_jobs"), - &assigned.into_iter().collect::>(), - ) - .await + self.req_with_payload("assign_jobs", &assigned.into_iter().collect::>()) + .await } /// get jobs for any agent by job_id, agent_id or result_id diff --git a/lib/u_lib/src/jobs.rs b/lib/u_lib/src/jobs.rs index 899aa67..9e4f42d 100644 --- a/lib/u_lib/src/jobs.rs +++ b/lib/u_lib/src/jobs.rs @@ -1,26 +1,26 @@ use crate::{ combined_result::CombinedResult, - executor::{ExecResult, Waiter}, - models::{Agent, AssignedJob, AssignedJobById, Job, JobType, RawJob}, + models::{Agent, AssignedJob, AssignedJobById, Job, JobType, PreparedJob, RawJob}, proc_output::ProcOutput, + u_runner::{ExecResult, URunner}, }; use std::collections::HashMap; use std::process::exit; use tokio::process::Command; pub struct AnonymousJobBatch { - waiter: Waiter, + runner: URunner, is_running: bool, } impl AnonymousJobBatch { - pub fn from_meta_with_id(jobs: impl IntoIterator) -> Self { - let mut waiter = Waiter::new(); - for (job, ids) in jobs { - waiter.push(run_assigned_job(job, ids)); + pub fn from_prepared_jobs(jobs: impl IntoIterator) -> Self { + let mut runner = URunner::new(); + for job in jobs { + runner.push(run_assigned_job(job)); } Self { - waiter, + runner, is_running: false, } } @@ -28,36 +28,33 @@ impl AnonymousJobBatch { pub fn from_meta(jobs: impl IntoIterator) -> Self { let jobs_ids: Vec<_> = jobs .into_iter() - .map(|job| { - let job_id = job.meta.id; - ( - job, - AssignedJobById { - job_id, - ..Default::default() - }, - ) + .map(|job| PreparedJob { + ids: AssignedJobById { + job_id: job.meta.id, + ..Default::default() + }, + job, }) .collect(); - AnonymousJobBatch::from_meta_with_id(jobs_ids) + AnonymousJobBatch::from_prepared_jobs(jobs_ids) } /// Spawn jobs pub async fn spawn(mut self) -> Self { debug!("spawning jobs"); - self.waiter = self.waiter.spawn().await; + self.runner = self.runner.spawn().await; self.is_running = true; self } /// Spawn jobs and wait for result pub async fn wait(self) -> Vec { - let waiter = if !self.is_running { - self.spawn().await.waiter + let runner = if !self.is_running { + self.spawn().await.runner } else { - self.waiter + self.runner }; - waiter.wait().await + runner.wait().await } /// Spawn one job and wait for result @@ -132,9 +129,9 @@ impl NamedJobBatch { } } -pub async fn run_assigned_job(job: Job, ids: AssignedJobById) -> ExecResult { - let Job { meta, payload } = job; - let mut result = AssignedJob::from((&meta, ids)); +pub async fn run_assigned_job(prepared_job: PreparedJob) -> ExecResult { + let mut result = AssignedJob::from(&prepared_job); + let Job { meta, payload } = prepared_job.job; match meta.exec_type { JobType::Shell => { let (argv, _prepared_payload) = { @@ -150,7 +147,11 @@ pub async fn run_assigned_job(job: Job, ids: AssignedJobById) -> ExecResult { let mut split_cmd = shlex::split(&argv).unwrap().into_iter(); let cmd = split_cmd.nth(0).unwrap(); let args = split_cmd.collect::>(); - let cmd_result = Command::new(cmd).args(args).output().await; + let cmd_result = Command::new(cmd) + .kill_on_drop(true) + .args(args) + .output() + .await; let (data, retcode) = match cmd_result { Ok(output) => ( ProcOutput::from_output(&output).into_vec(), diff --git a/lib/u_lib/src/lib.rs b/lib/u_lib/src/lib.rs index 52ada1b..92b8382 100644 --- a/lib/u_lib/src/lib.rs +++ b/lib/u_lib/src/lib.rs @@ -7,7 +7,6 @@ pub mod conv; #[cfg(feature = "server")] pub mod db; pub mod error; -pub mod executor; pub mod jobs; pub mod logging; pub mod messaging; @@ -15,7 +14,9 @@ pub mod misc; pub mod models; pub mod platform; pub mod proc_output; +pub mod scheduler; pub mod types; +pub mod u_runner; pub mod ufs; #[cfg(unix)] pub mod unix; @@ -37,3 +38,6 @@ extern crate tracing; #[cfg(test)] #[macro_use] extern crate rstest; + +#[macro_use] +extern crate async_trait; diff --git a/lib/u_lib/src/models/agent.rs b/lib/u_lib/src/models/agent.rs index a05e74d..efe8afa 100644 --- a/lib/u_lib/src/models/agent.rs +++ b/lib/u_lib/src/models/agent.rs @@ -13,8 +13,8 @@ mod server { use self::server::*; use crate::{ - config::get_self_id, conv::systime_to_string, executor::ExecResult, jobs::NamedJobBatch, - platform, types::Id, + config::get_self_id, conv::systime_to_string, jobs::NamedJobBatch, platform, types::Id, + u_runner::ExecResult, }; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Display)] diff --git a/lib/u_lib/src/models/jobs/assigned.rs b/lib/u_lib/src/models/jobs/assigned.rs index a7caf20..dfbb254 100644 --- a/lib/u_lib/src/models/jobs/assigned.rs +++ b/lib/u_lib/src/models/jobs/assigned.rs @@ -1,9 +1,10 @@ -use super::{JobMeta, JobState, JobType}; +use super::{JobState, JobType}; #[cfg(feature = "server")] use crate::models::schema::*; use crate::{ config::get_self_id, conv::{bytes_to_string_truncated, systime_to_string}, + models::Job, types::Id, }; #[cfg(feature = "server")] @@ -11,6 +12,7 @@ use diesel::{Identifiable, Insertable, Queryable}; use serde::{Deserialize, Serialize}; use std::{borrow::Cow, fmt::Debug, time::SystemTime}; +/// A job assigned to some agents, stores execution state and result #[derive(Serialize, Deserialize, Clone, PartialEq)] #[cfg_attr( feature = "server", @@ -53,6 +55,13 @@ impl Debug for AssignedJob { } } +#[derive(Debug, Clone)] +pub struct PreparedJob { + pub job: Job, + pub ids: AssignedJobById, +} + +/// Lightweight linking struct between agent job and assigned job #[derive(Serialize, Deserialize, Clone, Copy, Debug)] pub struct AssignedJobById { pub agent_id: Id, @@ -61,20 +70,20 @@ pub struct AssignedJobById { pub job_id: Id, } -impl From<(&JobMeta, AssignedJobById)> for AssignedJob { - fn from((job, ids): (&JobMeta, AssignedJobById)) -> Self { +impl From<&PreparedJob> for AssignedJob { + fn from(prep_job: &PreparedJob) -> Self { let AssignedJobById { agent_id, id, job_id, - } = ids; + } = prep_job.ids; AssignedJob { id, agent_id, job_id, - alias: job.alias.clone(), - exec_type: job.exec_type, + alias: prep_job.job.meta.alias.clone(), + exec_type: prep_job.job.meta.exec_type, ..Default::default() } } diff --git a/lib/u_lib/src/models/jobs/meta.rs b/lib/u_lib/src/models/jobs/meta.rs index 10a8026..0426661 100644 --- a/lib/u_lib/src/models/jobs/meta.rs +++ b/lib/u_lib/src/models/jobs/meta.rs @@ -7,6 +7,7 @@ use crate::models::Payload; use crate::platform; use crate::types::Id; use crate::{UError, UResult}; +use cron::Schedule; #[cfg(feature = "server")] use diesel::{Identifiable, Insertable, Queryable}; use serde::{Deserialize, Serialize}; @@ -119,16 +120,24 @@ impl JobMeta { ))); } + if let Some(schedule) = &self.schedule { + Schedule::try_from(schedule.as_str()) + .map_err(|e| mk_err(format!("bad schedule: {e}")))?; + } + Ok(self) } } +/// An abstract valid-constructed job that can be assigned to any agent. +/// Contains job meta and payload meta #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct Job { pub meta: JobMeta, pub payload: Option, } +/// Job that has only been deserialized without checks #[derive(Serialize, Deserialize, Clone, Default)] pub struct RawJob<'p> { #[serde(default)] diff --git a/lib/u_lib/src/scheduler/entry.rs b/lib/u_lib/src/scheduler/entry.rs new file mode 100644 index 0000000..2d3c422 --- /dev/null +++ b/lib/u_lib/src/scheduler/entry.rs @@ -0,0 +1,66 @@ +use crate::{models::PreparedJob, types::Id}; +use chrono::{DateTime, Utc}; +use core::fmt; +use std::{future::Future, pin::Pin, sync::Arc}; + +pub type JobFuture = Box + Send>; + +pub trait SchedulerJob { + fn call(&self) -> Pin; +} + +impl SchedulerJob for F +where + F: Fn() -> T, + T: Future + Send + 'static, +{ + fn call(&self) -> Pin { + Box::pin(self()) + } +} + +#[derive(Clone)] +pub struct Entry { + pub id: Id, + pub job_id: Id, + pub schedule: Option, + pub next: Option>, + pub runnable: EntryType, +} + +#[derive(Clone)] +pub enum EntryType { + Common(Arc), + URunner(PreparedJob), +} + +impl From for EntryType { + fn from(value: J) -> Self { + Self::Common(Arc::new(value)) + } +} + +impl From for EntryType { + fn from(value: PreparedJob) -> Self { + Self::URunner(value) + } +} + +impl Entry { + pub fn set_next_run_time(&mut self) { + self.next = self.get_next_run_time(); + } + + pub fn get_next_run_time(&self) -> Option> { + match &self.schedule { + Some(schedule) => schedule.upcoming(Utc).next(), + None => Some(Utc::now()), + } + } +} + +impl fmt::Debug for Entry { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{} {:?} {:?}", self.id, self.schedule, self.next) + } +} diff --git a/lib/u_lib/src/scheduler/mod.rs b/lib/u_lib/src/scheduler/mod.rs new file mode 100644 index 0000000..0d2cc8c --- /dev/null +++ b/lib/u_lib/src/scheduler/mod.rs @@ -0,0 +1,187 @@ +mod entry; +mod spawner; + +use std::sync::Arc; +use std::time::Duration; + +use chrono::Utc; +use cron::Schedule; +use entry::Entry; +use once_cell::sync::Lazy; +use tokio::sync::Mutex; +use uuid::Uuid; + +use crate::types::Id; + +use self::entry::EntryType; +use self::spawner::{CommonSpawner, Spawner, URunnerSpawner}; + +pub static SCHEDULER: Lazy = Lazy::new(|| AsyncScheduler::new()); + +#[derive(Clone)] +pub struct AsyncScheduler { + entries: Arc>>, +} + +impl AsyncScheduler { + pub fn new() -> AsyncScheduler { + AsyncScheduler { + entries: Arc::new(Mutex::new(Vec::new())), + } + } + + pub async fn start_blocking(&self) -> ! { + for entry in self.entries.lock().await.iter_mut() { + entry.set_next_run_time(); + } + + loop { + let mut entries = self.entries.lock().await; + entries.sort_by(|b, a| b.next.cmp(&a.next)); + + let wait_duration = if let Some(entry) = entries.first() { + let wait_millis = (entry.next.as_ref().unwrap().timestamp_millis() as u64) + .saturating_sub(Utc::now().timestamp_millis() as u64); + + Duration::from_millis(wait_millis) + } else { + Duration::from_secs(1) + }; + + drop(entries); + tokio::time::sleep(wait_duration).await; + + let mut entries = self.entries.lock().await; + + CommonSpawner { + entries: &mut entries, + } + .spawn() + .await; + + URunnerSpawner { + entries: &mut entries, + } + .spawn() + .await; + + entries.retain(|e| e.schedule.is_some()); + } + } + + pub async fn add_job(&self, schedule: Option, runnable: impl Into) -> Id { + let entry_id = Uuid::new_v4(); + let runnable = runnable.into(); + let job_id = match &runnable { + EntryType::URunner(j) => j.job.meta.id, + _ => Id::new_v4(), + }; + let mut entry = Entry { + id: entry_id, + job_id, + schedule, + next: None, + runnable, + }; + + entry.set_next_run_time(); + self.entries.lock().await.push(entry); + + entry_id + } + + pub async fn del_job(&self, entry_id: Id) { + self.entries.lock().await.retain(|e| e.id != entry_id); + } + + pub async fn start(&self) { + let cloned = self.clone(); + tokio::spawn(async move { + cloned.start_blocking().await; + }); + } +} + +#[cfg(test)] +mod tests { + use std::time::Duration; + use tokio::time::sleep; + + use super::*; + + #[tokio::test(flavor = "multi_thread")] + async fn scheduling() { + let v = Arc::new(Mutex::new(0)); + let scheduler = AsyncScheduler::new(); + + { + let v = v.clone(); + scheduler + .add_job(Some("*/1 * * * * * *".try_into().unwrap()), move || { + let v = v.clone(); + async move { + *v.lock().await += 1; + } + }) + .await; + } + + scheduler + .add_job( + Some("*/1 * * * * * *".try_into().unwrap()), + move || async move { + println!("hello1"); + }, + ) + .await; + + scheduler + .add_job( + Some("*/1 * * * * * *".try_into().unwrap()), + move || async move { + println!("hello2"); + }, + ) + .await; + + scheduler.start().await; + + sleep(Duration::from_secs_f32(0.1)).await; // wait for scheduler + sleep(Duration::from_secs(1)).await; + + assert_eq!(*v.lock().await, 1); + + sleep(Duration::from_secs(1)).await; + + assert_eq!(*v.lock().await, 2); + } + + /// Run task every second. + /// Task will be cancelled if not completed until next run + /// (and this task lasts 2 secs), + /// so the counter value should still be 0 + #[tokio::test(flavor = "multi_thread")] + async fn cancellation() { + let counter = Arc::new(Mutex::new(0)); + let scheduler = AsyncScheduler::new(); + + { + let counter = counter.clone(); + scheduler + .add_job(Some("*/1 * * * * * *".try_into().unwrap()), move || { + let counter = counter.clone(); + async move { + sleep(Duration::from_secs(2)).await; + *counter.lock().await += 1; + } + }) + .await; + } + + scheduler.start().await; + + sleep(Duration::from_secs(3)).await; + + assert_eq!(*counter.lock().await, 0); + } +} diff --git a/lib/u_lib/src/scheduler/spawner.rs b/lib/u_lib/src/scheduler/spawner.rs new file mode 100644 index 0000000..597efef --- /dev/null +++ b/lib/u_lib/src/scheduler/spawner.rs @@ -0,0 +1,85 @@ +use std::time::Duration; + +use crate::jobs::AnonymousJobBatch; + +use super::entry::{Entry, EntryType}; +use chrono::Utc; +use tokio::time::timeout; + +#[async_trait] +pub trait Spawner { + async fn spawn(self); +} + +/// Spawn jobs in scheduler thru `tokio::spawn` +pub struct CommonSpawner<'e> { + pub entries: &'e mut [Entry], +} + +#[async_trait] +impl Spawner for CommonSpawner<'_> { + async fn spawn(self) { + for entry in self + .entries + .iter_mut() + .filter(|e| matches!(e.runnable, EntryType::Common(_))) + { + if let EntryType::Common(runnable) = &entry.runnable { + match entry.next.as_ref() { + Some(next) => { + let cancel_timeout = + next.timestamp_millis() - Utc::now().timestamp_millis(); + let cancel_timeout = Duration::from_millis(cancel_timeout as u64); + + tokio::spawn(timeout(cancel_timeout, runnable.call())); + + entry.set_next_run_time(); + } + None => { + error!("not implemented yet"); + todo!(); + } + } + } + if entry.next.as_ref().unwrap().gt(&Utc::now()) { + break; + } + } + } +} + +/// Spawn jobs in scheduler thru `URunner` +pub struct URunnerSpawner<'e> { + pub entries: &'e mut [Entry], +} + +#[async_trait] +impl Spawner for URunnerSpawner<'_> { + async fn spawn(self) { + let mut job_batch = vec![]; + for entry in self + .entries + .iter_mut() + .filter(|e| matches!(e.runnable, EntryType::URunner(_))) + { + if let EntryType::URunner(runnable) = &entry.runnable { + match entry.next.as_ref() { + Some(_) => { + job_batch.push(runnable.clone()); + entry.set_next_run_time(); + } + None => { + error!("not implemented yet"); + todo!(); + } + } + } + if entry.next.as_ref().unwrap().gt(&Utc::now()) { + break; + } + } + AnonymousJobBatch::from_prepared_jobs(job_batch) + .spawn() + .await; + } +} diff --git a/lib/u_lib/src/executor.rs b/lib/u_lib/src/u_runner.rs similarity index 72% rename from lib/u_lib/src/executor.rs rename to lib/u_lib/src/u_runner.rs index 929011b..712c1f8 100644 --- a/lib/u_lib/src/executor.rs +++ b/lib/u_lib/src/u_runner.rs @@ -39,12 +39,15 @@ fn get_sender() -> Sender { FUT_CHANNEL.0.clone() } -pub struct Waiter { +/// Job runner. Has multiple ways of work. +/// - run 1 or more jobs and wait until they're all done +/// - run 1 or more jobs in background and collect results of completed jobs later +pub struct URunner { tasks: Vec>, fids: Vec, } -impl Waiter { +impl URunner { pub fn new() -> Self { Self { tasks: vec![], @@ -86,58 +89,58 @@ impl Waiter { pub async fn wait(self) -> Vec { let mut result = vec![]; for fid in self.fids { - if let Some(task) = pop_task(fid).await { + if let Some(task) = Self::pop_task(fid).await { result.push(task.wait_result().await); } } result } -} -async fn init_receiver() { - while let Some(fid) = FUT_CHANNEL.1.lock().await.recv().await { - let mut lock = FUT_RESULTS.lock().await; - if let Some(j) = lock.get_mut(&fid) { - j.completed = true; + pub async fn pop_task_if_completed(fid: Uuid) -> Option { + let &JoinInfo { + handle: _, + collectable, + completed, + } = match FUT_RESULTS.lock().await.get(&fid) { + Some(t) => t, + None => return None, + }; + if collectable && completed { + let task = Self::pop_task(fid).await.unwrap(); + Some(task.wait_result().await) + } else { + None } } -} -async fn pop_task(fid: Uuid) -> Option { - FUT_RESULTS.lock().await.remove(&fid) -} + pub async fn pop_completed() -> Vec { + let mut completed: Vec = vec![]; + let fids = FUT_RESULTS + .lock() + .await + .keys() + .copied() + .collect::>(); + for fid in fids { + if let Some(r) = Self::pop_task_if_completed(fid).await { + completed.push(r) + } + } + completed + } -pub async fn pop_task_if_completed(fid: Uuid) -> Option { - let &JoinInfo { - handle: _, - collectable, - completed, - } = match FUT_RESULTS.lock().await.get(&fid) { - Some(t) => t, - None => return None, - }; - if collectable && completed { - let task = pop_task(fid).await.unwrap(); - Some(task.wait_result().await) - } else { - None + async fn pop_task(fid: Uuid) -> Option { + FUT_RESULTS.lock().await.remove(&fid) } } -pub async fn pop_completed() -> Vec { - let mut completed: Vec = vec![]; - let fids = FUT_RESULTS - .lock() - .await - .keys() - .copied() - .collect::>(); - for fid in fids { - if let Some(r) = pop_task_if_completed(fid).await { - completed.push(r) +async fn init_receiver() { + while let Some(fid) = FUT_CHANNEL.1.lock().await.recv().await { + let mut lock = FUT_RESULTS.lock().await; + if let Some(j) = lock.get_mut(&fid) { + j.completed = true; } } - completed } #[cfg(test)] -- 2.36.2 From 2816e72cbdfee15157057f0371035eb702c2a3a2 Mon Sep 17 00:00:00 2001 From: plazmoid Date: Sat, 4 Nov 2023 23:40:15 +0300 Subject: [PATCH 2/4] initial stats --- Cargo.lock | 49 +++++++-------- bin/u_agent/src/lib.rs | 25 +++++--- bin/u_server/src/handlers.rs | 6 +- lib/u_lib/Cargo.toml | 3 +- lib/u_lib/src/cache.rs | 10 ++- lib/u_lib/src/jobs.rs | 45 ++++++++++---- lib/u_lib/src/lib.rs | 3 - lib/u_lib/src/models/jobs/assigned.rs | 2 +- lib/u_lib/src/models/jobs/meta.rs | 2 +- lib/u_lib/src/models/jobs/misc.rs | 2 +- lib/u_lib/src/models/mod.rs | 1 + lib/u_lib/src/models/payload.rs | 2 +- lib/u_lib/src/models/stats.rs | 14 +++++ lib/u_lib/src/scheduler/entry.rs | 47 ++++++++++---- lib/u_lib/src/scheduler/mod.rs | 83 +++++++++++++++---------- lib/u_lib/src/scheduler/spawner.rs | 85 -------------------------- lib/u_lib/src/u_runner.rs | 88 ++++++++++++++++++--------- lib/u_lib/src/ufs/index.rs | 47 ++++++++++++-- lib/u_lib/src/ufs/mod.rs | 52 ++++------------ 19 files changed, 301 insertions(+), 265 deletions(-) create mode 100644 lib/u_lib/src/models/stats.rs delete mode 100644 lib/u_lib/src/scheduler/spawner.rs diff --git a/Cargo.lock b/Cargo.lock index 381971d..794eaa4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -219,9 +219,9 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "ahash" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if 1.0.0", "getrandom", @@ -443,6 +443,7 @@ dependencies = [ "iana-time-zone", "js-sys", "num-traits", + "serde", "wasm-bindgen", "windows-targets", ] @@ -1477,7 +1478,7 @@ dependencies = [ "log", "memchr", "mime", - "spin 0.9.8", + "spin", "version_check", ] @@ -1931,17 +1932,16 @@ checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" [[package]] name = "ring" -version = "0.16.20" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", - "spin 0.5.2", + "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys", ] [[package]] @@ -2054,9 +2054,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ "log", "ring", @@ -2075,9 +2075,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", "untrusted", @@ -2121,9 +2121,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", @@ -2315,12 +2315,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -2801,7 +2795,6 @@ name = "u_lib" version = "0.1.0" dependencies = [ "anyhow", - "async-trait", "bincode", "chrono", "cron", @@ -2933,9 +2926,9 @@ checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" @@ -3254,18 +3247,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.11" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c19fae0c8a9efc6a8281f2e623db8af1db9e57852e04cde3e754dd2dc29340f" +checksum = "69c48d63854f77746c68a5fbb4aa17f3997ece1cb301689a257af8cb80610d21" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.11" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc56589e9ddd1f1c28d4b4b5c773ce232910a6bb67a70133d61c9e347585efe9" +checksum = "c258c1040279e4f88763a113de72ce32dde2d50e2a94573f15dd534cea36a16d" dependencies = [ "proc-macro2", "quote", diff --git a/bin/u_agent/src/lib.rs b/bin/u_agent/src/lib.rs index 7c69c2e..709bf59 100644 --- a/bin/u_agent/src/lib.rs +++ b/bin/u_agent/src/lib.rs @@ -5,7 +5,7 @@ use tokio::runtime::Builder; use tokio::time::{sleep, Duration}; use u_lib::models::PreparedJob; use u_lib::scheduler::SCHEDULER; -use u_lib::u_runner::URunner; +use u_lib::u_runner::{IdentifiableFuture, URunner}; use u_lib::{ api::HttpClient, cache::JobCache, @@ -143,17 +143,26 @@ pub fn run_forever() -> ! { SCHEDULER .add_job(Some("*/3 * * * * * *".try_into().unwrap()), move || { let client = client.clone(); - error_reporting(client.clone()) + + IdentifiableFuture::from_fut_with_ident("error_reporting", async move { + error_reporting(client.clone()).await + }) }) .await; } - SCHEDULER - .add_job(Some("*/3 * * * * * *".try_into().unwrap()), move || { - let client = client.clone(); - agent_loop(client) - }) - .await; + { + let client = client.clone(); + SCHEDULER + .add_job(Some("*/3 * * * * * *".try_into().unwrap()), move || { + let client = client.clone(); + + IdentifiableFuture::from_fut_with_ident("agent_loop", async move { + agent_loop(client).await + }) + }) + .await; + } SCHEDULER.start_blocking().await }) diff --git a/bin/u_server/src/handlers.rs b/bin/u_server/src/handlers.rs index e1a8ec7..f9aac78 100644 --- a/bin/u_server/src/handlers.rs +++ b/bin/u_server/src/handlers.rs @@ -277,9 +277,9 @@ impl Endpoints { JobType::Shell => { result.state = JobState::Finished }, - JobType::Service => (), - JobType::Terminate => todo!(), - JobType::Update => todo!(), + JobType::Stats => (), + JobType::Terminate => (), + JobType::Update => (), } db.update_result(&result)?; } diff --git a/lib/u_lib/Cargo.toml b/lib/u_lib/Cargo.toml index e091b62..841049c 100644 --- a/lib/u_lib/Cargo.toml +++ b/lib/u_lib/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] anyhow = { workspace = true } -chrono = "0.4.19" +chrono = { version = "0.4.19", features = ["serde"] } diesel = { workspace = true, optional = true } diesel-derive-enum = { version = "2.0.0", features = ["postgres"], optional = true } deadpool-diesel = { workspace = true, optional = true } @@ -34,7 +34,6 @@ parking_lot = "0.12.1" bincode = "1.3.3" sha3 = "0.10.7" cron = "0.12.0" -async-trait = "0.1.74" [target.'cfg(unix)'.dependencies] daemonize = "0.5" diff --git a/lib/u_lib/src/cache.rs b/lib/u_lib/src/cache.rs index 3031b0f..ef88ce1 100644 --- a/lib/u_lib/src/cache.rs +++ b/lib/u_lib/src/cache.rs @@ -22,7 +22,7 @@ impl JobCache { JOB_CACHE.read().contains_key(&id) } - pub fn get<'jh>(id: Id) -> Option> { + pub fn get(id: Id) -> Option { if !Self::contains(id) { return None; } @@ -33,11 +33,15 @@ impl JobCache { pub fn remove(id: Id) { JOB_CACHE.write().remove(&id); } + + pub fn stats() -> Vec { + JOB_CACHE.read().values().map(|job| job.meta.id).collect() + } } -pub struct JobCacheHolder<'jh>(pub RwLockReadGuard<'jh, Cache>, pub Id); +pub struct JobCacheHolder(pub RwLockReadGuard<'static, Cache>, pub Id); -impl<'jh> Deref for JobCacheHolder<'jh> { +impl Deref for JobCacheHolder { type Target = Val; fn deref(&self) -> &Self::Target { diff --git a/lib/u_lib/src/jobs.rs b/lib/u_lib/src/jobs.rs index 9e4f42d..cc83d18 100644 --- a/lib/u_lib/src/jobs.rs +++ b/lib/u_lib/src/jobs.rs @@ -1,8 +1,14 @@ use crate::{ + cache::JobCache, combined_result::CombinedResult, - models::{Agent, AssignedJob, AssignedJobById, Job, JobType, PreparedJob, RawJob}, + config::get_self_id, + models::{ + stats::Stats, Agent, AssignedJob, AssignedJobById, Job, JobType, PreparedJob, RawJob, + }, proc_output::ProcOutput, - u_runner::{ExecResult, URunner}, + scheduler::SCHEDULER, + u_runner::{ExecResult, IdentifiableFuture, URunner}, + ufs, }; use std::collections::HashMap; use std::process::exit; @@ -17,7 +23,10 @@ impl AnonymousJobBatch { pub fn from_prepared_jobs(jobs: impl IntoIterator) -> Self { let mut runner = URunner::new(); for job in jobs { - runner.push(run_assigned_job(job)); + runner.push(IdentifiableFuture::from_fut_with_ident( + job.ids.id, + run_assigned_job(job), + )); } Self { runner, @@ -25,7 +34,7 @@ impl AnonymousJobBatch { } } - pub fn from_meta(jobs: impl IntoIterator) -> Self { + pub fn from_jobs(jobs: impl IntoIterator) -> Self { let jobs_ids: Vec<_> = jobs .into_iter() .map(|job| PreparedJob { @@ -99,7 +108,7 @@ impl NamedJobBatch { .map(|job| (job.meta.alias.clone().unwrap(), job)) .unzip(); Self { - runner: Some(AnonymousJobBatch::from_meta(jobs)), + runner: Some(AnonymousJobBatch::from_jobs(jobs)), job_names, results: HashMap::new(), } @@ -173,8 +182,18 @@ pub async fn run_assigned_job(prepared_job: PreparedJob) -> ExecResult { result.set_result(&agent); result.retcode = Some(0); } - JobType::Service => todo!(), - JobType::Update => todo!(), + JobType::Stats => { + let stats = Stats { + agent_id: get_self_id(), + running_jobs: URunner::stats().await, + scheduled_jobs: SCHEDULER.stats().await, + cached_jobs: JobCache::stats(), + cached_payloads: ufs::stats(), + }; + result.set_result(&stats); + result.retcode = Some(0) + } + JobType::Update => (), JobType::Terminate => exit(0), }; Ok(result) @@ -198,7 +217,7 @@ mod tests { let sleep_jobs = (0..50).map(|_| job.clone()).collect::>(); let now = SystemTime::now(); - AnonymousJobBatch::from_meta(sleep_jobs).wait().await; + AnonymousJobBatch::from_jobs(sleep_jobs).wait().await; assert!(now.elapsed().unwrap().as_secs() < SLEEP_SECS + 2) } @@ -237,7 +256,7 @@ mod tests { raw_job = raw_job.with_raw_payload(p); } let job = raw_job.try_into_job().unwrap(); - let result = AnonymousJobBatch::from_meta([job]) + let result = AnonymousJobBatch::from_jobs([job]) .wait_one() .await .unwrap(); @@ -251,8 +270,8 @@ mod tests { const SLEEP_SECS: u64 = 1; let now = SystemTime::now(); let longest_job = RawJob::from_shell(format!("sleep {}", SLEEP_SECS)).unwrap(); - let longest_job = AnonymousJobBatch::from_meta([longest_job]).spawn().await; - let ls = AnonymousJobBatch::from_meta([RawJob::from_shell("ls").unwrap()]) + let longest_job = AnonymousJobBatch::from_jobs([longest_job]).spawn().await; + let ls = AnonymousJobBatch::from_jobs([RawJob::from_shell("ls").unwrap()]) .wait_one() .await .unwrap(); @@ -265,7 +284,7 @@ mod tests { .map(|f| RawJob::from_shell(format!("ls {f}")).unwrap()) .collect::>(); - let ls_subfolders = AnonymousJobBatch::from_meta(subfolders_jobs).wait().await; + let ls_subfolders = AnonymousJobBatch::from_jobs(subfolders_jobs).wait().await; for result in ls_subfolders { assert_eq!(result.unwrap().retcode.unwrap(), 0); @@ -296,7 +315,7 @@ mod tests { #[tokio::test] async fn test_failing_shell_job() -> TestResult { let job = RawJob::from_shell("lol_kek_puk").unwrap(); - let job_result = AnonymousJobBatch::from_meta([job]) + let job_result = AnonymousJobBatch::from_jobs([job]) .wait_one() .await .unwrap(); diff --git a/lib/u_lib/src/lib.rs b/lib/u_lib/src/lib.rs index 92b8382..59c30f5 100644 --- a/lib/u_lib/src/lib.rs +++ b/lib/u_lib/src/lib.rs @@ -38,6 +38,3 @@ extern crate tracing; #[cfg(test)] #[macro_use] extern crate rstest; - -#[macro_use] -extern crate async_trait; diff --git a/lib/u_lib/src/models/jobs/assigned.rs b/lib/u_lib/src/models/jobs/assigned.rs index dfbb254..397cf56 100644 --- a/lib/u_lib/src/models/jobs/assigned.rs +++ b/lib/u_lib/src/models/jobs/assigned.rs @@ -145,7 +145,7 @@ impl AssignedJob { String::from_utf8_lossy(self.to_raw_result()) } - pub fn set_result(&mut self, result: &S) { + pub fn set_result(&mut self, result: &impl Serialize) { self.result = Some(serde_json::to_vec(result).unwrap()); } diff --git a/lib/u_lib/src/models/jobs/meta.rs b/lib/u_lib/src/models/jobs/meta.rs index 0426661..a450f97 100644 --- a/lib/u_lib/src/models/jobs/meta.rs +++ b/lib/u_lib/src/models/jobs/meta.rs @@ -103,7 +103,7 @@ impl JobMeta { return Err(mk_err("Argv contains no executable placeholder")); } - if self.argv.contains("{}") && self.payload_id.is_none() { + if self.payload_id.is_none() && self.argv.contains("{}") { return Err(mk_err( "No payload provided, but argv contains executable placeholder", )); diff --git a/lib/u_lib/src/models/jobs/misc.rs b/lib/u_lib/src/models/jobs/misc.rs index faf108e..0fbca99 100644 --- a/lib/u_lib/src/models/jobs/misc.rs +++ b/lib/u_lib/src/models/jobs/misc.rs @@ -35,7 +35,7 @@ pub enum JobState { )] pub enum JobType { Init, - Service, + Stats, #[default] Shell, Terminate, diff --git a/lib/u_lib/src/models/mod.rs b/lib/u_lib/src/models/mod.rs index 61c9a56..0911500 100644 --- a/lib/u_lib/src/models/mod.rs +++ b/lib/u_lib/src/models/mod.rs @@ -3,6 +3,7 @@ mod jobs; mod payload; #[cfg(feature = "server")] pub mod schema; +pub mod stats; pub use crate::models::{agent::*, jobs::*, payload::*}; use serde::Deserialize; diff --git a/lib/u_lib/src/models/payload.rs b/lib/u_lib/src/models/payload.rs index 84db3d7..f947a28 100644 --- a/lib/u_lib/src/models/payload.rs +++ b/lib/u_lib/src/models/payload.rs @@ -185,7 +185,7 @@ impl Payload { #[cfg(windows)] pub fn prepare_executable(&self) -> Result<(File, String)> { - todo!() + compile_error!("допилить") } } diff --git a/lib/u_lib/src/models/stats.rs b/lib/u_lib/src/models/stats.rs new file mode 100644 index 0000000..d282286 --- /dev/null +++ b/lib/u_lib/src/models/stats.rs @@ -0,0 +1,14 @@ +use serde::Serialize; + +use crate::{messaging::AsMsg, scheduler::EntryStat, types::Id, ufs::IndexFileMeta}; + +#[derive(Debug, Clone, Serialize)] +pub struct Stats { + pub agent_id: Id, + pub running_jobs: Vec, + pub scheduled_jobs: Vec, + pub cached_jobs: Vec, + pub cached_payloads: Vec, +} + +impl AsMsg for Stats {} diff --git a/lib/u_lib/src/scheduler/entry.rs b/lib/u_lib/src/scheduler/entry.rs index 2d3c422..b235b51 100644 --- a/lib/u_lib/src/scheduler/entry.rs +++ b/lib/u_lib/src/scheduler/entry.rs @@ -1,33 +1,40 @@ -use crate::{models::PreparedJob, types::Id}; +use crate::{models::PreparedJob, types::Id, u_runner::IdentifiableFuture}; use chrono::{DateTime, Utc}; use core::fmt; -use std::{future::Future, pin::Pin, sync::Arc}; - -pub type JobFuture = Box + Send>; +use serde::Serialize; +use std::sync::Arc; pub trait SchedulerJob { - fn call(&self) -> Pin; + fn call(&self) -> IdentifiableFuture<()>; } -impl SchedulerJob for F +// scheduler job need to be called repeatedly, +// the only way to achieve this is to use Fn() -> Future +impl SchedulerJob for F where - F: Fn() -> T, - T: Future + Send + 'static, + F: Fn() -> IdentifiableFuture<()>, { - fn call(&self) -> Pin { - Box::pin(self()) + fn call(&self) -> IdentifiableFuture<()> { + self() } } #[derive(Clone)] pub struct Entry { pub id: Id, - pub job_id: Id, pub schedule: Option, pub next: Option>, pub runnable: EntryType, } +#[derive(Clone, Debug, Serialize)] +pub struct EntryStat { + pub id: Id, + pub job_id: String, + pub schedule: String, + pub next: Option>, +} + #[derive(Clone)] pub enum EntryType { Common(Arc), @@ -57,6 +64,24 @@ impl Entry { None => Some(Utc::now()), } } + + pub fn as_stat(&self) -> EntryStat { + let job_id = match &self.runnable { + EntryType::URunner(entry) => entry.job.meta.id.to_string(), + EntryType::Common(entry) => entry.call().job_id.to_string(), + }; + + EntryStat { + id: self.id, + job_id, + schedule: self + .schedule + .as_ref() + .map(|s| s.to_string()) + .unwrap_or_default(), + next: self.next.clone(), + } + } } impl fmt::Debug for Entry { diff --git a/lib/u_lib/src/scheduler/mod.rs b/lib/u_lib/src/scheduler/mod.rs index 0d2cc8c..29e40c7 100644 --- a/lib/u_lib/src/scheduler/mod.rs +++ b/lib/u_lib/src/scheduler/mod.rs @@ -1,5 +1,4 @@ mod entry; -mod spawner; use std::sync::Arc; use std::time::Duration; @@ -9,12 +8,15 @@ use cron::Schedule; use entry::Entry; use once_cell::sync::Lazy; use tokio::sync::Mutex; +use tokio::time::timeout; use uuid::Uuid; +use crate::jobs::AnonymousJobBatch; use crate::types::Id; use self::entry::EntryType; -use self::spawner::{CommonSpawner, Spawner, URunnerSpawner}; + +pub use entry::EntryStat; pub static SCHEDULER: Lazy = Lazy::new(|| AsyncScheduler::new()); @@ -52,18 +54,33 @@ impl AsyncScheduler { tokio::time::sleep(wait_duration).await; let mut entries = self.entries.lock().await; - - CommonSpawner { - entries: &mut entries, + let mut job_batch = vec![]; + + for entry in &mut *entries { + match entry.next.as_ref() { + Some(next) => { + match &entry.runnable { + EntryType::Common(runnable) => { + let cancel_timeout = + next.timestamp_millis() - Utc::now().timestamp_millis(); + let cancel_timeout = Duration::from_millis(cancel_timeout as u64); + + tokio::spawn(timeout(cancel_timeout, runnable.call())); + } + EntryType::URunner(runnable) => job_batch.push(runnable.clone()), + } + entry.set_next_run_time(); + } + None => {} + } + if entry.next.as_ref().unwrap().gt(&Utc::now()) { + break; + } } - .spawn() - .await; - URunnerSpawner { - entries: &mut entries, - } - .spawn() - .await; + AnonymousJobBatch::from_prepared_jobs(job_batch) + .spawn() + .await; entries.retain(|e| e.schedule.is_some()); } @@ -72,13 +89,8 @@ impl AsyncScheduler { pub async fn add_job(&self, schedule: Option, runnable: impl Into) -> Id { let entry_id = Uuid::new_v4(); let runnable = runnable.into(); - let job_id = match &runnable { - EntryType::URunner(j) => j.job.meta.id, - _ => Id::new_v4(), - }; let mut entry = Entry { id: entry_id, - job_id, schedule, next: None, runnable, @@ -94,6 +106,15 @@ impl AsyncScheduler { self.entries.lock().await.retain(|e| e.id != entry_id); } + pub async fn stats(&self) -> Vec { + self.entries + .lock() + .await + .iter() + .map(|entry| entry.as_stat()) + .collect() + } + pub async fn start(&self) { let cloned = self.clone(); tokio::spawn(async move { @@ -107,6 +128,8 @@ mod tests { use std::time::Duration; use tokio::time::sleep; + use crate::u_runner::IdentifiableFuture; + use super::*; #[tokio::test(flavor = "multi_thread")] @@ -119,29 +142,27 @@ mod tests { scheduler .add_job(Some("*/1 * * * * * *".try_into().unwrap()), move || { let v = v.clone(); - async move { + IdentifiableFuture::from_fut_with_ident("testf", async move { *v.lock().await += 1; - } + }) }) .await; } scheduler - .add_job( - Some("*/1 * * * * * *".try_into().unwrap()), - move || async move { + .add_job(Some("*/1 * * * * * *".try_into().unwrap()), move || { + IdentifiableFuture::from_fut_with_ident("testf", async move { println!("hello1"); - }, - ) + }) + }) .await; scheduler - .add_job( - Some("*/1 * * * * * *".try_into().unwrap()), - move || async move { + .add_job(Some("*/1 * * * * * *".try_into().unwrap()), move || { + IdentifiableFuture::from_fut_with_ident("testf", async move { println!("hello2"); - }, - ) + }) + }) .await; scheduler.start().await; @@ -170,10 +191,10 @@ mod tests { scheduler .add_job(Some("*/1 * * * * * *".try_into().unwrap()), move || { let counter = counter.clone(); - async move { + IdentifiableFuture::from_fut_with_ident("testf", async move { sleep(Duration::from_secs(2)).await; *counter.lock().await += 1; - } + }) }) .await; } diff --git a/lib/u_lib/src/scheduler/spawner.rs b/lib/u_lib/src/scheduler/spawner.rs deleted file mode 100644 index 597efef..0000000 --- a/lib/u_lib/src/scheduler/spawner.rs +++ /dev/null @@ -1,85 +0,0 @@ -use std::time::Duration; - -use crate::jobs::AnonymousJobBatch; - -use super::entry::{Entry, EntryType}; -use chrono::Utc; -use tokio::time::timeout; - -#[async_trait] -pub trait Spawner { - async fn spawn(self); -} - -/// Spawn jobs in scheduler thru `tokio::spawn` -pub struct CommonSpawner<'e> { - pub entries: &'e mut [Entry], -} - -#[async_trait] -impl Spawner for CommonSpawner<'_> { - async fn spawn(self) { - for entry in self - .entries - .iter_mut() - .filter(|e| matches!(e.runnable, EntryType::Common(_))) - { - if let EntryType::Common(runnable) = &entry.runnable { - match entry.next.as_ref() { - Some(next) => { - let cancel_timeout = - next.timestamp_millis() - Utc::now().timestamp_millis(); - let cancel_timeout = Duration::from_millis(cancel_timeout as u64); - - tokio::spawn(timeout(cancel_timeout, runnable.call())); - - entry.set_next_run_time(); - } - None => { - error!("not implemented yet"); - todo!(); - } - } - } - if entry.next.as_ref().unwrap().gt(&Utc::now()) { - break; - } - } - } -} - -/// Spawn jobs in scheduler thru `URunner` -pub struct URunnerSpawner<'e> { - pub entries: &'e mut [Entry], -} - -#[async_trait] -impl Spawner for URunnerSpawner<'_> { - async fn spawn(self) { - let mut job_batch = vec![]; - for entry in self - .entries - .iter_mut() - .filter(|e| matches!(e.runnable, EntryType::URunner(_))) - { - if let EntryType::URunner(runnable) = &entry.runnable { - match entry.next.as_ref() { - Some(_) => { - job_batch.push(runnable.clone()); - entry.set_next_run_time(); - } - None => { - error!("not implemented yet"); - todo!(); - } - } - } - if entry.next.as_ref().unwrap().gt(&Utc::now()) { - break; - } - } - AnonymousJobBatch::from_prepared_jobs(job_batch) - .spawn() - .await; - } -} diff --git a/lib/u_lib/src/u_runner.rs b/lib/u_lib/src/u_runner.rs index 712c1f8..3696885 100644 --- a/lib/u_lib/src/u_runner.rs +++ b/lib/u_lib/src/u_runner.rs @@ -1,8 +1,9 @@ use crate::{models::AssignedJob, UResult}; use lazy_static::lazy_static; -use std::collections::HashMap; use std::future::Future; use std::pin::Pin; +use std::task::Poll; +use std::{collections::HashMap, task::Context}; use tokio::{ runtime::Handle, sync::mpsc::{channel, Receiver, Sender}, @@ -12,7 +13,6 @@ use tokio::{ use uuid::Uuid; pub type ExecResult = UResult; -type BoxFuture<'a, T> = Pin + Send + 'a>>; lazy_static! { static ref FUT_RESULTS: Mutex> = Mutex::new(HashMap::new()); @@ -23,10 +23,36 @@ lazy_static! { }; } +pub struct IdentifiableFuture { + pub job_id: String, + fut: Pin + Send + Sync + 'static>>, +} + +impl IdentifiableFuture { + pub fn from_fut_with_ident( + job_id: impl Into, + job: impl Future + Send + Sync + 'static, + ) -> Self { + Self { + fut: Box::pin(job), + job_id: job_id.into(), + } + } +} + +impl Future for IdentifiableFuture { + type Output = R; + + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + self.fut.as_mut().poll(cx) + } +} + struct JoinInfo { + job_id: String, handle: JoinHandle>, completed: bool, - collectable: bool, // indicates if future can be popped from pool via pop_task_if_completed + // collectable: bool, // indicates if future can be popped from pool via pop_task_if_completed } impl JoinInfo { @@ -43,40 +69,40 @@ fn get_sender() -> Sender { /// - run 1 or more jobs and wait until they're all done /// - run 1 or more jobs in background and collect results of completed jobs later pub struct URunner { - tasks: Vec>, + executables: Vec>, fids: Vec, } impl URunner { pub fn new() -> Self { Self { - tasks: vec![], + executables: vec![], fids: vec![], } } - pub fn push(&mut self, task: impl Future + Send + 'static) { - self.tasks.push(Box::pin(task)); + pub fn push(&mut self, job: IdentifiableFuture) { + self.executables.push(job); } /// Spawn prepared tasks pub async fn spawn(mut self) -> Self { - let collectable = true; //TODO: self.tasks.len() != 1; - for f in self.tasks.drain(..) { + for executable in self.executables.drain(..) { let handle = Handle::current(); let fid = Uuid::new_v4(); let tx = get_sender(); + let job_id = executable.job_id.clone(); self.fids.push(fid); - let task_wrapper = async move { + let job_wrapper = async move { debug!("inside wrapper (started): {}", fid); - let result = f.await; - tx.send(fid).await.unwrap(); + let result = executable.await; + tx.send(fid).await.ok(); result }; let handler = JoinInfo { - handle: spawn_blocking(move || handle.spawn(task_wrapper)), + job_id, + handle: spawn_blocking(move || handle.spawn(job_wrapper)), completed: false, - collectable, }; FUT_RESULTS.lock().await.insert(fid, handler); } @@ -89,25 +115,20 @@ impl URunner { pub async fn wait(self) -> Vec { let mut result = vec![]; for fid in self.fids { - if let Some(task) = Self::pop_task(fid).await { - result.push(task.wait_result().await); + if let Some(job) = Self::pop_job(fid).await { + result.push(job.wait_result().await); } } result } - pub async fn pop_task_if_completed(fid: Uuid) -> Option { - let &JoinInfo { - handle: _, - collectable, - completed, - } = match FUT_RESULTS.lock().await.get(&fid) { - Some(t) => t, - None => return None, + pub async fn pop_job_if_completed(fid: Uuid) -> Option { + let Some(&JoinInfo { completed, .. }) = FUT_RESULTS.lock().await.get(&fid) else { + return None; }; - if collectable && completed { - let task = Self::pop_task(fid).await.unwrap(); - Some(task.wait_result().await) + if completed { + let job = Self::pop_job(fid).await.unwrap(); + Some(job.wait_result().await) } else { None } @@ -122,14 +143,23 @@ impl URunner { .copied() .collect::>(); for fid in fids { - if let Some(r) = Self::pop_task_if_completed(fid).await { + if let Some(r) = Self::pop_job_if_completed(fid).await { completed.push(r) } } completed } - async fn pop_task(fid: Uuid) -> Option { + pub async fn stats() -> Vec { + FUT_RESULTS + .lock() + .await + .values() + .map(|v| v.job_id.clone()) + .collect() + } + + async fn pop_job(fid: Uuid) -> Option { FUT_RESULTS.lock().await.remove(&fid) } } diff --git a/lib/u_lib/src/ufs/index.rs b/lib/u_lib/src/ufs/index.rs index 9a58ef6..dbfdbb2 100644 --- a/lib/u_lib/src/ufs/index.rs +++ b/lib/u_lib/src/ufs/index.rs @@ -1,13 +1,15 @@ -use super::{Error, FileMeta}; +use super::Error; use once_cell::sync::Lazy; use parking_lot::Mutex; +use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::env::temp_dir; +use std::ffi::OsString; use std::fs; use std::path::PathBuf; // index format: given_name -> payload_meta -type Index = HashMap; +type Index = HashMap; static IDX_FILE_NAME: Lazy = Lazy::new(|| temp_dir().join(".i")); static INDEX: Lazy> = Lazy::new(|| { @@ -28,6 +30,35 @@ static INDEX: Lazy> = Lazy::new(|| { Mutex::new(idx) }); +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct IndexFileMeta { + extension: Option, + pub external: bool, // if file is present before adding to index + pub hash: Vec, + pub path: PathBuf, // actual file path + pub size: u64, +} + +impl IndexFileMeta { + pub fn new( + full_path: impl Into, + hash: Vec, + external: bool, + ) -> Result { + let full_path: PathBuf = full_path.into(); + let extension = full_path.extension().map(ToOwned::to_owned); + let size = fs::metadata(&full_path)?.len(); + + Ok(IndexFileMeta { + path: full_path, + extension, + external, + hash, + size, + }) + } +} + mod sync { use super::{Index, IDX_FILE_NAME}; use std::fs; @@ -57,7 +88,7 @@ mod sync { } } -pub fn get(name: impl AsRef) -> Option { +pub fn get(name: impl AsRef) -> Option { let mut index = INDEX.lock(); sync::deleted(&mut index); @@ -65,7 +96,7 @@ pub fn get(name: impl AsRef) -> Option { index.get(name.as_ref()).cloned() } -pub fn get_by_hash(hash: impl AsRef<[u8]>) -> Option<(String, FileMeta)> { +pub fn get_by_hash(hash: impl AsRef<[u8]>) -> Option<(String, IndexFileMeta)> { let mut index = INDEX.lock(); sync::deleted(&mut index); @@ -76,7 +107,7 @@ pub fn get_by_hash(hash: impl AsRef<[u8]>) -> Option<(String, FileMeta)> { .map(|(n, m)| (n.to_owned(), m.clone())) } -pub fn insert(name: impl Into, meta: FileMeta) { +pub fn insert(name: impl Into, meta: IndexFileMeta) { let mut index = INDEX.lock(); sync::deleted(&mut index); @@ -87,7 +118,7 @@ pub fn insert(name: impl Into, meta: FileMeta) { sync::index2fs(&mut index); } -pub fn remove(name: impl AsRef) -> Option { +pub fn remove(name: impl AsRef) -> Option { let mut index = INDEX.lock(); sync::deleted(&mut index); @@ -99,3 +130,7 @@ pub fn remove(name: impl AsRef) -> Option { result } + +pub fn stats() -> Vec { + INDEX.lock().values().cloned().collect() +} diff --git a/lib/u_lib/src/ufs/mod.rs b/lib/u_lib/src/ufs/mod.rs index 96f0bbd..5fce83f 100644 --- a/lib/u_lib/src/ufs/mod.rs +++ b/lib/u_lib/src/ufs/mod.rs @@ -1,49 +1,19 @@ -// This module is aiming to store (obfuscated?) payloads, get them by name, -// rename, update, delete or prepare to execute via memfd_create (unix) +/// This module is aiming to store (obfuscated?) payloads, get them by name, +/// rename, update, delete or prepare to execute via memfd_create (unix) +mod error; +mod index; use anyhow::{Context, Result}; -use serde::{Deserialize, Serialize}; use std::env::temp_dir; -use std::ffi::OsString; use std::fs; use std::path::{Path, PathBuf}; use uuid::Uuid; -mod error; -mod index; pub use error::Error; +pub use index::IndexFileMeta; const OBFUSCATE: bool = cfg!(feature = "agent"); -#[derive(Debug, Clone, Deserialize, Serialize)] -pub struct FileMeta { - extension: Option, - external: bool, // if file is present before adding to index - hash: Vec, - pub path: PathBuf, // actual file path - pub size: u64, -} - -impl FileMeta { - pub fn new( - full_path: impl Into, - hash: Vec, - external: bool, - ) -> Result { - let full_path: PathBuf = full_path.into(); - let extension = full_path.extension().map(ToOwned::to_owned); - let size = fs::metadata(&full_path)?.len(); - - Ok(FileMeta { - path: full_path, - extension, - external, - hash, - size, - }) - } -} - /// Check if file exists in index. /// File may present in fs but not in index, fn will return false then. pub fn exists_in_index(name: impl AsRef) -> bool { @@ -51,7 +21,7 @@ pub fn exists_in_index(name: impl AsRef) -> bool { } #[inline] -pub fn read_meta(name: impl AsRef) -> Result { +pub fn read_meta(name: impl AsRef) -> Result { index::get(&name) .ok_or_else(|| Error::not_found(name.as_ref())) .context("meta") @@ -113,7 +83,7 @@ pub fn put(name: impl AsRef, data: impl AsRef<[u8]>) -> Result<()> { }; index::insert( name, - FileMeta::new(path, data_hash, false).context("put_insert")?, + IndexFileMeta::new(path, data_hash, false).context("put_insert")?, ); Ok(()) @@ -131,7 +101,7 @@ pub fn edit(name: impl AsRef, data: impl AsRef<[u8]>) -> Result<()> { .map_err(|e| Error::new(e, &meta.path)) .context("edit_write")?; - let new_meta = FileMeta::new(meta.path, data_hash, meta.external).context("edit_nmeta")?; + let new_meta = IndexFileMeta::new(meta.path, data_hash, meta.external).context("edit_nmeta")?; index::remove(&name); index::insert(name.as_ref(), new_meta); @@ -215,12 +185,16 @@ pub fn put_external(path: impl AsRef) -> Result<()> { index::insert( path_str, - FileMeta::new(path, data_hash, true).context("ext2")?, + IndexFileMeta::new(path, data_hash, true).context("ext2")?, ); Ok(()) } +pub fn stats() -> Vec { + index::stats() +} + /* pub fn cleanup() { let index = INDEX.read(); -- 2.36.2 From 810d942721c7169435c7e633cc3a82bf07248f5f Mon Sep 17 00:00:00 2001 From: plazmoid Date: Tue, 14 Nov 2023 02:52:14 +0300 Subject: [PATCH 3/4] add stats integration test --- Cargo.lock | 265 +++++++++--------- bin/u_agent/src/lib.rs | 82 +++--- bin/u_server/src/handlers.rs | 41 +-- integration-tests/docker-compose.yml | 2 +- .../tests/integration_tests/behaviour.rs | 51 +++- lib/u_lib/Cargo.toml | 1 + lib/u_lib/src/jobs.rs | 4 +- lib/u_lib/src/models/jobs/assigned.rs | 10 +- lib/u_lib/src/models/mod.rs | 4 +- lib/u_lib/src/models/schema.rs | 7 +- lib/u_lib/src/models/stats.rs | 4 +- lib/u_lib/src/scheduler/entry.rs | 20 +- lib/u_lib/src/scheduler/mod.rs | 52 +--- lib/u_lib/src/u_runner.rs | 14 +- lib/u_lib/src/ufs/index.rs | 10 +- lib/u_lib/src/ufs/mod.rs | 7 +- .../2020-10-24-111622_create_all/up.sql | 2 +- 17 files changed, 298 insertions(+), 278 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 794eaa4..c2619b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -80,7 +80,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -193,7 +193,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -292,7 +292,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -376,9 +376,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -404,20 +404,19 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytestring" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" +checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" dependencies = [ "bytes", ] [[package]] name = "cc" -version = "1.0.83" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "0f8e7c90afad890484a21653d08b6e209ae34770fb5ee298f9c699fcc1e5c856" dependencies = [ - "jobserver", "libc", ] @@ -498,9 +497,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -585,7 +584,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583" dependencies = [ "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -691,7 +690,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -703,7 +702,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -723,7 +722,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -791,9 +790,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" dependencies = [ "libc", "windows-sys", @@ -857,9 +856,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -872,9 +871,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -882,15 +881,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -899,32 +898,32 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-timer" @@ -934,9 +933,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -962,9 +961,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1074,11 +1073,17 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -1224,9 +1229,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", "hashbrown 0.14.2", @@ -1261,20 +1266,11 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" -[[package]] -name = "jobserver" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -1302,9 +1298,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libflate" @@ -1328,15 +1324,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "local-channel" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a493488de5f18c8ffcba89eebb8532ffc562dc400490eb65b84893fae0b178" +checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" dependencies = [ "futures-core", "futures-sink", @@ -1345,9 +1341,9 @@ dependencies = [ [[package]] name = "local-waker" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" +checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" [[package]] name = "lock_api" @@ -1578,9 +1574,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" dependencies = [ "bitflags 2.4.1", "cfg-if 1.0.0", @@ -1599,7 +1595,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1610,9 +1606,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" dependencies = [ "cc", "libc", @@ -1644,7 +1640,7 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", "windows-targets", ] @@ -1678,7 +1674,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1701,9 +1697,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "3.1.2" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] name = "powerfmt" @@ -1824,15 +1820,6 @@ dependencies = [ "crossbeam-utils", ] -[[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" @@ -2010,7 +1997,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.38", + "syn 2.0.39", "walkdir", ] @@ -2041,12 +2028,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.20" +version = "0.38.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" +checksum = "80109a168d9bc0c7f483083244543a6eb0dba02295d33ca268145e6190d6df0c" dependencies = [ "bitflags 2.4.1", - "errno 0.3.5", + "errno 0.3.6", "libc", "linux-raw-sys", "windows-sys", @@ -2066,9 +2053,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ "base64", ] @@ -2160,29 +2147,29 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -2291,9 +2278,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" @@ -2406,9 +2393,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -2453,13 +2440,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if 1.0.0", "fastrand", - "redox_syscall 0.3.5", + "redox_syscall", "rustix", "windows-sys", ] @@ -2549,9 +2536,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -2568,13 +2555,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2622,9 +2609,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -2661,7 +2648,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -2688,11 +2675,12 @@ dependencies = [ [[package]] name = "tracing-appender" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", + "thiserror", "time", "tracing-subscriber", ] @@ -2705,7 +2693,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2720,9 +2708,9 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ "log", "once_cell", @@ -2731,9 +2719,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -2805,6 +2793,7 @@ dependencies = [ "dotenv", "envy", "guess_host_triple", + "hex", "lazy_static", "libc", "nix", @@ -3046,9 +3035,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -3056,24 +3045,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -3083,9 +3072,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3093,28 +3082,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -3228,9 +3217,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.17" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -3247,22 +3236,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.14" +version = "0.7.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69c48d63854f77746c68a5fbb4aa17f3997ece1cb301689a257af8cb80610d21" +checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.14" +version = "0.7.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c258c1040279e4f88763a113de72ce32dde2d50e2a94573f15dd534cea36a16d" +checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] diff --git a/bin/u_agent/src/lib.rs b/bin/u_agent/src/lib.rs index 709bf59..2680b8e 100644 --- a/bin/u_agent/src/lib.rs +++ b/bin/u_agent/src/lib.rs @@ -17,56 +17,54 @@ use u_lib::{ }; async fn process_request(assigned_jobs: Vec, client: &HttpClient) { - if !assigned_jobs.is_empty() { - for asgn_job in assigned_jobs { - if !JobCache::contains(asgn_job.job_id) { - info!("Fetching job: {}", &asgn_job.job_id); - let mut fetched_job = loop { - //todo: use payload cache - match client.get_full_job(asgn_job.job_id).await { - Ok(result) => break result, - Err(err) => { - debug!("{:?} \nretrying...", err); - sleep(AGENT_ITERATION_INTERVAL).await; - } - } - }; - if let Some(payload) = &mut fetched_job.payload { - if let Err(e) = payload.maybe_split_payload() { - ErrChan::send(e, "pay").await; - continue; + for asgn_job in assigned_jobs { + if !JobCache::contains(asgn_job.job_id) { + info!("Fetching job: {}", &asgn_job.job_id); + let mut fetched_job = loop { + //todo: use payload cache + match client.get_full_job(asgn_job.job_id).await { + Ok(result) => break result, + Err(err) => { + debug!("{:?} \nretrying...", err); + sleep(AGENT_ITERATION_INTERVAL).await; } } - JobCache::insert(fetched_job); + }; + if let Some(payload) = &mut fetched_job.payload { + if let Err(e) = payload.maybe_split_payload() { + ErrChan::send(e, "pay").await; + continue; + } } + JobCache::insert(fetched_job); + } - let job = match JobCache::get(asgn_job.job_id).as_deref() { - Some(job) => job.clone(), - None => continue, - }; + let job = match JobCache::get(asgn_job.job_id).as_deref() { + Some(job) => job.clone(), + None => continue, + }; + + info!("Scheduling job {}", job.meta.id.to_string()); - info!("Scheduling job {}", job.meta.id.to_string()); - - let schedule = match job.meta.schedule.clone() { - Some(sched) => { - if sched.is_empty() { - None - } else { - match sched.as_str().try_into() { - Ok(s) => Some(s), - Err(err) => { - ErrChan::send(err, "sch").await; - continue; - } + let schedule = match job.meta.schedule.clone() { + Some(sched) => { + if sched.is_empty() { + None + } else { + match sched.as_str().try_into() { + Ok(s) => Some(s), + Err(err) => { + ErrChan::send(err, "sch").await; + continue; } } } - None => None, - }; - SCHEDULER - .add_job(schedule, PreparedJob { job, ids: asgn_job }) - .await; - } + } + None => None, + }; + SCHEDULER + .add_job(schedule, PreparedJob { job, ids: asgn_job }) + .await; } } diff --git a/bin/u_server/src/handlers.rs b/bin/u_server/src/handlers.rs index f9aac78..b84ec2c 100644 --- a/bin/u_server/src/handlers.rs +++ b/bin/u_server/src/handlers.rs @@ -249,7 +249,10 @@ impl Endpoints { Reportable::Assigned(mut result) => { let result_agent_id = &result.agent_id; if agent_id != *result_agent_id { - warn!("Agent ids are not equal! actual id: {agent_id}, id from job: {result_agent_id}"); + warn!( + "Agent ids are not equal! actual id: {agent_id}, \ + id from job: {result_agent_id}" + ); continue; } result.touch(); @@ -260,24 +263,21 @@ impl Endpoints { JobType::Init => { result.state = JobState::Finished; - match &result.result { - Some(rbytes) => { - let mut agent: Agent = match serde_json::from_slice(&rbytes) { - Ok(a) => a, - Err(e) => { - error!("Error deserializing agent data from {agent_id}: {e}"); - continue; - } - }; - agent.state = AgentState::Active; - db.upsert_agent(&agent)?; - } - None => error!("Empty agent data"), - }}, - JobType::Shell => { - result.state = JobState::Finished - }, - JobType::Stats => (), + let mut agent: Agent = match result.deserialize() { + Ok(a) => a, + Err(e) => { + error!( + "Error deserializing agent \ + data from {agent_id}: {e}" + ); + continue; + } + }; + agent.state = AgentState::Active; + db.upsert_agent(&agent)?; + } + JobType::Shell => result.state = JobState::Finished, + JobType::Stats => result.state = JobState::Finished, JobType::Terminate => (), JobType::Update => (), } @@ -287,7 +287,8 @@ impl Endpoints { error!("agent {agent_id} reported: {e}"); } Reportable::Dummy => (), - }} + } + } Ok(()) }) .await diff --git a/integration-tests/docker-compose.yml b/integration-tests/docker-compose.yml index 093312d..d7e937e 100644 --- a/integration-tests/docker-compose.yml +++ b/integration-tests/docker-compose.yml @@ -40,7 +40,7 @@ services: networks: - u_net ports: - - 54321:5432 + - 5432:5432 env_file: - ../.env - ../.env.private diff --git a/integration-tests/tests/integration_tests/behaviour.rs b/integration-tests/tests/integration_tests/behaviour.rs index cea4f85..f4a3b2d 100644 --- a/integration-tests/tests/integration_tests/behaviour.rs +++ b/integration-tests/tests/integration_tests/behaviour.rs @@ -16,7 +16,7 @@ async fn registration(registered_agent: &RegisteredAgent) { } #[tokio::test] -async fn setup_tasks() { +async fn setup_jobs() { let agents: Vec = Panel::check_output("agents read"); let agent_id = agents[0].id; let job_alias = "passwd_contents"; @@ -88,3 +88,52 @@ async fn large_payload() { }) .await; } + +#[tokio::test] +async fn gather_stats() { + let agent = &Panel::check_output::>("agents read")[0]; + let job_alias = "stats"; + let job = RawJob::default() + .with_type(JobType::Stats) + .with_alias(job_alias) + .with_target_platforms(&agent.platform) + .try_into_job() + .unwrap(); + let job_id = job.meta.id; + let agent_id = agent.id; + + Panel::check_status(["jobs", "create", &to_string(&RawJob::from(job)).unwrap()]); + + let assigned = AssignedJobById { + agent_id, + job_id, + ..Default::default() + }; + Panel::check_status(["map", "create", &to_string(&[assigned]).unwrap()]); + + let result = retry_with_interval(5, AGENT_ITERATION_INTERVAL, || { + let result = + Panel::check_output::>(["map", "read", &job_id.to_string()]).remove(0); + if result.state == JobState::Finished { + Ok(result) + } else { + Err("job didn't finish") + } + }) + .await; + + let stats = result.deserialize::().unwrap(); + + assert_eq!(stats.agent_id, agent_id); + assert!(stats.cached_jobs.contains(&job_id)); + assert!(stats + .scheduled_jobs + .iter() + .find(|j| j.job_ident == "error_reporting") + .is_some()); + assert!(stats + .scheduled_jobs + .iter() + .find(|j| j.job_ident == "agent_loop") + .is_some()) +} diff --git a/lib/u_lib/Cargo.toml b/lib/u_lib/Cargo.toml index 841049c..191f52f 100644 --- a/lib/u_lib/Cargo.toml +++ b/lib/u_lib/Cargo.toml @@ -34,6 +34,7 @@ parking_lot = "0.12.1" bincode = "1.3.3" sha3 = "0.10.7" cron = "0.12.0" +hex = "0.4.3" [target.'cfg(unix)'.dependencies] daemonize = "0.5" diff --git a/lib/u_lib/src/jobs.rs b/lib/u_lib/src/jobs.rs index cc83d18..d122566 100644 --- a/lib/u_lib/src/jobs.rs +++ b/lib/u_lib/src/jobs.rs @@ -2,9 +2,7 @@ use crate::{ cache::JobCache, combined_result::CombinedResult, config::get_self_id, - models::{ - stats::Stats, Agent, AssignedJob, AssignedJobById, Job, JobType, PreparedJob, RawJob, - }, + models::{Agent, AssignedJob, AssignedJobById, Job, JobType, PreparedJob, RawJob, Stats}, proc_output::ProcOutput, scheduler::SCHEDULER, u_runner::{ExecResult, IdentifiableFuture, URunner}, diff --git a/lib/u_lib/src/models/jobs/assigned.rs b/lib/u_lib/src/models/jobs/assigned.rs index 397cf56..93f0a68 100644 --- a/lib/u_lib/src/models/jobs/assigned.rs +++ b/lib/u_lib/src/models/jobs/assigned.rs @@ -6,10 +6,11 @@ use crate::{ conv::{bytes_to_string_truncated, systime_to_string}, models::Job, types::Id, + UError, UResult, }; #[cfg(feature = "server")] use diesel::{Identifiable, Insertable, Queryable}; -use serde::{Deserialize, Serialize}; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; use std::{borrow::Cow, fmt::Debug, time::SystemTime}; /// A job assigned to some agents, stores execution state and result @@ -145,6 +146,13 @@ impl AssignedJob { String::from_utf8_lossy(self.to_raw_result()) } + pub fn deserialize(&self) -> UResult { + let body = self.result.as_deref().unwrap_or_default(); + serde_json::from_slice(body).map_err(|e| { + UError::DeserializeError(e.to_string(), bytes_to_string_truncated(body, 1024)) + }) + } + pub fn set_result(&mut self, result: &impl Serialize) { self.result = Some(serde_json::to_vec(result).unwrap()); } diff --git a/lib/u_lib/src/models/mod.rs b/lib/u_lib/src/models/mod.rs index 0911500..4754ae4 100644 --- a/lib/u_lib/src/models/mod.rs +++ b/lib/u_lib/src/models/mod.rs @@ -3,9 +3,9 @@ mod jobs; mod payload; #[cfg(feature = "server")] pub mod schema; -pub mod stats; +mod stats; -pub use crate::models::{agent::*, jobs::*, payload::*}; +pub use crate::models::{agent::*, jobs::*, payload::*, stats::*}; use serde::Deserialize; use strum::{Display as StrumDisplay, EnumString}; diff --git a/lib/u_lib/src/models/schema.rs b/lib/u_lib/src/models/schema.rs index 53a01fc..38683f1 100644 --- a/lib/u_lib/src/models/schema.rs +++ b/lib/u_lib/src/models/schema.rs @@ -86,4 +86,9 @@ diesel::joinable!(jobs -> payloads (payload_id)); diesel::joinable!(results -> agents (agent_id)); diesel::joinable!(results -> jobs (job_id)); -diesel::allow_tables_to_appear_in_same_query!(agents, jobs, payloads, results,); +diesel::allow_tables_to_appear_in_same_query!( + agents, + jobs, + payloads, + results, +); diff --git a/lib/u_lib/src/models/stats.rs b/lib/u_lib/src/models/stats.rs index d282286..4b19462 100644 --- a/lib/u_lib/src/models/stats.rs +++ b/lib/u_lib/src/models/stats.rs @@ -1,8 +1,8 @@ -use serde::Serialize; +use serde::{Deserialize, Serialize}; use crate::{messaging::AsMsg, scheduler::EntryStat, types::Id, ufs::IndexFileMeta}; -#[derive(Debug, Clone, Serialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Stats { pub agent_id: Id, pub running_jobs: Vec, diff --git a/lib/u_lib/src/scheduler/entry.rs b/lib/u_lib/src/scheduler/entry.rs index b235b51..6eb7d47 100644 --- a/lib/u_lib/src/scheduler/entry.rs +++ b/lib/u_lib/src/scheduler/entry.rs @@ -1,7 +1,7 @@ use crate::{models::PreparedJob, types::Id, u_runner::IdentifiableFuture}; use chrono::{DateTime, Utc}; use core::fmt; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use std::sync::Arc; pub trait SchedulerJob { @@ -21,16 +21,16 @@ where #[derive(Clone)] pub struct Entry { - pub id: Id, + pub entry_id: Id, pub schedule: Option, pub next: Option>, pub runnable: EntryType, } -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct EntryStat { - pub id: Id, - pub job_id: String, + pub entry_id: Id, + pub job_ident: String, pub schedule: String, pub next: Option>, } @@ -66,14 +66,14 @@ impl Entry { } pub fn as_stat(&self) -> EntryStat { - let job_id = match &self.runnable { + let job_ident = match &self.runnable { EntryType::URunner(entry) => entry.job.meta.id.to_string(), - EntryType::Common(entry) => entry.call().job_id.to_string(), + EntryType::Common(entry) => entry.call().job_ident.to_string(), }; EntryStat { - id: self.id, - job_id, + entry_id: self.entry_id, + job_ident, schedule: self .schedule .as_ref() @@ -86,6 +86,6 @@ impl Entry { impl fmt::Debug for Entry { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{} {:?} {:?}", self.id, self.schedule, self.next) + write!(f, "{} {:?} {:?}", self.entry_id, self.schedule, self.next) } } diff --git a/lib/u_lib/src/scheduler/mod.rs b/lib/u_lib/src/scheduler/mod.rs index 29e40c7..b40622c 100644 --- a/lib/u_lib/src/scheduler/mod.rs +++ b/lib/u_lib/src/scheduler/mod.rs @@ -8,7 +8,6 @@ use cron::Schedule; use entry::Entry; use once_cell::sync::Lazy; use tokio::sync::Mutex; -use tokio::time::timeout; use uuid::Uuid; use crate::jobs::AnonymousJobBatch; @@ -59,23 +58,23 @@ impl AsyncScheduler { for entry in &mut *entries { match entry.next.as_ref() { Some(next) => { + if next.gt(&Utc::now()) { + break; + } match &entry.runnable { EntryType::Common(runnable) => { - let cancel_timeout = - next.timestamp_millis() - Utc::now().timestamp_millis(); - let cancel_timeout = Duration::from_millis(cancel_timeout as u64); - - tokio::spawn(timeout(cancel_timeout, runnable.call())); + let fut = runnable.call(); + tokio::spawn(fut); + } + EntryType::URunner(runnable) => { + debug!("starting assigned job {:?}", runnable.ids); + job_batch.push(runnable.clone()) } - EntryType::URunner(runnable) => job_batch.push(runnable.clone()), } entry.set_next_run_time(); } None => {} } - if entry.next.as_ref().unwrap().gt(&Utc::now()) { - break; - } } AnonymousJobBatch::from_prepared_jobs(job_batch) @@ -90,7 +89,7 @@ impl AsyncScheduler { let entry_id = Uuid::new_v4(); let runnable = runnable.into(); let mut entry = Entry { - id: entry_id, + entry_id, schedule, next: None, runnable, @@ -103,7 +102,7 @@ impl AsyncScheduler { } pub async fn del_job(&self, entry_id: Id) { - self.entries.lock().await.retain(|e| e.id != entry_id); + self.entries.lock().await.retain(|e| e.entry_id != entry_id); } pub async fn stats(&self) -> Vec { @@ -176,33 +175,4 @@ mod tests { assert_eq!(*v.lock().await, 2); } - - /// Run task every second. - /// Task will be cancelled if not completed until next run - /// (and this task lasts 2 secs), - /// so the counter value should still be 0 - #[tokio::test(flavor = "multi_thread")] - async fn cancellation() { - let counter = Arc::new(Mutex::new(0)); - let scheduler = AsyncScheduler::new(); - - { - let counter = counter.clone(); - scheduler - .add_job(Some("*/1 * * * * * *".try_into().unwrap()), move || { - let counter = counter.clone(); - IdentifiableFuture::from_fut_with_ident("testf", async move { - sleep(Duration::from_secs(2)).await; - *counter.lock().await += 1; - }) - }) - .await; - } - - scheduler.start().await; - - sleep(Duration::from_secs(3)).await; - - assert_eq!(*counter.lock().await, 0); - } } diff --git a/lib/u_lib/src/u_runner.rs b/lib/u_lib/src/u_runner.rs index 3696885..59f34fc 100644 --- a/lib/u_lib/src/u_runner.rs +++ b/lib/u_lib/src/u_runner.rs @@ -24,18 +24,18 @@ lazy_static! { } pub struct IdentifiableFuture { - pub job_id: String, + pub job_ident: String, fut: Pin + Send + Sync + 'static>>, } impl IdentifiableFuture { pub fn from_fut_with_ident( - job_id: impl Into, + job_ident: impl Into, job: impl Future + Send + Sync + 'static, ) -> Self { Self { fut: Box::pin(job), - job_id: job_id.into(), + job_ident: job_ident.into(), } } } @@ -49,7 +49,7 @@ impl Future for IdentifiableFuture { } struct JoinInfo { - job_id: String, + job_ident: String, handle: JoinHandle>, completed: bool, // collectable: bool, // indicates if future can be popped from pool via pop_task_if_completed @@ -91,7 +91,7 @@ impl URunner { let handle = Handle::current(); let fid = Uuid::new_v4(); let tx = get_sender(); - let job_id = executable.job_id.clone(); + let job_id = executable.job_ident.clone(); self.fids.push(fid); let job_wrapper = async move { debug!("inside wrapper (started): {}", fid); @@ -100,7 +100,7 @@ impl URunner { result }; let handler = JoinInfo { - job_id, + job_ident: job_id, handle: spawn_blocking(move || handle.spawn(job_wrapper)), completed: false, }; @@ -155,7 +155,7 @@ impl URunner { .lock() .await .values() - .map(|v| v.job_id.clone()) + .map(|v| v.job_ident.clone()) .collect() } diff --git a/lib/u_lib/src/ufs/index.rs b/lib/u_lib/src/ufs/index.rs index dbfdbb2..c6b0cb9 100644 --- a/lib/u_lib/src/ufs/index.rs +++ b/lib/u_lib/src/ufs/index.rs @@ -34,7 +34,7 @@ static INDEX: Lazy> = Lazy::new(|| { pub struct IndexFileMeta { extension: Option, pub external: bool, // if file is present before adding to index - pub hash: Vec, + pub hashsum: String, pub path: PathBuf, // actual file path pub size: u64, } @@ -42,7 +42,7 @@ pub struct IndexFileMeta { impl IndexFileMeta { pub fn new( full_path: impl Into, - hash: Vec, + hashsum: String, external: bool, ) -> Result { let full_path: PathBuf = full_path.into(); @@ -53,7 +53,7 @@ impl IndexFileMeta { path: full_path, extension, external, - hash, + hashsum, size, }) } @@ -96,14 +96,14 @@ pub fn get(name: impl AsRef) -> Option { index.get(name.as_ref()).cloned() } -pub fn get_by_hash(hash: impl AsRef<[u8]>) -> Option<(String, IndexFileMeta)> { +pub fn get_by_hash(hash: impl AsRef) -> Option<(String, IndexFileMeta)> { let mut index = INDEX.lock(); sync::deleted(&mut index); index .iter() - .find(|(_name, meta)| meta.hash == hash.as_ref()) + .find(|(_name, meta)| meta.hashsum == hash.as_ref()) .map(|(n, m)| (n.to_owned(), m.clone())) } diff --git a/lib/u_lib/src/ufs/mod.rs b/lib/u_lib/src/ufs/mod.rs index 5fce83f..dc9ac8e 100644 --- a/lib/u_lib/src/ufs/mod.rs +++ b/lib/u_lib/src/ufs/mod.rs @@ -93,7 +93,7 @@ pub fn edit(name: impl AsRef, data: impl AsRef<[u8]>) -> Result<()> { let meta = read_meta(&name).context("edit_meta")?; let data_hash = hash_data(&data); - if meta.hash == data_hash { + if meta.hashsum == data_hash { return Ok(()); } @@ -205,10 +205,11 @@ pub fn cleanup() { } */ -fn hash_data(data: impl AsRef<[u8]>) -> Vec { +fn hash_data(data: impl AsRef<[u8]>) -> String { use sha3::{Digest, Sha3_256}; let mut hasher = Sha3_256::new(); hasher.update(data); - hasher.finalize().to_vec() + let hashsum = hasher.finalize().to_vec(); + hex::encode(hashsum) } diff --git a/migrations/2020-10-24-111622_create_all/up.sql b/migrations/2020-10-24-111622_create_all/up.sql index f4058a8..3dce513 100644 --- a/migrations/2020-10-24-111622_create_all/up.sql +++ b/migrations/2020-10-24-111622_create_all/up.sql @@ -1,5 +1,5 @@ CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; -CREATE TYPE JobType AS ENUM ('shell', 'init', 'python', 'service'); +CREATE TYPE JobType AS ENUM ('shell', 'init', 'python', 'service', 'stats'); CREATE TYPE JobState AS ENUM ('queued', 'running', 'finished'); CREATE TYPE AgentState AS ENUM ('new', 'active', 'banned'); -- 2.36.2 From 31b678da3ec769f5ffd4f7192e458161201d815f Mon Sep 17 00:00:00 2001 From: plazmoid Date: Sun, 7 Jan 2024 02:41:37 +0500 Subject: [PATCH 4/4] smol fixes --- Cargo.lock | 524 ++++++++++-------- bin/u_panel/src/gui/fe/src/app/app.module.ts | 2 + .../dialogs/base-info-dialog.component.less | 4 + .../payload-overview.component.html | 5 +- bin/u_panel/src/gui/fe/src/index.html | 2 +- integration-tests/tests/helpers/panel.rs | 2 +- lib/u_lib/src/proc_output.rs | 2 +- 7 files changed, 293 insertions(+), 248 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c2619b6..fd23023 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,9 +21,9 @@ dependencies = [ [[package]] name = "actix-cors" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b340e9cfa5b08690aae90fb61beb44e9b06f44fe3d0f93781aaa58cfba86245e" +checksum = "0346d8c1f762b41b458ed3145eea914966bb9ad20b9be0d6d463b20d45586370" dependencies = [ "actix-utils", "actix-web", @@ -36,9 +36,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", @@ -80,14 +80,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[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", @@ -118,7 +118,7 @@ dependencies = [ "futures-core", "futures-util", "mio", - "socket2 0.5.5", + "socket2", "tokio", "tracing", ] @@ -146,9 +146,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", @@ -179,7 +179,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "smallvec", - "socket2 0.5.5", + "socket2", "time", "url", ] @@ -193,7 +193,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -219,9 +219,9 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[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", @@ -286,13 +286,13 @@ checksum = "a26fa4d7e3f2eebadf743988fc8aec9fa9a9e82611acafd77c1462ed6262440a" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -413,10 +413,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.84" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f8e7c90afad890484a21653d08b6e209ae34770fb5ee298f9c699fcc1e5c856" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ + "jobserver", "libc", ] @@ -444,7 +445,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -481,9 +482,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -491,9 +492,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" @@ -526,9 +527,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -536,9 +537,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", @@ -547,22 +548,20 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if 1.0.0", ] @@ -579,12 +578,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583" +checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" dependencies = [ "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -598,9 +597,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "deadpool" @@ -646,9 +645,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -668,9 +667,9 @@ dependencies = [ [[package]] name = "diesel" -version = "2.1.3" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2268a214a6f118fce1838edba3d1561cf0e78d8de785475957a580a7f8c69d33" +checksum = "62c6fcf842f17f8c78ecf7c81d75c5ce84436b41ee07e03f490fbb5f5a8731d8" dependencies = [ "bitflags 2.4.1", "byteorder", @@ -690,7 +689,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -702,7 +701,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -722,7 +721,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -790,12 +789,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -847,18 +846,18 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[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", @@ -871,9 +870,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", @@ -881,15 +880,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", @@ -898,32 +897,32 @@ 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.39", + "syn 2.0.43", ] [[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-timer" @@ -933,9 +932,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[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-channel", "futures-core", @@ -972,9 +971,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "guess_host_triple" @@ -990,9 +989,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -1000,7 +999,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap", "slab", "tokio", "tokio-util", @@ -1009,15 +1008,9 @@ dependencies = [ [[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.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "headers" @@ -1092,9 +1085,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -1115,9 +1108,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -1130,7 +1123,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -1152,9 +1145,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", @@ -1175,9 +1168,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1217,16 +1210,6 @@ dependencies = [ "proc-macro-hack", ] -[[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.1.0" @@ -1234,7 +1217,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown", ] [[package]] @@ -1262,15 +1245,24 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -1298,9 +1290,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libflate" @@ -1324,9 +1316,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "local-channel" @@ -1372,18 +1364,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "migrations_internals" @@ -1450,14 +1433,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1559,24 +1542,24 @@ 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", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.59" +version = "0.10.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" +checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" dependencies = [ "bitflags 2.4.1", "cfg-if 1.0.0", @@ -1595,7 +1578,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -1606,9 +1589,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.95" +version = "0.9.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" +checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" dependencies = [ "cc", "libc", @@ -1642,7 +1625,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -1653,9 +1636,9 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" @@ -1674,7 +1657,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -1691,15 +1674,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" [[package]] name = "platforms" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "powerfmt" @@ -1754,9 +1737,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" dependencies = [ "unicode-ident", ] @@ -1875,9 +1858,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64", "bytes", @@ -1919,16 +1902,16 @@ checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" [[package]] name = "ring" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom", "libc", "spin", "untrusted", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1997,7 +1980,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.39", + "syn 2.0.43", "walkdir", ] @@ -2028,22 +2011,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.22" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80109a168d9bc0c7f483083244543a6eb0dba02295d33ca268145e6190d6df0c" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", - "errno 0.3.6", + "errno 0.3.8", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.8" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring", @@ -2072,9 +2055,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -2087,11 +2070,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", + "windows-sys 0.52.0", ] [[package]] @@ -2147,22 +2130,22 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -2192,9 +2175,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -2282,16 +2265,6 @@ version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -2299,7 +2272,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2393,9 +2366,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" dependencies = [ "proc-macro2", "quote", @@ -2440,15 +2413,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", "rustix", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -2492,9 +2465,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -2512,9 +2485,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -2536,9 +2509,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -2548,9 +2521,9 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2561,7 +2534,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -2648,7 +2621,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -2693,7 +2666,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[package]] @@ -2737,9 +2710,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" @@ -2882,9 +2855,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" @@ -2921,9 +2894,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -2938,9 +2911,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ "getrandom", "serde", @@ -3035,9 +3008,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -3045,24 +3018,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -3072,9 +3045,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3082,28 +3055,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -3142,11 +3115,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", + "windows-targets 0.52.0", ] [[package]] @@ -3155,7 +3128,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -3164,13 +3146,28 @@ 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", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -3179,47 +3176,89 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[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_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[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_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[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_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" dependencies = [ "memchr", ] @@ -3231,45 +3270,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if 1.0.0", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "zerocopy" -version = "0.7.25" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.25" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.43", ] [[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/bin/u_panel/src/gui/fe/src/app/app.module.ts b/bin/u_panel/src/gui/fe/src/app/app.module.ts index 5925085..e8831c3 100644 --- a/bin/u_panel/src/gui/fe/src/app/app.module.ts +++ b/bin/u_panel/src/gui/fe/src/app/app.module.ts @@ -12,6 +12,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { HttpClientModule } from '@angular/common/http'; import { MatDialogModule } from '@angular/material/dialog'; +import { MatGridListModule } from '@angular/material/grid-list'; import { MatIconModule } from '@angular/material/icon'; import { FormsModule } from '@angular/forms'; import { AgentComponent, JobComponent, ResultComponent, PayloadComponent } from './components/tables'; @@ -62,6 +63,7 @@ import { NewPayloadDialogComponent } from './components/dialogs/new-payload-dial MatSnackBarModule, MatSelectModule, MatListModule, + MatGridListModule, FormsModule, BrowserAnimationsModule ], diff --git a/bin/u_panel/src/gui/fe/src/app/components/dialogs/base-info-dialog.component.less b/bin/u_panel/src/gui/fe/src/app/components/dialogs/base-info-dialog.component.less index 23b8bc5..f5e1d33 100644 --- a/bin/u_panel/src/gui/fe/src/app/components/dialogs/base-info-dialog.component.less +++ b/bin/u_panel/src/gui/fe/src/app/components/dialogs/base-info-dialog.component.less @@ -11,4 +11,8 @@ div.info-dialog-forms-box-smol { width: 30%; float: left; margin-right: 10px; +} + +.code { + font-family: "Roboto Mono", monospace; } \ No newline at end of file diff --git a/bin/u_panel/src/gui/fe/src/app/components/payload-overview/payload-overview.component.html b/bin/u_panel/src/gui/fe/src/app/components/payload-overview/payload-overview.component.html index 4e4fc7c..bf929cb 100644 --- a/bin/u_panel/src/gui/fe/src/app/components/payload-overview/payload-overview.component.html +++ b/bin/u_panel/src/gui/fe/src/app/components/payload-overview/payload-overview.component.html @@ -1,6 +1,7 @@ - + Payload data - \ No newline at end of file diff --git a/bin/u_panel/src/gui/fe/src/index.html b/bin/u_panel/src/gui/fe/src/index.html index e299aec..33299f4 100644 --- a/bin/u_panel/src/gui/fe/src/index.html +++ b/bin/u_panel/src/gui/fe/src/index.html @@ -7,7 +7,7 @@ - + diff --git a/integration-tests/tests/helpers/panel.rs b/integration-tests/tests/helpers/panel.rs index f33085b..0423986 100644 --- a/integration-tests/tests/helpers/panel.rs +++ b/integration-tests/tests/helpers/panel.rs @@ -80,7 +80,7 @@ pub trait IntoArgs { impl IntoArgs for String { fn into_args(self) -> Vec { - >::as_ref(&self).into_args() + self.as_str().into_args() } fn display(&self) -> String { diff --git a/lib/u_lib/src/proc_output.rs b/lib/u_lib/src/proc_output.rs index 06de5a6..1fe5c33 100644 --- a/lib/u_lib/src/proc_output.rs +++ b/lib/u_lib/src/proc_output.rs @@ -7,7 +7,7 @@ pub struct ProcOutput { } impl ProcOutput { - const STDERR_DELIMETER: &[u8] = b"[STDERR]\n"; + const STDERR_DELIMETER: &'static [u8] = b"[STDERR]\n"; pub fn from_output(output: &Output) -> Self { Self::new() -- 2.36.2