diff --git a/Cargo.lock b/Cargo.lock index 273aad9..feaa19e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,7 +89,8 @@ checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "apalis" version = "0.3.6" -source = "git+https://github.com/akhildevelops/apalis.git?branch=summarizer#fd4591a5a76080b502d654df4fb1156372722194" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1dfa7394642efc1aa1f07fd069019b98b24519962e2791c8b396b450457ba3a" dependencies = [ "apalis-core", "apalis-sql", @@ -98,7 +99,8 @@ dependencies = [ [[package]] name = "apalis-core" version = "0.3.6" -source = "git+https://github.com/akhildevelops/apalis.git?branch=summarizer#fd4591a5a76080b502d654df4fb1156372722194" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5c28b120411d25c16ad0dfdfa1d41b0661717ce99c77fe45d3d6f5c4f4e089d" dependencies = [ "anyhow", "async-trait", @@ -115,13 +117,14 @@ dependencies = [ "tower", "tracing", "tracing-futures", - "uuid 0.8.2", + "uuid", ] [[package]] name = "apalis-sql" version = "0.3.6" -source = "git+https://github.com/akhildevelops/apalis.git?branch=summarizer#fd4591a5a76080b502d654df4fb1156372722194" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b874a1a881e807207e69bc4bcea765f39aad74fe6f673a6f7e3012baec69cbe5" dependencies = [ "apalis-core", "async-stream", @@ -133,7 +136,6 @@ dependencies = [ "serde_json", "sqlx", "tokio 1.27.0", - "uuid 1.0.0", ] [[package]] @@ -143,7 +145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d5e93aca1b2f0ca772c76cadd43e965809df87ef98e25e47244c7f006c85d2" dependencies = [ "backoff", - "base64 0.21.0", + "base64 0.21.2", "derive_builder", "futures 0.3.28", "rand", @@ -177,25 +179,25 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.27", ] [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.27", ] [[package]] name = "atoi" -version = "1.0.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5" dependencies = [ "num-traits", ] @@ -299,9 +301,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "bit-set" @@ -335,13 +337,12 @@ dependencies = [ [[package]] name = "bstr" -version = "1.4.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", - "once_cell", - "regex-automata", + "regex-automata 0.3.3", "serde", ] @@ -487,18 +488,18 @@ dependencies = [ [[package]] name = "crc" -version = "3.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.2.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" +checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" [[package]] name = "crossbeam-deque" @@ -601,7 +602,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.15", + "syn 2.0.27", ] [[package]] @@ -618,7 +619,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.27", ] [[package]] @@ -719,10 +720,10 @@ dependencies = [ ] [[package]] -name = "dotenvy" -version = "0.15.7" +name = "dotenv" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] name = "either" @@ -943,7 +944,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.27", ] [[package]] @@ -1024,20 +1025,26 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashlink" -version = "0.8.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" +checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" dependencies = [ - "hashbrown", + "hashbrown 0.11.2", ] [[package]] @@ -1166,9 +1173,9 @@ checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ "http", "hyper", - "rustls", + "rustls 0.20.8", "tokio 1.27.0", - "tokio-rustls", + "tokio-rustls 0.23.4", ] [[package]] @@ -1231,7 +1238,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1376,7 +1383,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -1598,7 +1605,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.27", ] [[package]] @@ -1609,9 +1616,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.25.3+1.1.1t" +version = "111.26.0+1.1.1u" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924757a6a226bf60da5f7dd0311a34d2b52283dd82ddeb103208ddc66362f80c" +checksum = "efc62c9f12b22b8f5208c23a7200a442b2e5999f8bdf80233852122b5a4f6f37" dependencies = [ "cc", ] @@ -1749,9 +1756,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -1773,18 +1780,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -1874,6 +1881,12 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" + [[package]] name = "regex-syntax" version = "0.6.29" @@ -1892,7 +1905,7 @@ version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", "bytes 1.4.0", "encoding_rs", "futures-core", @@ -1912,7 +1925,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.20.8", "rustls-native-certs", "rustls-pemfile", "serde", @@ -1920,7 +1933,7 @@ dependencies = [ "serde_urlencoded", "tokio 1.27.0", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.23.4", "tokio-util", "tower-service", "url", @@ -2000,6 +2013,19 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.1", + "log", + "ring", + "sct 0.6.1", + "webpki 0.21.4", +] + [[package]] name = "rustls" version = "0.20.8" @@ -2008,8 +2034,8 @@ checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", - "sct", - "webpki", + "sct 0.7.0", + "webpki 0.22.0", ] [[package]] @@ -2030,7 +2056,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", ] [[package]] @@ -2066,6 +2092,16 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sct" version = "0.7.0" @@ -2131,7 +2167,7 @@ checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.27", ] [[package]] @@ -2167,10 +2203,10 @@ dependencies = [ ] [[package]] -name = "sha1" -version = "0.10.5" +name = "sha-1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -2248,9 +2284,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "sqlformat" -version = "0.2.1" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" +checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4" dependencies = [ "itertools", "nom", @@ -2259,9 +2295,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.6.3" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8de3b03a925878ed54a954f621e64bf55a3c1bd29652d0d1a17830405350188" +checksum = "551873805652ba0d912fec5bbb0f8b4cdd96baf8e2ebf5970e5671092966019b" dependencies = [ "sqlx-core", "sqlx-macros", @@ -2269,9 +2305,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.6.3" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" +checksum = "e48c61941ccf5ddcada342cd59e3e5173b007c509e1e8e990dafc830294d9dc5" dependencies = [ "ahash", "atoi", @@ -2283,7 +2319,6 @@ dependencies = [ "crc", "crossbeam-queue 0.3.8", "dirs", - "dotenvy", "either", "event-listener", "futures-channel", @@ -2304,9 +2339,10 @@ dependencies = [ "paste", "percent-encoding", "rand", + "rustls 0.19.1", "serde", "serde_json", - "sha1", + "sha-1", "sha2", "smallvec 1.10.0", "sqlformat", @@ -2315,17 +2351,19 @@ dependencies = [ "thiserror", "tokio-stream", "url", - "uuid 1.0.0", + "uuid", + "webpki 0.21.4", + "webpki-roots", "whoami", ] [[package]] name = "sqlx-macros" -version = "0.6.3" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9966e64ae989e7e575b19d7265cb79d7fc3cbbdf179835cb0d716f294c2049c9" +checksum = "bc0fba2b0cae21fc00fe6046f8baa4c7fcb49e379f0f592b04696607f69ed2e1" dependencies = [ - "dotenvy", + "dotenv", "either", "heck", "once_cell", @@ -2341,14 +2379,13 @@ dependencies = [ [[package]] name = "sqlx-rt" -version = "0.6.3" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" +checksum = "4db708cd3e459078f85f39f96a00960bd841f66ee2a669e90bf36907f5a79aae" dependencies = [ - "native-tls", "once_cell", "tokio 1.27.0", - "tokio-native-tls", + "tokio-rustls 0.22.0", ] [[package]] @@ -2437,9 +2474,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -2476,22 +2513,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.27", ] [[package]] @@ -2506,12 +2543,12 @@ dependencies = [ [[package]] name = "tiktoken-rs" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba161c549e2c0686f35f5d920e63fad5cafba2c28ad2caceaf07e5d9fa6e8c4" +checksum = "1a99d843674a3468b4a9200a565bbe909a0152f95e82a52feae71e6bf2d4b49d" dependencies = [ "anyhow", - "base64 0.21.0", + "base64 0.21.2", "bstr", "fancy-regex", "lazy_static", @@ -2648,7 +2685,7 @@ checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.27", ] [[package]] @@ -2680,15 +2717,26 @@ dependencies = [ "tokio-sync", ] +[[package]] +name = "tokio-rustls" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +dependencies = [ + "rustls 0.19.1", + "tokio 1.27.0", + "webpki 0.21.4", +] + [[package]] name = "tokio-rustls" version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls", + "rustls 0.20.8", "tokio 1.27.0", - "webpki", + "webpki 0.22.0", ] [[package]] @@ -2876,7 +2924,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.27", ] [[package]] @@ -3022,15 +3070,6 @@ dependencies = [ "serde", ] -[[package]] -name = "uuid" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfcd319456c4d6ea10087ed423473267e1a071f3bc0aa89f80d60997843c6f0" -dependencies = [ - "getrandom", -] - [[package]] name = "valuable" version = "0.1.0" @@ -3166,6 +3205,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "webpki" version = "0.22.0" @@ -3176,6 +3225,15 @@ dependencies = [ "untrusted", ] +[[package]] +name = "webpki-roots" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +dependencies = [ + "webpki 0.21.4", +] + [[package]] name = "whoami" version = "1.4.0" diff --git a/Cargo.toml b/Cargo.toml index 84afa96..75d1dd2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,16 +10,15 @@ version = "0.3.2" repository = "https://github.com/akhildevelops/summarizer" [workspace.dependencies] -async-openai = { version = "~0.10" } -tokio = { version = "~1.27", features = ["macros"] } +async-openai = { version = "^0.10" } +tokio = { version = "^1.27", features = ["macros"] } serde_json = { version = "~1.0" } serde = { version = "~1.0", features = ["derive"] } roxmltree = { version = "~0.18" } reqwest = { version = "~0.11" } clap = { version = "4.2.1", features = ["string"] } -once_cell = { version = "~1.17" } -apalis = { git = "https://github.com/akhildevelops/apalis.git", branch = "summarizer" } -sqlx = { version = "~0.6", features = ["runtime-tokio-native-tls"] } +once_cell = { version = "^1.17" } +apalis = { version = "^0.3.6" } anyhow = { version = "~1.0" } chrono = { version = "~0.4" } futures = { version = "~0.3" } @@ -31,6 +30,7 @@ tower = { version = "0.4", features = ["util"] } tower-http = { version = "0.4", features = ["fs"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } + [profile.release] panic = "abort" lto = "fat" diff --git a/README.md b/README.md index e2b9d8e..101bc50 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,28 @@ -# summarizer +# Summarizer Podcast and Youtube -## Notes: -openssl has a featureflag "vendored" to compile for arm binaries. +# Setup +- Install rust from https://www.rust-lang.org/tools/install if not present in the system. +- Clone the repo +- Install sqlx-cli - `cargo install sqlx-cli --no-default-features --features native-tls,postgres` +- Point existing postgresql (or install) through environment variable in the terminal - `export DATABASE_URL=postgresql://:@:/` +- Get OpenAI Key and export as a env variable: `export OPENAI_API_KEY=**********` + +# Start the service +### Hub +- This is the hub that accepts jobs - `cargo run --bin controller` +### Client +- Open a new terminal. +- This will submit jobs to hub - `sqlx migrate run --ignore-missing && cargo run --bin jobs` +### Server +- A restapi to interact with the service - `cargo run --bin server` +### UI +- A small piece of UI to see all the summaries - `cd ui && npm install && VITE_SUMMARIZER_URL=http://localhost:3001/api/v1 npm run dev` + +## Cross-compilation to raspberrypi +- Install podman or docker +- Install cross cli - `cargo install cross --git https://github.com/cross-rs/cross` +- Run `cross build --release --features=vendored-ssl --target=arm-unknown-linux-gnueabihf` +- Find binaries in `target/arm-unknown-linux-gnueabihf/release/` +- Port them to raspberry pi device and follow above steps of starting of service + diff --git a/summarizer/Cargo.toml b/summarizer/Cargo.toml index f33af4e..7d7cc12 100644 --- a/summarizer/Cargo.toml +++ b/summarizer/Cargo.toml @@ -12,11 +12,11 @@ youtube-transcript = { path = "../youtube-transcript" } tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } apalis = { workspace = true, features = ["postgres", "extensions"] } serde = { workspace = true, features = ["derive"] } -sqlx = { workspace = true, features = ["postgres"] } -openssl = { version = "0.10", features = ["vendored"] } +sqlx = { version = "^0.5", features = ["postgres"] } +openssl = { version = "0.10", features = ["vendored"], optional = true } anyhow = { workspace = true } chrono = { workspace = true } -tiktoken-rs = { version = "~0.4" } +tiktoken-rs = { version = "0.5" } futures = { workspace = true, features = ["executor"] } env_logger = { workspace = true } log = { workspace = true } @@ -29,3 +29,6 @@ tower-http = { workspace = true, features = ["trace", "cors"] } tracing = { workspace = true } tracing-subscriber = { workspace = true } axum-extra = { version = "0.7" } + +[features] +vendored-ssl = ["dep:openssl"] diff --git a/summarizer/src/bin/job.rs b/summarizer/src/bin/job.rs index 0e1deb8..861bf4b 100644 --- a/summarizer/src/bin/job.rs +++ b/summarizer/src/bin/job.rs @@ -9,14 +9,14 @@ use tokio; async fn main() -> Result<(), Serror> { let postgres_url = env_var("DATABASE_URL")?; let links = [ - // "https://www.youtube.com/watch?v=sBH-ngpL0zo", + "https://www.youtube.com/watch?v=sBH-ngpL0zo", "https://www.youtube.com/watch?v=WYNRt-AwoUg", - // "https://www.youtube.com/watch?v=fPWzeFYtjfc", - // "https://www.youtube.com/watch?v=e64JTo7LMmY", - // "https://www.youtube.com/watch?v=vcTtYZX7Ahk", - // "https://www.youtube.com/watch?v=FzUeQ7AZ3O0", - // "https://www.youtube.com/watch?v=sWSgQFmWMxw", - // "https://www.youtube.com/watch?v=vjfypJq5pK8", + "https://www.youtube.com/watch?v=fPWzeFYtjfc", + "https://www.youtube.com/watch?v=e64JTo7LMmY", + "https://www.youtube.com/watch?v=vcTtYZX7Ahk", + "https://www.youtube.com/watch?v=FzUeQ7AZ3O0", + "https://www.youtube.com/watch?v=sWSgQFmWMxw", + "https://www.youtube.com/watch?v=vjfypJq5pK8", ]; let mut storage: PostgresStorage = PostgresStorage::connect(postgres_url).await?; for link in links { diff --git a/summarizer/src/scheduler.rs b/summarizer/src/scheduler.rs index 3b10eb1..a8e8d5d 100644 --- a/summarizer/src/scheduler.rs +++ b/summarizer/src/scheduler.rs @@ -67,7 +67,7 @@ pub async fn setup_youtube_data_workers(postgres_url: &str) -> Result<(), Serror let summarizer = Summarizer::default_params()?; ps_client.setup().await?; Monitor::new() - .register_with_count(1, |_| { + .register_with_count(1, move |_| { WorkerBuilder::new(ps_client.clone()) .layer(Extension(pgpool.clone())) .layer(Extension(summarizer.clone()))