From 7399b7eb94c518448f86fc485173ee5e681dcbe7 Mon Sep 17 00:00:00 2001 From: stopmin Date: Wed, 3 Jul 2024 03:18:15 +0900 Subject: [PATCH 01/20] =?UTF-8?q?python=20version=203.12.4=EB=A1=9C=20?= =?UTF-8?q?=EC=97=85=EA=B7=B8=EB=A0=88=EC=9D=B4=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pipfile | 2 +- Pipfile.lock | 284 +++++++++++++++++++++++++++------------------------ 2 files changed, 150 insertions(+), 136 deletions(-) diff --git a/Pipfile b/Pipfile index 0f6599c..9533519 100644 --- a/Pipfile +++ b/Pipfile @@ -29,4 +29,4 @@ python-dotenv = "*" [requires] python_version = "3.12" -python_full_version = "3.12.3" +python_full_version = "3.12.4" diff --git a/Pipfile.lock b/Pipfile.lock index 5390141..3bc34fa 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "7b0afeb6d7908fd95b9931d2b2b07708e2b95c7f21effa110bb110e65cb2c106" + "sha256": "dd7d01d0081beb52197821b40c588d4d034a1094a482598fe6e4e6f372ceb76c" }, "pipfile-spec": 6, "requires": { - "python_full_version": "3.12.3", + "python_full_version": "3.12.4", "python_version": "3.12" }, "sources": [ @@ -691,157 +691,171 @@ }, "openai": { "hashes": [ - "sha256:009bfa1504c9c7ef64d87be55936d142325656bbc6d98c68b669d6472e4beb09", - "sha256:3d1e0b0aac9b0db69a972d36dc7efa7563f8e8d65550b27a48f2a0c2ec207e80" + "sha256:3f6101888bb516647edade74c503f2b937b8bab73408e799d58f2aba68bbe51c", + "sha256:69d5b0f47f0c806d5da83fb0f84c147661395226d7f79acc78aa1d9b8c635887" ], "index": "pypi", "markers": "python_full_version >= '3.7.1'", - "version": "==1.35.7" + "version": "==1.35.8" }, "orjson": { "hashes": [ - "sha256:03b565c3b93f5d6e001db48b747d31ea3819b89abf041ee10ac6988886d18e01", - "sha256:099e81a5975237fda3100f918839af95f42f981447ba8f47adb7b6a3cdb078fa", - "sha256:10c0eb7e0c75e1e486c7563fe231b40fdd658a035ae125c6ba651ca3b07936f5", - "sha256:1146bf85ea37ac421594107195db8bc77104f74bc83e8ee21a2e58596bfb2f04", - "sha256:1670fe88b116c2745a3a30b0f099b699a02bb3482c2591514baf5433819e4f4d", - "sha256:185c394ef45b18b9a7d8e8f333606e2e8194a50c6e3c664215aae8cf42c5385e", - "sha256:1ad1de7fef79736dde8c3554e75361ec351158a906d747bd901a52a5c9c8d24b", - "sha256:235dadefb793ad12f7fa11e98a480db1f7c6469ff9e3da5e73c7809c700d746b", - "sha256:28afa96f496474ce60d3340fe8d9a263aa93ea01201cd2bad844c45cd21f5268", - "sha256:2d97531cdfe9bdd76d492e69800afd97e5930cb0da6a825646667b2c6c6c0211", - "sha256:338fd4f071b242f26e9ca802f443edc588fa4ab60bfa81f38beaedf42eda226c", - "sha256:36a10f43c5f3a55c2f680efe07aa93ef4a342d2960dd2b1b7ea2dd764fe4a37c", - "sha256:3d21b9983da032505f7050795e98b5d9eee0df903258951566ecc358f6696969", - "sha256:51bbcdea96cdefa4a9b4461e690c75ad4e33796530d182bdd5c38980202c134a", - "sha256:53ed1c879b10de56f35daf06dbc4a0d9a5db98f6ee853c2dbd3ee9d13e6f302f", - "sha256:545d493c1f560d5ccfc134803ceb8955a14c3fcb47bbb4b2fee0232646d0b932", - "sha256:584c902ec19ab7928fd5add1783c909094cc53f31ac7acfada817b0847975f26", - "sha256:5a35455cc0b0b3a1eaf67224035f5388591ec72b9b6136d66b49a553ce9eb1e6", - "sha256:5df58d206e78c40da118a8c14fc189207fffdcb1f21b3b4c9c0c18e839b5a214", - "sha256:64c9cc089f127e5875901ac05e5c25aa13cfa5dbbbd9602bda51e5c611d6e3e2", - "sha256:68f85ecae7af14a585a563ac741b0547a3f291de81cd1e20903e79f25170458f", - "sha256:6970ed7a3126cfed873c5d21ece1cd5d6f83ca6c9afb71bbae21a0b034588d96", - "sha256:6b68742c469745d0e6ca5724506858f75e2f1e5b59a4315861f9e2b1df77775a", - "sha256:7a5baef8a4284405d96c90c7c62b755e9ef1ada84c2406c24a9ebec86b89f46d", - "sha256:7d10cc1b594951522e35a3463da19e899abe6ca95f3c84c69e9e901e0bd93d38", - "sha256:85c89131d7b3218db1b24c4abecea92fd6c7f9fab87441cfc342d3acc725d807", - "sha256:8a11d459338f96a9aa7f232ba95679fc0c7cedbd1b990d736467894210205c09", - "sha256:8c13ca5e2ddded0ce6a927ea5a9f27cae77eee4c75547b4297252cb20c4d30e6", - "sha256:9cd684927af3e11b6e754df80b9ffafd9fb6adcaa9d3e8fdd5891be5a5cad51e", - "sha256:b2efbd67feff8c1f7728937c0d7f6ca8c25ec81373dc8db4ef394c1d93d13dc5", - "sha256:b39e006b00c57125ab974362e740c14a0c6a66ff695bff44615dcf4a70ce2b86", - "sha256:b6c8e30adfa52c025f042a87f450a6b9ea29649d828e0fec4858ed5e6caecf63", - "sha256:be79e2393679eda6a590638abda16d167754393f5d0850dcbca2d0c3735cebe2", - "sha256:c05f16701ab2a4ca146d0bca950af254cb7c02f3c01fca8efbbad82d23b3d9d4", - "sha256:c4057c3b511bb8aef605616bd3f1f002a697c7e4da6adf095ca5b84c0fd43595", - "sha256:c4a65310ccb5c9910c47b078ba78e2787cb3878cdded1702ac3d0da71ddc5228", - "sha256:ca0b3a94ac8d3886c9581b9f9de3ce858263865fdaa383fbc31c310b9eac07c9", - "sha256:cc28e90a7cae7fcba2493953cff61da5a52950e78dc2dacfe931a317ee3d8de7", - "sha256:cdf7365063e80899ae3a697def1277c17a7df7ccfc979990a403dfe77bb54d40", - "sha256:d69858c32f09c3e1ce44b617b3ebba1aba030e777000ebdf72b0d8e365d0b2b3", - "sha256:dbead71dbe65f959b7bd8cf91e0e11d5338033eba34c114f69078d59827ee139", - "sha256:dcbe82b35d1ac43b0d84072408330fd3295c2896973112d495e7234f7e3da2e1", - "sha256:dfc91d4720d48e2a709e9c368d5125b4b5899dced34b5400c3837dadc7d6271b", - "sha256:eded5138cc565a9d618e111c6d5c2547bbdd951114eb822f7f6309e04db0fb47", - "sha256:f4324929c2dd917598212bfd554757feca3e5e0fa60da08be11b4aa8b90013c1", - "sha256:fb66215277a230c456f9038d5e2d84778141643207f85336ef8d2a9da26bd7ca" + "sha256:03c95484d53ed8e479cade8628c9cea00fd9d67f5554764a1110e0d5aa2de96e", + "sha256:05ac3d3916023745aa3b3b388e91b9166be1ca02b7c7e41045da6d12985685f0", + "sha256:0943e4c701196b23c240b3d10ed8ecd674f03089198cf503105b474a4f77f21f", + "sha256:1335d4ef59ab85cab66fe73fd7a4e881c298ee7f63ede918b7faa1b27cbe5212", + "sha256:1c680b269d33ec444afe2bdc647c9eb73166fa47a16d9a75ee56a374f4a45f43", + "sha256:227df19441372610b20e05bdb906e1742ec2ad7a66ac8350dcfd29a63014a83b", + "sha256:30b0a09a2014e621b1adf66a4f705f0809358350a757508ee80209b2d8dae219", + "sha256:3722fddb821b6036fd2a3c814f6bd9b57a89dc6337b9924ecd614ebce3271394", + "sha256:446dee5a491b5bc7d8f825d80d9637e7af43f86a331207b9c9610e2f93fee22a", + "sha256:450e39ab1f7694465060a0550b3f6d328d20297bf2e06aa947b97c21e5241fbd", + "sha256:49e3bc615652617d463069f91b867a4458114c5b104e13b7ae6872e5f79d0844", + "sha256:4bbc6d0af24c1575edc79994c20e1b29e6fb3c6a570371306db0993ecf144dc5", + "sha256:5410111d7b6681d4b0d65e0f58a13be588d01b473822483f77f513c7f93bd3b2", + "sha256:55d43d3feb8f19d07e9f01e5b9be4f28801cf7c60d0fa0d279951b18fae1932b", + "sha256:57985ee7e91d6214c837936dc1608f40f330a6b88bb13f5a57ce5257807da143", + "sha256:61272a5aec2b2661f4fa2b37c907ce9701e821b2c1285d5c3ab0207ebd358d38", + "sha256:633a3b31d9d7c9f02d49c4ab4d0a86065c4a6f6adc297d63d272e043472acab5", + "sha256:64c81456d2a050d380786413786b057983892db105516639cb5d3ee3c7fd5148", + "sha256:66680eae4c4e7fc193d91cfc1353ad6d01b4801ae9b5314f17e11ba55e934183", + "sha256:697a35a083c4f834807a6232b3e62c8b280f7a44ad0b759fd4dce748951e70db", + "sha256:6eeb13218c8cf34c61912e9df2de2853f1d009de0e46ea09ccdf3d757896af0a", + "sha256:7275664f84e027dcb1ad5200b8b18373e9c669b2a9ec33d410c40f5ccf4b257e", + "sha256:738dbe3ef909c4b019d69afc19caf6b5ed0e2f1c786b5d6215fbb7539246e4c6", + "sha256:79b9b9e33bd4c517445a62b90ca0cc279b0f1f3970655c3df9e608bc3f91741a", + "sha256:874ce88264b7e655dde4aeaacdc8fd772a7962faadfb41abe63e2a4861abc3dc", + "sha256:95a0cce17f969fb5391762e5719575217bd10ac5a189d1979442ee54456393f3", + "sha256:960db0e31c4e52fa0fc3ecbaea5b2d3b58f379e32a95ae6b0ebeaa25b93dfd34", + "sha256:965a916373382674e323c957d560b953d81d7a8603fbeee26f7b8248638bd48b", + "sha256:9c1c4b53b24a4c06547ce43e5fee6ec4e0d8fe2d597f4647fc033fd205707365", + "sha256:a2debd8ddce948a8c0938c8c93ade191d2f4ba4649a54302a7da905a81f00b56", + "sha256:a6ea7afb5b30b2317e0bee03c8d34c8181bc5a36f2afd4d0952f378972c4efd5", + "sha256:ac3045267e98fe749408eee1593a142e02357c5c99be0802185ef2170086a863", + "sha256:b1ec490e10d2a77c345def52599311849fc063ae0e67cf4f84528073152bb2ba", + "sha256:b6f3d167d13a16ed263b52dbfedff52c962bfd3d270b46b7518365bcc2121eed", + "sha256:bb1f28a137337fdc18384079fa5726810681055b32b92253fa15ae5656e1dddb", + "sha256:bf2fbbce5fe7cd1aa177ea3eab2b8e6a6bc6e8592e4279ed3db2d62e57c0e1b2", + "sha256:c27bc6a28ae95923350ab382c57113abd38f3928af3c80be6f2ba7eb8d8db0b0", + "sha256:c2c116072a8533f2fec435fde4d134610f806bdac20188c7bd2081f3e9e0133f", + "sha256:caff75b425db5ef8e8f23af93c80f072f97b4fb3afd4af44482905c9f588da28", + "sha256:d27456491ca79532d11e507cadca37fb8c9324a3976294f68fb1eff2dc6ced5a", + "sha256:d40f839dddf6a7d77114fe6b8a70218556408c71d4d6e29413bb5f150a692ff7", + "sha256:df25d9271270ba2133cc88ee83c318372bdc0f2cd6f32e7a450809a111efc45c", + "sha256:e060748a04cccf1e0a6f2358dffea9c080b849a4a68c28b1b907f272b5127e9b", + "sha256:e54b63d0a7c6c54a5f5f726bc93a2078111ef060fec4ecbf34c5db800ca3b3a7", + "sha256:ea2977b21f8d5d9b758bb3f344a75e55ca78e3ff85595d248eee813ae23ecdfb", + "sha256:eadc8fd310edb4bdbd333374f2c8fec6794bbbae99b592f448d8214a5e4050c0", + "sha256:f215789fb1667cdc874c1b8af6a84dc939fd802bf293a8334fce185c79cd359b", + "sha256:f710f346e4c44a4e8bdf23daa974faede58f83334289df80bc9cd12fe82573c7", + "sha256:f759503a97a6ace19e55461395ab0d618b5a117e8d0fbb20e70cfd68a47327f2", + "sha256:fb0ee33124db6eaa517d00890fc1a55c3bfe1cf78ba4a8899d71a06f2d6ff5c7", + "sha256:fd502f96bf5ea9a61cbc0b2b5900d0dd68aa0da197179042bdd2be67e51a1e4b" ], "markers": "python_version >= '3.8'", - "version": "==3.10.5" + "version": "==3.10.6" }, "pydantic": { "hashes": [ - "sha256:0c84efd9548d545f63ac0060c1e4d39bb9b14db8b3c0652338aecc07b5adec52", - "sha256:ee8538d41ccb9c0a9ad3e0e5f07bf15ed8015b481ced539a1759d8cc89ae90d0" + "sha256:d970ffb9d030b710795878940bd0489842c638e7252fc4a19c3ae2f7da4d6141", + "sha256:ead4f3a1e92386a734ca1411cb25d94147cf8778ed5be6b56749047676d6364e" ], "markers": "python_version >= '3.8'", - "version": "==2.7.4" + "version": "==2.8.0" }, "pydantic-core": { "hashes": [ - "sha256:01dd777215e2aa86dfd664daed5957704b769e726626393438f9c87690ce78c3", - "sha256:0eb2a4f660fcd8e2b1c90ad566db2b98d7f3f4717c64fe0a83e0adb39766d5b8", - "sha256:0fbbdc827fe5e42e4d196c746b890b3d72876bdbf160b0eafe9f0334525119c8", - "sha256:123c3cec203e3f5ac7b000bd82235f1a3eced8665b63d18be751f115588fea30", - "sha256:14601cdb733d741b8958224030e2bfe21a4a881fb3dd6fbb21f071cabd48fa0a", - "sha256:18f469a3d2a2fdafe99296a87e8a4c37748b5080a26b806a707f25a902c040a8", - "sha256:19894b95aacfa98e7cb093cd7881a0c76f55731efad31073db4521e2b6ff5b7d", - "sha256:1b4de2e51bbcb61fdebd0ab86ef28062704f62c82bbf4addc4e37fa4b00b7cbc", - "sha256:1d886dc848e60cb7666f771e406acae54ab279b9f1e4143babc9c2258213daa2", - "sha256:1f4d26ceb5eb9eed4af91bebeae4b06c3fb28966ca3a8fb765208cf6b51102ab", - "sha256:21a5e440dbe315ab9825fcd459b8814bb92b27c974cbc23c3e8baa2b76890077", - "sha256:293afe532740370aba8c060882f7d26cfd00c94cae32fd2e212a3a6e3b7bc15e", - "sha256:2f5966897e5461f818e136b8451d0551a2e77259eb0f73a837027b47dc95dab9", - "sha256:2fd41f6eff4c20778d717af1cc50eca52f5afe7805ee530a4fbd0bae284f16e9", - "sha256:2fdf2156aa3d017fddf8aea5adfba9f777db1d6022d392b682d2a8329e087cef", - "sha256:3c40d4eaad41f78e3bbda31b89edc46a3f3dc6e171bf0ecf097ff7a0ffff7cb1", - "sha256:43d447dd2ae072a0065389092a231283f62d960030ecd27565672bd40746c507", - "sha256:44a688331d4a4e2129140a8118479443bd6f1905231138971372fcde37e43528", - "sha256:44c7486a4228413c317952e9d89598bcdfb06399735e49e0f8df643e1ccd0558", - "sha256:44cd83ab6a51da80fb5adbd9560e26018e2ac7826f9626bc06ca3dc074cd198b", - "sha256:46387e38bd641b3ee5ce247563b60c5ca098da9c56c75c157a05eaa0933ed154", - "sha256:4701b19f7e3a06ea655513f7938de6f108123bf7c86bbebb1196eb9bd35cf724", - "sha256:4748321b5078216070b151d5271ef3e7cc905ab170bbfd27d5c83ee3ec436695", - "sha256:4b06beb3b3f1479d32befd1f3079cc47b34fa2da62457cdf6c963393340b56e9", - "sha256:4d0dcc59664fcb8974b356fe0a18a672d6d7cf9f54746c05f43275fc48636851", - "sha256:4e99bc050fe65c450344421017f98298a97cefc18c53bb2f7b3531eb39bc7805", - "sha256:509daade3b8649f80d4e5ff21aa5673e4ebe58590b25fe42fac5f0f52c6f034a", - "sha256:51991a89639a912c17bef4b45c87bd83593aee0437d8102556af4885811d59f5", - "sha256:53db086f9f6ab2b4061958d9c276d1dbe3690e8dd727d6abf2321d6cce37fa94", - "sha256:564d7922e4b13a16b98772441879fcdcbe82ff50daa622d681dd682175ea918c", - "sha256:574d92eac874f7f4db0ca653514d823a0d22e2354359d0759e3f6a406db5d55d", - "sha256:578e24f761f3b425834f297b9935e1ce2e30f51400964ce4801002435a1b41ef", - "sha256:59ff3e89f4eaf14050c8022011862df275b552caef8082e37b542b066ce1ff26", - "sha256:5f09baa656c904807e832cf9cce799c6460c450c4ad80803517032da0cd062e2", - "sha256:6891a2ae0e8692679c07728819b6e2b822fb30ca7445f67bbf6509b25a96332c", - "sha256:6a750aec7bf431517a9fd78cb93c97b9b0c496090fee84a47a0d23668976b4b0", - "sha256:6f5c4d41b2771c730ea1c34e458e781b18cc668d194958e0112455fff4e402b2", - "sha256:77450e6d20016ec41f43ca4a6c63e9fdde03f0ae3fe90e7c27bdbeaece8b1ed4", - "sha256:81b5efb2f126454586d0f40c4d834010979cb80785173d1586df845a632e4e6d", - "sha256:823be1deb01793da05ecb0484d6c9e20baebb39bd42b5d72636ae9cf8350dbd2", - "sha256:834b5230b5dfc0c1ec37b2fda433b271cbbc0e507560b5d1588e2cc1148cf1ce", - "sha256:847a35c4d58721c5dc3dba599878ebbdfd96784f3fb8bb2c356e123bdcd73f34", - "sha256:86110d7e1907ab36691f80b33eb2da87d780f4739ae773e5fc83fb272f88825f", - "sha256:8951eee36c57cd128f779e641e21eb40bc5073eb28b2d23f33eb0ef14ffb3f5d", - "sha256:8a7164fe2005d03c64fd3b85649891cd4953a8de53107940bf272500ba8a788b", - "sha256:8b8bab4c97248095ae0c4455b5a1cd1cdd96e4e4769306ab19dda135ea4cdb07", - "sha256:90afc12421df2b1b4dcc975f814e21bc1754640d502a2fbcc6d41e77af5ec312", - "sha256:938cb21650855054dc54dfd9120a851c974f95450f00683399006aa6e8abb057", - "sha256:942ba11e7dfb66dc70f9ae66b33452f51ac7bb90676da39a7345e99ffb55402d", - "sha256:972658f4a72d02b8abfa2581d92d59f59897d2e9f7e708fdabe922f9087773af", - "sha256:97736815b9cc893b2b7f663628e63f436018b75f44854c8027040e05230eeddb", - "sha256:98906207f29bc2c459ff64fa007afd10a8c8ac080f7e4d5beff4c97086a3dabd", - "sha256:99457f184ad90235cfe8461c4d70ab7dd2680e28821c29eca00252ba90308c78", - "sha256:a0d829524aaefdebccb869eed855e2d04c21d2d7479b6cada7ace5448416597b", - "sha256:a2fdd81edd64342c85ac7cf2753ccae0b79bf2dfa063785503cb85a7d3593223", - "sha256:a55b5b16c839df1070bc113c1f7f94a0af4433fcfa1b41799ce7606e5c79ce0a", - "sha256:a642295cd0c8df1b86fc3dced1d067874c353a188dc8e0f744626d49e9aa51c4", - "sha256:ab86ce7c8f9bea87b9d12c7f0af71102acbf5ecbc66c17796cff45dae54ef9a5", - "sha256:abc267fa9837245cc28ea6929f19fa335f3dc330a35d2e45509b6566dc18be23", - "sha256:ae1d6df168efb88d7d522664693607b80b4080be6750c913eefb77e34c12c71a", - "sha256:b2ebef0e0b4454320274f5e83a41844c63438fdc874ea40a8b5b4ecb7693f1c4", - "sha256:b48ece5bde2e768197a2d0f6e925f9d7e3e826f0ad2271120f8144a9db18d5c8", - "sha256:b7cdf28938ac6b8b49ae5e92f2735056a7ba99c9b110a474473fd71185c1af5d", - "sha256:bb4462bd43c2460774914b8525f79b00f8f407c945d50881568f294c1d9b4443", - "sha256:bc4ff9805858bd54d1a20efff925ccd89c9d2e7cf4986144b30802bf78091c3e", - "sha256:c1322d7dd74713dcc157a2b7898a564ab091ca6c58302d5c7b4c07296e3fd00f", - "sha256:c67598100338d5d985db1b3d21f3619ef392e185e71b8d52bceacc4a7771ea7e", - "sha256:ca26a1e73c48cfc54c4a76ff78df3727b9d9f4ccc8dbee4ae3f73306a591676d", - "sha256:d323a01da91851a4f17bf592faf46149c9169d68430b3146dcba2bb5e5719abc", - "sha256:dc1803ac5c32ec324c5261c7209e8f8ce88e83254c4e1aebdc8b0a39f9ddb443", - "sha256:e00a3f196329e08e43d99b79b286d60ce46bed10f2280d25a1718399457e06be", - "sha256:e85637bc8fe81ddb73fda9e56bab24560bdddfa98aa64f87aaa4e4b6730c23d2", - "sha256:e858ac0a25074ba4bce653f9b5d0a85b7456eaddadc0ce82d3878c22489fa4ee", - "sha256:eae237477a873ab46e8dd748e515c72c0c804fb380fbe6c85533c7de51f23a8f", - "sha256:ebef0dd9bf9b812bf75bda96743f2a6c5734a02092ae7f721c048d156d5fabae", - "sha256:ec3beeada09ff865c344ff3bc2f427f5e6c26401cc6113d77e372c3fdac73864", - "sha256:f76d0ad001edd426b92233d45c746fd08f467d56100fd8f30e9ace4b005266e4", - "sha256:f85d05aa0918283cf29a30b547b4df2fbb56b45b135f9e35b6807cb28bc47951", - "sha256:f9899c94762343f2cc2fc64c13e7cae4c3cc65cdfc87dd810a31654c9b7358cc" + "sha256:03aceaf6a5adaad3bec2233edc5a7905026553916615888e53154807e404545c", + "sha256:05e83ce2f7eba29e627dd8066aa6c4c0269b2d4f889c0eba157233a353053cea", + "sha256:0b0eefc7633a04c0694340aad91fbfd1986fe1a1e0c63a22793ba40a18fcbdc8", + "sha256:0e75794883d635071cf6b4ed2a5d7a1e50672ab7a051454c76446ef1ebcdcc91", + "sha256:0f6dd3612a3b9f91f2e63924ea18a4476656c6d01843ca20a4c09e00422195af", + "sha256:116b326ac82c8b315e7348390f6d30bcfe6e688a7d3f1de50ff7bcc2042a23c2", + "sha256:16197e6f4fdecb9892ed2436e507e44f0a1aa2cff3b9306d1c879ea2f9200997", + "sha256:1c3c5b7f70dd19a6845292b0775295ea81c61540f68671ae06bfe4421b3222c2", + "sha256:1dacf660d6de692fe351e8c806e7efccf09ee5184865893afbe8e59be4920b4a", + "sha256:1def125d59a87fe451212a72ab9ed34c118ff771e5473fef4f2f95d8ede26d75", + "sha256:1e4f46189d8740561b43655263a41aac75ff0388febcb2c9ec4f1b60a0ec12f3", + "sha256:1f038156b696a1c39d763b2080aeefa87ddb4162c10aa9fabfefffc3dd8180fa", + "sha256:21d9f7e24f63fdc7118e6cc49defaab8c1d27570782f7e5256169d77498cf7c7", + "sha256:22b813baf0dbf612752d8143a2dbf8e33ccb850656b7850e009bad2e101fc377", + "sha256:22e3b1d4b1b3f6082849f9b28427ef147a5b46a6132a3dbaf9ca1baa40c88609", + "sha256:23425eccef8f2c342f78d3a238c824623836c6c874d93c726673dbf7e56c78c0", + "sha256:25c46bb2ff6084859bbcfdf4f1a63004b98e88b6d04053e8bf324e115398e9e7", + "sha256:2761f71faed820e25ec62eacba670d1b5c2709bb131a19fcdbfbb09884593e5a", + "sha256:2aec8eeea0b08fd6bc2213d8e86811a07491849fd3d79955b62d83e32fa2ad5f", + "sha256:2d06a7fa437f93782e3f32d739c3ec189f82fca74336c08255f9e20cea1ed378", + "sha256:316fe7c3fec017affd916a0c83d6f1ec697cbbbdf1124769fa73328e7907cc2e", + "sha256:344e352c96e53b4f56b53d24728217c69399b8129c16789f70236083c6ceb2ac", + "sha256:35681445dc85446fb105943d81ae7569aa7e89de80d1ca4ac3229e05c311bdb1", + "sha256:366be8e64e0cb63d87cf79b4e1765c0703dd6313c729b22e7b9e378db6b96877", + "sha256:3a7235b46c1bbe201f09b6f0f5e6c36b16bad3d0532a10493742f91fbdc8035f", + "sha256:3c05eaf6c863781eb834ab41f5963604ab92855822a2062897958089d1335dad", + "sha256:3e147fc6e27b9a487320d78515c5f29798b539179f7777018cedf51b7749e4f4", + "sha256:3f0f3a4a23717280a5ee3ac4fb1f81d6fde604c9ec5100f7f6f987716bb8c137", + "sha256:5084ec9721f82bef5ff7c4d1ee65e1626783abb585f8c0993833490b63fe1792", + "sha256:52527e8f223ba29608d999d65b204676398009725007c9336651c2ec2d93cffc", + "sha256:53b06aea7a48919a254b32107647be9128c066aaa6ee6d5d08222325f25ef175", + "sha256:58e251bb5a5998f7226dc90b0b753eeffa720bd66664eba51927c2a7a2d5f32c", + "sha256:603a843fea76a595c8f661cd4da4d2281dff1e38c4a836a928eac1a2f8fe88e4", + "sha256:616b9c2f882393d422ba11b40e72382fe975e806ad693095e9a3b67c59ea6150", + "sha256:649a764d9b0da29816889424697b2a3746963ad36d3e0968784ceed6e40c6355", + "sha256:658287a29351166510ebbe0a75c373600cc4367a3d9337b964dada8d38bcc0f4", + "sha256:6d0f52684868db7c218437d260e14d37948b094493f2646f22d3dda7229bbe3f", + "sha256:6dc85b9e10cc21d9c1055f15684f76fa4facadddcb6cd63abab702eb93c98943", + "sha256:72432fd6e868c8d0a6849869e004b8bcae233a3c56383954c228316694920b38", + "sha256:73deadd6fd8a23e2f40b412b3ac617a112143c8989a4fe265050fd91ba5c0608", + "sha256:763602504bf640b3ded3bba3f8ed8a1cc2fc6a87b8d55c1c5689f428c49c947e", + "sha256:7701df088d0b05f3460f7ba15aec81ac8b0fb5690367dfd072a6c38cf5b7fdb5", + "sha256:78d584caac52c24240ef9ecd75de64c760bbd0e20dbf6973631815e3ef16ef8b", + "sha256:7a3639011c2e8a9628466f616ed7fb413f30032b891898e10895a0a8b5857d6c", + "sha256:7b6a24d7b5893392f2b8e3b7a0031ae3b14c6c1942a4615f0d8794fdeeefb08b", + "sha256:7d4df13d1c55e84351fab51383520b84f490740a9f1fec905362aa64590b7a5d", + "sha256:7e37b6bb6e90c2b8412b06373c6978d9d81e7199a40e24a6ef480e8acdeaf918", + "sha256:8093473d7b9e908af1cef30025609afc8f5fd2a16ff07f97440fd911421e4432", + "sha256:840200827984f1c4e114008abc2f5ede362d6e11ed0b5931681884dd41852ff1", + "sha256:85770b4b37bb36ef93a6122601795231225641003e0318d23c6233c59b424279", + "sha256:879ae6bb08a063b3e1b7ac8c860096d8fd6b48dd9b2690b7f2738b8c835e744b", + "sha256:87d3df115f4a3c8c5e4d5acf067d399c6466d7e604fc9ee9acbe6f0c88a0c3cf", + "sha256:8b315685832ab9287e6124b5d74fc12dda31e6421d7f6b08525791452844bc2d", + "sha256:8e49524917b8d3c2f42cd0d2df61178e08e50f5f029f9af1f402b3ee64574392", + "sha256:978d4123ad1e605daf1ba5e01d4f235bcf7b6e340ef07e7122e8e9cfe3eb61ab", + "sha256:a0586cddbf4380e24569b8a05f234e7305717cc8323f50114dfb2051fcbce2a3", + "sha256:a272785a226869416c6b3c1b7e450506152d3844207331f02f27173562c917e0", + "sha256:a340d2bdebe819d08f605e9705ed551c3feb97e4fd71822d7147c1e4bdbb9508", + "sha256:a3f243f318bd9523277fa123b3163f4c005a3e8619d4b867064de02f287a564d", + "sha256:a4f0f71653b1c1bad0350bc0b4cc057ab87b438ff18fa6392533811ebd01439c", + "sha256:ab760f17c3e792225cdaef31ca23c0aea45c14ce80d8eff62503f86a5ab76bff", + "sha256:ac76f30d5d3454f4c28826d891fe74d25121a346c69523c9810ebba43f3b1cec", + "sha256:ad1bd2f377f56fec11d5cfd0977c30061cd19f4fa199bf138b200ec0d5e27eeb", + "sha256:b2ba34a099576234671f2e4274e5bc6813b22e28778c216d680eabd0db3f7dad", + "sha256:b2f13c3e955a087c3ec86f97661d9f72a76e221281b2262956af381224cfc243", + "sha256:b34480fd6778ab356abf1e9086a4ced95002a1e195e8d2fd182b0def9d944d11", + "sha256:b4a085bd04af7245e140d1b95619fe8abb445a3d7fdf219b3f80c940853268ef", + "sha256:b81ec2efc04fc1dbf400647d4357d64fb25543bae38d2d19787d69360aad21c9", + "sha256:b8c46a8cf53e849eea7090f331ae2202cd0f1ceb090b00f5902c423bd1e11805", + "sha256:bc7e43b4a528ffca8c9151b6a2ca34482c2fdc05e6aa24a84b7f475c896fc51d", + "sha256:c3dc8ec8b87c7ad534c75b8855168a08a7036fdb9deeeed5705ba9410721c84d", + "sha256:c4a9732a5cad764ba37f3aa873dccb41b584f69c347a57323eda0930deec8e10", + "sha256:c867230d715a3dd1d962c8d9bef0d3168994ed663e21bf748b6e3a529a129aab", + "sha256:cafde15a6f7feaec2f570646e2ffc5b73412295d29134a29067e70740ec6ee20", + "sha256:cb1ad5b4d73cde784cf64580166568074f5ccd2548d765e690546cff3d80937d", + "sha256:d08264b4460326cefacc179fc1411304d5af388a79910832835e6f641512358b", + "sha256:d42669d319db366cb567c3b444f43caa7ffb779bf9530692c6f244fc635a41eb", + "sha256:d43e7ab3b65e4dc35a7612cfff7b0fd62dce5bc11a7cd198310b57f39847fd6c", + "sha256:d5b8376a867047bf08910573deb95d3c8dfb976eb014ee24f3b5a61ccc5bee1b", + "sha256:d6f2d8b8da1f03f577243b07bbdd3412eee3d37d1f2fd71d1513cbc76a8c1239", + "sha256:d6f8c49657f3eb7720ed4c9b26624063da14937fc94d1812f1e04a2204db3e17", + "sha256:d70a8ff2d4953afb4cbe6211f17268ad29c0b47e73d3372f40e7775904bc28fc", + "sha256:d82e5ed3a05f2dcb89c6ead2fd0dbff7ac09bc02c1b4028ece2d3a3854d049ce", + "sha256:e9dcd7fb34f7bfb239b5fa420033642fff0ad676b765559c3737b91f664d4fa9", + "sha256:ed741183719a5271f97d93bbcc45ed64619fa38068aaa6e90027d1d17e30dc8d", + "sha256:ee7785938e407418795e4399b2bf5b5f3cf6cf728077a7f26973220d58d885cf", + "sha256:efbb412d55a4ffe73963fed95c09ccb83647ec63b711c4b3752be10a56f0090b", + "sha256:f8ea1d8b7df522e5ced34993c423c3bf3735c53df8b2a15688a2f03a7d678800" ], "markers": "python_version >= '3.8'", - "version": "==2.18.4" + "version": "==2.20.0" }, "pygments": { "hashes": [ From f5f3024caeca6ce1c6acfefa23ed2e2ca78907ec Mon Sep 17 00:00:00 2001 From: stopmin Date: Thu, 4 Jul 2024 00:13:46 +0900 Subject: [PATCH 02/20] =?UTF-8?q?=EB=8F=84=EC=BB=A4=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=A0=95=EC=9D=98=20=EB=B0=8F=20pipfile=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 21 ++++++++++ Pipfile.lock | 109 ++++++++++++++++++++++++++------------------------ entrypoint.sh | 4 ++ 3 files changed, 82 insertions(+), 52 deletions(-) create mode 100644 Dockerfile create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d2d2c33 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM --platform=linux/amd64 python:3.12.4-slim-bookworm + +WORKDIR /app + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gcc libpq-dev && \ + pip install --no-cache-dir pipenv && \ + apt-get purge -y --auto-remove gcc && \ + rm -rf /var/lib/apt/lists/* + +COPY Pipfile Pipfile.lock ./ +RUN pipenv install --deploy --ignore-pipfile + +COPY ./entrypoint.sh ./entrypoint.sh +COPY ./app ./app + +ENV PORT=8000 + +RUN chmod +x ./entrypoint.sh + +ENTRYPOINT ["/bin/sh", "-c", "./entrypoint.sh"] diff --git a/Pipfile.lock b/Pipfile.lock index fa35d10..155211c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "09d83d8b6da2289fa4357747121deb4a89bbf55cffc2e591d460238c8c9e99c7" + "sha256": "1a8e880d24fe4f7a7f2ba47534ff161b542f6b3036de0e649c4b0c4c79473860" }, "pipfile-spec": 6, "requires": { - "python_full_version": "3.12.3", + "python_full_version": "3.12.4", "python_version": "3.12" }, "sources": [ @@ -700,64 +700,69 @@ }, "openai": { "hashes": [ - "sha256:009bfa1504c9c7ef64d87be55936d142325656bbc6d98c68b669d6472e4beb09", - "sha256:3d1e0b0aac9b0db69a972d36dc7efa7563f8e8d65550b27a48f2a0c2ec207e80" + "sha256:4f5c1b90526cf48eaedac7b32d11b5c92fa7064b82617ad8f5f3279cd9ef090d", + "sha256:d73d353bcc0bd46b9516e78a0c6fb1cffaaeb92906c7c7b467c4fa088332a150" ], "index": "pypi", "markers": "python_full_version >= '3.7.1'", - "version": "==1.35.7" + "version": "==1.35.9" }, "orjson": { "hashes": [ - "sha256:03b565c3b93f5d6e001db48b747d31ea3819b89abf041ee10ac6988886d18e01", - "sha256:099e81a5975237fda3100f918839af95f42f981447ba8f47adb7b6a3cdb078fa", - "sha256:10c0eb7e0c75e1e486c7563fe231b40fdd658a035ae125c6ba651ca3b07936f5", - "sha256:1146bf85ea37ac421594107195db8bc77104f74bc83e8ee21a2e58596bfb2f04", - "sha256:1670fe88b116c2745a3a30b0f099b699a02bb3482c2591514baf5433819e4f4d", - "sha256:185c394ef45b18b9a7d8e8f333606e2e8194a50c6e3c664215aae8cf42c5385e", - "sha256:1ad1de7fef79736dde8c3554e75361ec351158a906d747bd901a52a5c9c8d24b", - "sha256:235dadefb793ad12f7fa11e98a480db1f7c6469ff9e3da5e73c7809c700d746b", - "sha256:28afa96f496474ce60d3340fe8d9a263aa93ea01201cd2bad844c45cd21f5268", - "sha256:2d97531cdfe9bdd76d492e69800afd97e5930cb0da6a825646667b2c6c6c0211", - "sha256:338fd4f071b242f26e9ca802f443edc588fa4ab60bfa81f38beaedf42eda226c", - "sha256:36a10f43c5f3a55c2f680efe07aa93ef4a342d2960dd2b1b7ea2dd764fe4a37c", - "sha256:3d21b9983da032505f7050795e98b5d9eee0df903258951566ecc358f6696969", - "sha256:51bbcdea96cdefa4a9b4461e690c75ad4e33796530d182bdd5c38980202c134a", - "sha256:53ed1c879b10de56f35daf06dbc4a0d9a5db98f6ee853c2dbd3ee9d13e6f302f", - "sha256:545d493c1f560d5ccfc134803ceb8955a14c3fcb47bbb4b2fee0232646d0b932", - "sha256:584c902ec19ab7928fd5add1783c909094cc53f31ac7acfada817b0847975f26", - "sha256:5a35455cc0b0b3a1eaf67224035f5388591ec72b9b6136d66b49a553ce9eb1e6", - "sha256:5df58d206e78c40da118a8c14fc189207fffdcb1f21b3b4c9c0c18e839b5a214", - "sha256:64c9cc089f127e5875901ac05e5c25aa13cfa5dbbbd9602bda51e5c611d6e3e2", - "sha256:68f85ecae7af14a585a563ac741b0547a3f291de81cd1e20903e79f25170458f", - "sha256:6970ed7a3126cfed873c5d21ece1cd5d6f83ca6c9afb71bbae21a0b034588d96", - "sha256:6b68742c469745d0e6ca5724506858f75e2f1e5b59a4315861f9e2b1df77775a", - "sha256:7a5baef8a4284405d96c90c7c62b755e9ef1ada84c2406c24a9ebec86b89f46d", - "sha256:7d10cc1b594951522e35a3463da19e899abe6ca95f3c84c69e9e901e0bd93d38", - "sha256:85c89131d7b3218db1b24c4abecea92fd6c7f9fab87441cfc342d3acc725d807", - "sha256:8a11d459338f96a9aa7f232ba95679fc0c7cedbd1b990d736467894210205c09", - "sha256:8c13ca5e2ddded0ce6a927ea5a9f27cae77eee4c75547b4297252cb20c4d30e6", - "sha256:9cd684927af3e11b6e754df80b9ffafd9fb6adcaa9d3e8fdd5891be5a5cad51e", - "sha256:b2efbd67feff8c1f7728937c0d7f6ca8c25ec81373dc8db4ef394c1d93d13dc5", - "sha256:b39e006b00c57125ab974362e740c14a0c6a66ff695bff44615dcf4a70ce2b86", - "sha256:b6c8e30adfa52c025f042a87f450a6b9ea29649d828e0fec4858ed5e6caecf63", - "sha256:be79e2393679eda6a590638abda16d167754393f5d0850dcbca2d0c3735cebe2", - "sha256:c05f16701ab2a4ca146d0bca950af254cb7c02f3c01fca8efbbad82d23b3d9d4", - "sha256:c4057c3b511bb8aef605616bd3f1f002a697c7e4da6adf095ca5b84c0fd43595", - "sha256:c4a65310ccb5c9910c47b078ba78e2787cb3878cdded1702ac3d0da71ddc5228", - "sha256:ca0b3a94ac8d3886c9581b9f9de3ce858263865fdaa383fbc31c310b9eac07c9", - "sha256:cc28e90a7cae7fcba2493953cff61da5a52950e78dc2dacfe931a317ee3d8de7", - "sha256:cdf7365063e80899ae3a697def1277c17a7df7ccfc979990a403dfe77bb54d40", - "sha256:d69858c32f09c3e1ce44b617b3ebba1aba030e777000ebdf72b0d8e365d0b2b3", - "sha256:dbead71dbe65f959b7bd8cf91e0e11d5338033eba34c114f69078d59827ee139", - "sha256:dcbe82b35d1ac43b0d84072408330fd3295c2896973112d495e7234f7e3da2e1", - "sha256:dfc91d4720d48e2a709e9c368d5125b4b5899dced34b5400c3837dadc7d6271b", - "sha256:eded5138cc565a9d618e111c6d5c2547bbdd951114eb822f7f6309e04db0fb47", - "sha256:f4324929c2dd917598212bfd554757feca3e5e0fa60da08be11b4aa8b90013c1", - "sha256:fb66215277a230c456f9038d5e2d84778141643207f85336ef8d2a9da26bd7ca" + "sha256:03c95484d53ed8e479cade8628c9cea00fd9d67f5554764a1110e0d5aa2de96e", + "sha256:05ac3d3916023745aa3b3b388e91b9166be1ca02b7c7e41045da6d12985685f0", + "sha256:0943e4c701196b23c240b3d10ed8ecd674f03089198cf503105b474a4f77f21f", + "sha256:1335d4ef59ab85cab66fe73fd7a4e881c298ee7f63ede918b7faa1b27cbe5212", + "sha256:1c680b269d33ec444afe2bdc647c9eb73166fa47a16d9a75ee56a374f4a45f43", + "sha256:227df19441372610b20e05bdb906e1742ec2ad7a66ac8350dcfd29a63014a83b", + "sha256:30b0a09a2014e621b1adf66a4f705f0809358350a757508ee80209b2d8dae219", + "sha256:3722fddb821b6036fd2a3c814f6bd9b57a89dc6337b9924ecd614ebce3271394", + "sha256:446dee5a491b5bc7d8f825d80d9637e7af43f86a331207b9c9610e2f93fee22a", + "sha256:450e39ab1f7694465060a0550b3f6d328d20297bf2e06aa947b97c21e5241fbd", + "sha256:49e3bc615652617d463069f91b867a4458114c5b104e13b7ae6872e5f79d0844", + "sha256:4bbc6d0af24c1575edc79994c20e1b29e6fb3c6a570371306db0993ecf144dc5", + "sha256:5410111d7b6681d4b0d65e0f58a13be588d01b473822483f77f513c7f93bd3b2", + "sha256:55d43d3feb8f19d07e9f01e5b9be4f28801cf7c60d0fa0d279951b18fae1932b", + "sha256:57985ee7e91d6214c837936dc1608f40f330a6b88bb13f5a57ce5257807da143", + "sha256:61272a5aec2b2661f4fa2b37c907ce9701e821b2c1285d5c3ab0207ebd358d38", + "sha256:633a3b31d9d7c9f02d49c4ab4d0a86065c4a6f6adc297d63d272e043472acab5", + "sha256:64c81456d2a050d380786413786b057983892db105516639cb5d3ee3c7fd5148", + "sha256:66680eae4c4e7fc193d91cfc1353ad6d01b4801ae9b5314f17e11ba55e934183", + "sha256:697a35a083c4f834807a6232b3e62c8b280f7a44ad0b759fd4dce748951e70db", + "sha256:6eeb13218c8cf34c61912e9df2de2853f1d009de0e46ea09ccdf3d757896af0a", + "sha256:7275664f84e027dcb1ad5200b8b18373e9c669b2a9ec33d410c40f5ccf4b257e", + "sha256:738dbe3ef909c4b019d69afc19caf6b5ed0e2f1c786b5d6215fbb7539246e4c6", + "sha256:79b9b9e33bd4c517445a62b90ca0cc279b0f1f3970655c3df9e608bc3f91741a", + "sha256:874ce88264b7e655dde4aeaacdc8fd772a7962faadfb41abe63e2a4861abc3dc", + "sha256:95a0cce17f969fb5391762e5719575217bd10ac5a189d1979442ee54456393f3", + "sha256:960db0e31c4e52fa0fc3ecbaea5b2d3b58f379e32a95ae6b0ebeaa25b93dfd34", + "sha256:965a916373382674e323c957d560b953d81d7a8603fbeee26f7b8248638bd48b", + "sha256:9c1c4b53b24a4c06547ce43e5fee6ec4e0d8fe2d597f4647fc033fd205707365", + "sha256:a2debd8ddce948a8c0938c8c93ade191d2f4ba4649a54302a7da905a81f00b56", + "sha256:a6ea7afb5b30b2317e0bee03c8d34c8181bc5a36f2afd4d0952f378972c4efd5", + "sha256:ac3045267e98fe749408eee1593a142e02357c5c99be0802185ef2170086a863", + "sha256:b1ec490e10d2a77c345def52599311849fc063ae0e67cf4f84528073152bb2ba", + "sha256:b6f3d167d13a16ed263b52dbfedff52c962bfd3d270b46b7518365bcc2121eed", + "sha256:bb1f28a137337fdc18384079fa5726810681055b32b92253fa15ae5656e1dddb", + "sha256:bf2fbbce5fe7cd1aa177ea3eab2b8e6a6bc6e8592e4279ed3db2d62e57c0e1b2", + "sha256:c27bc6a28ae95923350ab382c57113abd38f3928af3c80be6f2ba7eb8d8db0b0", + "sha256:c2c116072a8533f2fec435fde4d134610f806bdac20188c7bd2081f3e9e0133f", + "sha256:caff75b425db5ef8e8f23af93c80f072f97b4fb3afd4af44482905c9f588da28", + "sha256:d27456491ca79532d11e507cadca37fb8c9324a3976294f68fb1eff2dc6ced5a", + "sha256:d40f839dddf6a7d77114fe6b8a70218556408c71d4d6e29413bb5f150a692ff7", + "sha256:df25d9271270ba2133cc88ee83c318372bdc0f2cd6f32e7a450809a111efc45c", + "sha256:e060748a04cccf1e0a6f2358dffea9c080b849a4a68c28b1b907f272b5127e9b", + "sha256:e54b63d0a7c6c54a5f5f726bc93a2078111ef060fec4ecbf34c5db800ca3b3a7", + "sha256:ea2977b21f8d5d9b758bb3f344a75e55ca78e3ff85595d248eee813ae23ecdfb", + "sha256:eadc8fd310edb4bdbd333374f2c8fec6794bbbae99b592f448d8214a5e4050c0", + "sha256:f215789fb1667cdc874c1b8af6a84dc939fd802bf293a8334fce185c79cd359b", + "sha256:f710f346e4c44a4e8bdf23daa974faede58f83334289df80bc9cd12fe82573c7", + "sha256:f759503a97a6ace19e55461395ab0d618b5a117e8d0fbb20e70cfd68a47327f2", + "sha256:fb0ee33124db6eaa517d00890fc1a55c3bfe1cf78ba4a8899d71a06f2d6ff5c7", + "sha256:fd502f96bf5ea9a61cbc0b2b5900d0dd68aa0da197179042bdd2be67e51a1e4b" ], "markers": "python_version >= '3.8'", - "version": "==3.10.5" + "version": "==3.10.6" }, "pydantic": { "hashes": [ diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..ee0a888 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh +ln -snf /usr/share/zoneinfo/Asia/Seoul /etc/localtime + +pipenv run uvicorn app.main:app --host 0.0.0.0 --port ${PORT} From 1e81e623a859936f740800fca3064187f941b10a Mon Sep 17 00:00:00 2001 From: stopmin Date: Mon, 8 Jul 2024 11:31:24 +0900 Subject: [PATCH 03/20] =?UTF-8?q?ECS=20Deploy=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-ecs.yml | 204 +++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 .github/workflows/deploy-ecs.yml diff --git a/.github/workflows/deploy-ecs.yml b/.github/workflows/deploy-ecs.yml new file mode 100644 index 0000000..53268d0 --- /dev/null +++ b/.github/workflows/deploy-ecs.yml @@ -0,0 +1,204 @@ +name: Deploy to Amazon ECS + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: [ "staging" ] + +env: + AWS_REGION: ap-northeast-2 # AWS region 설정 + ECR_REPOSITORY: gyeongdan-fastapi # Amazon ECR repository 이름 + ECS_SERVICE: GyeongdanFastAPI # Amazon ECS 서비스 이름 + ECS_CLUSTER: gyeongdan # Amazon ECS 클러스터 이름 + ECS_TASK_DEFINITION: tf-gyeongdan-fastapi.json # Amazon ECS task definition 파일 경로 + CONTAINER_NAME: FastAPI # 컨테이너 이름 + PROGRESS_SLACK_CHANNEL: C07BRCDNBMF # Slack 채널 ID + +permissions: + contents: read + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest-8-cores + + steps: + - name: Post Slack Channel that Build Start + id: slack-build-start + uses: slackapi/slack-github-action@v1.23.0 + with: + channel-id: ${{ env.PROGRESS_SLACK_CHANNEL }} + payload: | + { + "text": ":small_airplane: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 시작되었습니다.", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":mega: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 시작되었습니다." + } + }, + { + "type": "actions", + "elements": [ + { + "type": "button", + "text": { + "type": "plain_text", + "emoji": true, + "text": "깃허브액션에서 확인하기." + }, + "value": "click_me_123", + "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + ] + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.PROGRESS_SLACK_CHANNEL_TOKEN }} + + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker build & Push Docker image to Amazon ECR + id: build-image + uses: docker/build-push-action@v5 + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + IMAGE_TAG: ${{ github.sha }} + with: + context: . + push: true + tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }} + build-args: | + DATABASE_USERNAME=${{ secrets.GYEONGDAN_DB_USERNAME }} + DATABASE_PASSWORD=${{ secrets.GYEONGDAN_DB_PASSWORD }} + cache-from: type=gha + cache-to: type=gha,mode=min,ignore-error=true + + - name: Fill in the new image ID in the Amazon ECS task definition + id: task-def + uses: aws-actions/amazon-ecs-render-task-definition@v1 + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + IMAGE_TAG: ${{ github.sha }} + with: + task-definition: ${{ env.ECS_TASK_DEFINITION }} + container-name: ${{ env.CONTAINER_NAME }} + image: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }} + + - name: Deploy Amazon ECS task definition + id: ecs-deploy + uses: aws-actions/amazon-ecs-deploy-task-definition@v1 + with: + task-definition: ${{ steps.task-def.outputs.task-definition }} + service: ${{ env.ECS_SERVICE }} + cluster: ${{ env.ECS_CLUSTER }} + wait-for-service-stability: true + wait-for-minutes: 10 + + - name: Verify New Task Definition is Deployed + run: | + CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster ${{ env.ECS_CLUSTER }} --service ${{ env.ECS_SERVICE }} --query services[0].deployments[0].taskDefinition | jq -r ".") + NEW_TASK_DEF_ARN=${{ steps.ecs-deploy.outputs.task-definition-arn }} + echo "Current task arn: $CURRENT_TASK_DEF_ARN" + echo "New task arn: $NEW_TASK_DEF_ARN" + if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then + echo "Deployment failed." + exit 1 + fi + + - name: Post Slack Channel that Build Success + if: success() + id: slack-build-success + uses: slackapi/slack-github-action@v1.23.0 + with: + channel-id: ${{ env.PROGRESS_SLACK_CHANNEL }} + payload: | + { + "text": ":white_check_mark: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 성공했습니다.", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":pepe_cheer: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 성공했습니다." + } + }, + { + "type": "actions", + "elements": [ + { + "type": "button", + "text": { + "type": "plain_text", + "emoji": true, + "text": "깃허브액션에서 확인하기." + }, + "style": "primary", + "value": "click_me_123", + "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + ] + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.PROGRESS_SLACK_CHANNEL_TOKEN }} + + - name: Post Slack Channel that Build Fail + if: failure() + id: slack-build-fail + uses: slackapi/slack-github-action@v1.23.0 + with: + channel-id: ${{ env.PROGRESS_SLACK_CHANNEL }} + payload: | + { + "text": ":x: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 실패했습니다.", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":pepe_rainy: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 실패했습니다." + } + }, + { + "type": "actions", + "elements": [ + { + "type": "button", + "text": { + "type": "plain_text", + "emoji": true, + "text": "깃허브액션에서 확인하기." + }, + "style": "danger", + "value": "click_me_123", + "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + ] + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.PROGRESS_SLACK_CHANNEL_TOKEN }} From 20c9e1fc1ab8c00d039971251a5efa0af972c567 Mon Sep 17 00:00:00 2001 From: stopmin Date: Mon, 8 Jul 2024 12:04:57 +0900 Subject: [PATCH 04/20] =?UTF-8?q?ECS=20Deploy=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-ecs.yml | 4 ++-- tf-staging.json | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 tf-staging.json diff --git a/.github/workflows/deploy-ecs.yml b/.github/workflows/deploy-ecs.yml index 82de88b..8b810ab 100644 --- a/.github/workflows/deploy-ecs.yml +++ b/.github/workflows/deploy-ecs.yml @@ -13,7 +13,7 @@ env: ECR_REPOSITORY: gyeongdan-fastapi # Amazon ECR repository 이름 ECS_SERVICE: GyeongdanFastAPI # Amazon ECS 서비스 이름 ECS_CLUSTER: gyeongdan # Amazon ECS 클러스터 이름 - ECS_TASK_DEFINITION: tf-gyeongdan-fastapi.json # Amazon ECS task definition 파일 경로 + ECS_TASK_DEFINITION: tf-staging.json # Amazon ECS task definition 파일 경로 CONTAINER_NAME: FastAPI # 컨테이너 이름 PROGRESS_SLACK_CHANNEL: C07BRCDNBMF # Slack 채널 ID @@ -141,7 +141,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": ":pepe_cheer: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 성공했습니다." + "text": "*Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 성공했습니다." } }, { diff --git a/tf-staging.json b/tf-staging.json new file mode 100644 index 0000000..3a82c74 --- /dev/null +++ b/tf-staging.json @@ -0,0 +1,41 @@ +{ + "family": "GyeongdanFastAPI", + "containerDefinitions": [ + { + "name": "FastAPI", + "image": "ACCOUNT_ID.dkr.ecr.ap-northeast-2.amazonaws.com/gyeongdan-fastapi:latest", + "cpu": 512, + "memory": 512, + "portMappings": [ + { + "containerPort": 8000, + "hostPort": 8000, + "protocol": "tcp" + } + ], + "essential": true, + "environment": [], + "logConfiguration": { + "logDriver": "awslogs", + "options": { + "awslogs-group": "/ecs/GyeongdanFastAPI", + "awslogs-create-group": "true", + "awslogs-region": "ap-northeast-2", + "awslogs-stream-prefix": "ecs" + } + } + } + ], + "taskRoleArn": "arn:aws:iam::ACCOUNT_ID:role/ecsTaskExecutionRole", + "executionRoleArn": "arn:aws:iam::ACCOUNT_ID:role/ecsTaskExecutionRole", + "networkMode": "bridge", + "requiresCompatibilities": [ + "EC2" + ], + "cpu": "512", + "memory": "512", + "runtimePlatform": { + "cpuArchitecture": "X86_64", + "operatingSystemFamily": "LINUX" + } +} From f629f9060539ce77b80000910a4d806bb002549c Mon Sep 17 00:00:00 2001 From: stopmin Date: Mon, 8 Jul 2024 12:15:19 +0900 Subject: [PATCH 05/20] =?UTF-8?q?ECS=20Deploy=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tf-staging.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tf-staging.json b/tf-staging.json index 3a82c74..61c80d8 100644 --- a/tf-staging.json +++ b/tf-staging.json @@ -26,8 +26,8 @@ } } ], - "taskRoleArn": "arn:aws:iam::ACCOUNT_ID:role/ecsTaskExecutionRole", - "executionRoleArn": "arn:aws:iam::ACCOUNT_ID:role/ecsTaskExecutionRole", + "taskRoleArn": "arn:aws:iam::730335311420:role/ecsTaskExecutionRole", + "executionRoleArn": "arn:aws:iam::730335311420:role/ecsTaskExecutionRole", "networkMode": "bridge", "requiresCompatibilities": [ "EC2" From e625ab90767025868f24af70b7544803e4b6a5f3 Mon Sep 17 00:00:00 2001 From: stopmin Date: Mon, 8 Jul 2024 12:16:31 +0900 Subject: [PATCH 06/20] =?UTF-8?q?=ED=81=B4=EB=9F=AC=EC=8A=A4=ED=84=B0=20?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-ecs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-ecs.yml b/.github/workflows/deploy-ecs.yml index 8b810ab..257bdd8 100644 --- a/.github/workflows/deploy-ecs.yml +++ b/.github/workflows/deploy-ecs.yml @@ -12,7 +12,7 @@ env: AWS_REGION: ap-northeast-2 # AWS region 설정 ECR_REPOSITORY: gyeongdan-fastapi # Amazon ECR repository 이름 ECS_SERVICE: GyeongdanFastAPI # Amazon ECS 서비스 이름 - ECS_CLUSTER: gyeongdan # Amazon ECS 클러스터 이름 + ECS_CLUSTER: Gyeongdan # Amazon ECS 클러스터 이름 ECS_TASK_DEFINITION: tf-staging.json # Amazon ECS task definition 파일 경로 CONTAINER_NAME: FastAPI # 컨테이너 이름 PROGRESS_SLACK_CHANNEL: C07BRCDNBMF # Slack 채널 ID From 040889b9541ec45e1092a523c7445363f704ebc5 Mon Sep 17 00:00:00 2001 From: stopmin Date: Thu, 11 Jul 2024 04:55:30 +0900 Subject: [PATCH 07/20] =?UTF-8?q?DB=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 5 +++++ app/database/session.py | 12 +++++++++--- app/model/crawled_article.py | 5 ++++- app/model/prompt/simple_article/2024-07-02.txt | 7 +++++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index d2d2c33..0180b7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,9 @@ ENV PORT=8000 RUN chmod +x ./entrypoint.sh +COPY .env .env + +RUN export $(grep -v '^#' .env | xargs) + + ENTRYPOINT ["/bin/sh", "-c", "./entrypoint.sh"] diff --git a/app/database/session.py b/app/database/session.py index e5523e8..baea564 100644 --- a/app/database/session.py +++ b/app/database/session.py @@ -1,6 +1,7 @@ import os from collections.abc import AsyncGenerator +from dotenv import load_dotenv from fastapi import HTTPException from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine from sqlalchemy.ext.declarative import declarative_base @@ -10,11 +11,16 @@ Base = declarative_base() -DB_USER = os.getenv("DATABASE_USERNAME", "postgres") +load_dotenv() +DB_HOST = os.getenv("DATABASE_HOST", "localhost") +DB_USER = os.getenv("DB_USER", "postgres") DB_PASSWORD = os.getenv("DB_PASSWORD", "password") DB_NAME = os.getenv("DB_NAME", "gyeongdan") -# DB_CONFIG = f"mysql+aiomysql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}" -DB_CONFIG = "postgresql+asyncpg://localhost:5432/gyeongdan" +DB_PORT = os.getenv("DB_PORT", "5432") +DB_CONFIG = ( + f"postgresql+asyncpg://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}" +) +# DB_CONFIG = "postgresql+asyncpg://localhost:5432/gyeongdan" engine = create_async_engine(DB_CONFIG) diff --git a/app/model/crawled_article.py b/app/model/crawled_article.py index cb52ef1..63d7e4c 100644 --- a/app/model/crawled_article.py +++ b/app/model/crawled_article.py @@ -1,12 +1,14 @@ from datetime import datetime -from sqlalchemy import CHAR, BigInteger, Column, DateTime, String, Text, JSON, Enum, event +from sqlalchemy import CHAR, BigInteger, Column, DateTime, String, Text, event from sqlalchemy.dialects.postgresql import JSONB from app.database.repository import Base + class Articles(Base): __tablename__ = "articles" + __table_args__ = {"schema": "gyeongdan"} id = Column(BigInteger, primary_key=True, index=True, autoincrement=True) url = Column(String, nullable=False) @@ -21,6 +23,7 @@ class Articles(Base): comment = Column(Text, nullable=True) category = Column(CHAR(255), nullable=True) + @event.listens_for(Articles, "before_update", propagate=True) def update_timestamp(mapper, connection, target): # pylint: disable=unused-argument target.updated_at = datetime.now() diff --git a/app/model/prompt/simple_article/2024-07-02.txt b/app/model/prompt/simple_article/2024-07-02.txt index a1aef41..2870733 100644 --- a/app/model/prompt/simple_article/2024-07-02.txt +++ b/app/model/prompt/simple_article/2024-07-02.txt @@ -4,7 +4,7 @@ 다음은 json 형식의 예시이다: { "title": "기사 제목(한국어)", - "content": "기사 본문 (한국어)" 단, 경제 기사의 독자층이 20대 초반인 것을 고려하여 친근하고 간결하게 설명할 것, + "content": "기사 본문 (한국어)" 단, 경제 기사의 독자층이 20대 초반인 것을 고려하여 친근하고 꽤 간결하게 설명할 것" "phrase": ["어려웠던 경제 표현들" : "어려웠던 경제 표현들을 쉽게 바꾼 문구"] (문자열 리스트) 예를 들어 "환율" : "다른 나라 돈과 우리나라 돈을 교환하는 비율"과 같이, "comment": "기사를 3줄 이하로 요약하기. 단, 친근하게. (한국어)", "category": "기사가 어느 카테고리, 즉 enum에 속하는지 (한국어)" @@ -15,4 +15,7 @@ enum Category: POLITICS_AND_SOCIETY = "정치 및 사회" TECHNOLOGY_AND_CULTURE = "기술 및 문화" SPORTS_AND_LEISURE = "스포츠 및 여가" - OPINION_AND_ANALYSIS = "오피니언 및 분석" \ No newline at end of file + OPINION_AND_ANALYSIS = "오피니언 및 분석" + + +결과는 json형식이어야 하며, 여러 줄일 경우 줄바꿈 문자는 \n으로 표시한다. From 831690bdc12ce29faa65c596155440a042aeaee4 Mon Sep 17 00:00:00 2001 From: stopmin Date: Thu, 11 Jul 2024 05:00:32 +0900 Subject: [PATCH 08/20] =?UTF-8?q?docker=20file=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0180b7d..d2d2c33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,9 +18,4 @@ ENV PORT=8000 RUN chmod +x ./entrypoint.sh -COPY .env .env - -RUN export $(grep -v '^#' .env | xargs) - - ENTRYPOINT ["/bin/sh", "-c", "./entrypoint.sh"] From faeb07db80aeedead0d5f4b5cecca3687674589a Mon Sep 17 00:00:00 2001 From: stopmin Date: Thu, 11 Jul 2024 05:07:04 +0900 Subject: [PATCH 09/20] =?UTF-8?q?=ED=81=B4=EB=9F=AC=EC=8A=A4=ED=84=B0=20?= =?UTF-8?q?=EB=84=A4=EC=9E=84=20=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-ecs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-ecs.yml b/.github/workflows/deploy-ecs.yml index 8b810ab..257bdd8 100644 --- a/.github/workflows/deploy-ecs.yml +++ b/.github/workflows/deploy-ecs.yml @@ -12,7 +12,7 @@ env: AWS_REGION: ap-northeast-2 # AWS region 설정 ECR_REPOSITORY: gyeongdan-fastapi # Amazon ECR repository 이름 ECS_SERVICE: GyeongdanFastAPI # Amazon ECS 서비스 이름 - ECS_CLUSTER: gyeongdan # Amazon ECS 클러스터 이름 + ECS_CLUSTER: Gyeongdan # Amazon ECS 클러스터 이름 ECS_TASK_DEFINITION: tf-staging.json # Amazon ECS task definition 파일 경로 CONTAINER_NAME: FastAPI # 컨테이너 이름 PROGRESS_SLACK_CHANNEL: C07BRCDNBMF # Slack 채널 ID From c3e9e11630ff858f3c76dee25c449906907b90f1 Mon Sep 17 00:00:00 2001 From: stopmin Date: Thu, 11 Jul 2024 05:10:25 +0900 Subject: [PATCH 10/20] =?UTF-8?q?=EC=84=B1=EA=B3=B5/=EC=8B=A4=ED=8C=A8=20?= =?UTF-8?q?=EB=AC=B8=EA=B5=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-ecs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-ecs.yml b/.github/workflows/deploy-ecs.yml index 257bdd8..1f1d141 100644 --- a/.github/workflows/deploy-ecs.yml +++ b/.github/workflows/deploy-ecs.yml @@ -141,7 +141,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "*Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 성공했습니다." + "text": ":pedro: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 성공했습니다." } }, { @@ -179,7 +179,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": ":pepe_rainy: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 실패했습니다." + "text": ":typingcat: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 실패했습니다." } }, { From 2c2b3c84b1a4a103a1a029cd663702958c9ac742 Mon Sep 17 00:00:00 2001 From: stopmin Date: Thu, 11 Jul 2024 14:13:09 +0900 Subject: [PATCH 11/20] =?UTF-8?q?key=EA=B0=92=20github=20secret=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-ecs.yml | 8 ++++++-- app/database/session.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-ecs.yml b/.github/workflows/deploy-ecs.yml index 1f1d141..eca6063 100644 --- a/.github/workflows/deploy-ecs.yml +++ b/.github/workflows/deploy-ecs.yml @@ -90,8 +90,12 @@ jobs: push: true tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }} build-args: | - DATABASE_USERNAME=${{ secrets.GYEONGDAN_DB_USERNAME }} - DATABASE_PASSWORD=${{ secrets.GYEONGDAN_DB_PASSWORD }} + DB_HOST=${{ secrets.DB_HOST }} + DB_USER=${{ secrets.DB_USER }} + DB_PASSWORD=${{ secrets.DB_PASSWORD }} + DB_NAME=${{ secrets.DB_NAME }} + DB_PORT=${{ secrets.DB_PORT }} + OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} cache-from: type=gha cache-to: type=gha,mode=min,ignore-error=true diff --git a/app/database/session.py b/app/database/session.py index baea564..0ccef6d 100644 --- a/app/database/session.py +++ b/app/database/session.py @@ -12,7 +12,7 @@ Base = declarative_base() load_dotenv() -DB_HOST = os.getenv("DATABASE_HOST", "localhost") +DB_HOST = os.getenv("DB_HOST", "localhost") DB_USER = os.getenv("DB_USER", "postgres") DB_PASSWORD = os.getenv("DB_PASSWORD", "password") DB_NAME = os.getenv("DB_NAME", "gyeongdan") From 6c9e3b58358fc1504f38ba43ca016bfa30c2c687 Mon Sep 17 00:00:00 2001 From: stopmin Date: Thu, 11 Jul 2024 14:28:10 +0900 Subject: [PATCH 12/20] =?UTF-8?q?dockerfile=20=EC=88=98=EC=A0=95=20-=20?= =?UTF-8?q?=ED=99=98=EA=B2=BD=EB=B3=80=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index d2d2c33..bb9681d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,20 @@ COPY ./app ./app ENV PORT=8000 +ARG DB_HOST +ARG DB_USER +ARG DB_PASSWORD +ARG DB_NAME +ARG DB_PORT +ARG OPENAI_API_KEY + +ENV DB_HOST=${DB_HOST} +ENV DB_USER=${DB_USER} +ENV DB_PASSWORD=${DB_PASSWORD} +ENV DB_NAME=${DB_NAME} +ENV DB_PORT=${DB_PORT} +ENV OPENAI_API_KEY=${OPENAI_API_KEY} + RUN chmod +x ./entrypoint.sh ENTRYPOINT ["/bin/sh", "-c", "./entrypoint.sh"] From 197deea887fa147c647f23dd054d07116da484c7 Mon Sep 17 00:00:00 2001 From: mandu Date: Thu, 11 Jul 2024 20:37:42 +0900 Subject: [PATCH 13/20] =?UTF-8?q?feat(recommend=5Fservice.py)=20=EC=B6=94?= =?UTF-8?q?=EC=B2=9C=20=EC=8B=9C=EC=8A=A4=ED=85=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/recommend/recommend_service.py | 199 +++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 app/recommend/recommend_service.py diff --git a/app/recommend/recommend_service.py b/app/recommend/recommend_service.py new file mode 100644 index 0000000..3b5e1d2 --- /dev/null +++ b/app/recommend/recommend_service.py @@ -0,0 +1,199 @@ +# pylint: disable=missing-module-docstring, missing-module-docstring, attribute-defined-outside-init, unnecessary-comprehension, not-callable, consider-using-f-string, unused-variable + +import asyncio +import warnings +from datetime import datetime + +import numpy as np +import pandas as pd +from fastapi import Depends + +from app.database.session import get_db_session +from app.model.crawled_article import Articles +from app.service.article_manage_service import ArticleManageService +from lightfm import LightFM +from lightfm.data import Dataset # pylint: disable=E0611 + +warnings.filterwarnings("ignore") + + +def articles_to_dataframe(articles: list[Articles]) -> pd.DataFrame: + # 객체 리스트를 딕셔너리 리스트로 변환 + articles_dict_list = [ + { + "article_id": article.id, + article.category: 1, + "created_at": article.created_at, + } + for article in articles + ] + + # pandas DataFrame 생성 + df = pd.DataFrame(articles_dict_list) + return df + + +class ArticleDataInfo: + def __init__(self, article_id, category, created_at): + self.article_data = pd.DataFrame( + { + "article_id": article_id, + "경제 및 기업": [0], + "정치 및 사회": [0], + "기술 및 문화": [0], + "스포츠 및 여가": [0], + "오피니언 및 분석": [0], + "created at": [created_at], + } + ) + self.article_data.iloc[0][category] = 1 + + +class InteractionDataInfo: + def __init__(self, user_id, article_id, duration_time): + self.interaction_data = pd.DataFrame( + { + "user_id": [user_id], + "article_id": [article_id], + "duration_time": [duration_time], + } + ) + + +class RecommendService: + # pylint: disable=too-many-instance-attributes + def __init__(self): + self.set_user_datas("user_classification.csv") + asyncio.run(self.set_article_datas()) + self.set_interaction_datas("data/interaction_data.csv") + + def set_user_datas(self, user_data_path): + self.user_data_path = user_data_path + self.user_datas = pd.read_csv(user_data_path) + + async def set_article_datas(self): + session = Depends(get_db_session) + articles = await ArticleManageService().get_all_articles(session=session) + self.article_datas = pd.get_dummies(articles_to_dataframe(articles)) + + def set_interaction_datas(self, interaction_data_path): + self.interaction_data_path = interaction_data_path + self.interaction_datas = pd.read_csv(interaction_data_path) + + def make_dataset(self): + self.user_datas = pd.get_dummies(self.user_datas) + self.user_features_col = self.user_datas.drop( + columns=["classification_id"] + ).columns.values + self.user_feat = self.user_datas.drop(columns=["classification_id"]).to_dict( + orient="records" + ) + + self.item_features = self.article_datas + self.item_features_col = self.item_features.drop( + columns=["article_id", "created at"] + ).columns.values + self.item_feat = self.item_features.drop( + columns=["article_id", "created at"] + ).to_dict(orient="records") + + self.dataset = Dataset() + self.dataset.fit( + users=[x for x in self.user_datas["classification_id"]], + items=[x for x in self.article_datas["article_id"]], + item_features=self.item_features_col, + user_features=self.user_features_col, + ) + + self.item_features = self.dataset.build_item_features( + (x, y) for x, y in zip(self.item_features["article_id"], self.item_feat) + ) + self.user_features = self.dataset.build_user_features( + (x, y) for x, y in zip(self.user_datas["classification_id"], self.user_feat) + ) + + (self.interactions, self.weights) = self.dataset.build_interactions( + (x, y, z * self.get_time_weight(y)) + for x, y, z in zip( + self.interaction_datas["classification_id"], + self.interaction_datas["article_id"], + self.interaction_datas["duration_time"], + ) + ) + + num_users, num_items = self.dataset.interactions_shape() + print("Num users: {}, num_items {}.".format(num_users, num_items)) + + def make_model( + self, + n_components: int = 30, + loss: str = "warp", + epoch: int = 30, + num_thread: int = 4, + ): + self.n_components = n_components + self.loss = loss + self.epoch = epoch + self.num_thread = num_thread + self.model = LightFM( + no_components=self.n_components, loss=self.loss, random_state=1616 + ) + + def fit_model(self): + self.make_dataset() + self.make_model() + self.model.fit( + self.interactions, + user_features=self.user_features, + item_features=self.item_features, + epochs=self.epoch, + num_threads=self.num_thread, + sample_weight=self.weights, + ) + + def get_top_n_articles(self, user_id: int, article_num: int): + item_ids = np.arange(self.interactions.shape[1]) # 예측할 아이템 ID 배열 + + predictions = self.model.predict(user_id, item_ids) + top_items = self.article_datas.iloc[np.argsort(-predictions)[:article_num]] + return top_items + + def similar_items(self, item_id, N=10): + item_bias, item_representations = self.model.get_item_representations( + features=self.item_features + ) + + scores = item_representations.dot(item_representations[item_id, :]) + best = np.argpartition(scores, -N)[-N:] + + return self.article_datas.iloc[best] + + def get_time_weight(self, article_id): + today = datetime.now().date() + date_obj = datetime.strptime( + self.article_datas[self.article_datas["article_id"] == article_id][ + "created at" + ].iloc[0], + "%Y-%m-%d", + ).date() + difference = today - date_obj + return max(1 - ((difference.days // 30) / 5), 0) + + def fit_model_partialy(self): + self.make_dataset() + self.model.fit_partial(self.interactions, item_features=self.item_features) + + def add_interaction_data(self, interaction_data: InteractionDataInfo): + df = pd.read_csv(self.interaction_data_path) + df = pd.concat([df, interaction_data.interaction_data]) + df.to_csv(self.interaction_data_path, index=False) + print("interaction is added") + + +def main(): + recommendService = RecommendService() + recommendService.fit_model() + user_id = 1 + print(recommendService.get_top_n_articles(user_id, 5)) + + return "goof" From 98b4b01fcac434ae58da0d5f6772eb5fcba1d107 Mon Sep 17 00:00:00 2001 From: mandu Date: Thu, 11 Jul 2024 20:38:29 +0900 Subject: [PATCH 14/20] =?UTF-8?q?create(user=5Fclassification.csv)=20:=20?= =?UTF-8?q?=EC=9C=A0=EC=A0=80=20=EB=B6=84=EB=A5=98=20=EC=A0=95=EC=9D=98=20?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/recommend/user_classification.csv | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/recommend/user_classification.csv diff --git a/app/recommend/user_classification.csv b/app/recommend/user_classification.csv new file mode 100644 index 0000000..398400a --- /dev/null +++ b/app/recommend/user_classification.csv @@ -0,0 +1,21 @@ +classification_id,sex,issue finder,lifestyle consumer,entertainer,tech specialist,professionals +1,F,1,1,1,0,0 +2,F,1,1,0,1,0 +3,F,1,1,0,0,1 +4,F,1,0,1,1,0 +5,F,1,0,1,0,1 +6,F,1,0,0,1,1 +7,F,0,1,1,1,0 +8,F,0,1,1,0,1 +9,F,0,1,0,1,1 +10,F,0,0,1,1,1 +11,M,1,1,1,0,0 +12,M,1,1,0,1,0 +13,M,1,1,0,0,1 +14,M,1,0,1,1,0 +15,M,1,0,1,0,1 +16,M,1,0,0,1,1 +17,M,0,1,1,1,0 +18,M,0,1,1,0,1 +19,M,0,1,0,1,1 +20,M,0,0,1,1,1 From 77ef491b3b0fab8e7ada0496ba0bff1e04c85743 Mon Sep 17 00:00:00 2001 From: stopmin Date: Thu, 11 Jul 2024 23:04:22 +0900 Subject: [PATCH 15/20] =?UTF-8?q?python=20=EB=B2=84=EC=A0=84=203.11.4?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95=20-=20lightfm,=20pandas,=20numpy?= =?UTF-8?q?=20=EC=A2=85=EC=86=8D=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- Pipfile | 7 +- Pipfile.lock | 537 ++++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 435 insertions(+), 111 deletions(-) diff --git a/Dockerfile b/Dockerfile index d2d2c33..69da693 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 python:3.12.4-slim-bookworm +FROM --platform=linux/amd64 python:3.11.4-slim-bookworm WORKDIR /app diff --git a/Pipfile b/Pipfile index cdd0161..d109294 100644 --- a/Pipfile +++ b/Pipfile @@ -19,6 +19,9 @@ aiohttp = "*" aiosmtplib = "*" schedule = "*" feedparser = "*" +numpy = "*" +pandas = "*" +lightfm = "*" [dev-packages] flake8 = "*" @@ -30,5 +33,5 @@ pylint = "*" python-dotenv = "*" [requires] -python_version = "3.12" -python_full_version = "3.12.4" +python_version = "3.11" +python_full_version = "3.11.4" diff --git a/Pipfile.lock b/Pipfile.lock index 155211c..4decaf1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,12 +1,12 @@ { "_meta": { "hash": { - "sha256": "1a8e880d24fe4f7a7f2ba47534ff161b542f6b3036de0e649c4b0c4c79473860" + "sha256": "0bc0e447f68081f98544da4d9de5559d7392e588f8c0a77511c5e064597ea5cd" }, "pipfile-spec": 6, "requires": { - "python_full_version": "3.12.4", - "python_version": "3.12" + "python_full_version": "3.11.4", + "python_version": "3.11" }, "sources": [ { @@ -142,6 +142,14 @@ "markers": "python_version >= '3.8'", "version": "==4.4.0" }, + "async-timeout": { + "hashes": [ + "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f", + "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028" + ], + "markers": "python_full_version < '3.12.0'", + "version": "==4.0.3" + }, "asyncpg": { "hashes": [ "sha256:0009a300cae37b8c525e5b449233d59cd9868fd35431abc470a3e364d2b85cb9", @@ -209,11 +217,107 @@ }, "certifi": { "hashes": [ - "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516", - "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56" + "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b", + "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90" ], "markers": "python_version >= '3.6'", - "version": "==2024.6.2" + "version": "==2024.7.4" + }, + "charset-normalizer": { + "hashes": [ + "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027", + "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087", + "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786", + "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8", + "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09", + "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185", + "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574", + "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e", + "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519", + "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898", + "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269", + "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3", + "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f", + "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6", + "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8", + "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a", + "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73", + "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc", + "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714", + "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2", + "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc", + "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce", + "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d", + "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e", + "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6", + "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269", + "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96", + "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d", + "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a", + "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4", + "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77", + "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d", + "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0", + "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed", + "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068", + "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac", + "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25", + "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8", + "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab", + "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26", + "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2", + "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db", + "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f", + "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5", + "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99", + "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c", + "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d", + "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811", + "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa", + "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a", + "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03", + "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b", + "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04", + "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c", + "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001", + "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458", + "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389", + "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99", + "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985", + "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537", + "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238", + "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f", + "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d", + "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796", + "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a", + "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143", + "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8", + "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c", + "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5", + "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5", + "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711", + "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4", + "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6", + "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c", + "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7", + "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4", + "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b", + "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae", + "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12", + "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c", + "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae", + "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8", + "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887", + "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b", + "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4", + "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f", + "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5", + "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33", + "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519", + "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561" + ], + "markers": "python_full_version >= '3.7.0'", + "version": "==3.3.2" }, "click": { "hashes": [ @@ -511,6 +615,21 @@ "markers": "python_version >= '3.7'", "version": "==3.1.4" }, + "joblib": { + "hashes": [ + "sha256:06d478d5674cbc267e7496a410ee875abd68e4340feff4490bcb7afb88060ae6", + "sha256:2382c5816b2636fbd20a09e0f4e9dad4736765fdfb7dca582943b9c1366b3f0e" + ], + "markers": "python_version >= '3.8'", + "version": "==1.4.2" + }, + "lightfm": { + "hashes": [ + "sha256:2b77ada182ccd768a8d7643ab3cfcd8b6e855db09087f7cc7329bd63316697a8" + ], + "index": "pypi", + "version": "==1.17" + }, "loguru": { "hashes": [ "sha256:003d71e3d3ed35f0f8984898359d65b79e5b21943f78af86aa5491210429b8eb", @@ -698,14 +817,66 @@ "markers": "python_version >= '3.7'", "version": "==6.0.5" }, + "numpy": { + "hashes": [ + "sha256:04494f6ec467ccb5369d1808570ae55f6ed9b5809d7f035059000a37b8d7e86f", + "sha256:0a43f0974d501842866cc83471bdb0116ba0dffdbaac33ec05e6afed5b615238", + "sha256:0e50842b2295ba8414c8c1d9d957083d5dfe9e16828b37de883f51fc53c4016f", + "sha256:0ec84b9ba0654f3b962802edc91424331f423dcf5d5f926676e0150789cb3d95", + "sha256:17067d097ed036636fa79f6a869ac26df7db1ba22039d962422506640314933a", + "sha256:1cde1753efe513705a0c6d28f5884e22bdc30438bf0085c5c486cdaff40cd67a", + "sha256:1e72728e7501a450288fc8e1f9ebc73d90cfd4671ebbd631f3e7857c39bd16f2", + "sha256:2635dbd200c2d6faf2ef9a0d04f0ecc6b13b3cad54f7c67c61155138835515d2", + "sha256:2ce46fd0b8a0c947ae047d222f7136fc4d55538741373107574271bc00e20e8f", + "sha256:34f003cb88b1ba38cb9a9a4a3161c1604973d7f9d5552c38bc2f04f829536609", + "sha256:354f373279768fa5a584bac997de6a6c9bc535c482592d7a813bb0c09be6c76f", + "sha256:38ecb5b0582cd125f67a629072fed6f83562d9dd04d7e03256c9829bdec027ad", + "sha256:3e8e01233d57639b2e30966c63d36fcea099d17c53bf424d77f088b0f4babd86", + "sha256:3f6bed7f840d44c08ebdb73b1825282b801799e325bcbdfa6bc5c370e5aecc65", + "sha256:4554eb96f0fd263041baf16cf0881b3f5dafae7a59b1049acb9540c4d57bc8cb", + "sha256:46e161722e0f619749d1cd892167039015b2c2817296104487cd03ed4a955995", + "sha256:49d9f7d256fbc804391a7f72d4a617302b1afac1112fac19b6c6cec63fe7fe8a", + "sha256:4d2f62e55a4cd9c58c1d9a1c9edaedcd857a73cb6fda875bf79093f9d9086f85", + "sha256:5f64641b42b2429f56ee08b4f427a4d2daf916ec59686061de751a55aafa22e4", + "sha256:63b92c512d9dbcc37f9d81b123dec99fdb318ba38c8059afc78086fe73820275", + "sha256:6d7696c615765091cc5093f76fd1fa069870304beaccfd58b5dcc69e55ef49c1", + "sha256:79e843d186c8fb1b102bef3e2bc35ef81160ffef3194646a7fdd6a73c6b97196", + "sha256:821eedb7165ead9eebdb569986968b541f9908979c2da8a4967ecac4439bae3d", + "sha256:84554fc53daa8f6abf8e8a66e076aff6ece62de68523d9f665f32d2fc50fd66e", + "sha256:8d83bb187fb647643bd56e1ae43f273c7f4dbcdf94550d7938cfc32566756514", + "sha256:903703372d46bce88b6920a0cd86c3ad82dae2dbef157b5fc01b70ea1cfc430f", + "sha256:9416a5c2e92ace094e9f0082c5fd473502c91651fb896bc17690d6fc475128d6", + "sha256:9a1712c015831da583b21c5bfe15e8684137097969c6d22e8316ba66b5baabe4", + "sha256:9c27f0946a3536403efb0e1c28def1ae6730a72cd0d5878db38824855e3afc44", + "sha256:a356364941fb0593bb899a1076b92dfa2029f6f5b8ba88a14fd0984aaf76d0df", + "sha256:a7039a136017eaa92c1848152827e1424701532ca8e8967fe480fe1569dae581", + "sha256:acd3a644e4807e73b4e1867b769fbf1ce8c5d80e7caaef0d90dcdc640dfc9787", + "sha256:ad0c86f3455fbd0de6c31a3056eb822fc939f81b1618f10ff3406971893b62a5", + "sha256:b4c76e3d4c56f145d41b7b6751255feefae92edbc9a61e1758a98204200f30fc", + "sha256:b6f6a8f45d0313db07d6d1d37bd0b112f887e1369758a5419c0370ba915b3871", + "sha256:c5a59996dc61835133b56a32ebe4ef3740ea5bc19b3983ac60cc32be5a665d54", + "sha256:c73aafd1afca80afecb22718f8700b40ac7cab927b8abab3c3e337d70e10e5a2", + "sha256:cee6cc0584f71adefe2c908856ccc98702baf95ff80092e4ca46061538a2ba98", + "sha256:cef04d068f5fb0518a77857953193b6bb94809a806bd0a14983a8f12ada060c9", + "sha256:cf5d1c9e6837f8af9f92b6bd3e86d513cdc11f60fd62185cc49ec7d1aba34864", + "sha256:e61155fae27570692ad1d327e81c6cf27d535a5d7ef97648a17d922224b216de", + "sha256:e7f387600d424f91576af20518334df3d97bc76a300a755f9a8d6e4f5cadd289", + "sha256:ed08d2703b5972ec736451b818c2eb9da80d66c3e84aed1deeb0c345fefe461b", + "sha256:fbd6acc766814ea6443628f4e6751d0da6593dae29c08c0b2606164db026970c", + "sha256:feff59f27338135776f6d4e2ec7aeeac5d5f7a08a83e80869121ef8164b74af9" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==2.0.0" + }, "openai": { "hashes": [ - "sha256:4f5c1b90526cf48eaedac7b32d11b5c92fa7064b82617ad8f5f3279cd9ef090d", - "sha256:d73d353bcc0bd46b9516e78a0c6fb1cffaaeb92906c7c7b467c4fa088332a150" + "sha256:36ec3e93e0d1f243f69be85c89b9221a471c3e450dfd9df16c9829e3cdf63e60", + "sha256:c684f3945608baf7d2dcc0ef3ee6f3e27e4c66f21076df0b47be45d57e6ae6e4" ], "index": "pypi", "markers": "python_full_version >= '3.7.1'", - "version": "==1.35.9" + "version": "==1.35.13" }, "orjson": { "hashes": [ @@ -764,107 +935,144 @@ "markers": "python_version >= '3.8'", "version": "==3.10.6" }, + "pandas": { + "hashes": [ + "sha256:001910ad31abc7bf06f49dcc903755d2f7f3a9186c0c040b827e522e9cef0863", + "sha256:0ca6377b8fca51815f382bd0b697a0814c8bda55115678cbc94c30aacbb6eff2", + "sha256:0cace394b6ea70c01ca1595f839cf193df35d1575986e484ad35c4aeae7266c1", + "sha256:1cb51fe389360f3b5a4d57dbd2848a5f033350336ca3b340d1c53a1fad33bcad", + "sha256:2925720037f06e89af896c70bca73459d7e6a4be96f9de79e2d440bd499fe0db", + "sha256:3e374f59e440d4ab45ca2fffde54b81ac3834cf5ae2cdfa69c90bc03bde04d76", + "sha256:40ae1dffb3967a52203105a077415a86044a2bea011b5f321c6aa64b379a3f51", + "sha256:43498c0bdb43d55cb162cdc8c06fac328ccb5d2eabe3cadeb3529ae6f0517c32", + "sha256:4abfe0be0d7221be4f12552995e58723c7422c80a659da13ca382697de830c08", + "sha256:58b84b91b0b9f4bafac2a0ac55002280c094dfc6402402332c0913a59654ab2b", + "sha256:640cef9aa381b60e296db324337a554aeeb883ead99dc8f6c18e81a93942f5f4", + "sha256:66b479b0bd07204e37583c191535505410daa8df638fd8e75ae1b383851fe921", + "sha256:696039430f7a562b74fa45f540aca068ea85fa34c244d0deee539cb6d70aa288", + "sha256:6d2123dc9ad6a814bcdea0f099885276b31b24f7edf40f6cdbc0912672e22eee", + "sha256:8635c16bf3d99040fdf3ca3db669a7250ddf49c55dc4aa8fe0ae0fa8d6dcc1f0", + "sha256:873d13d177501a28b2756375d59816c365e42ed8417b41665f346289adc68d24", + "sha256:8e5a0b00e1e56a842f922e7fae8ae4077aee4af0acb5ae3622bd4b4c30aedf99", + "sha256:8e90497254aacacbc4ea6ae5e7a8cd75629d6ad2b30025a4a8b09aa4faf55151", + "sha256:9057e6aa78a584bc93a13f0a9bf7e753a5e9770a30b4d758b8d5f2a62a9433cd", + "sha256:90c6fca2acf139569e74e8781709dccb6fe25940488755716d1d354d6bc58bce", + "sha256:92fd6b027924a7e178ac202cfbe25e53368db90d56872d20ffae94b96c7acc57", + "sha256:9dfde2a0ddef507a631dc9dc4af6a9489d5e2e740e226ad426a05cabfbd7c8ef", + "sha256:9e79019aba43cb4fda9e4d983f8e88ca0373adbb697ae9c6c43093218de28b54", + "sha256:a77e9d1c386196879aa5eb712e77461aaee433e54c68cf253053a73b7e49c33a", + "sha256:c7adfc142dac335d8c1e0dcbd37eb8617eac386596eb9e1a1b77791cf2498238", + "sha256:d187d355ecec3629624fccb01d104da7d7f391db0311145817525281e2804d23", + "sha256:ddf818e4e6c7c6f4f7c8a12709696d193976b591cc7dc50588d3d1a6b5dc8772", + "sha256:e9b79011ff7a0f4b1d6da6a61aa1aa604fb312d6647de5bad20013682d1429ce", + "sha256:eee3a87076c0756de40b05c5e9a6069c035ba43e8dd71c379e68cab2c20f16ad" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==2.2.2" + }, "pydantic": { "hashes": [ - "sha256:d970ffb9d030b710795878940bd0489842c638e7252fc4a19c3ae2f7da4d6141", - "sha256:ead4f3a1e92386a734ca1411cb25d94147cf8778ed5be6b56749047676d6364e" + "sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a", + "sha256:73ee9fddd406dc318b885c7a2eab8a6472b68b8fb5ba8150949fc3db939f23c8" ], "markers": "python_version >= '3.8'", - "version": "==2.8.0" + "version": "==2.8.2" }, "pydantic-core": { "hashes": [ - "sha256:03aceaf6a5adaad3bec2233edc5a7905026553916615888e53154807e404545c", - "sha256:05e83ce2f7eba29e627dd8066aa6c4c0269b2d4f889c0eba157233a353053cea", - "sha256:0b0eefc7633a04c0694340aad91fbfd1986fe1a1e0c63a22793ba40a18fcbdc8", - "sha256:0e75794883d635071cf6b4ed2a5d7a1e50672ab7a051454c76446ef1ebcdcc91", - "sha256:0f6dd3612a3b9f91f2e63924ea18a4476656c6d01843ca20a4c09e00422195af", - "sha256:116b326ac82c8b315e7348390f6d30bcfe6e688a7d3f1de50ff7bcc2042a23c2", - "sha256:16197e6f4fdecb9892ed2436e507e44f0a1aa2cff3b9306d1c879ea2f9200997", - "sha256:1c3c5b7f70dd19a6845292b0775295ea81c61540f68671ae06bfe4421b3222c2", - "sha256:1dacf660d6de692fe351e8c806e7efccf09ee5184865893afbe8e59be4920b4a", - "sha256:1def125d59a87fe451212a72ab9ed34c118ff771e5473fef4f2f95d8ede26d75", - "sha256:1e4f46189d8740561b43655263a41aac75ff0388febcb2c9ec4f1b60a0ec12f3", - "sha256:1f038156b696a1c39d763b2080aeefa87ddb4162c10aa9fabfefffc3dd8180fa", - "sha256:21d9f7e24f63fdc7118e6cc49defaab8c1d27570782f7e5256169d77498cf7c7", - "sha256:22b813baf0dbf612752d8143a2dbf8e33ccb850656b7850e009bad2e101fc377", - "sha256:22e3b1d4b1b3f6082849f9b28427ef147a5b46a6132a3dbaf9ca1baa40c88609", - "sha256:23425eccef8f2c342f78d3a238c824623836c6c874d93c726673dbf7e56c78c0", - "sha256:25c46bb2ff6084859bbcfdf4f1a63004b98e88b6d04053e8bf324e115398e9e7", - "sha256:2761f71faed820e25ec62eacba670d1b5c2709bb131a19fcdbfbb09884593e5a", - "sha256:2aec8eeea0b08fd6bc2213d8e86811a07491849fd3d79955b62d83e32fa2ad5f", - "sha256:2d06a7fa437f93782e3f32d739c3ec189f82fca74336c08255f9e20cea1ed378", - "sha256:316fe7c3fec017affd916a0c83d6f1ec697cbbbdf1124769fa73328e7907cc2e", - "sha256:344e352c96e53b4f56b53d24728217c69399b8129c16789f70236083c6ceb2ac", - "sha256:35681445dc85446fb105943d81ae7569aa7e89de80d1ca4ac3229e05c311bdb1", - "sha256:366be8e64e0cb63d87cf79b4e1765c0703dd6313c729b22e7b9e378db6b96877", - "sha256:3a7235b46c1bbe201f09b6f0f5e6c36b16bad3d0532a10493742f91fbdc8035f", - "sha256:3c05eaf6c863781eb834ab41f5963604ab92855822a2062897958089d1335dad", - "sha256:3e147fc6e27b9a487320d78515c5f29798b539179f7777018cedf51b7749e4f4", - "sha256:3f0f3a4a23717280a5ee3ac4fb1f81d6fde604c9ec5100f7f6f987716bb8c137", - "sha256:5084ec9721f82bef5ff7c4d1ee65e1626783abb585f8c0993833490b63fe1792", - "sha256:52527e8f223ba29608d999d65b204676398009725007c9336651c2ec2d93cffc", - "sha256:53b06aea7a48919a254b32107647be9128c066aaa6ee6d5d08222325f25ef175", - "sha256:58e251bb5a5998f7226dc90b0b753eeffa720bd66664eba51927c2a7a2d5f32c", - "sha256:603a843fea76a595c8f661cd4da4d2281dff1e38c4a836a928eac1a2f8fe88e4", - "sha256:616b9c2f882393d422ba11b40e72382fe975e806ad693095e9a3b67c59ea6150", - "sha256:649a764d9b0da29816889424697b2a3746963ad36d3e0968784ceed6e40c6355", - "sha256:658287a29351166510ebbe0a75c373600cc4367a3d9337b964dada8d38bcc0f4", - "sha256:6d0f52684868db7c218437d260e14d37948b094493f2646f22d3dda7229bbe3f", - "sha256:6dc85b9e10cc21d9c1055f15684f76fa4facadddcb6cd63abab702eb93c98943", - "sha256:72432fd6e868c8d0a6849869e004b8bcae233a3c56383954c228316694920b38", - "sha256:73deadd6fd8a23e2f40b412b3ac617a112143c8989a4fe265050fd91ba5c0608", - "sha256:763602504bf640b3ded3bba3f8ed8a1cc2fc6a87b8d55c1c5689f428c49c947e", - "sha256:7701df088d0b05f3460f7ba15aec81ac8b0fb5690367dfd072a6c38cf5b7fdb5", - "sha256:78d584caac52c24240ef9ecd75de64c760bbd0e20dbf6973631815e3ef16ef8b", - "sha256:7a3639011c2e8a9628466f616ed7fb413f30032b891898e10895a0a8b5857d6c", - "sha256:7b6a24d7b5893392f2b8e3b7a0031ae3b14c6c1942a4615f0d8794fdeeefb08b", - "sha256:7d4df13d1c55e84351fab51383520b84f490740a9f1fec905362aa64590b7a5d", - "sha256:7e37b6bb6e90c2b8412b06373c6978d9d81e7199a40e24a6ef480e8acdeaf918", - "sha256:8093473d7b9e908af1cef30025609afc8f5fd2a16ff07f97440fd911421e4432", - "sha256:840200827984f1c4e114008abc2f5ede362d6e11ed0b5931681884dd41852ff1", - "sha256:85770b4b37bb36ef93a6122601795231225641003e0318d23c6233c59b424279", - "sha256:879ae6bb08a063b3e1b7ac8c860096d8fd6b48dd9b2690b7f2738b8c835e744b", - "sha256:87d3df115f4a3c8c5e4d5acf067d399c6466d7e604fc9ee9acbe6f0c88a0c3cf", - "sha256:8b315685832ab9287e6124b5d74fc12dda31e6421d7f6b08525791452844bc2d", - "sha256:8e49524917b8d3c2f42cd0d2df61178e08e50f5f029f9af1f402b3ee64574392", - "sha256:978d4123ad1e605daf1ba5e01d4f235bcf7b6e340ef07e7122e8e9cfe3eb61ab", - "sha256:a0586cddbf4380e24569b8a05f234e7305717cc8323f50114dfb2051fcbce2a3", - "sha256:a272785a226869416c6b3c1b7e450506152d3844207331f02f27173562c917e0", - "sha256:a340d2bdebe819d08f605e9705ed551c3feb97e4fd71822d7147c1e4bdbb9508", - "sha256:a3f243f318bd9523277fa123b3163f4c005a3e8619d4b867064de02f287a564d", - "sha256:a4f0f71653b1c1bad0350bc0b4cc057ab87b438ff18fa6392533811ebd01439c", - "sha256:ab760f17c3e792225cdaef31ca23c0aea45c14ce80d8eff62503f86a5ab76bff", - "sha256:ac76f30d5d3454f4c28826d891fe74d25121a346c69523c9810ebba43f3b1cec", - "sha256:ad1bd2f377f56fec11d5cfd0977c30061cd19f4fa199bf138b200ec0d5e27eeb", - "sha256:b2ba34a099576234671f2e4274e5bc6813b22e28778c216d680eabd0db3f7dad", - "sha256:b2f13c3e955a087c3ec86f97661d9f72a76e221281b2262956af381224cfc243", - "sha256:b34480fd6778ab356abf1e9086a4ced95002a1e195e8d2fd182b0def9d944d11", - "sha256:b4a085bd04af7245e140d1b95619fe8abb445a3d7fdf219b3f80c940853268ef", - "sha256:b81ec2efc04fc1dbf400647d4357d64fb25543bae38d2d19787d69360aad21c9", - "sha256:b8c46a8cf53e849eea7090f331ae2202cd0f1ceb090b00f5902c423bd1e11805", - "sha256:bc7e43b4a528ffca8c9151b6a2ca34482c2fdc05e6aa24a84b7f475c896fc51d", - "sha256:c3dc8ec8b87c7ad534c75b8855168a08a7036fdb9deeeed5705ba9410721c84d", - "sha256:c4a9732a5cad764ba37f3aa873dccb41b584f69c347a57323eda0930deec8e10", - "sha256:c867230d715a3dd1d962c8d9bef0d3168994ed663e21bf748b6e3a529a129aab", - "sha256:cafde15a6f7feaec2f570646e2ffc5b73412295d29134a29067e70740ec6ee20", - "sha256:cb1ad5b4d73cde784cf64580166568074f5ccd2548d765e690546cff3d80937d", - "sha256:d08264b4460326cefacc179fc1411304d5af388a79910832835e6f641512358b", - "sha256:d42669d319db366cb567c3b444f43caa7ffb779bf9530692c6f244fc635a41eb", - "sha256:d43e7ab3b65e4dc35a7612cfff7b0fd62dce5bc11a7cd198310b57f39847fd6c", - "sha256:d5b8376a867047bf08910573deb95d3c8dfb976eb014ee24f3b5a61ccc5bee1b", - "sha256:d6f2d8b8da1f03f577243b07bbdd3412eee3d37d1f2fd71d1513cbc76a8c1239", - "sha256:d6f8c49657f3eb7720ed4c9b26624063da14937fc94d1812f1e04a2204db3e17", - "sha256:d70a8ff2d4953afb4cbe6211f17268ad29c0b47e73d3372f40e7775904bc28fc", - "sha256:d82e5ed3a05f2dcb89c6ead2fd0dbff7ac09bc02c1b4028ece2d3a3854d049ce", - "sha256:e9dcd7fb34f7bfb239b5fa420033642fff0ad676b765559c3737b91f664d4fa9", - "sha256:ed741183719a5271f97d93bbcc45ed64619fa38068aaa6e90027d1d17e30dc8d", - "sha256:ee7785938e407418795e4399b2bf5b5f3cf6cf728077a7f26973220d58d885cf", - "sha256:efbb412d55a4ffe73963fed95c09ccb83647ec63b711c4b3752be10a56f0090b", - "sha256:f8ea1d8b7df522e5ced34993c423c3bf3735c53df8b2a15688a2f03a7d678800" + "sha256:035ede2e16da7281041f0e626459bcae33ed998cca6a0a007a5ebb73414ac72d", + "sha256:04024d270cf63f586ad41fff13fde4311c4fc13ea74676962c876d9577bcc78f", + "sha256:0827505a5c87e8aa285dc31e9ec7f4a17c81a813d45f70b1d9164e03a813a686", + "sha256:084659fac3c83fd674596612aeff6041a18402f1e1bc19ca39e417d554468482", + "sha256:10d4204d8ca33146e761c79f83cc861df20e7ae9f6487ca290a97702daf56006", + "sha256:11b71d67b4725e7e2a9f6e9c0ac1239bbc0c48cce3dc59f98635efc57d6dac83", + "sha256:150906b40ff188a3260cbee25380e7494ee85048584998c1e66df0c7a11c17a6", + "sha256:175873691124f3d0da55aeea1d90660a6ea7a3cfea137c38afa0a5ffabe37b88", + "sha256:177f55a886d74f1808763976ac4efd29b7ed15c69f4d838bbd74d9d09cf6fa86", + "sha256:19c0fa39fa154e7e0b7f82f88ef85faa2a4c23cc65aae2f5aea625e3c13c735a", + "sha256:1eedfeb6089ed3fad42e81a67755846ad4dcc14d73698c120a82e4ccf0f1f9f6", + "sha256:225b67a1f6d602de0ce7f6c1c3ae89a4aa25d3de9be857999e9124f15dab486a", + "sha256:242b8feb3c493ab78be289c034a1f659e8826e2233786e36f2893a950a719bb6", + "sha256:254ec27fdb5b1ee60684f91683be95e5133c994cc54e86a0b0963afa25c8f8a6", + "sha256:25e9185e2d06c16ee438ed39bf62935ec436474a6ac4f9358524220f1b236e43", + "sha256:26ab812fa0c845df815e506be30337e2df27e88399b985d0bb4e3ecfe72df31c", + "sha256:26ca695eeee5f9f1aeeb211ffc12f10bcb6f71e2989988fda61dabd65db878d4", + "sha256:26dc97754b57d2fd00ac2b24dfa341abffc380b823211994c4efac7f13b9e90e", + "sha256:270755f15174fb983890c49881e93f8f1b80f0b5e3a3cc1394a255706cabd203", + "sha256:2aafc5a503855ea5885559eae883978c9b6d8c8993d67766ee73d82e841300dd", + "sha256:2d036c7187b9422ae5b262badb87a20a49eb6c5238b2004e96d4da1231badef1", + "sha256:33499e85e739a4b60c9dac710c20a08dc73cb3240c9a0e22325e671b27b70d24", + "sha256:37eee5b638f0e0dcd18d21f59b679686bbd18917b87db0193ae36f9c23c355fc", + "sha256:38cf1c40a921d05c5edc61a785c0ddb4bed67827069f535d794ce6bcded919fc", + "sha256:3acae97ffd19bf091c72df4d726d552c473f3576409b2a7ca36b2f535ffff4a3", + "sha256:3c5ebac750d9d5f2706654c638c041635c385596caf68f81342011ddfa1e5598", + "sha256:3d482efec8b7dc6bfaedc0f166b2ce349df0011f5d2f1f25537ced4cfc34fd98", + "sha256:407653af5617f0757261ae249d3fba09504d7a71ab36ac057c938572d1bc9331", + "sha256:40a783fb7ee353c50bd3853e626f15677ea527ae556429453685ae32280c19c2", + "sha256:41e81317dd6a0127cabce83c0c9c3fbecceae981c8391e6f1dec88a77c8a569a", + "sha256:41f4c96227a67a013e7de5ff8f20fb496ce573893b7f4f2707d065907bffdbd6", + "sha256:469f29f9093c9d834432034d33f5fe45699e664f12a13bf38c04967ce233d688", + "sha256:4745f4ac52cc6686390c40eaa01d48b18997cb130833154801a442323cc78f91", + "sha256:4868f6bd7c9d98904b748a2653031fc9c2f85b6237009d475b1008bfaeb0a5aa", + "sha256:4aa223cd1e36b642092c326d694d8bf59b71ddddc94cdb752bbbb1c5c91d833b", + "sha256:4dd484681c15e6b9a977c785a345d3e378d72678fd5f1f3c0509608da24f2ac0", + "sha256:4f2790949cf385d985a31984907fecb3896999329103df4e4983a4a41e13e840", + "sha256:512ecfbefef6dac7bc5eaaf46177b2de58cdf7acac8793fe033b24ece0b9566c", + "sha256:516d9227919612425c8ef1c9b869bbbee249bc91912c8aaffb66116c0b447ebd", + "sha256:53e431da3fc53360db73eedf6f7124d1076e1b4ee4276b36fb25514544ceb4a3", + "sha256:595ba5be69b35777474fa07f80fc260ea71255656191adb22a8c53aba4479231", + "sha256:5b5ff4911aea936a47d9376fd3ab17e970cc543d1b68921886e7f64bd28308d1", + "sha256:5d41e6daee2813ecceea8eda38062d69e280b39df793f5a942fa515b8ed67953", + "sha256:5e999ba8dd90e93d57410c5e67ebb67ffcaadcea0ad973240fdfd3a135506250", + "sha256:5f239eb799a2081495ea659d8d4a43a8f42cd1fe9ff2e7e436295c38a10c286a", + "sha256:635fee4e041ab9c479e31edda27fcf966ea9614fff1317e280d99eb3e5ab6fe2", + "sha256:65db0f2eefcaad1a3950f498aabb4875c8890438bc80b19362cf633b87a8ab20", + "sha256:6b507132dcfc0dea440cce23ee2182c0ce7aba7054576efc65634f080dbe9434", + "sha256:6b9d9bb600328a1ce523ab4f454859e9d439150abb0906c5a1983c146580ebab", + "sha256:70c8daf4faca8da5a6d655f9af86faf6ec2e1768f4b8b9d0226c02f3d6209703", + "sha256:77bf3ac639c1ff567ae3b47f8d4cc3dc20f9966a2a6dd2311dcc055d3d04fb8a", + "sha256:784c1214cb6dd1e3b15dd8b91b9a53852aed16671cc3fbe4786f4f1db07089e2", + "sha256:7eb6a0587eded33aeefea9f916899d42b1799b7b14b8f8ff2753c0ac1741edac", + "sha256:7ed1b0132f24beeec5a78b67d9388656d03e6a7c837394f99257e2d55b461611", + "sha256:8ad4aeb3e9a97286573c03df758fc7627aecdd02f1da04516a86dc159bf70121", + "sha256:964faa8a861d2664f0c7ab0c181af0bea66098b1919439815ca8803ef136fc4e", + "sha256:9dc1b507c12eb0481d071f3c1808f0529ad41dc415d0ca11f7ebfc666e66a18b", + "sha256:9ebfef07dbe1d93efb94b4700f2d278494e9162565a54f124c404a5656d7ff09", + "sha256:a45f84b09ac9c3d35dfcf6a27fd0634d30d183205230a0ebe8373a0e8cfa0906", + "sha256:a4f55095ad087474999ee28d3398bae183a66be4823f753cd7d67dd0153427c9", + "sha256:a6d511cc297ff0883bc3708b465ff82d7560193169a8b93260f74ecb0a5e08a7", + "sha256:a8ad4c766d3f33ba8fd692f9aa297c9058970530a32c728a2c4bfd2616d3358b", + "sha256:aa2f457b4af386254372dfa78a2eda2563680d982422641a85f271c859df1987", + "sha256:b03f7941783b4c4a26051846dea594628b38f6940a2fdc0df00b221aed39314c", + "sha256:b0dae11d8f5ded51699c74d9548dcc5938e0804cc8298ec0aa0da95c21fff57b", + "sha256:b91ced227c41aa29c672814f50dbb05ec93536abf8f43cd14ec9521ea09afe4e", + "sha256:bc633a9fe1eb87e250b5c57d389cf28998e4292336926b0b6cdaee353f89a237", + "sha256:bebb4d6715c814597f85297c332297c6ce81e29436125ca59d1159b07f423eb1", + "sha256:c336a6d235522a62fef872c6295a42ecb0c4e1d0f1a3e500fe949415761b8a19", + "sha256:c6514f963b023aeee506678a1cf821fe31159b925c4b76fe2afa94cc70b3222b", + "sha256:c693e916709c2465b02ca0ad7b387c4f8423d1db7b4649c551f27a529181c5ad", + "sha256:c81131869240e3e568916ef4c307f8b99583efaa60a8112ef27a366eefba8ef0", + "sha256:d02a72df14dfdbaf228424573a07af10637bd490f0901cee872c4f434a735b94", + "sha256:d2a8fa9d6d6f891f3deec72f5cc668e6f66b188ab14bb1ab52422fe8e644f312", + "sha256:d2b27e6af28f07e2f195552b37d7d66b150adbaa39a6d327766ffd695799780f", + "sha256:d2fe69c5434391727efa54b47a1e7986bb0186e72a41b203df8f5b0a19a4f669", + "sha256:d3f3ed29cd9f978c604708511a1f9c2fdcb6c38b9aae36a51905b8811ee5cbf1", + "sha256:d573faf8eb7e6b1cbbcb4f5b247c60ca8be39fe2c674495df0eb4318303137fe", + "sha256:e0bbdd76ce9aa5d4209d65f2b27fc6e5ef1312ae6c5333c26db3f5ade53a1e99", + "sha256:e7c4ea22b6739b162c9ecaaa41d718dfad48a244909fe7ef4b54c0b530effc5a", + "sha256:e93e1a4b4b33daed65d781a57a522ff153dcf748dee70b40c7258c5861e1768a", + "sha256:e97fdf088d4b31ff4ba35db26d9cc472ac7ef4a2ff2badeabf8d727b3377fc52", + "sha256:e9fa4c9bf273ca41f940bceb86922a7667cd5bf90e95dbb157cbb8441008482c", + "sha256:eaad4ff2de1c3823fddf82f41121bdf453d922e9a238642b1dedb33c4e4f98ad", + "sha256:f1f62b2413c3a0e846c3b838b2ecd6c7a19ec6793b2a522745b0869e37ab5bc1", + "sha256:f6d6cff3538391e8486a431569b77921adfcdef14eb18fbf19b7c0a5294d4e6a", + "sha256:f9aa05d09ecf4c75157197f27cdc9cfaeb7c5f15021c6373932bf3e124af029f", + "sha256:fa2fddcb7107e0d1808086ca306dcade7df60a13a6c347a7acf1ec139aa6789a", + "sha256:faa6b09ee09433b87992fb5a2859efd1c264ddc37280d2dd5db502126d0e7f27" ], "markers": "python_version >= '3.8'", - "version": "==2.20.0" + "version": "==2.20.1" }, "pygments": { "hashes": [ @@ -874,6 +1082,14 @@ "markers": "python_version >= '3.8'", "version": "==2.18.0" }, + "python-dateutil": { + "hashes": [ + "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", + "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.9.0.post0" + }, "python-dotenv": { "hashes": [ "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca", @@ -889,6 +1105,13 @@ "markers": "python_version >= '3.8'", "version": "==0.0.9" }, + "pytz": { + "hashes": [ + "sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812", + "sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319" + ], + "version": "==2024.1" + }, "pyyaml": { "hashes": [ "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5", @@ -1031,6 +1254,14 @@ "markers": "python_version >= '3.8'", "version": "==2024.5.15" }, + "requests": { + "hashes": [ + "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", + "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6" + ], + "markers": "python_version >= '3.8'", + "version": "==2.32.3" + }, "rich": { "hashes": [ "sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222", @@ -1048,6 +1279,64 @@ "markers": "python_version >= '3.7'", "version": "==1.2.2" }, + "scikit-learn": { + "hashes": [ + "sha256:0828673c5b520e879f2af6a9e99eee0eefea69a2188be1ca68a6121b809055c1", + "sha256:0ea5d40c0e3951df445721927448755d3fe1d80833b0b7308ebff5d2a45e6414", + "sha256:10e49170691514a94bb2e03787aa921b82dbc507a4ea1f20fd95557862c98dc1", + "sha256:154297ee43c0b83af12464adeab378dee2d0a700ccd03979e2b821e7dd7cc1c2", + "sha256:161808750c267b77b4a9603cf9c93579c7a74ba8486b1336034c2f1579546d21", + "sha256:1bd8d3a19d4bd6dc5a7d4f358c8c3a60934dc058f363c34c0ac1e9e12a31421d", + "sha256:1ff4ba34c2abff5ec59c803ed1d97d61b036f659a17f55be102679e88f926fac", + "sha256:508907e5f81390e16d754e8815f7497e52139162fd69c4fdbd2dfa5d6cc88915", + "sha256:5944ce1faada31c55fb2ba20a5346b88e36811aab504ccafb9f0339e9f780395", + "sha256:5f57428de0c900a98389c4a433d4a3cf89de979b3aa24d1c1d251802aa15e44d", + "sha256:689b6f74b2c880276e365fe84fe4f1befd6a774f016339c65655eaff12e10cbf", + "sha256:781586c414f8cc58e71da4f3d7af311e0505a683e112f2f62919e3019abd3745", + "sha256:7b073a27797a283187a4ef4ee149959defc350b46cbf63a84d8514fe16b69855", + "sha256:88e0672c7ac21eb149d409c74cc29f1d611d5158175846e7a9c2427bd12b3956", + "sha256:909144d50f367a513cee6090873ae582dba019cb3fca063b38054fa42704c3a4", + "sha256:97625f217c5c0c5d0505fa2af28ae424bd37949bb2f16ace3ff5f2f81fb4498b", + "sha256:9a07f90846313a7639af6a019d849ff72baadfa4c74c778821ae0fad07b7275b", + "sha256:b59e3e62d2be870e5c74af4e793293753565c7383ae82943b83383fdcf5cc5c1", + "sha256:b5e865e9bd59396220de49cb4a57b17016256637c61b4c5cc81aaf16bc123bbe", + "sha256:da3f404e9e284d2b0a157e1b56b6566a34eb2798205cba35a211df3296ab7a74", + "sha256:f5b213bc29cc30a89a3130393b0e39c847a15d769d6e59539cd86b75d276b1a7" + ], + "markers": "python_version >= '3.9'", + "version": "==1.5.1" + }, + "scipy": { + "hashes": [ + "sha256:076c27284c768b84a45dcf2e914d4000aac537da74236a0d45d82c6fa4b7b3c0", + "sha256:07e179dc0205a50721022344fb85074f772eadbda1e1b3eecdc483f8033709b7", + "sha256:176c6f0d0470a32f1b2efaf40c3d37a24876cebf447498a4cefb947a79c21e9d", + "sha256:42470ea0195336df319741e230626b6225a740fd9dce9642ca13e98f667047c0", + "sha256:4c4161597c75043f7154238ef419c29a64ac4a7c889d588ea77690ac4d0d9b20", + "sha256:5b083c8940028bb7e0b4172acafda6df762da1927b9091f9611b0bcd8676f2bc", + "sha256:64b2ff514a98cf2bb734a9f90d32dc89dc6ad4a4a36a312cd0d6327170339eb0", + "sha256:65df4da3c12a2bb9ad52b86b4dcf46813e869afb006e58be0f516bc370165159", + "sha256:687af0a35462402dd851726295c1a5ae5f987bd6e9026f52e9505994e2f84ef6", + "sha256:6a9c9a9b226d9a21e0a208bdb024c3982932e43811b62d202aaf1bb59af264b1", + "sha256:6d056a8709ccda6cf36cdd2eac597d13bc03dba38360f418560a93050c76a16e", + "sha256:7d3da42fbbbb860211a811782504f38ae7aaec9de8764a9bef6b262de7a2b50f", + "sha256:7e911933d54ead4d557c02402710c2396529540b81dd554fc1ba270eb7308484", + "sha256:94c164a9e2498e68308e6e148646e486d979f7fcdb8b4cf34b5441894bdb9caf", + "sha256:9e3154691b9f7ed73778d746da2df67a19d046a6c8087c8b385bc4cdb2cfca74", + "sha256:9eee2989868e274aae26125345584254d97c56194c072ed96cb433f32f692ed8", + "sha256:a01cc03bcdc777c9da3cfdcc74b5a75caffb48a6c39c8450a9a05f82c4250a14", + "sha256:a7d46c3e0aea5c064e734c3eac5cf9eb1f8c4ceee756262f2c7327c4c2691c86", + "sha256:ad36af9626d27a4326c8e884917b7ec321d8a1841cd6dacc67d2a9e90c2f0359", + "sha256:b5923f48cb840380f9854339176ef21763118a7300a88203ccd0bdd26e58527b", + "sha256:bbc0471b5f22c11c389075d091d3885693fd3f5e9a54ce051b46308bc787e5d4", + "sha256:bff2438ea1330e06e53c424893ec0072640dac00f29c6a43a575cbae4c99b2b9", + "sha256:c40003d880f39c11c1edbae8144e3813904b10514cd3d3d00c277ae996488cdb", + "sha256:d91db2c41dd6c20646af280355d41dfa1ec7eead235642178bd57635a3f82209", + "sha256:f0a50da861a7ec4573b7c716b2ebdcdf142b66b756a0d392c236ae568b3a93fb" + ], + "markers": "python_version >= '3.10'", + "version": "==1.14.0" + }, "sgmllib3k": { "hashes": [ "sha256:7868fb1c8bfa764c1ac563d3cf369c381d1325d36124933a726f29fcdaa812e9" @@ -1062,6 +1351,14 @@ "markers": "python_version >= '3.7'", "version": "==1.5.4" }, + "six": { + "hashes": [ + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.16.0" + }, "sniffio": { "hashes": [ "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", @@ -1142,6 +1439,14 @@ "markers": "python_version >= '3.8'", "version": "==0.37.2" }, + "threadpoolctl": { + "hashes": [ + "sha256:082433502dd922bf738de0d8bcc4fdcbf0979ff44c42bd40f5af8a282f6fa107", + "sha256:56c1e26c150397e58c4926da8eeee87533b1e32bef131bd4bf6a2f45f3185467" + ], + "markers": "python_version >= '3.8'", + "version": "==3.5.0" + }, "tqdm": { "hashes": [ "sha256:b75ca56b413b030bc3f00af51fd2c1a1a5eac6a0c1cca83cbb37a5c52abce644", @@ -1166,6 +1471,14 @@ "markers": "python_version >= '3.8'", "version": "==4.12.2" }, + "tzdata": { + "hashes": [ + "sha256:2674120f8d891909751c38abcdfd386ac0a5a1127954fbc332af6b5ceae07efd", + "sha256:9068bc196136463f5245e51efda838afa15aaeca9903f49050dfa2679db4d252" + ], + "markers": "python_version >= '2'", + "version": "==2024.1" + }, "ujson": { "hashes": [ "sha256:0de4971a89a762398006e844ae394bd46991f7c385d7a6a3b93ba229e6dac17e", @@ -1250,6 +1563,14 @@ "markers": "python_version >= '3.8'", "version": "==5.10.0" }, + "urllib3": { + "hashes": [ + "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472", + "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168" + ], + "markers": "python_version >= '3.8'", + "version": "==2.2.2" + }, "uvicorn": { "extras": [ "standard" @@ -1649,11 +1970,11 @@ }, "identify": { "hashes": [ - "sha256:37d93f380f4de590500d9dba7db359d0d3da95ffe7f9de1753faa159e71e7dfa", - "sha256:e5e00f54165f9047fbebeb4a560f9acfb8af4c88232be60a488e9b68d122745d" + "sha256:cb171c685bdc31bcc4c1734698736a7d5b6c8bf2e0c15117f4d469c8640ae5cf", + "sha256:e79ae4406387a9d300332b5fd366d8994f1525e8414984e1a59e058b2eda2dd0" ], "markers": "python_version >= '3.8'", - "version": "==2.5.36" + "version": "==2.6.0" }, "isort": { "hashes": [ @@ -1811,11 +2132,11 @@ }, "tomlkit": { "hashes": [ - "sha256:af914f5a9c59ed9d0762c7b64d3b5d5df007448eb9cd2edc8a46b1eafead172f", - "sha256:eef34fba39834d4d6b73c9ba7f3e4d1c417a4e56f89a7e96e090dd0d24b8fb3c" + "sha256:08ad192699734149f5b97b45f1f18dad7eb1b6d16bc72ad0c2335772650d7b72", + "sha256:7075d3042d03b80f603482d69bf0c8f345c2b30e41699fd8883227f89972b264" ], - "markers": "python_version >= '3.7'", - "version": "==0.12.5" + "markers": "python_version >= '3.8'", + "version": "==0.13.0" }, "virtualenv": { "hashes": [ From 2b51e4fa207faa8e97375611a2549baf8ecb1c8a Mon Sep 17 00:00:00 2001 From: stopmin Date: Thu, 11 Jul 2024 23:16:54 +0900 Subject: [PATCH 16/20] =?UTF-8?q?Dockerfile=20=EC=88=98=EC=A0=95=20-=20gcc?= =?UTF-8?q?,=20libpq-dev=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 69da693..982d7f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,15 @@ FROM --platform=linux/amd64 python:3.11.4-slim-bookworm WORKDIR /app RUN apt-get update && \ - apt-get install -y --no-install-recommends gcc libpq-dev && \ - pip install --no-cache-dir pipenv && \ - apt-get purge -y --auto-remove gcc && \ - rm -rf /var/lib/apt/lists/* + apt-get install -y --no-install-recommends gcc libpq-dev libatlas-base-dev && \ + pip install --no-cache-dir pipenv COPY Pipfile Pipfile.lock ./ RUN pipenv install --deploy --ignore-pipfile +RUN apt-get purge -y --auto-remove gcc && \ + rm -rf /var/lib/apt/lists/* + COPY ./entrypoint.sh ./entrypoint.sh COPY ./app ./app From 36aa891be95902aed40acd4beb7faa688f1de7db Mon Sep 17 00:00:00 2001 From: stopmin Date: Fri, 12 Jul 2024 04:13:43 +0900 Subject: [PATCH 17/20] =?UTF-8?q?=EA=B8=B0=EC=82=AC=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=9E=A9=20=EB=9D=BC=EC=9A=B0=ED=84=B0=20=EC=82=AD=EC=A0=9C=20?= =?UTF-8?q?-=20=EC=95=88=EC=93=B0=EB=8A=94=20=EB=9D=BC=EC=9A=B0=ED=84=B0?= =?UTF-8?q?=EC=9D=B4=EB=AF=80=EB=A1=9C=20=EC=82=AD=EC=A0=9C=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=ED=95=98=EA=B2=A0=EC=8A=B5=EB=8B=88?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 2 -- app/router/news_scrap_router.py | 28 ---------------------------- 2 files changed, 30 deletions(-) delete mode 100644 app/router/news_scrap_router.py diff --git a/app/main.py b/app/main.py index 508ea41..2ccb5c5 100644 --- a/app/main.py +++ b/app/main.py @@ -9,7 +9,6 @@ LoggingMiddleware, ) from app.router.generate_simple_article_router import simple_article_router -from app.router.news_scrap_router import news_scrap_rotuer from app.router.newsletter_article_crud_router import newsletter_article_router from app.router.send_email_service_router import send_email_service_router from app.router.subscription_crud_router import subscription_router @@ -30,7 +29,6 @@ async def startup_event(): app.add_middleware(LoggingMiddleware) # routers -app.include_router(news_scrap_rotuer) app.include_router(subscription_router) app.include_router(newsletter_article_router) app.include_router(send_email_service_router) diff --git a/app/router/news_scrap_router.py b/app/router/news_scrap_router.py deleted file mode 100644 index 1ff5601..0000000 --- a/app/router/news_scrap_router.py +++ /dev/null @@ -1,28 +0,0 @@ -from fastapi import APIRouter -from groq import BaseModel - -from app.model.article_model import ArticleResponse -from app.service.crawl_article_service import CrawlArticleService -from app.utils.generic_response import GenericResponseDTO - -news_scrap_rotuer = APIRouter() - - -class ArticleCreateRequestDTO(BaseModel): - url: str - publisher: str - - -@news_scrap_rotuer.post( - "/extract-article", response_model=GenericResponseDTO[ArticleResponse] -) -async def extract_article_api( - articleCreateRequestDTO: ArticleCreateRequestDTO, -): - article = await CrawlArticleService().crawl_article( - news_type=articleCreateRequestDTO.publisher, - url=articleCreateRequestDTO.url, - ) - return GenericResponseDTO( - data=article, message="Article extracted successfully", result=True - ) From 858e59b89ca29580d25c5f2075876a945f34e684 Mon Sep 17 00:00:00 2001 From: stopmin Date: Fri, 12 Jul 2024 14:58:10 +0900 Subject: [PATCH 18/20] =?UTF-8?q?=ED=94=84=EB=A1=AC=ED=94=84=ED=8A=B8=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/model/prompt/simple_article/2024-07-02.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/model/prompt/simple_article/2024-07-02.txt b/app/model/prompt/simple_article/2024-07-02.txt index 2870733..55da96b 100644 --- a/app/model/prompt/simple_article/2024-07-02.txt +++ b/app/model/prompt/simple_article/2024-07-02.txt @@ -1,13 +1,13 @@ 너는 내가 제공하는 어려운 대한민국 경제 신문 본문을 20대 초반이 읽어도 이해하기 쉽게, 한국어로 기사를 재생성하는 기자이다. - 아래 json 형식에 맞게 기사를 재생성해야 한다. 단, 기사 본문의 경우 문단을 나누어야 한다. + 아래 json 형식에 맞게 기사를 재생성해야 한다. 단, 기사 본문의 경우 문단을 나누어야 한다. 줄바꿈 문자는 \n으로 표시한다. 다음은 json 형식의 예시이다: { "title": "기사 제목(한국어)", - "content": "기사 본문 (한국어)" 단, 경제 기사의 독자층이 20대 초반인 것을 고려하여 친근하고 꽤 간결하게 설명할 것" - "phrase": ["어려웠던 경제 표현들" : "어려웠던 경제 표현들을 쉽게 바꾼 문구"] (문자열 리스트) 예를 들어 "환율" : "다른 나라 돈과 우리나라 돈을 교환하는 비율"과 같이, - "comment": "기사를 3줄 이하로 요약하기. 단, 친근하게. (한국어)", - "category": "기사가 어느 카테고리, 즉 enum에 속하는지 (한국어)" + "content": "기사 본문 (한국어)" 단, 경제 기사의 독자층이 경제 지식이 부족한 20대 초반인 것을 고려하여 적당한 이모지를 사용하여 친근하고 간결하게 설명할 것" + "phrase": ["어려웠던 경제 표현들" : "어려웠던 경제 표현들을 쉽게 바꾼 문구"] (예시: "환율" : "다른 나라 돈과 우리나라 돈을 교환하는 비율") + "comment": "기사를 보고 추론할 수 있는 것 1문장을 친구에게 설명하는 듯한 표현으로", + "category": "Category 중 하나" } enum Category: @@ -18,4 +18,4 @@ enum Category: OPINION_AND_ANALYSIS = "오피니언 및 분석" -결과는 json형식이어야 하며, 여러 줄일 경우 줄바꿈 문자는 \n으로 표시한다. +결과는 json형식이어야 한다. From 6baefba3c12ecf466fda5289fa2269b49a5bb86d Mon Sep 17 00:00:00 2001 From: stopmin Date: Fri, 12 Jul 2024 15:25:52 +0900 Subject: [PATCH 19/20] =?UTF-8?q?=EC=84=B8=EC=85=98=20=EC=A3=BC=EC=9E=85?= =?UTF-8?q?=20=EB=B0=A9=EC=8B=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/database/repository.py | 6 ++---- app/database/session.py | 9 ++++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/database/repository.py b/app/database/repository.py index cfd7884..b9ecbfd 100644 --- a/app/database/repository.py +++ b/app/database/repository.py @@ -1,13 +1,11 @@ from typing import Any, Callable, Generic, Sequence, TypeVar -from fastapi import Depends, HTTPException +from fastapi import HTTPException from sqlalchemy import BinaryExpression, Row, RowMapping, desc, select from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import class_mapper -from app.database.session import get_db_session - Base = declarative_base() Model = TypeVar("Model", bound=Base) @@ -118,7 +116,7 @@ async def filter( def get_repository( model: type[Base], ) -> Callable[[AsyncSession], DatabaseRepository[Base]]: - def func(session: AsyncSession = Depends(get_db_session)): + def func(session: AsyncSession): if session is None: raise HTTPException(status_code=500, detail="DB Connection Error") return DatabaseRepository(model, session) diff --git a/app/database/session.py b/app/database/session.py index 0ccef6d..3df52ab 100644 --- a/app/database/session.py +++ b/app/database/session.py @@ -1,5 +1,6 @@ import os from collections.abc import AsyncGenerator +from contextlib import asynccontextmanager from dotenv import load_dotenv from fastapi import HTTPException @@ -25,7 +26,8 @@ engine = create_async_engine(DB_CONFIG) -async def get_db_session() -> AsyncGenerator[AsyncSession, None]: +@asynccontextmanager +async def db_session() -> AsyncGenerator[AsyncSession, None]: factory = sessionmaker(engine, class_=AsyncSession, expire_on_commit=False) async with factory() as session: @@ -44,3 +46,8 @@ async def get_db_session() -> AsyncGenerator[AsyncSession, None]: ) from error # pylint: disable=line-too-long finally: await session.close() + + +async def get_db_session() -> AsyncSession: + async with db_session() as session: + yield session From 2fc91792d6ba9e58a9dacffd985fe0f2af273141 Mon Sep 17 00:00:00 2001 From: stopmin Date: Fri, 12 Jul 2024 15:33:24 +0900 Subject: [PATCH 20/20] =?UTF-8?q?=EC=84=B8=EC=85=98=20=EC=A3=BC=EC=9E=85?= =?UTF-8?q?=EB=B0=A9=EC=8B=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/news_scheduling_service.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/service/news_scheduling_service.py b/app/service/news_scheduling_service.py index 9be042c..ea334a4 100644 --- a/app/service/news_scheduling_service.py +++ b/app/service/news_scheduling_service.py @@ -6,7 +6,7 @@ from sqlalchemy.ext.asyncio import AsyncSession from app.config.loguru_config import logger -from app.database.session import get_db_session +from app.database.session import db_session from app.model.article_publisher import Publisher from app.service.article_manage_service import ArticleManageService from app.service.simple_article_service import generate_simple_article @@ -55,9 +55,14 @@ async def fetch_and_store_all_publisher_feeds(): async def run_crawl_and_store(session: AsyncSession): articles = await fetch_and_store_all_publisher_feeds() + + # 기존에 저장된 기사들을 가져옴 exist_articles = await ArticleManageService().get_all_articles(session=session) + + # 기존에 저장된 기사들의 URL을 가져옴 exist_urls = {article.url for article in exist_articles} + # 새로운 기사들만 필터링 new_articles = [ article for article in articles if article["link"] not in exist_urls ] @@ -69,7 +74,7 @@ async def run_crawl_and_store(session: AsyncSession): ) for article in new_articles ] - await asyncio.gather(*tasks) + await asyncio.gather(*tasks, return_exceptions=True) else: logger.info("No new articles") @@ -83,7 +88,7 @@ async def schedule_task(): delay = (target_time - now).total_seconds() await asyncio.sleep(delay) - async with get_db_session() as session: # pylint: disable=not-async-context-manager + async with db_session() as session: await run_crawl_and_store(session)