diff --git a/examples/pipeline-transactional-processing/Cargo.lock b/examples/pipeline-transactional-processing/Cargo.lock index 46c155f..8440800 100644 --- a/examples/pipeline-transactional-processing/Cargo.lock +++ b/examples/pipeline-transactional-processing/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ahash" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ "getrandom", "once_cell", @@ -24,9 +24,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" +checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" [[package]] name = "arc-swap" @@ -110,9 +110,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "byteorder" @@ -128,9 +128,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -138,18 +138,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "libc", - "num-integer", - "num-traits", - "winapi", -] - [[package]] name = "const_fn" version = "0.4.8" @@ -167,9 +155,9 @@ dependencies = [ [[package]] name = "crc" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c2722795460108a7872e1cd933a85d6ec38abc4baecad51028f702da28889f" +checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" dependencies = [ "crc-catalog", ] @@ -414,9 +402,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c06815895acec637cd6ed6e9662c935b866d20a106f8361892893a7d9234964" +checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" dependencies = [ "bytes", "fnv", @@ -518,9 +506,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes", "http", @@ -541,9 +529,9 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" -version = "0.14.13" +version = "0.14.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" +checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" dependencies = [ "bytes", "futures-channel", @@ -598,9 +586,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", ] @@ -637,9 +625,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.103" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" +checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "lock_api" @@ -661,9 +649,9 @@ dependencies = [ [[package]] name = "matchers" -version = "0.0.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ "regex-automata", ] @@ -693,15 +681,15 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "minimal-lexical" -version = "0.1.4" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c64630dcdd71f1a64c435f54885086a0de5d6a12d104d69b165fb7d5286d677" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "mio" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -721,9 +709,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" +checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" dependencies = [ "memchr", "minimal-lexical", @@ -739,16 +727,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.14" @@ -857,9 +835,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "proc-macro-hack" @@ -875,9 +853,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] @@ -1143,9 +1121,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740223c51853f3145fe7c90360d2d4232f2b62e3449489c207eccde818979982" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] @@ -1161,9 +1139,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" @@ -1370,9 +1348,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4eac2e6c19f5c3abc0c229bea31ff0b9b091c7b14990e8924b92902a303a0c0" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -1381,18 +1359,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -1463,9 +1441,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" +checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee" dependencies = [ "autocfg", "bytes", @@ -1492,9 +1470,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "154794c8f499c2619acd19e839294703e9e32e7630ef5f46ea80d4ef0fbee5eb" +checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095" dependencies = [ "proc-macro2", "quote", @@ -1514,9 +1492,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -1526,9 +1504,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes", "futures-core", @@ -1572,14 +1550,15 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60422bc7fefa2f3ec70359b8ff1caff59d785877eb70595904605bcc412470f" +checksum = "c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00" dependencies = [ "futures-core", "futures-util", "indexmap", "pin-project", + "pin-project-lite", "rand", "slab", "tokio", @@ -1604,9 +1583,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if", "log", @@ -1617,9 +1596,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", @@ -1656,36 +1635,22 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.2.24" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd0568dbfe3baf7048b7908d2b32bca0d81cd56bec6d2a8f894b01d74f86be3" +checksum = "80a4ddde70311d8da398062ecf6fc2c309337de6b0f77d6c27aff8d53f6fca52" dependencies = [ "ansi_term", - "chrono", "lazy_static", "matchers", "regex", - "serde", - "serde_json", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] @@ -1702,9 +1667,9 @@ checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" [[package]] name = "unicode-bidi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" diff --git a/examples/pipeline-transactional-processing/Cargo.toml b/examples/pipeline-transactional-processing/Cargo.toml index 5f62f8d..3c21e0b 100644 --- a/examples/pipeline-transactional-processing/Cargo.toml +++ b/examples/pipeline-transactional-processing/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "pipeline-txp" version = "0.1.0" -edition = "2018" +edition = "2021" authors = ["Anthony Dodd "] [dependencies] -anyhow = "1.0.44" +anyhow = "1" hadron = { package = "hadron-client", version = "0.1.0-beta.1" } sqlx = { version = "0.5", features = [ "runtime-tokio-rustls", "postgres", "offline", "time" ] } tokio = { version = "1", default-features = false, features = [ @@ -13,4 +13,4 @@ tokio = { version = "1", default-features = false, features = [ "rt", "macros", "sync", "signal", ]} tracing = { version = "0.1", features = ["attributes"] } -tracing-subscriber = "0.2" +tracing-subscriber = { version = "0.3", features = ["env-filter", "registry"] } diff --git a/examples/pipeline-transactional-processing/Dockerfile b/examples/pipeline-transactional-processing/Dockerfile index 875a139..e0e60c1 100644 --- a/examples/pipeline-transactional-processing/Dockerfile +++ b/examples/pipeline-transactional-processing/Dockerfile @@ -1,7 +1,7 @@ ## Dockerfile for pipeline-transactional-processing (txp) demo app. # syntax=docker/dockerfile:1.3 -ARG RUST_TAG=1.56.0 +ARG RUST_TAG=1.56.1 ARG ALPINE_TAG=3.14 FROM rust:${RUST_TAG}-alpine${ALPINE_TAG} as builder diff --git a/examples/stream-transactional-processing/Cargo.lock b/examples/stream-transactional-processing/Cargo.lock index dbddb39..b8f7b72 100644 --- a/examples/stream-transactional-processing/Cargo.lock +++ b/examples/stream-transactional-processing/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ahash" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ "getrandom", "once_cell", @@ -24,9 +24,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" +checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" [[package]] name = "arc-swap" @@ -104,9 +104,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "byteorder" @@ -122,9 +122,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -132,18 +132,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "libc", - "num-integer", - "num-traits", - "winapi", -] - [[package]] name = "cpufeatures" version = "0.2.1" @@ -155,9 +143,9 @@ dependencies = [ [[package]] name = "crc" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c2722795460108a7872e1cd933a85d6ec38abc4baecad51028f702da28889f" +checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" dependencies = [ "crc-catalog", ] @@ -396,9 +384,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c06815895acec637cd6ed6e9662c935b866d20a106f8361892893a7d9234964" +checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" dependencies = [ "bytes", "fnv", @@ -500,9 +488,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes", "http", @@ -523,9 +511,9 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" -version = "0.14.13" +version = "0.14.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" +checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" dependencies = [ "bytes", "futures-channel", @@ -580,9 +568,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", ] @@ -619,9 +607,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.103" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" +checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "lock_api" @@ -643,9 +631,9 @@ dependencies = [ [[package]] name = "matchers" -version = "0.0.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ "regex-automata", ] @@ -675,15 +663,15 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "minimal-lexical" -version = "0.1.4" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c64630dcdd71f1a64c435f54885086a0de5d6a12d104d69b165fb7d5286d677" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "mio" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -703,9 +691,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" +checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" dependencies = [ "memchr", "minimal-lexical", @@ -721,16 +709,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.14" @@ -827,9 +805,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "proc-macro-hack" @@ -845,9 +823,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] @@ -1083,9 +1061,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740223c51853f3145fe7c90360d2d4232f2b62e3449489c207eccde818979982" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] @@ -1101,9 +1079,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" @@ -1263,9 +1241,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4eac2e6c19f5c3abc0c229bea31ff0b9b091c7b14990e8924b92902a303a0c0" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -1274,18 +1252,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -1318,9 +1296,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" +checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee" dependencies = [ "autocfg", "bytes", @@ -1347,9 +1325,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "154794c8f499c2619acd19e839294703e9e32e7630ef5f46ea80d4ef0fbee5eb" +checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095" dependencies = [ "proc-macro2", "quote", @@ -1369,9 +1347,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -1381,9 +1359,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes", "futures-core", @@ -1427,14 +1405,15 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60422bc7fefa2f3ec70359b8ff1caff59d785877eb70595904605bcc412470f" +checksum = "c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00" dependencies = [ "futures-core", "futures-util", "indexmap", "pin-project", + "pin-project-lite", "rand", "slab", "tokio", @@ -1459,9 +1438,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if", "log", @@ -1472,9 +1451,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", @@ -1511,36 +1490,22 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.2.24" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd0568dbfe3baf7048b7908d2b32bca0d81cd56bec6d2a8f894b01d74f86be3" +checksum = "80a4ddde70311d8da398062ecf6fc2c309337de6b0f77d6c27aff8d53f6fca52" dependencies = [ "ansi_term", - "chrono", "lazy_static", "matchers", "regex", - "serde", - "serde_json", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] @@ -1557,9 +1522,9 @@ checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" [[package]] name = "unicode-bidi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" diff --git a/examples/stream-transactional-processing/Cargo.toml b/examples/stream-transactional-processing/Cargo.toml index 25d41f6..eb17b31 100644 --- a/examples/stream-transactional-processing/Cargo.toml +++ b/examples/stream-transactional-processing/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "stream-txp" version = "0.1.0" -edition = "2018" +edition = "2021" authors = ["Anthony Dodd "] [dependencies] -anyhow = "1.0.44" +anyhow = "1" hadron = { package = "hadron-client", version = "0.1.0-beta.1" } sqlx = { version = "0.5", features = [ "runtime-tokio-rustls", "postgres", "offline" ] } tokio = { version = "1", default-features = false, features = [ @@ -13,4 +13,4 @@ tokio = { version = "1", default-features = false, features = [ "rt", "macros", "sync", "signal", ]} tracing = { version = "0.1", features = ["attributes"] } -tracing-subscriber = "0.2" +tracing-subscriber = { version = "0.3", features = ["env-filter", "registry"] } diff --git a/examples/stream-transactional-processing/Dockerfile b/examples/stream-transactional-processing/Dockerfile index 5bee7cb..6fed233 100644 --- a/examples/stream-transactional-processing/Dockerfile +++ b/examples/stream-transactional-processing/Dockerfile @@ -1,7 +1,7 @@ ## Dockerfile for stream-transactional-processing (txp) demo app. # syntax=docker/dockerfile:1.3 -ARG RUST_TAG=1.56.0 +ARG RUST_TAG=1.56.1 ARG ALPINE_TAG=3.14 FROM rust:${RUST_TAG}-alpine${ALPINE_TAG} as builder diff --git a/hadron-cli/Cargo.lock b/hadron-cli/Cargo.lock index 0274000..4f5b2e3 100644 --- a/hadron-cli/Cargo.lock +++ b/hadron-cli/Cargo.lock @@ -31,9 +31,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" +checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" [[package]] name = "arc-swap" @@ -104,9 +104,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "bytes" @@ -116,9 +116,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -126,18 +126,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "libc", - "num-integer", - "num-traits", - "winapi", -] - [[package]] name = "clap" version = "2.33.3" @@ -272,9 +260,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c06815895acec637cd6ed6e9662c935b866d20a106f8361892893a7d9234964" +checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" dependencies = [ "bytes", "fnv", @@ -367,9 +355,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes", "http", @@ -390,9 +378,9 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" -version = "0.14.13" +version = "0.14.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" +checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" dependencies = [ "bytes", "futures-channel", @@ -466,9 +454,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.103" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" +checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "log" @@ -481,9 +469,9 @@ dependencies = [ [[package]] name = "matchers" -version = "0.0.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ "regex-automata", ] @@ -496,9 +484,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "mio" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -525,25 +513,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - [[package]] name = "once_cell" version = "1.8.0" @@ -590,9 +559,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "proc-macro-error" @@ -632,9 +601,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] @@ -765,12 +734,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - [[package]] name = "sct" version = "0.6.1" @@ -787,28 +750,11 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" -[[package]] -name = "serde" -version = "1.0.130" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" - -[[package]] -name = "serde_json" -version = "1.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" -dependencies = [ - "itoa", - "ryu", - "serde", -] - [[package]] name = "sharded-slab" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740223c51853f3145fe7c90360d2d4232f2b62e3449489c207eccde818979982" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] @@ -824,9 +770,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" @@ -858,9 +804,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "structopt" -version = "0.3.23" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf9d950ef167e25e0bdb073cf1d68e9ad2795ac826f2f3f59647817cf23c0bfa" +checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c" dependencies = [ "clap", "lazy_static", @@ -869,9 +815,9 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.16" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134d838a2c9943ac3125cf6df165eda53493451b719f3255b2a26b85f772d0ba" +checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ "heck", "proc-macro-error", @@ -882,9 +828,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4eac2e6c19f5c3abc0c229bea31ff0b9b091c7b14990e8924b92902a303a0c0" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -911,9 +857,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" +checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee" dependencies = [ "autocfg", "bytes", @@ -939,9 +885,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "154794c8f499c2619acd19e839294703e9e32e7630ef5f46ea80d4ef0fbee5eb" +checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095" dependencies = [ "proc-macro2", "quote", @@ -961,9 +907,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -973,9 +919,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes", "futures-core", @@ -1019,14 +965,15 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60422bc7fefa2f3ec70359b8ff1caff59d785877eb70595904605bcc412470f" +checksum = "c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00" dependencies = [ "futures-core", "futures-util", "indexmap", "pin-project", + "pin-project-lite", "rand", "slab", "tokio", @@ -1051,9 +998,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if", "log", @@ -1064,9 +1011,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", @@ -1103,36 +1050,22 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.2.24" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd0568dbfe3baf7048b7908d2b32bca0d81cd56bec6d2a8f894b01d74f86be3" +checksum = "80a4ddde70311d8da398062ecf6fc2c309337de6b0f77d6c27aff8d53f6fca52" dependencies = [ "ansi_term 0.12.1", - "chrono", "lazy_static", "matchers", "regex", - "serde", - "serde_json", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] diff --git a/hadron-cli/Cargo.toml b/hadron-cli/Cargo.toml index 8f92ebf..3fc2954 100644 --- a/hadron-cli/Cargo.toml +++ b/hadron-cli/Cargo.toml @@ -1,13 +1,13 @@ [package] authors = ["Anthony Dodd "] -edition = "2018" +edition = "2021" name = "hadron-cli" version = "0.1.0-beta.0" description = "The Hadron CLI." [dependencies] anyhow = "1" -base64 = "0.13.0" +base64 = "0.13" futures = "0.3" hadron = { package = "hadron-client", version = "0.1.0-beta.0" } lazy_static = "1" @@ -20,5 +20,5 @@ tokio = { version = "1", default-features = false, features = [ ]} tokio-stream = { version = "0.1", default-features = false, features = ["time", "net", "signal", "sync"] } tracing = { version = "0.1", features = ["attributes"] } -tracing-subscriber = "0.2" +tracing-subscriber = { version = "0.3", features = ["env-filter", "registry"] } uuid = { version = "0.8", default-features = false, features = ["v4"] } diff --git a/hadron-cli/Dockerfile b/hadron-cli/Dockerfile index a88e185..8d4da17 100644 --- a/hadron-cli/Dockerfile +++ b/hadron-cli/Dockerfile @@ -3,7 +3,7 @@ ## NOTE WELL: this Dockerfile assumes a context from the root of this repo. # syntax=docker/dockerfile:1.3 -ARG RUST_TAG=1.55.0 +ARG RUST_TAG=1.56.1 ARG ALPINE_TAG=3.14 FROM rust:${RUST_TAG}-alpine${ALPINE_TAG} as builder diff --git a/hadron-client/Cargo.lock b/hadron-client/Cargo.lock index 85a4047..e1cadd5 100644 --- a/hadron-client/Cargo.lock +++ b/hadron-client/Cargo.lock @@ -2,11 +2,20 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + [[package]] name = "anyhow" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" +checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" [[package]] name = "arc-swap" @@ -66,9 +75,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "bytes" @@ -78,9 +87,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -96,9 +105,9 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "fixedbitset" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" +checksum = "398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e" [[package]] name = "fnv" @@ -213,9 +222,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.4" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f3675cfef6a30c8031cf9e6493ebdc3bb3272a3fea3923c4210d1830e6a472" +checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" dependencies = [ "bytes", "fnv", @@ -279,9 +288,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes", "http", @@ -302,9 +311,9 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" -version = "0.14.13" +version = "0.14.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" +checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" dependencies = [ "bytes", "futures-channel", @@ -378,9 +387,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.103" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" +checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "log" @@ -399,9 +408,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "mio" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -448,9 +457,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "petgraph" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ "fixedbitset", "indexmap", @@ -490,9 +499,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "proc-macro-hack" @@ -508,18 +517,18 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] [[package]] name = "prost" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ "bytes", "prost-derive", @@ -527,27 +536,29 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" dependencies = [ "bytes", "heck", "itertools", + "lazy_static", "log", "multimap", "petgraph", "prost", "prost-types", + "regex", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" dependencies = [ "anyhow", "itertools", @@ -558,9 +569,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" dependencies = [ "bytes", "prost", @@ -568,9 +579,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] @@ -624,6 +635,23 @@ dependencies = [ "bitflags", ] +[[package]] +name = "regex" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + [[package]] name = "remove_dir_all" version = "0.5.3" @@ -688,9 +716,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "socket2" @@ -710,9 +738,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "syn" -version = "1.0.77" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5239bc68e0fef57495900cfea4e8dc75596d9a319d7e16b1e0a440d24e6fe0a0" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -735,9 +763,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" +checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee" dependencies = [ "autocfg", "bytes", @@ -763,9 +791,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.3.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" +checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095" dependencies = [ "proc-macro2", "quote", @@ -785,9 +813,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -797,9 +825,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes", "futures-core", @@ -811,9 +839,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "796c5e1cd49905e65dd8e700d4cb1dffcbfdb4fc9d017de08c1a537afd83627c" +checksum = "24203b79cf2d68909da91178db3026e77054effba0c5d93deb870d3ca7b35afa" dependencies = [ "async-stream", "async-trait", @@ -843,9 +871,9 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b52d07035516c2b74337d2ac7746075e7dcae7643816c1b12c5ff8a7484c08" +checksum = "88358bb1dcfeb62dcce85c63006cafb964b7be481d522b7e09589d4d1e718d2a" dependencies = [ "proc-macro2", "prost-build", @@ -855,14 +883,15 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60422bc7fefa2f3ec70359b8ff1caff59d785877eb70595904605bcc412470f" +checksum = "c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00" dependencies = [ "futures-core", "futures-util", "indexmap", "pin-project", + "pin-project-lite", "rand", "slab", "tokio", @@ -887,9 +916,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if", "log", @@ -900,9 +929,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", @@ -911,9 +940,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46125608c26121c81b0c6d693eab5a420e416da7e43c426d2e8f7df8da8a3acf" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" dependencies = [ "lazy_static", ] diff --git a/hadron-client/Cargo.toml b/hadron-client/Cargo.toml index 549dd1e..5c57825 100644 --- a/hadron-client/Cargo.toml +++ b/hadron-client/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0-beta.1" description = "The Hadron Rust client library." authors = ["Anthony Dodd "] categories = ["api-bindings", "concurrency", "database"] -edition = "2018" +edition = "2021" keywords = ["hadron", "events", "CloudEvents", "stream-processing", "workflows"] license = "MIT/Apache-2.0" readme = "README.md" @@ -12,23 +12,23 @@ repository = "https://github.com/hadron-project/hadron" [dependencies] anyhow = "1" -arc-swap = "1.3.1" +arc-swap = "1.3" async-trait = "0.1" base64 = "0.13" futures = "0.3" http = "0.2" -prost = "0.8" +prost = "0.9" rand = "0.8" -seahash = "4.1.0" +seahash = "4.1" tokio = { version = "1", default-features = false, features = [ # See https://docs.rs/tokio/latest/tokio/#feature-flags "rt", "io-util", "net", "time", "macros", "sync", "signal", ]} tokio-stream = { version = "0.1", default-features = false, features = ["time", "net", "signal", "sync"] } -tonic = { version = "0.5", default-features = false, features = ["transport", "codegen", "prost", "tls"] } +tonic = { version = "0.6", default-features = false, features = ["transport", "codegen", "prost", "tls"] } tower = { version = "0.4", default-features = false, features = ["discover"] } tracing = { version = "0.1", features = ["attributes"] } [dev-dependencies] anyhow = "1" -tonic-build = "0.5" +tonic-build = "0.6" diff --git a/hadron-client/src/client/mod.rs b/hadron-client/src/client/mod.rs index 4794364..4ff2970 100644 --- a/hadron-client/src/client/mod.rs +++ b/hadron-client/src/client/mod.rs @@ -167,15 +167,7 @@ async fn diff_and_update_endpoints( continue; } }; - let chan = match endpoint.connect_lazy() { - Ok(chan) => chan, - Err(err) => { - // NOTE: as of tonic@0.5, this actually can not fail, but returns - // a result for API future-proofing. - tracing::error!(error = ?err, "error building connection to endpoint"); - continue; - } - }; + let chan = endpoint.connect_lazy(); let conn = StreamControllerClient::new(chan); changes.push(Change::Insert(partition.partition, conn.clone())); tracing::debug!(endpoint = new_endpoint_str, "new endpoint connection established"); diff --git a/hadron-core/Cargo.lock b/hadron-core/Cargo.lock index 3f92ec9..e4f1a41 100644 --- a/hadron-core/Cargo.lock +++ b/hadron-core/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" +checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" [[package]] name = "async-stream" @@ -69,9 +69,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "bytes" @@ -81,9 +81,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -107,9 +107,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c" +checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" dependencies = [ "darling_core", "darling_macro", @@ -117,9 +117,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" +checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" dependencies = [ "fnv", "ident_case", @@ -131,9 +131,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" +checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" dependencies = [ "darling_core", "quote", @@ -233,9 +233,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c06815895acec637cd6ed6e9662c935b866d20a106f8361892893a7d9234964" +checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" dependencies = [ "bytes", "fnv", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes", "http", @@ -313,9 +313,9 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" -version = "0.14.13" +version = "0.14.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" +checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" dependencies = [ "bytes", "futures-channel", @@ -425,9 +425,9 @@ dependencies = [ [[package]] name = "k8s-openapi" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "748acc444200aa3528dc131a8048e131a9e75a611a52d152e276e99199313d1a" +checksum = "4f8de9873b904e74b3533f77493731ee26742418077503683db44e1b3c54aa5c" dependencies = [ "base64 0.13.0", "bytes", @@ -442,25 +442,22 @@ dependencies = [ [[package]] name = "kube" -version = "0.59.0" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2bfa22c305a6d817b57a7afcd2e6ee23c80c6c93933edb02f210fdf73f837cc" +checksum = "75e877325e5540a3041b519bd7ee27a858691f9f816cf533d652cbb33cbfea45" dependencies = [ - "http", "k8s-openapi", "kube-core", "kube-derive", - "serde", - "serde_json", - "thiserror", ] [[package]] name = "kube-core" -version = "0.59.0" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33d2272d8e530938bafc6cf4ac76f2a6f6c9ca684defcfab6c357913a43bcc" +checksum = "a91e572d244436fbc0d0b5a4829d96b9d623e08eb6b5d1e80418c1fab10b162a" dependencies = [ + "chrono", "form_urlencoded", "http", "json-patch", @@ -473,9 +470,9 @@ dependencies = [ [[package]] name = "kube-derive" -version = "0.59.0" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53dc9fa719dd21d1a4c155cf8936f618a687f3590885e09d9261727cd5dc56a5" +checksum = "2034f57f3db36978ef366f45f1e263e623d9a6a8fcc6a6b1ef8879a213e1d2c4" dependencies = [ "darling", "proc-macro2", @@ -492,9 +489,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.103" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" +checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "linked-hash-map" @@ -525,9 +522,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "mio" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -660,24 +657,24 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] [[package]] name = "prost" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ "bytes", "prost-derive", @@ -685,9 +682,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" dependencies = [ "anyhow", "itertools", @@ -698,9 +695,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] @@ -884,9 +881,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "socket2" @@ -912,9 +909,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.77" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5239bc68e0fef57495900cfea4e8dc75596d9a319d7e16b1e0a440d24e6fe0a0" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -923,18 +920,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -943,11 +940,12 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", + "wasi", "winapi", ] @@ -968,9 +966,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" +checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee" dependencies = [ "autocfg", "bytes", @@ -994,9 +992,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "154794c8f499c2619acd19e839294703e9e32e7630ef5f46ea80d4ef0fbee5eb" +checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095" dependencies = [ "proc-macro2", "quote", @@ -1005,9 +1003,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -1016,9 +1014,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes", "futures-core", @@ -1030,9 +1028,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "796c5e1cd49905e65dd8e700d4cb1dffcbfdb4fc9d017de08c1a537afd83627c" +checksum = "24203b79cf2d68909da91178db3026e77054effba0c5d93deb870d3ca7b35afa" dependencies = [ "async-stream", "async-trait", @@ -1061,14 +1059,15 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60422bc7fefa2f3ec70359b8ff1caff59d785877eb70595904605bcc412470f" +checksum = "c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00" dependencies = [ "futures-core", "futures-util", "indexmap", "pin-project", + "pin-project-lite", "rand", "slab", "tokio", @@ -1093,9 +1092,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if", "log", @@ -1106,9 +1105,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", @@ -1117,9 +1116,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46125608c26121c81b0c6d693eab5a420e416da7e43c426d2e8f7df8da8a3acf" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" dependencies = [ "lazy_static", ] @@ -1151,9 +1150,9 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "unicode-bidi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" @@ -1210,9 +1209,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" diff --git a/hadron-core/Cargo.toml b/hadron-core/Cargo.toml index 3157bc4..f46d846 100644 --- a/hadron-core/Cargo.toml +++ b/hadron-core/Cargo.toml @@ -7,15 +7,15 @@ edition = "2018" anyhow = "1" base64 = "0.13" jsonwebtoken = "7" -k8s-openapi = { version = "0.13", default-features = false, features = ["api", "v1_18"] } -kube = { version = "0.59", default-features = false, features = ["derive", "jsonpatch"] } -lazy_static = "1.4.0" -petgraph = "0.6.0" -regex = "1.5.4" +k8s-openapi = { version = "0.13", default-features = false, features = ["api", "v1_22"] } +kube = { version = "0.63", default-features = false, features = ["derive", "jsonpatch"] } +lazy_static = "1.4" +petgraph = "0.6" +regex = "1.5" schemars = "0.8" serde = { version="1", features = ["derive"] } serde_json = "1" serde_yaml = "0.8" thiserror = "1" -tonic = "0.5" +tonic = "0.6" uuid = { version="0.8", default-features=false, features=["serde", "v4"] } diff --git a/hadron-core/src/crd/mod.rs b/hadron-core/src/crd/mod.rs index 0838be9..4b0fdca 100644 --- a/hadron-core/src/crd/mod.rs +++ b/hadron-core/src/crd/mod.rs @@ -11,8 +11,8 @@ mod token; use kube::Resource; -pub use pipeline::{Pipeline, PipelineSpec, PipelineStage, PipelineStatus, PipelineStartPointLocation, PipelineStartPoint}; -pub use stream::{Stream, StreamSpec, StreamStatus}; +pub use pipeline::{Pipeline, PipelineSpec, PipelineStage, PipelineStartPoint, PipelineStartPointLocation, PipelineStatus}; +pub use stream::{Stream, StreamRetentionPolicy, StreamRetentionSpec, StreamSpec, StreamStatus}; pub use token::{PubSubAccess, Token, TokenSpec, TokenStatus}; /// A convenience trait built around the fact that all implementors diff --git a/hadron-core/src/crd/stream.rs b/hadron-core/src/crd/stream.rs index 5afefff..6788b0f 100644 --- a/hadron-core/src/crd/stream.rs +++ b/hadron-core/src/crd/stream.rs @@ -76,11 +76,18 @@ pub struct StreamRetentionSpec { pub retention_seconds: Option, } +impl StreamRetentionSpec { + /// The default retention seconds value, which is 7 days. + pub fn retention_seconds_default() -> u64 { + 604_800 // 7 days. + } +} + impl Default for StreamRetentionSpec { fn default() -> Self { Self { strategy: StreamRetentionPolicy::Time, - retention_seconds: Some(604_800), // 7 days. + retention_seconds: Some(StreamRetentionSpec::retention_seconds_default()), } } } @@ -94,3 +101,16 @@ pub enum StreamRetentionPolicy { /// Retain data on the Stream based on secondary timestamp index. Time, } + +impl std::fmt::Display for StreamRetentionPolicy { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!( + f, + "{}", + match self { + Self::Retain => "retain", + Self::Time => "time", + } + ) + } +} diff --git a/hadron-operator/Cargo.lock b/hadron-operator/Cargo.lock index 26e4e5a..fbbd00a 100644 --- a/hadron-operator/Cargo.lock +++ b/hadron-operator/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" +checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" [[package]] name = "async-compression" @@ -85,9 +85,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "axum" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6519a24c07bab4effe38e226c447faef56869f99aa66aa92502aba7ad47b168" +checksum = "8f08f95a202e827209db1491047aa57c18c8adb4c5efcfcfd4a2da4838ee3a72" dependencies = [ "async-trait", "bitflags", @@ -139,9 +139,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "byteorder" @@ -157,9 +157,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -183,9 +183,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" dependencies = [ "core-foundation-sys", "libc", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" @@ -226,9 +226,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c" +checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" dependencies = [ "darling_core", "darling_macro", @@ -236,9 +236,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" +checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" dependencies = [ "fnv", "ident_case", @@ -250,9 +250,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" +checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" dependencies = [ "darling_core", "quote", @@ -343,12 +343,6 @@ dependencies = [ "serde", ] -[[package]] -name = "fixedbitset" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" - [[package]] name = "fixedbitset" version = "0.4.0" @@ -500,9 +494,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c06815895acec637cd6ed6e9662c935b866d20a106f8361892893a7d9234964" +checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" dependencies = [ "bytes", "fnv", @@ -527,7 +521,7 @@ dependencies = [ "k8s-openapi", "kube", "lazy_static", - "petgraph 0.6.0", + "petgraph", "regex", "schemars", "serde", @@ -554,7 +548,6 @@ dependencies = [ "jsonwebtoken", "k8s-openapi", "kube", - "kube-runtime", "maplit", "prost", "ring", @@ -606,9 +599,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes", "http", @@ -629,9 +622,9 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" -version = "0.14.13" +version = "0.14.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" +checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" dependencies = [ "bytes", "futures-channel", @@ -707,15 +700,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "input_buffer" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" -dependencies = [ - "bytes", -] - [[package]] name = "itertools" version = "0.10.1" @@ -778,9 +762,9 @@ dependencies = [ [[package]] name = "k8s-openapi" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "748acc444200aa3528dc131a8048e131a9e75a611a52d152e276e99199313d1a" +checksum = "4f8de9873b904e74b3533f77493731ee26742418077503683db44e1b3c54aa5c" dependencies = [ "base64 0.13.0", "bytes", @@ -795,9 +779,22 @@ dependencies = [ [[package]] name = "kube" -version = "0.59.0" +version = "0.63.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75e877325e5540a3041b519bd7ee27a858691f9f816cf533d652cbb33cbfea45" +dependencies = [ + "k8s-openapi", + "kube-client", + "kube-core", + "kube-derive", + "kube-runtime", +] + +[[package]] +name = "kube-client" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2bfa22c305a6d817b57a7afcd2e6ee23c80c6c93933edb02f210fdf73f837cc" +checksum = "bb8e1a36f17c63e263ba0ffa2c0658de315c75decad983d83aaeafeda578cc78" dependencies = [ "base64 0.13.0", "bytes", @@ -813,7 +810,6 @@ dependencies = [ "jsonpath_lib", "k8s-openapi", "kube-core", - "kube-derive", "pem", "pin-project 1.0.8", "rand", @@ -834,10 +830,11 @@ dependencies = [ [[package]] name = "kube-core" -version = "0.59.0" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33d2272d8e530938bafc6cf4ac76f2a6f6c9ca684defcfab6c357913a43bcc" +checksum = "a91e572d244436fbc0d0b5a4829d96b9d623e08eb6b5d1e80418c1fab10b162a" dependencies = [ + "chrono", "form_urlencoded", "http", "json-patch", @@ -850,9 +847,9 @@ dependencies = [ [[package]] name = "kube-derive" -version = "0.59.0" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53dc9fa719dd21d1a4c155cf8936f618a687f3590885e09d9261727cd5dc56a5" +checksum = "2034f57f3db36978ef366f45f1e263e623d9a6a8fcc6a6b1ef8879a213e1d2c4" dependencies = [ "darling", "proc-macro2", @@ -863,16 +860,16 @@ dependencies = [ [[package]] name = "kube-runtime" -version = "0.59.0" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb40d5730a3ac47b7153c7ad0494a66881bbdf0c17ead478b714dd82c9dba259" +checksum = "6018cf8410f9d460be3a3ac35deef63b71c860c368016d7bf6871994343728b4" dependencies = [ "dashmap", "derivative", "futures", "json-patch", "k8s-openapi", - "kube", + "kube-client", "pin-project 1.0.8", "serde", "serde_json", @@ -891,9 +888,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.103" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" +checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "linked-hash-map" @@ -918,9 +915,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "matchers" -version = "0.0.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ "regex-automata", ] @@ -949,9 +946,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -1068,23 +1065,13 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "petgraph" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" -dependencies = [ - "fixedbitset 0.2.0", - "indexmap", -] - [[package]] name = "petgraph" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ - "fixedbitset 0.4.0", + "fixedbitset", "indexmap", ] @@ -1142,9 +1129,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "proc-macro-hack" @@ -1160,18 +1147,18 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] [[package]] name = "prost" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ "bytes", "prost-derive", @@ -1179,27 +1166,29 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" dependencies = [ "bytes", "heck", "itertools", + "lazy_static", "log", "multimap", - "petgraph 0.5.1", + "petgraph", "prost", "prost-types", + "regex", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" dependencies = [ "anyhow", "itertools", @@ -1210,9 +1199,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" dependencies = [ "bytes", "prost", @@ -1220,9 +1209,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] @@ -1535,9 +1524,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740223c51853f3145fe7c90360d2d4232f2b62e3449489c207eccde818979982" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] @@ -1564,9 +1553,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" @@ -1621,9 +1610,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.77" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5239bc68e0fef57495900cfea4e8dc75596d9a319d7e16b1e0a440d24e6fe0a0" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -1652,18 +1641,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -1707,9 +1696,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" +checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee" dependencies = [ "autocfg", "bytes", @@ -1736,9 +1725,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "154794c8f499c2619acd19e839294703e9e32e7630ef5f46ea80d4ef0fbee5eb" +checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095" dependencies = [ "proc-macro2", "quote", @@ -1758,9 +1747,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -1770,9 +1759,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e96bb520beab540ab664bd5a9cfeaa1fcd846fa68c830b42e2c8963071251d2" +checksum = "511de3f85caf1c98983545490c3d09685fa8eb634e57eec22bb4db271f46cbd8" dependencies = [ "futures-util", "log", @@ -1783,9 +1772,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes", "futures-core", @@ -1798,9 +1787,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "796c5e1cd49905e65dd8e700d4cb1dffcbfdb4fc9d017de08c1a537afd83627c" +checksum = "24203b79cf2d68909da91178db3026e77054effba0c5d93deb870d3ca7b35afa" dependencies = [ "async-stream", "async-trait", @@ -1829,9 +1818,9 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b52d07035516c2b74337d2ac7746075e7dcae7643816c1b12c5ff8a7484c08" +checksum = "88358bb1dcfeb62dcce85c63006cafb964b7be481d522b7e09589d4d1e718d2a" dependencies = [ "proc-macro2", "prost-build", @@ -1841,14 +1830,15 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60422bc7fefa2f3ec70359b8ff1caff59d785877eb70595904605bcc412470f" +checksum = "c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00" dependencies = [ "futures-core", "futures-util", "indexmap", "pin-project 1.0.8", + "pin-project-lite", "rand", "slab", "tokio", @@ -1894,9 +1884,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if", "log", @@ -1907,9 +1897,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", @@ -1918,9 +1908,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46125608c26121c81b0c6d693eab5a420e416da7e43c426d2e8f7df8da8a3acf" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" dependencies = [ "lazy_static", ] @@ -1946,36 +1936,22 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.2.24" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd0568dbfe3baf7048b7908d2b32bca0d81cd56bec6d2a8f894b01d74f86be3" +checksum = "80a4ddde70311d8da398062ecf6fc2c309337de6b0f77d6c27aff8d53f6fca52" dependencies = [ "ansi_term", - "chrono", "lazy_static", "matchers", "regex", - "serde", - "serde_json", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] @@ -1995,16 +1971,15 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "tungstenite" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8dada8c1a3aeca77d6b51a4f1314e0f4b8e438b7b1b71e3ddaca8080e4093" +checksum = "a0b2d8558abd2e276b0a8df5c05a2ec762609344191e5fd23e292c910e9165b5" dependencies = [ "base64 0.13.0", "byteorder", "bytes", "http", "httparse", - "input_buffer", "log", "rand", "sha-1", @@ -2021,9 +1996,9 @@ checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" [[package]] name = "unicode-bidi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" diff --git a/hadron-operator/Cargo.toml b/hadron-operator/Cargo.toml index d2d5231..5d15db8 100644 --- a/hadron-operator/Cargo.toml +++ b/hadron-operator/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Anthony Dodd "] -edition = "2018" +edition = "2021" name = "hadron-operator" version = "0.1.0-beta.0" description = "The Hadron Kubernetes operator." @@ -20,24 +20,23 @@ hadron-core = { path = "../hadron-core" } http = "0.2" hyper = { version = "0.14", default-features = false, features = ["http1", "http2", "server", "runtime"] } jsonwebtoken = "7.2" -k8s-openapi = { version = "0.13", default-features = false, features = ["api", "v1_18"] } -kube = { version = "0.59", default-features = false, features = ["admission", "derive", "gzip", "jsonpatch", "rustls-tls", "ws"] } -kube-runtime = { version = "0.59", default-features = false } +k8s-openapi = { version = "0.13", default-features = false, features = ["api", "v1_22"] } +kube = { version = "0.63", default-features = false, features = ["admission", "client", "derive", "gzip", "jsonpatch", "runtime", "rustls-tls", "ws"] } maplit = "1" -prost = "0.8" +prost = "0.9" ring = "0.16" serde = { version="1", features = ["derive"] } tokio = { version = "1", default-features = false, features = [ # See https://docs.rs/tokio/latest/tokio/#feature-flags "rt-multi-thread", "io-util", "net", "time", "macros", "sync", "signal", "fs", ]} -tokio-rustls = "0.22.0" +tokio-rustls = "0.22" tokio-stream = { version = "0.1", default-features = false, features = ["time", "net", "signal", "sync"] } -tonic = "0.5" +tonic = "0.6" tower-http = "0.1.1" tracing = { version = "0.1", features = ["attributes", "release_max_level_trace"] } -tracing-subscriber = "0.2" +tracing-subscriber = { version = "0.3", features = ["env-filter", "registry"] } [build-dependencies] anyhow = "1" -tonic-build = "0.5" +tonic-build = "0.6" diff --git a/hadron-operator/Dockerfile b/hadron-operator/Dockerfile index dc3f232..0d290ff 100644 --- a/hadron-operator/Dockerfile +++ b/hadron-operator/Dockerfile @@ -3,7 +3,7 @@ ## NOTE WELL: this Dockerfile assumes a context from the root of this repo. # syntax=docker/dockerfile:1.3 -ARG RUST_TAG=1.56.0 +ARG RUST_TAG=1.56.1 ARG ALPINE_TAG=3.14 FROM rust:${RUST_TAG}-alpine${ALPINE_TAG} as builder diff --git a/hadron-operator/src/grpc/operator.rs b/hadron-operator/src/grpc/operator.rs index 0ccdc1d..4123e34 100644 --- a/hadron-operator/src/grpc/operator.rs +++ b/hadron-operator/src/grpc/operator.rs @@ -33,7 +33,7 @@ pub mod operator_server { impl tonic::codegen::Service> for OperatorServer where T: Operator, - B: Body + Send + Sync + 'static, + B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; diff --git a/hadron-operator/src/k8s/coordination.rs b/hadron-operator/src/k8s/coordination.rs index 8c5f8de..69e0b09 100644 --- a/hadron-operator/src/k8s/coordination.rs +++ b/hadron-operator/src/k8s/coordination.rs @@ -15,7 +15,7 @@ use k8s_openapi::api::coordination::v1::Lease; use k8s_openapi::apimachinery::pkg::apis::meta::v1::MicroTime; use kube::api::{Api, ListParams, Patch, PatchParams}; use kube::client::Client; -use kube_runtime::{ +use kube::runtime::{ watcher, watcher::{Event, Result as WatcherResult}, }; diff --git a/hadron-operator/src/k8s/data.rs b/hadron-operator/src/k8s/data.rs index bc1a3e0..942e0d1 100644 --- a/hadron-operator/src/k8s/data.rs +++ b/hadron-operator/src/k8s/data.rs @@ -15,8 +15,8 @@ use std::time::Duration; use k8s_openapi::api::apps::v1::StatefulSet; use k8s_openapi::api::core::v1::{Secret, Service}; +use kube::runtime::watcher::Event; use kube::Resource; -use kube_runtime::watcher::Event; use crate::k8s::scheduler::SchedulerTask; use crate::k8s::{Controller, EventResult}; diff --git a/hadron-operator/src/k8s/mod.rs b/hadron-operator/src/k8s/mod.rs index 82b6ebc..d7eba62 100644 --- a/hadron-operator/src/k8s/mod.rs +++ b/hadron-operator/src/k8s/mod.rs @@ -25,7 +25,7 @@ use k8s_openapi::api::core::v1::{Secret, Service}; use k8s_openapi::apimachinery::pkg::apis::meta::v1::{MicroTime, ObjectMeta}; use kube::api::{Api, ListParams}; use kube::client::Client; -use kube_runtime::watcher::{watcher, Error as WatcherError, Event}; +use kube::runtime::watcher::{watcher, Error as WatcherError, Event}; use maplit::btreemap; use tokio::sync::{broadcast, mpsc}; use tokio::task::JoinHandle; diff --git a/hadron-operator/src/k8s/scheduler.rs b/hadron-operator/src/k8s/scheduler.rs index 5fe36f1..1985285 100644 --- a/hadron-operator/src/k8s/scheduler.rs +++ b/hadron-operator/src/k8s/scheduler.rs @@ -700,6 +700,21 @@ impl Controller { value: Some(STREAM_DATA_PATH.into()), ..Default::default() }, + EnvVar { + name: "RETENTION_POLICY_STRATEGY".into(), + value: Some(stream.spec.retention_policy.strategy.to_string()), + ..Default::default() + }, + EnvVar { + name: "RETENTION_POLICY_RETENTION_SECONDS".into(), + value: stream + .spec + .retention_policy + .retention_seconds + .as_ref() + .map(|val| format!("{}", val)), + ..Default::default() + }, ]), volume_mounts: Some(vec![VolumeMount { name: "data".into(), diff --git a/hadron-operator/src/server/webhook.rs b/hadron-operator/src/server/webhook.rs index b316a0c..c2b63a4 100644 --- a/hadron-operator/src/server/webhook.rs +++ b/hadron-operator/src/server/webhook.rs @@ -6,8 +6,8 @@ use axum::handler::{get, post, Handler}; use axum::http::StatusCode; use axum::{extract, Router}; use hyper::server::conn::Http; -use kube::api::admission::{AdmissionResponse, AdmissionReview, Operation}; use kube::api::DynamicObject; +use kube::core::admission::{AdmissionResponse, AdmissionReview, Operation}; use tokio::net::TcpListener; use tokio::sync::broadcast; use tokio::task::JoinHandle; diff --git a/hadron-stream/Cargo.lock b/hadron-stream/Cargo.lock index 0903d4f..e6af7ec 100644 --- a/hadron-stream/Cargo.lock +++ b/hadron-stream/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" +checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" [[package]] name = "arc-swap" @@ -118,9 +118,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "byteorder" @@ -136,9 +136,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -162,9 +162,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" dependencies = [ "core-foundation-sys", "libc", @@ -172,9 +172,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" @@ -228,9 +228,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c" +checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" dependencies = [ "darling_core", "darling_macro", @@ -238,9 +238,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" +checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" dependencies = [ "fnv", "ident_case", @@ -252,9 +252,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" +checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" dependencies = [ "darling_core", "quote", @@ -345,12 +345,6 @@ dependencies = [ "serde", ] -[[package]] -name = "fixedbitset" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" - [[package]] name = "fixedbitset" version = "0.4.0" @@ -521,9 +515,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c06815895acec637cd6ed6e9662c935b866d20a106f8361892893a7d9234964" +checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" dependencies = [ "bytes", "fnv", @@ -548,7 +542,7 @@ dependencies = [ "k8s-openapi", "kube", "lazy_static", - "petgraph 0.6.0", + "petgraph", "regex", "schemars", "serde", @@ -575,7 +569,6 @@ dependencies = [ "jsonwebtoken", "k8s-openapi", "kube", - "kube-runtime", "prost", "rand", "serde", @@ -628,9 +621,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes", "http", @@ -651,9 +644,9 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" -version = "0.14.13" +version = "0.14.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" +checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" dependencies = [ "bytes", "futures-channel", @@ -729,20 +722,11 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "input_buffer" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" -dependencies = [ - "bytes", -] - [[package]] name = "instant" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", ] @@ -809,9 +793,9 @@ dependencies = [ [[package]] name = "k8s-openapi" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "748acc444200aa3528dc131a8048e131a9e75a611a52d152e276e99199313d1a" +checksum = "4f8de9873b904e74b3533f77493731ee26742418077503683db44e1b3c54aa5c" dependencies = [ "base64 0.13.0", "bytes", @@ -826,9 +810,22 @@ dependencies = [ [[package]] name = "kube" -version = "0.59.0" +version = "0.63.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75e877325e5540a3041b519bd7ee27a858691f9f816cf533d652cbb33cbfea45" +dependencies = [ + "k8s-openapi", + "kube-client", + "kube-core", + "kube-derive", + "kube-runtime", +] + +[[package]] +name = "kube-client" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2bfa22c305a6d817b57a7afcd2e6ee23c80c6c93933edb02f210fdf73f837cc" +checksum = "bb8e1a36f17c63e263ba0ffa2c0658de315c75decad983d83aaeafeda578cc78" dependencies = [ "base64 0.13.0", "bytes", @@ -844,7 +841,6 @@ dependencies = [ "jsonpath_lib", "k8s-openapi", "kube-core", - "kube-derive", "pem", "pin-project 1.0.8", "rand", @@ -865,10 +861,11 @@ dependencies = [ [[package]] name = "kube-core" -version = "0.59.0" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33d2272d8e530938bafc6cf4ac76f2a6f6c9ca684defcfab6c357913a43bcc" +checksum = "a91e572d244436fbc0d0b5a4829d96b9d623e08eb6b5d1e80418c1fab10b162a" dependencies = [ + "chrono", "form_urlencoded", "http", "json-patch", @@ -881,9 +878,9 @@ dependencies = [ [[package]] name = "kube-derive" -version = "0.59.0" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53dc9fa719dd21d1a4c155cf8936f618a687f3590885e09d9261727cd5dc56a5" +checksum = "2034f57f3db36978ef366f45f1e263e623d9a6a8fcc6a6b1ef8879a213e1d2c4" dependencies = [ "darling", "proc-macro2", @@ -894,16 +891,16 @@ dependencies = [ [[package]] name = "kube-runtime" -version = "0.59.0" +version = "0.63.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb40d5730a3ac47b7153c7ad0494a66881bbdf0c17ead478b714dd82c9dba259" +checksum = "6018cf8410f9d460be3a3ac35deef63b71c860c368016d7bf6871994343728b4" dependencies = [ "dashmap", "derivative", "futures", "json-patch", "k8s-openapi", - "kube", + "kube-client", "pin-project 1.0.8", "serde", "serde_json", @@ -922,9 +919,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.103" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" +checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "linked-hash-map" @@ -952,9 +949,9 @@ dependencies = [ [[package]] name = "matchers" -version = "0.0.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ "regex-automata", ] @@ -992,9 +989,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -1136,23 +1133,13 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "petgraph" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" -dependencies = [ - "fixedbitset 0.2.0", - "indexmap", -] - [[package]] name = "petgraph" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ - "fixedbitset 0.4.0", + "fixedbitset", "indexmap", ] @@ -1210,9 +1197,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "proc-macro-hack" @@ -1228,18 +1215,18 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] [[package]] name = "prost" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ "bytes", "prost-derive", @@ -1247,27 +1234,29 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" dependencies = [ "bytes", "heck", "itertools", + "lazy_static", "log", "multimap", - "petgraph 0.5.1", + "petgraph", "prost", "prost-types", + "regex", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" dependencies = [ "anyhow", "itertools", @@ -1278,9 +1267,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" dependencies = [ "bytes", "prost", @@ -1597,9 +1586,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740223c51853f3145fe7c90360d2d4232f2b62e3449489c207eccde818979982" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] @@ -1626,9 +1615,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "sled" @@ -1699,9 +1688,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4eac2e6c19f5c3abc0c229bea31ff0b9b091c7b14990e8924b92902a303a0c0" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -1724,18 +1713,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -1779,9 +1768,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" +checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee" dependencies = [ "autocfg", "bytes", @@ -1808,9 +1797,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "154794c8f499c2619acd19e839294703e9e32e7630ef5f46ea80d4ef0fbee5eb" +checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095" dependencies = [ "proc-macro2", "quote", @@ -1830,9 +1819,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -1842,9 +1831,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e96bb520beab540ab664bd5a9cfeaa1fcd846fa68c830b42e2c8963071251d2" +checksum = "511de3f85caf1c98983545490c3d09685fa8eb634e57eec22bb4db271f46cbd8" dependencies = [ "futures-util", "log", @@ -1855,9 +1844,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes", "futures-core", @@ -1870,9 +1859,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "796c5e1cd49905e65dd8e700d4cb1dffcbfdb4fc9d017de08c1a537afd83627c" +checksum = "24203b79cf2d68909da91178db3026e77054effba0c5d93deb870d3ca7b35afa" dependencies = [ "async-stream", "async-trait", @@ -1901,9 +1890,9 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b52d07035516c2b74337d2ac7746075e7dcae7643816c1b12c5ff8a7484c08" +checksum = "88358bb1dcfeb62dcce85c63006cafb964b7be481d522b7e09589d4d1e718d2a" dependencies = [ "proc-macro2", "prost-build", @@ -1913,14 +1902,15 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60422bc7fefa2f3ec70359b8ff1caff59d785877eb70595904605bcc412470f" +checksum = "c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00" dependencies = [ "futures-core", "futures-util", "indexmap", "pin-project 1.0.8", + "pin-project-lite", "rand", "slab", "tokio", @@ -1966,9 +1956,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if", "log", @@ -1979,9 +1969,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", @@ -2018,36 +2008,22 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.2.24" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd0568dbfe3baf7048b7908d2b32bca0d81cd56bec6d2a8f894b01d74f86be3" +checksum = "80a4ddde70311d8da398062ecf6fc2c309337de6b0f77d6c27aff8d53f6fca52" dependencies = [ "ansi_term", - "chrono", "lazy_static", "matchers", "regex", - "serde", - "serde_json", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] @@ -2067,16 +2043,15 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "tungstenite" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8dada8c1a3aeca77d6b51a4f1314e0f4b8e438b7b1b71e3ddaca8080e4093" +checksum = "a0b2d8558abd2e276b0a8df5c05a2ec762609344191e5fd23e292c910e9165b5" dependencies = [ "base64 0.13.0", "byteorder", "bytes", "http", "httparse", - "input_buffer", "log", "rand", "sha-1", @@ -2093,9 +2068,9 @@ checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" [[package]] name = "unicode-bidi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" diff --git a/hadron-stream/Cargo.toml b/hadron-stream/Cargo.toml index dc4a207..278569c 100644 --- a/hadron-stream/Cargo.toml +++ b/hadron-stream/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Anthony Dodd "] -edition = "2018" +edition = "2021" name = "hadron-stream" version = "0.1.0-beta.0" description = "The Hadron stream controller." @@ -20,10 +20,9 @@ futures = "0.3" hadron-core = { path = "../hadron-core" } http = "0.2" jsonwebtoken = "7.2" -k8s-openapi = { version = "0.13", default-features = false, features = ["api", "v1_18"] } -kube = { version = "0.59", default-features = false, features = ["admission", "derive", "gzip", "jsonpatch", "rustls-tls", "ws"] } -kube-runtime = { version = "0.59", default-features = false } -prost = "0.8" +k8s-openapi = { version = "0.13", default-features = false, features = ["api", "v1_22"] } +kube = { version = "0.63", default-features = false, features = ["admission", "client", "derive", "gzip", "jsonpatch", "runtime", "rustls-tls", "ws"] } +prost = "0.9" rand = "0.8" serde = { version="1", features = ["derive"] } sled = "0.34" @@ -33,14 +32,14 @@ tokio = { version = "1", default-features = false, features = [ "rt-multi-thread", "io-util", "net", "time", "macros", "sync", "signal", "fs", ]} tokio-stream = { version = "0.1", default-features = false, features = ["time", "net", "signal", "sync"] } -tonic = "0.5" +tonic = "0.6" tracing = { version = "0.1", features = ["attributes", "release_max_level_trace"] } -tracing-subscriber = "0.2" +tracing-subscriber = { version = "0.3", features = ["env-filter", "registry"] } uuid = { version="0.8", default-features=false, features=["serde", "v4"] } [build-dependencies] anyhow = "1" -tonic-build = "0.5" +tonic-build = "0.6" [dev-dependencies] -tempfile = "3.2.0" +tempfile = "3" diff --git a/hadron-stream/Dockerfile b/hadron-stream/Dockerfile index 3390fa5..94bd9bc 100644 --- a/hadron-stream/Dockerfile +++ b/hadron-stream/Dockerfile @@ -3,7 +3,7 @@ ## NOTE WELL: this Dockerfile assumes a context from the root of this repo. # syntax=docker/dockerfile:1.3 -ARG RUST_TAG=1.56.0 +ARG RUST_TAG=1.56.1 ARG ALPINE_TAG=3.14 FROM rust:${RUST_TAG}-alpine${ALPINE_TAG} as builder diff --git a/hadron-stream/src/app.rs b/hadron-stream/src/app.rs index f1c4579..569fb57 100644 --- a/hadron-stream/src/app.rs +++ b/hadron-stream/src/app.rs @@ -64,7 +64,7 @@ impl App { let tokens_handle = tokens.spawn(); let (stream_tx, stream_rx) = mpsc::channel(1000); - let (stream_ctl, stream_offset_signal) = StreamCtl::new(config.clone(), db.clone(), shutdown_tx.clone(), stream_rx) + let (stream_ctl, stream_offset_signal) = StreamCtl::new(config.clone(), db.clone(), shutdown_tx.clone(), stream_tx.clone(), stream_rx) .await .context("error spawning stream controller")?; let stream_handle = stream_ctl.spawn(); diff --git a/hadron-stream/src/config.rs b/hadron-stream/src/config.rs index a4d7c33..dc65b39 100644 --- a/hadron-stream/src/config.rs +++ b/hadron-stream/src/config.rs @@ -3,6 +3,8 @@ use anyhow::{Context, Result}; use serde::Deserialize; +use hadron_core::crd::StreamRetentionSpec; + /// Runtime configuration data. #[derive(Clone, Debug, Deserialize)] pub struct Config { @@ -30,6 +32,10 @@ pub struct Config { /// The path to the database on disk. #[serde(default = "crate::database::default_data_path")] pub storage_data_path: String, + + /// The retention policy to use for data on the Stream. + #[serde(default)] + pub retention_policy: StreamRetentionSpec, } impl Config { @@ -67,6 +73,7 @@ impl Config { partition: 0, storage_data_path: tmpdir.path().to_string_lossy().to_string(), + retention_policy: StreamRetentionSpec::default(), }), tmpdir, )) diff --git a/hadron-stream/src/config_test.rs b/hadron-stream/src/config_test.rs new file mode 100644 index 0000000..9603e7e --- /dev/null +++ b/hadron-stream/src/config_test.rs @@ -0,0 +1,173 @@ +use anyhow::Result; + +use super::*; +use hadron_core::crd::StreamRetentionPolicy; + +#[test] +fn config_deserializes_from_full_env() -> Result<()> { + let config: Config = envy::from_iter(vec![ + ("RUST_LOG".into(), "error".into()), + ("CLIENT_PORT".into(), "7000".into()), + ("SERVER_PORT".into(), "7001".into()), + ("NAMESPACE".into(), "default".into()), + ("STREAM".into(), "events".into()), + ("STATEFULSET".into(), "events".into()), + ("POD_NAME".into(), "events-0".into()), + ("STORAGE_DATA_PATH".into(), "/usr/local/hadron-stream/data".into()), + ("RETENTION_POLICY_STRATEGY".into(), "time".into()), + ("RETENTION_POLICY_RETENTION_SECONDS".into(), "604800".into()), + ])?; + + assert!( + config.rust_log == "error", + "unexpected value parsed for RUST_LOG, got {}, expected {}", + config.rust_log, + "" + ); + assert!( + config.client_port == 7000, + "unexpected value parsed for CLIENT_PORT, got {}, expected {}", + config.client_port, + "7000" + ); + assert!( + config.server_port == 7001, + "unexpected value parsed for SERVER_PORT, got {}, expected {}", + config.server_port, + "7001" + ); + assert!( + config.namespace == "default", + "unexpected value parsed for NAMESPACE, got {}, expected {}", + config.namespace, + "default" + ); + assert!( + config.stream == "events", + "unexpected value parsed for STREAM, got {}, expected {}", + config.stream, + "events" + ); + assert!( + config.statefulset == "events", + "unexpected value parsed for STATEFULSET, got {}, expected {}", + config.statefulset, + "events" + ); + assert!( + config.pod_name == "events-0", + "unexpected value parsed for POD_NAME, got {}, expected {}", + config.pod_name, + "events-0" + ); + assert!( + config.partition == 0, + "unexpected value derived for partition, got {}, expected {}", + config.partition, + 0 + ); + assert!( + config.storage_data_path == "/usr/local/hadron-stream/data", + "unexpected value parsed for STORAGE_DATA_PATH, got {}, expected {}", + config.storage_data_path, + "/usr/local/hadron-stream/data" + ); + assert!( + config.retention_policy.strategy == StreamRetentionPolicy::Time, + "unexpected value parsed for RETENTION_POLICY_STRATEGY, got {}, expected {}", + config.retention_policy.strategy, + StreamRetentionPolicy::Time + ); + assert!( + config.retention_policy.retention_seconds == Some(604800), + "unexpected value parsed for RETENTION_POLICY_RETENTION_SECONDS, got {:?}, expected {:?}", + config.retention_policy.retention_seconds, + Some(604800) + ); + + Ok(()) +} + +#[test] +fn config_deserializes_from_sparse_env() -> Result<()> { + let config: Config = envy::from_iter(vec![ + ("RUST_LOG".into(), "error".into()), + ("CLIENT_PORT".into(), "7000".into()), + ("SERVER_PORT".into(), "7001".into()), + ("NAMESPACE".into(), "default".into()), + ("STREAM".into(), "events".into()), + ("STATEFULSET".into(), "events".into()), + ("POD_NAME".into(), "events-0".into()), + ("STORAGE_DATA_PATH".into(), "/usr/local/hadron-stream/data".into()), + ("RETENTION_POLICY_STRATEGY".into(), "time".into()), + ])?; + + assert!( + config.rust_log == "error", + "unexpected value parsed for RUST_LOG, got {}, expected {}", + config.rust_log, + "" + ); + assert!( + config.client_port == 7000, + "unexpected value parsed for CLIENT_PORT, got {}, expected {}", + config.client_port, + "7000" + ); + assert!( + config.server_port == 7001, + "unexpected value parsed for SERVER_PORT, got {}, expected {}", + config.server_port, + "7001" + ); + assert!( + config.namespace == "default", + "unexpected value parsed for NAMESPACE, got {}, expected {}", + config.namespace, + "default" + ); + assert!( + config.stream == "events", + "unexpected value parsed for STREAM, got {}, expected {}", + config.stream, + "events" + ); + assert!( + config.statefulset == "events", + "unexpected value parsed for STATEFULSET, got {}, expected {}", + config.statefulset, + "events" + ); + assert!( + config.pod_name == "events-0", + "unexpected value parsed for POD_NAME, got {}, expected {}", + config.pod_name, + "events-0" + ); + assert!( + config.partition == 0, + "unexpected value derived for partition, got {}, expected {}", + config.partition, + 0 + ); + assert!( + config.storage_data_path == "/usr/local/hadron-stream/data", + "unexpected value parsed for STORAGE_DATA_PATH, got {}, expected {}", + config.storage_data_path, + "/usr/local/hadron-stream/data" + ); + assert!( + config.retention_policy.strategy == StreamRetentionPolicy::Time, + "unexpected value parsed for RETENTION_POLICY_STRATEGY, got {}, expected {}", + config.retention_policy.strategy, + StreamRetentionPolicy::Time + ); + assert!( + config.retention_policy.retention_seconds == Some(604800), + "unexpected value parsed for RETENTION_POLICY_RETENTION_SECONDS, got {:?}, expected {:?}", + config.retention_policy.retention_seconds, + Some(604800) + ); + + Ok(()) +} diff --git a/hadron-stream/src/grpc/stream.rs b/hadron-stream/src/grpc/stream.rs index ad37bd0..5642db6 100644 --- a/hadron-stream/src/grpc/stream.rs +++ b/hadron-stream/src/grpc/stream.rs @@ -9,28 +9,28 @@ pub struct Empty {} pub struct Event { /// The application defined ID of this event. /// - /// See [`id`](https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#id). + /// See \[`id`\](). #[prost(string, tag = "1")] pub id: ::prost::alloc::string::String, /// The application defined source of this event. /// - /// See [`source`](https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#source-1). + /// See \[`source`\](). #[prost(string, tag = "2")] pub source: ::prost::alloc::string::String, /// The CloudEvents specification version which the event uses. /// - /// See [`specversion`](https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#specversion). + /// See \[`specversion`\](). #[prost(string, tag = "3")] pub specversion: ::prost::alloc::string::String, /// The type identifier of this event. /// - /// See [`type`](https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#type). + /// See \[`type`\](). #[prost(string, tag = "4")] pub r#type: ::prost::alloc::string::String, /// Any additional optional attributes or extension attributes of this event. /// - /// See [`optional attributes`](https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#optional-attributes) - /// and [`extension context attributes`](https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#extension-context-attributes). + /// See [`optional attributes`]() + /// and [`extension context attributes`](). #[prost(map = "string, string", tag = "5")] pub optattrs: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, /// The data payload of this event. @@ -228,7 +228,7 @@ pub mod stream_controller_server { #[async_trait] pub trait StreamController: Send + Sync + 'static { #[doc = "Server streaming response type for the Metadata method."] - type MetadataStream: futures_core::Stream> + Send + Sync + 'static; + type MetadataStream: futures_core::Stream> + Send + 'static; #[doc = " Open a metadata stream."] async fn metadata(&self, request: tonic::Request) -> Result, tonic::Status>; #[doc = " Open a stream publisher channel."] @@ -236,13 +236,13 @@ pub mod stream_controller_server { &self, request: tonic::Request, ) -> Result, tonic::Status>; #[doc = "Server streaming response type for the StreamSubscribe method."] - type StreamSubscribeStream: futures_core::Stream> + Send + Sync + 'static; + type StreamSubscribeStream: futures_core::Stream> + Send + 'static; #[doc = " Open a stream subscriber channel."] async fn stream_subscribe( &self, request: tonic::Request>, ) -> Result, tonic::Status>; #[doc = "Server streaming response type for the PipelineSubscribe method."] - type PipelineSubscribeStream: futures_core::Stream> + Send + Sync + 'static; + type PipelineSubscribeStream: futures_core::Stream> + Send + 'static; #[doc = " Open a pipeline subscriber channel."] async fn pipeline_subscribe( &self, request: tonic::Request>, @@ -276,7 +276,7 @@ pub mod stream_controller_server { impl tonic::codegen::Service> for StreamControllerServer where T: StreamController, - B: Body + Send + Sync + 'static, + B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; diff --git a/hadron-stream/src/main.rs b/hadron-stream/src/main.rs index 244d45b..cfbb611 100644 --- a/hadron-stream/src/main.rs +++ b/hadron-stream/src/main.rs @@ -2,6 +2,8 @@ mod app; mod config; +#[cfg(test)] +mod config_test; mod database; mod error; mod futures; diff --git a/hadron-stream/src/stream/mod.rs b/hadron-stream/src/stream/mod.rs index 4abaf09..1733895 100644 --- a/hadron-stream/src/stream/mod.rs +++ b/hadron-stream/src/stream/mod.rs @@ -43,11 +43,12 @@ use tonic::Streaming; use crate::config::Config; use crate::database::Database; -use crate::error::{RpcResult, ERR_ITER_FAILURE}; +use crate::error::{RpcResult, ERR_DB_FLUSH, ERR_ITER_FAILURE}; use crate::grpc::{StreamPublishRequest, StreamPublishResponse, StreamSubscribeRequest, StreamSubscribeResponse, StreamSubscribeSetup}; use crate::models::stream::Subscription; use crate::stream::subscriber::StreamSubCtlMsg; use crate::utils; +use hadron_core::crd::{StreamRetentionPolicy, StreamRetentionSpec}; /// The key prefix used for storing stream events. /// @@ -72,6 +73,7 @@ pub const PREFIX_STREAM_SUB_OFFSETS: &[u8; 1] = b"o"; /// The key used to store the last written offset for the stream. pub const KEY_STREAM_LAST_WRITTEN_OFFSET: &[u8; 1] = b"l"; +const COMPACTION_INTERVAL: std::time::Duration = std::time::Duration::from_secs(60 * 30); const ERR_DECODING_STREAM_META_GROUP_NAME: &str = "error decoding stream meta group name from storage"; /// A controller encapsulating all logic for interacting with a stream. @@ -86,18 +88,18 @@ pub struct StreamCtl { partition: u32, /// A channel of inbound client requests. - requests: ReceiverStream, + requests_tx: mpsc::Sender, + /// A channel of inbound client requests. + requests_rx: ReceiverStream, /// A channel of requests for stream subscription. subs_tx: mpsc::Sender, /// A channel used for communicating the stream's last written offset value. offset_signal: watch::Sender, /// A channel used for triggering graceful shutdown. - _shutdown_tx: broadcast::Sender<()>, + shutdown_tx: broadcast::Sender<()>, /// A channel used for triggering graceful shutdown. shutdown_rx: BroadcastStream<()>, - /// A bool indicating that this controller has been descheduled and needs to shutdown. - descheduled: bool, /// A handle to this controller's spawned subscription controller. sub_ctl: JoinHandle>, @@ -108,12 +110,15 @@ pub struct StreamCtl { /// A `None` value indicates that no timestamp record exists on disk, and it will be populated /// when the next batch is written to the stream. earliest_timestamp: Option<(i64, u64)>, + /// A bool indicating if the stream is currently undergoing a compaction routine. + is_compacting: bool, } impl StreamCtl { /// Create a new instance. pub async fn new( - config: Arc, db: Database, shutdown_tx: broadcast::Sender<()>, requests: mpsc::Receiver, + config: Arc, db: Database, shutdown_tx: broadcast::Sender<()>, requests_tx: mpsc::Sender, + requests_rx: mpsc::Receiver, ) -> Result<(Self, watch::Receiver)> { // Recover stream state. let partition = config.partition; @@ -143,15 +148,16 @@ impl StreamCtl { _db: db, tree, partition, - requests: ReceiverStream::new(requests), + requests_tx, + requests_rx: ReceiverStream::new(requests_rx), subs_tx, offset_signal, shutdown_rx: BroadcastStream::new(shutdown_tx.subscribe()), - _shutdown_tx: shutdown_tx, - descheduled: false, + shutdown_tx, sub_ctl, current_offset: recovery_data.last_written_offset, earliest_timestamp: recovery_data.first_timestamp_opt, + is_compacting: false, }, offset_signal_rx, )) @@ -164,12 +170,15 @@ impl StreamCtl { async fn run(mut self) -> Result<()> { tracing::debug!("stream controller {}/{} has started", self.config.stream, self.partition); + let compaction_timer = tokio::time::sleep(COMPACTION_INTERVAL); + tokio::pin!(compaction_timer); loop { - if self.descheduled { - break; - } tokio::select! { - msg_opt = self.requests.next() => self.handle_ctl_msg(msg_opt).await, + msg_opt = self.requests_rx.next() => self.handle_ctl_msg(msg_opt).await, + _ = &mut compaction_timer => { + compaction_timer.set(tokio::time::sleep(COMPACTION_INTERVAL)); + self.spawn_compaction_task(); + } _ = self.shutdown_rx.next() => break, } } @@ -188,14 +197,14 @@ impl StreamCtl { let msg = match msg_opt { Some(msg) => msg, None => { - let _ = self.subs_tx.send(StreamSubCtlMsg::Shutdown).await; - self.descheduled = true; + let _res = self.shutdown_tx.send(()); return; } }; match msg { StreamCtlMsg::RequestPublish { tx, request } => self.handle_publisher_request(tx, request).await, StreamCtlMsg::RequestSubscribe { tx, rx, setup } => self.handle_request_subscribe(tx, rx, setup).await, + StreamCtlMsg::CompactionFinished { earliest_timestamp } => self.handle_compaction_finished(earliest_timestamp).await, } } @@ -205,6 +214,126 @@ impl StreamCtl { ) { let _ = self.subs_tx.send(StreamSubCtlMsg::Request { tx, rx, setup }).await; } + + /// Begin a compaction routine, if possible. + #[tracing::instrument(level = "trace", skip(self))] + fn spawn_compaction_task(&mut self) { + // FUTURE: instrument the compaction routine so that we can generate metrics over durations. + if self.is_compacting { + return; + } + self.is_compacting = true; + let (config, tree, ts, stream_tx, shutdown_tx) = ( + self.config.clone(), + self.tree.clone(), + self.earliest_timestamp, + self.requests_tx.clone(), + self.shutdown_tx.clone(), + ); + let _handle = tokio::spawn(async move { + match compact_stream(config, tree, ts).await { + Ok(earliest_timestamp) => { + let _res = stream_tx + .send(StreamCtlMsg::CompactionFinished { earliest_timestamp }) + .await; + } + Err(err) => { + tracing::error!(error = ?err, "error during compaction routine, shutting down"); + let _res = shutdown_tx.send(()); + } + } + }); + } + + /// Handle a compaction finalization. + #[tracing::instrument(level = "trace", skip(self))] + async fn handle_compaction_finished(&mut self, earliest_timestamp: Option<(i64, u64)>) { + self.is_compacting = false; + self.earliest_timestamp = earliest_timestamp; + } +} + +/// Execute a compaction routine on the given DB tree. +/// +/// If compaction is not configured for the stream, then this routine will immediately finish and +/// will return the given `earliest_timestamp` as its output. +/// +/// This routine currently supports time based compaction, and its algorithm is as follows: +/// - Extract the configured TTL of the policy. +/// - Calculate an invalidation threshold based on a delta of now and the configured TTL. +/// - Search the secondary time index for all records which fall behind the threshold. +/// - Delete any records which fall behind the threshold. +/// - Return the next earliest timestamp record as output. +/// +/// **NOTE: any error returned from this routine will cause a shutdown to be issued.** +#[tracing::instrument(level = "trace", skip(config, tree, earliest_timestamp))] +async fn compact_stream(config: Arc, tree: Tree, earliest_timestamp: Option<(i64, u64)>) -> Result> { + tracing::debug!("compaction routine is starting"); + + // Extract the configured retention policy. + let ttl = match &config.retention_policy.strategy { + StreamRetentionPolicy::Retain => return Ok(earliest_timestamp), + StreamRetentionPolicy::Time => { + let ttl = config + .retention_policy + .retention_seconds + .unwrap_or_else(StreamRetentionSpec::retention_seconds_default); + chrono::Duration::seconds(i64::try_from(ttl).unwrap_or(i64::MAX)) + } + }; + let threshold = (chrono::Utc::now() - ttl).timestamp_millis(); + + // Search for all timestamps falling behind the calculated threshold. + let earliest_timestamp_opt = Database::spawn_blocking(move || -> Result> { + // Scan over timestamp index entries, adding to batch for deletion. + let mut batch = sled::Batch::default(); + let ts_start: &[u8] = PREFIX_STREAM_TS; + let ts_threshold: &[u8] = &utils::encode_byte_prefix_i64(PREFIX_STREAM_TS, threshold); + let mut last_ts_offset_opt = None; // Last event u64 offset targeted based on timestamp index. + for kv_res in tree.range(ts_start..=ts_threshold) { + let (key, val) = kv_res.context(ERR_ITER_FAILURE)?; + batch.remove(key); + last_ts_offset_opt = Some(utils::decode_u64(&val).context("error decoding timestamp index offset, data corrupted")?); + } + let last_ts_offset = match last_ts_offset_opt { + Some(last_ts_offset) => last_ts_offset, + None => return Ok(None), + }; + + // Scan over stream event entries, adding to batch for deletion, stopping at the offset + // of the last timestamp index offset of the compaction threshold. + let event_start: &[u8] = PREFIX_STREAM_EVENT; + let event_stop: &[u8] = &utils::encode_byte_prefix(PREFIX_STREAM_EVENT, last_ts_offset); + for key_res in tree.range(event_start..=event_stop).keys() { + let key = key_res.context(ERR_ITER_FAILURE)?; + batch.remove(key); + } + + // Find the next timestamp index which takes the place of the earliest timestamp. + let ts_stop: &[u8] = &utils::encode_byte_prefix_i64(PREFIX_STREAM_TS, i64::MAX); + let next_earliest_timestamp = tree + .range(ts_threshold..=ts_stop) + .next() + .transpose() + .context(ERR_ITER_FAILURE)? + .map(|(key, val)| -> Result<(i64, u64)> { + let ts = utils::decode_i64(&key[1..]).context("error decoding timestamp index key, data corrupted")?; + let offset = utils::decode_u64(&val).context("error decoding timestamp index value, data corrupted")?; + Ok((ts, offset)) + }) + .transpose()?; + + // Apply the batch. + tracing::debug!("compacting timestamp and event records up through offset {}", last_ts_offset); + tree.apply_batch(batch) + .context("error applying compaction batch to stream tree")?; + tree.flush().context(ERR_DB_FLUSH)?; + Ok(next_earliest_timestamp) + }) + .await + .context("error from compaction routine") + .and_then(|res| res)?; + Ok(earliest_timestamp_opt) } /// Recover this stream's last recorded state. @@ -292,4 +421,9 @@ pub enum StreamCtlMsg { rx: Streaming, setup: StreamSubscribeSetup, }, + /// A compaction routine has finished. + CompactionFinished { + /// The new earliest timestamp of data on disk. + earliest_timestamp: Option<(i64, u64)>, + }, } diff --git a/hadron-stream/src/stream/mod_test.rs b/hadron-stream/src/stream/mod_test.rs index 0119a1b..af0f06d 100644 --- a/hadron-stream/src/stream/mod_test.rs +++ b/hadron-stream/src/stream/mod_test.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use anyhow::{Context, Result}; use rand::prelude::*; @@ -5,8 +7,9 @@ use crate::config::Config; use crate::database::Database; use crate::grpc::Event; use crate::models::stream::Subscription; -use crate::stream::{KEY_STREAM_LAST_WRITTEN_OFFSET, PREFIX_STREAM_EVENT, PREFIX_STREAM_SUBS, PREFIX_STREAM_SUB_OFFSETS}; +use crate::stream::{KEY_STREAM_LAST_WRITTEN_OFFSET, PREFIX_STREAM_EVENT, PREFIX_STREAM_SUBS, PREFIX_STREAM_SUB_OFFSETS, PREFIX_STREAM_TS}; use crate::utils; +use hadron_core::crd::StreamRetentionPolicy; #[tokio::test] async fn recover_stream_state_empty_state() -> Result<()> { @@ -36,7 +39,7 @@ async fn recover_stream_state_with_previous_state() -> Result<()> { let db = Database::new(config.clone()).await?; let stream_tree = db.get_stream_tree().await?; - let expected_offset = setup_stream_data(&stream_tree).await?; + let expected_offset = setup_stream_data(&stream_tree).await?.1; let output = super::recover_stream_state(stream_tree).await?; @@ -51,6 +54,10 @@ async fn recover_stream_state_with_previous_state() -> Result<()> { "expected subscriptions len to be 0 got {}", output.subscriptions.len() ); + assert!( + output.first_timestamp_opt.is_some(), + "expected first_timestamp_opt to be populated, got None" + ); Ok(()) } @@ -61,7 +68,7 @@ async fn recover_stream_state_with_previous_state_and_subs() -> Result<()> { let db = Database::new(config.clone()).await?; let stream_tree = db.get_stream_tree().await?; - let expected_offset = setup_stream_data(&stream_tree).await?; + let expected_offset = setup_stream_data(&stream_tree).await?.1; let expected_subs = setup_subs_data(&stream_tree).await?; let mut output = super::recover_stream_state(stream_tree).await?; @@ -82,12 +89,140 @@ async fn recover_stream_state_with_previous_state_and_subs() -> Result<()> { Ok(()) } -/// Setup some stream data in the given DB tree returning the last written offset. -async fn setup_stream_data(db: &sled::Tree) -> Result { - use rand::prelude::*; +#[tokio::test] +async fn compact_stream_noop_with_empty_tree() -> Result<()> { + let (config, _tmpdir) = Config::new_test()?; + let db = Database::new(config.clone()).await?; + let stream_tree = db.get_stream_tree().await?; + + let earliest_timestamp_opt = super::compact_stream(config, stream_tree.clone(), None) + .await + .context("unexpected error from compaction")?; + + assert!( + earliest_timestamp_opt.is_none(), + "expected compaction to return None, got {:?}", + earliest_timestamp_opt + ); + let count = stream_tree.scan_prefix(PREFIX_STREAM_EVENT).count(); + assert_eq!( + count, 0, + "mismatch number of stream events after compaction, got {} expected {}", + count, 0 + ); + + Ok(()) +} + +#[tokio::test] +async fn compact_stream_noop_retention_policy_retain() -> Result<()> { + let (mut config, _tmpdir) = Config::new_test()?; + Arc::make_mut(&mut config).retention_policy.strategy = StreamRetentionPolicy::Retain; + let db = Database::new(config.clone()).await?; + let stream_tree = db.get_stream_tree().await?; + let last_offset = setup_stream_data(&stream_tree).await?.1; + + let earliest_timestamp_opt = super::compact_stream(config, stream_tree.clone(), None) + .await + .context("unexpected error from compaction")?; + + assert!( + earliest_timestamp_opt.is_none(), + "expected compaction to return None, got {:?}", + earliest_timestamp_opt + ); + let count = stream_tree.scan_prefix(PREFIX_STREAM_EVENT).count(); + assert_eq!( + count, + last_offset as usize + 1, + "mismatch number of stream events after compaction, got {} expected {}", + count, + last_offset + 1 + ); + + Ok(()) +} + +#[tokio::test] +async fn compact_stream_deletes_all_data() -> Result<()> { + let (mut config, _tmpdir) = Config::new_test()?; + Arc::make_mut(&mut config).retention_policy.retention_seconds = Some(0); // Should ensure that all data is removed. + let db = Database::new(config.clone()).await?; + let stream_tree = db.get_stream_tree().await?; + let last_offset = setup_stream_data(&stream_tree).await?.1; + + let earliest_timestamp_opt = super::compact_stream(config, stream_tree.clone(), None) + .await + .context("unexpected error from compaction")?; + + assert!( + last_offset > 50, + "expected at least offset 50 from setup_stream_data, got {}", + last_offset + ); + assert!( + earliest_timestamp_opt.is_none(), + "expected compaction to return None, got {:?}", + earliest_timestamp_opt + ); + let count = stream_tree.scan_prefix(PREFIX_STREAM_EVENT).count(); + assert_eq!( + count, 0, + "mismatch number of stream events after compaction, got {} expected {}", + count, 0 + ); + + Ok(()) +} +#[tokio::test] +async fn compact_stream_deletes_only_old_data() -> Result<()> { + let (config, _tmpdir) = Config::new_test()?; + let db = Database::new(config.clone()).await?; + let stream_tree = db.get_stream_tree().await?; + let (last_ts, last_offset) = setup_stream_data(&stream_tree).await?; + let ts_two_weeks_ago = (chrono::Utc::now() - chrono::Duration::weeks(2)).timestamp_millis(); + let old_offset = last_offset / 2; + stream_tree + .insert( + &utils::encode_byte_prefix_i64(PREFIX_STREAM_TS, ts_two_weeks_ago), + &utils::encode_u64(old_offset), + ) + .context("error inserting fake timestamp index record for compaction test")?; + + let earliest_timestamp = super::compact_stream(config, stream_tree.clone(), None) + .await + .context("unexpected error from compaction")? + .context("expected next earliest timestamp record to be returned")?; + + assert_eq!( + earliest_timestamp.0, last_ts, + "expected earliest timestamp to be {}, got {}", + earliest_timestamp.0, last_ts + ); + assert_eq!( + earliest_timestamp.1, last_offset, + "expected earliest timestamp offset to be {}, got {}", + earliest_timestamp.1, last_offset + ); + let event_count = stream_tree.scan_prefix(PREFIX_STREAM_EVENT).count(); + let expected_count = (old_offset..last_offset).count(); // `..` because old_offset is deleted. + assert_eq!( + event_count, expected_count, + "mismatch number of stream events after compaction, got {} expected {}", + event_count, expected_count + ); + let ts_count = stream_tree.scan_prefix(PREFIX_STREAM_TS).count(); + assert_eq!(ts_count, 1, "expected 1 timestamp index entry, got {}", ts_count); + + Ok(()) +} + +/// Setup some stream data in the given DB tree returning the last written offset. +async fn setup_stream_data(db: &sled::Tree) -> Result<(i64, u64)> { let mut batch = sled::Batch::default(); let mut last_offset = 0; + let ts = chrono::Utc::now().timestamp_millis(); for offset in 0..rand::thread_rng().gen_range(50..100) { let event = Event::new_test(offset, "test", "empty"); let event_bytes = utils::encode_model(&event)?; @@ -95,9 +230,10 @@ async fn setup_stream_data(db: &sled::Tree) -> Result { last_offset = offset; } batch.insert(KEY_STREAM_LAST_WRITTEN_OFFSET, &utils::encode_u64(last_offset)); + batch.insert(&utils::encode_byte_prefix_i64(PREFIX_STREAM_TS, ts), &utils::encode_u64(last_offset)); db.apply_batch(batch) .context("error applying batch to write test data to stream")?; - Ok(last_offset) + Ok((ts, last_offset)) } /// Setup some subscriptions data in the given DB tree returning the set of created subs. diff --git a/hadron-stream/src/stream/subscriber.rs b/hadron-stream/src/stream/subscriber.rs index 7544238..c57535e 100644 --- a/hadron-stream/src/stream/subscriber.rs +++ b/hadron-stream/src/stream/subscriber.rs @@ -64,8 +64,6 @@ pub struct StreamSubCtl { shutdown_tx: broadcast::Sender<()>, /// A channel used for triggering graceful shutdown. shutdown_rx: BroadcastStream<()>, - /// A bool indicating that this controller has been descheduled and needs to shutdown. - descheduled: bool, /// A general purpose reusable bytes buffer, safe for concurrent use. buf: BytesMut, @@ -91,7 +89,6 @@ impl StreamSubCtl { liveness_checks: StreamMap::new(), shutdown_rx: BroadcastStream::new(shutdown_tx.subscribe()), shutdown_tx, - descheduled: false, buf: BytesMut::with_capacity(5000), } } @@ -104,9 +101,6 @@ impl StreamSubCtl { tracing::debug!("stream subscriber controller {}/{} has started", self.config.stream, self.partition,); loop { - if self.descheduled { - break; - } tokio::select! { Some(msg) = self.events_rx.next() => self.handle_msg(msg).await, Some(offset) = self.stream_offset.next() => self.handle_offset_update(offset).await, @@ -127,9 +121,6 @@ impl StreamSubCtl { StreamSubCtlMsg::Request { tx, rx, setup } => self.handle_request(tx, rx, setup).await, StreamSubCtlMsg::FetchStreamRecords(res) => self.handle_fetch_stream_records_result(res).await, StreamSubCtlMsg::DeliveryResponse(res) => self.handle_delivery_response(res).await, - StreamSubCtlMsg::Shutdown => { - self.descheduled = true; - } } } @@ -580,8 +571,6 @@ pub enum StreamSubCtlMsg { FetchStreamRecords(ShutdownResult), /// A response from a subscriber following a delivery of data for processing. DeliveryResponse(DeliveryResponse), - /// The parent controller is shutting down, so this controller needs to do the same. - Shutdown, } pub struct FetchStreamRecords { diff --git a/hadron-stream/src/watchers/pipelines.rs b/hadron-stream/src/watchers/pipelines.rs index 358d878..6721040 100644 --- a/hadron-stream/src/watchers/pipelines.rs +++ b/hadron-stream/src/watchers/pipelines.rs @@ -6,7 +6,7 @@ use arc_swap::ArcSwap; use futures::stream::StreamExt; use kube::api::{Api, ListParams}; use kube::client::Client; -use kube_runtime::watcher::{watcher, Error as WatcherError, Event}; +use kube::runtime::watcher::{watcher, Error as WatcherError, Event}; use tokio::sync::{broadcast, mpsc, watch}; use tokio::task::JoinHandle; use tokio_stream::wrappers::BroadcastStream; @@ -97,6 +97,10 @@ impl PipelineWatcher { match event { Event::Applied(pipeline) => self.handle_pipeline_applied(pipeline).await, Event::Deleted(pipeline) => { + // Only process Pipelines for this Stream. + if pipeline.spec.source_stream != self.config.stream { + return; + } let pipeline = Arc::new(pipeline); let name = match &pipeline.metadata.name { Some(name) => name, diff --git a/hadron-stream/src/watchers/stream.rs b/hadron-stream/src/watchers/stream.rs index f42c8ad..e01a8a1 100644 --- a/hadron-stream/src/watchers/stream.rs +++ b/hadron-stream/src/watchers/stream.rs @@ -4,7 +4,7 @@ use anyhow::Result; use futures::stream::StreamExt; use kube::api::{Api, ListParams}; use kube::client::Client; -use kube_runtime::watcher::{watcher, Error as WatcherError, Event}; +use kube::runtime::watcher::{watcher, Error as WatcherError, Event}; use tokio::sync::{broadcast, watch}; use tokio::task::JoinHandle; use tokio_stream::wrappers::BroadcastStream; diff --git a/hadron-stream/src/watchers/tokens.rs b/hadron-stream/src/watchers/tokens.rs index 94b9644..e307383 100644 --- a/hadron-stream/src/watchers/tokens.rs +++ b/hadron-stream/src/watchers/tokens.rs @@ -8,7 +8,7 @@ use jsonwebtoken::DecodingKey; use k8s_openapi::api::core::v1::Secret; use kube::api::{Api, ListParams}; use kube::client::Client; -use kube_runtime::watcher::{watcher, Error as WatcherError, Event}; +use kube::runtime::watcher::{watcher, Error as WatcherError, Event}; use tokio::sync::broadcast; use tokio::task::JoinHandle; use tokio_stream::wrappers::BroadcastStream;