Compare commits

...
Author SHA1 Message Date
michael chung 3e9581a29d Minor update 2023-09-19 22:32:09 -04:00
michael chung ab42870ff1 Updated General Setup! 2023-09-19 22:29:53 -04:00
michael chung 998c8ef49d General Setup Guide Updates! 2023-09-19 22:09:29 -04:00
Brandon Thomas aa8e7597ee get rid of redundancy 2023-09-19 20:26:35 -04:00
Brandon Thomas 725d16bbd9 readme: hosts file, running application 2023-09-19 20:13:22 -04:00
Brandon Thomas f6ee06a72f updated setup README 2023-09-19 20:01:38 -04:00
Brandon Thomas 14d028ea8a docs 2023-09-19 18:34:39 -04:00
Brandon Thomas 699c49c02f cleanup docs 2023-09-19 18:31:00 -04:00
Brandon Thomas b126998ee3 these are probably obsolete 2023-09-19 18:07:30 -04:00
Brandon Thomas 1b43433b72 Documentation updates 2023-09-19 18:06:37 -04:00
Brandon Thomas 1f7dc268a8 SadTalker arguments (wip) 2023-09-19 17:27:34 -04:00
Brandon Thomas dda67adc52 optional alternate checkpoint path arg 2023-09-15 10:07:33 -04:00
Brandon Thomas fa74b9715f logging for job 2023-09-15 09:28:41 -04:00
Brandon Thomas 653a0b26ce sleep(50) - ugh 2023-09-15 08:51:44 -04:00
Brandon Thomas ab8e9b9134 sqlite was failing, emit which is being prepared 2023-09-15 06:36:11 -04:00
Brandon Thomas dac67ada23 codegen db 2023-09-15 06:35:04 -04:00
Brandon Thomas f56530e36b Merge pull request #53 from storytold/bt-sadtalker-backup-2.2
Sad Talker worker, file uploads, etc.
2023-09-15 06:32:45 -04:00
Brandon Thomas 3077359165 logs 2023-09-15 06:29:22 -04:00
Brandon Thomas efdb0377f4 serve bucket paths 2023-09-15 06:15:11 -04:00
Brandon Thomas 4e935a1c2b worker details 2023-09-15 04:43:23 -04:00
Brandon Thomas 063760663f get job working again 2023-09-15 04:14:38 -04:00
Brandon Thomas 176cbcc4be remove directory full path, work on query 2023-09-15 03:33:55 -04:00
Brandon Thomas 359b7a5bd0 migrations, about to insert media file result 2023-09-15 02:19:41 -04:00
Brandon Thomas 9f67a3b82d SadTalker inference works ! 2023-09-14 05:33:08 -04:00
Brandon Thomas eb0e05f61e download image and audio 2023-09-14 04:58:28 -04:00
Brandon Thomas 24f6b3c2f6 upload image route 2023-09-12 20:04:58 -04:00
Brandon Thomas c47bae40d4 download voice conversion result 2023-09-12 20:04:58 -04:00
Brandon Thomas cf2c246bc2 voice_conversion_for_inference 2023-09-12 20:04:58 -04:00
Brandon Thomas 9b89402549 get_voice_conversion_result query 2023-09-12 20:04:58 -04:00
Brandon Thomas f2f2bd465c wip 2023-09-12 20:04:58 -04:00
Brandon Thomas 7e9acc6476 unpack args 2023-09-12 20:04:58 -04:00
Brandon Thomas 7d68347f4f fixed enqueue, fixed downloaders 2023-09-12 20:04:58 -04:00
Brandon Thomas 655f9fad7d downloaders 2023-09-12 20:04:58 -04:00
Brandon Thomas 754581ec70 impl_model_downloader appears to work 2023-09-12 20:04:58 -04:00
Brandon Thomas 80b7352581 async trait/macro starting to work 2023-09-12 20:04:58 -04:00
Brandon Thomas dd7bd71587 model downloader trait wip 2023-09-12 20:04:58 -04:00
Brandon Thomas e41f72305b (from other laptop) - inference args work, inference-job boilerplate 2023-09-12 20:04:58 -04:00
Brandon Thomas fa2a15a4f2 install route 2023-09-12 20:04:58 -04:00
Brandon Thomas eddb71d712 enqueue animation endpoint + more plumbing 2023-09-12 20:04:58 -04:00
Brandon Thomas 71758e6616 upload images (untested) 2023-09-12 20:04:58 -04:00
Brandon Thomas 7afa50ce29 another 101soundboards account 2023-09-12 18:42:38 -04:00
Brandon Thomas 14480e50b4 analytics queries 2023-08-31 22:45:43 -04:00
Brandon Thomas b99e4c5edb more 101soundboards accounts and notes 2023-08-31 22:31:38 -04:00
Brandon Thomas f5b7ad0428 analytics queries 2023-08-30 22:49:55 -04:00
Brandon Thomas ff2713358d imyfone notes 2023-08-28 21:37:28 -04:00
Brandon Thomas 60ab3565bd 101soundboards notes 2023-08-28 21:34:53 -04:00
Brandon Thomas d4ee7a8673 ban some abusers 2023-08-28 21:31:49 -04:00
Brandon Thomas 8e15e1e14c media_files enums 2023-08-23 21:33:06 -04:00
Brandon Thomas a8f0947352 media file token 2023-08-23 21:14:45 -04:00
Brandon Thomas 2600762df2 mysql table: media_files 2023-08-23 21:01:49 -04:00
Brandon Thomas 1100fc1a91 clion/intellij formatting rules 2023-08-23 18:03:56 -04:00
Brandon Thomas a538989c57 UserInfoLite shared response type 2023-08-23 18:03:36 -04:00
Brandon Thomas a4524ee679 execute all lints and tests 2023-08-23 17:13:11 -04:00
Brandon Thomas 1551a014a4 revisit rustfmt with minimal changes to formatting 2023-08-21 00:59:52 -04:00
Brandon Thomas e5afff51a6 Change rustfmt rules 2023-08-21 00:32:17 -04:00
Brandon Thomas 9a7b746460 return statement lint 2023-08-21 00:23:09 -04:00
Brandon Thomas a63b085086 Clippy: fix for newrelic, lint duplicate field name 2023-08-20 21:56:20 -04:00
Brandon Thomas 3b40f005d0 add storyteller.ai hostname 2023-08-20 21:01:57 -04:00
Brandon Thomas afc4fbdcb5 lints 2023-08-20 20:59:22 -04:00
Brandon Thomas 63008a7fe8 analytics query 2023-08-18 09:01:57 -04:00
Brandon Thomas 902c840833 takedown request 2023-08-18 08:49:05 -04:00
Brandon Thomas e8a8c6349f clippy 2023-08-16 16:00:37 -04:00
Brandon Thomas 76a62eaece more lints (add gradually) 2023-08-16 02:57:06 -04:00
Brandon Thomas 226fb93a36 lint progress 2023-08-16 02:28:48 -04:00
Brandon Thomas 1868170c31 more progress on lints 2023-08-16 01:51:30 -04:00
Brandon Thomas 7ecdac5151 Lint script 2023-08-16 01:34:24 -04:00
Brandon Thomas f41833e4f4 cargo cranky: &'static 2023-08-15 23:56:03 -04:00
Brandon Thomas bd9c4d752f move includes to single root dir 2023-08-15 23:42:01 -04:00
Brandon Thomas 7dab1b9ea1 username reservations 2023-08-14 14:33:32 -04:00
Brandon Thomas 512b214fb8 cargo 'cranky' (clippy helper) 2023-08-10 16:50:25 -04:00
Brandon Thomas 21e2eeac68 remove more duplicates 2023-08-10 15:28:43 -04:00
Brandon Thomas ec7a61a08e remove duplicates 2023-08-10 15:00:05 -04:00
Brandon Thomas c195a23425 inventory duplicates 2023-08-10 14:49:03 -04:00
Brandon Thomas 2c61db12d6 takedown requests 2023-08-10 14:36:24 -04:00
Brandon Thomas 8bac7ca332 analytics queries 2023-08-10 14:22:32 -04:00
Brandon Thomas 56fb99aa81 takedown request 2023-08-07 16:28:58 -04:00
Brandon Thomas e87091c5cb re-codegen 2023-07-30 18:13:30 -04:00
Brandon Thomas ffb081777d Enrich stats query with per-queue info 2023-07-30 18:12:45 -04:00
Brandon Thomas e8be6f9775 improved queue length query 2023-07-30 17:26:07 -04:00
Brandon Thomas 2094ab2fe8 query 2023-07-30 16:21:23 -04:00
Brandon Thomas 596434868c takedown requests, duplicates 2023-07-30 00:15:40 -04:00
Brandon Thomas 14c5f02127 takedown requests 2023-07-30 00:04:07 -04:00
Brandon Thomas ffc018ee18 broken clients 2023-07-27 23:54:57 -04:00
Brandon Thomas 0b7f08e838 cache queue stats in Redis 2023-07-27 04:03:07 -04:00
Brandon Thomas 3a8398a94e much better logging for download jobs 2023-07-27 03:10:55 -04:00
Brandon Thomas 35e26e7f72 more queries 2023-07-27 02:48:00 -04:00
Brandon Thomas 3e6b4c43af scope download job 2023-07-27 01:30:33 -04:00
Brandon Thomas e5289809fd more analytics queries 2023-07-26 01:13:38 -04:00
Brandon Thomas b335e1839c analytics queries 2023-07-25 16:59:08 -04:00
Brandon Thomas ce3f83e9af subscriber analytics 2023-07-24 23:46:36 -04:00
Brandon Thomas e324c6ce44 query to restart failed downloads 2023-07-24 20:43:38 -04:00
Brandon Thomas 062a80fafa more analytics, etc. queries 2023-07-24 19:22:47 -04:00
Brandon Thomas 986e8b104a most popular VC models analytics query 2023-07-24 17:15:06 -04:00
Brandon Thomas 1e948a51e9 logging, common media upload query 2023-07-24 02:06:16 -04:00
Brandon Thomas f9b7a0e774 fix bug 2023-07-23 23:41:21 -04:00
Brandon Thomas 4db56881c0 debugging type error 2023-07-23 23:36:57 -04:00
Brandon Thomas c11b2f0a94 better logging 2023-07-23 21:46:26 -04:00
Brandon Thomas 3d9a0cfcc1 scoped job execution 2023-07-23 21:32:39 -04:00
Brandon Thomas b019968ce1 re codegen db 2023-07-23 19:12:59 -04:00
Brandon Thomas 31c88d6d64 Poll voice conversion model info; pull from cache 2023-07-23 19:12:16 -04:00
Brandon Thomas a601998fa5 query for voice conversion model info 2023-07-23 18:08:45 -04:00
Brandon Thomas c1ccfb419a in-memory token info cache 2023-07-23 17:54:41 -04:00
Brandon Thomas d9a1fcf989 types on inference jobs are wrong (gradually fixing) 2023-07-23 17:33:57 -04:00
Brandon Thomas 839b33425a keep alive elapses shouldn't be system failures 2023-07-20 23:58:29 -04:00
Brandon Thomas 8017fef05a rename files across devices 2023-07-20 23:50:19 -04:00
Brandon Thomas 0534db0033 inference-job: more logging, default location for rvc hubert 2023-07-20 23:30:53 -04:00
Brandon Thomas ef53568dcf correct comment 2023-07-20 20:16:58 -04:00
Brandon Thomas 72c5c99a1c no longer log nvidia-smi spam 2023-07-20 20:16:32 -04:00
Brandon Thomas 0b0a9c428c fix python logger issue with rvc-v2 2023-07-20 19:58:46 -04:00
Brandon Thomas a9f0b1d485 fix deletion of directory bug 2023-07-20 18:07:52 -04:00
Brandon Thomas 76dc39df16 Fix list jobs query (now that it isn't statically typed) 2023-07-20 18:04:53 -04:00
Brandon Thomas 79d8af8bf4 re-codegen db 2023-07-20 17:44:03 -04:00
Brandon Thomas b1d69ba9ac no-op comment to trigger build 2023-07-20 15:06:17 -04:00
Brandon Thomas ffcf460291 scope download job type 2023-07-20 14:40:28 -04:00
Brandon Thomas f0a8b6d175 additional logging for download-job 2023-07-20 01:41:59 -04:00
Brandon Thomas e3a5d68fcc download hubert for inference-job 2023-07-20 00:02:41 -04:00
Brandon Thomas 877b95a00c Download pretrained hubert for download-job 2023-07-19 23:36:38 -04:00
Brandon Thomas 20e32ff3e3 begin handling hubert 2023-07-19 22:35:42 -04:00
Brandon Thomas 97a6f6e4ff add health checker to download-job 2023-07-19 19:52:24 -04:00
Brandon Thomas cf27fca799 Merge pull request #52 from storytold/bt-upgrade-actix-4
upgrade to actix 4
2023-07-19 02:53:40 -04:00
Brandon Thomas 5eab05753f fix broken tests 2023-07-19 02:52:11 -04:00
Brandon Thomas 385e1e53c1 update middleware 2023-07-19 02:41:40 -04:00
Brandon Thomas 039e61499f fix routes generics / upgrade generics on routing pieces 2023-07-19 01:57:51 -04:00
Brandon Thomas 9dd91ce7cc only a few compile errors left with storyteller-web 2023-07-19 01:09:10 -04:00
Brandon Thomas a75c1f391a Upgrade actix partially (was on beta version)
Old version was causing conflicts with zip and transitive bzip
dependency, so it's time to upgrade. We need to get to the next version
number soon anyway.
2023-07-19 00:20:49 -04:00
Brandon Thomas d833b3babd Merge pull request #51 from storytold/bt-rvc-v2-support
RVC v2 support
2023-07-18 23:06:49 -04:00
Brandon Thomas 1427e3eecd Handle zip files with .index files 2023-07-18 23:05:46 -04:00
Brandon Thomas 45990f5631 research 2023-07-18 17:57:37 -04:00
Brandon Thomas 5653a918c0 codegen db (was there an sqlite issue?) 2023-07-18 16:53:08 -04:00
Brandon Thomas 8172774a98 Handle RVC models without an index file 2023-07-18 16:50:44 -04:00
Brandon Thomas 6189d6fe9d working rvc(v2), it needs cleanup; also fixed race condition 2023-07-18 02:13:46 -04:00
Brandon Thomas 395940ef34 Progress on rvc inference job (not working yet) 2023-07-18 01:55:39 -04:00
Brandon Thomas 85cfc0cf2e env files 2023-07-18 00:10:57 -04:00
Brandon Thomas 93e066e70b fixing rvc uploads 2023-07-17 17:10:14 -04:00
Brandon Thomas 5cb79a5a33 Begin work on download-job rvc-v2 support 2023-07-17 16:24:35 -04:00
Brandon Thomas 6b06a825f3 Merge pull request #50 from storytold/bt-saj-rvc-integration
Bt saj rvc integration
2023-07-16 19:26:23 -04:00
Brandon Thomas d653260ee5 Change enum variant name 2023-07-16 19:22:00 -04:00
Paul Sajna c8530e186e rvc stubs 2023-07-15 21:56:46 -04:00
Brandon Thomas aee52c04ff Fix failing builds (everything was working before)
Something mysteriously made my machine think we needed nightly.

Begone, nightly.
2023-07-15 21:55:59 -04:00
Brandon Thomas cd91acb4a8 fix compile error 2023-07-15 21:13:37 -04:00
Brandon Thomas d591472478 Merge pull request #49 from storytold/new-queries
new queries
2023-07-14 10:59:11 -04:00
Brandon Thomas c14073f06d new queries 2023-07-14 10:58:34 -04:00
Brandon Thomas edde256ff6 delete more duplicates 2023-06-27 15:33:50 -07:00
Brandon Thomas c6bcd25b19 get rid of takedown request models, duplicate models 2023-06-27 15:20:37 -07:00
Brandon Thomas 82c1563459 comments about users 2023-06-25 21:51:18 -07:00
Brandon Thomas 866ed89d9c refactor disabled endpoint filter 2023-06-25 21:21:53 -07:00
Brandon Thomas ac4ffb4f34 refactor 2023-06-25 20:57:36 -07:00
Brandon Thomas 41fe0866d4 refactor ip filter 2023-06-25 20:42:06 -07:00
Brandon Thomas de3e2e8924 cidr refactor 2023-06-25 20:28:31 -07:00
Brandon Thomas 800c9bd9d5 Add cidr filter 2023-06-25 20:11:59 -07:00
Brandon Thomas 1fe62a2570 Actix CIDR filter 2023-06-25 19:59:01 -07:00
Brandon Thomas f293b56089 Merge pull request #47 from storytold/bt-block-alibaba
block a few Alibaba IPs
2023-06-23 21:23:43 -04:00
Brandon Thomas a0a2d1434f block a few Alibaba IPs 2023-06-23 18:23:03 -07:00
Brandon Thomas 8ba1d9f303 Merge pull request #45 from storytold/bevy-experiments
roko bevy testing
2023-06-20 10:17:23 -04:00
Paul Sajna a11779e3aa roko bevy testing 2023-06-19 11:31:32 -07:00
Brandon Thomas 5c46fd7c60 easier to see logs in k8s 2023-06-17 19:02:28 -07:00
Brandon Thomas 09e26164b8 even beefier build machines 2023-06-17 18:32:58 -07:00
Brandon Thomas 8c24b0c755 log job successes 2023-06-17 18:18:15 -07:00
Brandon Thomas 83ae73d8d0 improperly counting successes 2023-06-17 18:05:34 -07:00
Brandon Thomas 1d0db0eeb9 install nvidia-container packages 2023-06-17 16:12:19 -07:00
Brandon Thomas 04581d06ee better exit status 2023-06-17 14:14:29 -07:00
Brandon Thomas a31ecc01ab configurable health threshold 2023-06-17 11:43:25 -07:00
Brandon Thomas be20e105ea Health check HTTP server runs and shuts down 2023-06-17 11:39:34 -07:00
Brandon Thomas 67864f3db2 Both job and HTTP server (doesn't respond to ctrl-c) 2023-06-17 11:05:27 -07:00
Brandon Thomas 10c277d9cf health check endpoint (not installed) 2023-06-17 07:49:27 -07:00
Brandon Thomas c6e4c2e274 job stats (consecutive success, failure) for inference-job 2023-06-16 21:42:00 -07:00
Brandon Thomas a3815ad64d Merge pull request #43 from storytold/saj-audiowmark
audiowmark wrapper
2023-05-29 23:23:37 -04:00
Paul Sajna 8cd48fcf58 audiowmark wrapper 2023-05-29 20:15:45 -07:00
Brandon Thomas 523c02326b more logging 2023-05-28 22:34:48 -07:00
Brandon Thomas 37eef276a0 more logger methods 2023-05-28 21:20:30 -07:00
Brandon Thomas f5cbedb230 fix logger 2023-05-28 21:01:14 -07:00
Brandon Thomas 6994a9c2ce documentation 2023-05-28 19:07:45 -07:00
Brandon Thomas 213742ff29 override python logger in dockerfile 2023-05-28 19:05:51 -07:00
Brandon Thomas df4f1e6a6c fix log levels 2023-05-28 19:04:09 -07:00
Brandon Thomas 64fa281bc1 parameter for flushing logs 2023-05-28 18:52:01 -07:00
Brandon Thomas bd386aa70b don't need the logger.py in isolation 2023-05-28 18:16:35 -07:00
Brandon Thomas 28875c9272 Add patches to upstream logger 2023-05-28 18:16:11 -07:00
Brandon Thomas a79bfc7a24 add version of logger we're using in production - we'll patch instead 2023-05-28 17:42:32 -07:00
Brandon Thomas ecca8ff17c we'll need to replace python logging in our container for performance 2023-05-28 17:33:04 -07:00
Brandon Thomas a3cabf6779 fix import 2023-05-28 00:53:59 -07:00
Brandon Thomas dd35a7cca9 ignore sensitive env vars 2023-05-28 00:52:05 -07:00
Brandon Thomas f876cac4cf job pause file 2023-05-27 23:23:42 -07:00
Brandon Thomas d2b840cb13 analytics queries 2023-05-27 00:32:09 -07:00
Brandon Thomas 85bac00194 password_reset table 2023-05-23 02:12:58 -07:00
Brandon Thomas 367a516f89 fix option typo 2023-05-23 01:41:01 -07:00
Brandon Thomas 5fe85072a2 pack more in docker container, "hacky fix" flag for so-vits-svc 2023-05-23 00:16:11 -07:00
Brandon Thomas 5867d2356c install vim 2023-05-22 22:21:53 -07:00
Brandon Thomas 275333c1ed netstat in docker image 2023-05-22 17:44:41 -07:00
Brandon Thomas 5ec2cde68f report errors better 2023-05-22 11:15:19 -07:00
Brandon Thomas daf5a63f86 cleanup temp dir 2023-05-22 02:44:34 -07:00
Brandon Thomas 2fe3d5dc99 add less to container 2023-05-22 02:38:20 -07:00
Brandon Thomas 44df952bd1 fix inference job path for VC uploaded audio 2023-05-22 01:51:12 -07:00
Brandon Thomas 5bf98f70d9 rework where temp storage lives: download vs workspace 2023-05-22 00:52:49 -07:00
Brandon Thomas af685b37cf fix keepalive redis in job 2023-05-21 22:11:19 -07:00
Brandon Thomas 0f7ff50cf6 better error logging 2023-05-21 20:01:08 -07:00
Brandon Thomas 1ae8d8d615 Fail jobs with elapsed keepalive 2023-05-21 18:16:44 -07:00
Brandon Thomas 63c0124267 test execution safety 2023-05-21 17:52:53 -07:00
Brandon Thomas 17e8c1942e codegen db 2023-05-21 17:49:58 -07:00
Brandon Thomas cf24a07bba Set keepalive key 2023-05-21 17:48:29 -07:00
Brandon Thomas 9ece30722f Enqueue inferene with keepalive flag 2023-05-21 17:21:17 -07:00
Brandon Thomas 9ab977d016 Add job table keepalive column 2023-05-21 17:04:02 -07:00
Brandon Thomas ebd3f52717 tmux to gpu container 2023-05-19 04:22:53 -07:00
Brandon Thomas 35a75e144a unban IP 2023-05-19 04:08:29 -07:00
Brandon Thomas 4b145a7419 Patch for firefox opus audio uploads failing 2023-05-19 04:06:36 -07:00
Brandon Thomas eb539e9142 query was wrong 2023-05-19 02:08:51 -07:00
Brandon Thomas 37604cdd7b config 2023-05-19 02:48:22 -04:00
Brandon Thomas f724031aa3 config 2023-05-19 02:44:14 -04:00
Brandon Thomas b8b10f6fc1 f0-method and frequency transpose for job 2023-05-18 12:17:08 -07:00
Brandon Thomas bd4bcab2c2 args for pitch/f0 method in http handler 2023-05-18 00:14:42 -07:00
Brandon Thomas caa3e3ae53 clear filesystem when full 2023-05-16 01:13:54 -07:00
Brandon Thomas 7cd8099ab5 variable length tts inference text 2023-05-15 00:47:57 -07:00
Brandon Thomas 6ec39b9c68 loyalty for VC contributors 2023-05-14 21:00:27 -07:00
Brandon Thomas c8b4b7daa0 analytics queries 2023-05-13 09:27:57 -07:00
Brandon Thomas a294549d02 queries 2023-05-09 12:55:07 -04:00
Brandon Thomas 33ff75274f add ripgrep 2023-05-04 06:17:12 -07:00
Brandon Thomas 945e5226c5 add a few tools to the container 2023-05-04 03:47:54 -07:00
Brandon Thomas 85a52cd26e config comments 2023-05-04 03:09:23 -04:00
Brandon Thomas 32ee4209da this configuration works 2023-05-04 03:07:38 -04:00
Brandon Thomas f94cdac47d local dev confi 2023-05-03 23:18:53 -04:00
Brandon Thomas a2ea870ac7 update nvidia driver ??? 2023-05-02 23:01:29 -07:00
Brandon Thomas a2c48d7469 kill subprocess if timeout elapses 2023-05-02 22:19:03 -07:00
Brandon Thomas fe3dd7d66b add routing tags to inference jobs 2023-05-02 21:31:39 -07:00
Brandon Thomas 88fae4ba89 timeout argument 2023-05-02 06:12:49 -07:00
Brandon Thomas 6505e67bf2 analytics 2023-05-02 04:37:21 -07:00
Brandon Thomas 3453fe0e3b add minor logging 2023-05-02 01:18:25 -07:00
Brandon Thomas 8b36d870d1 fix inference job, add env perameter for threshold 2023-05-01 06:52:34 -07:00
Brandon Thomas 9555ac51fe Skip jobs that aren't on filesystem 2023-05-01 06:42:41 -07:00
Brandon Thomas f00b4011b5 record inferecne duration stats to db 2023-05-01 04:17:36 -07:00
Brandon Thomas d1d208d714 add more timing stats to the jobs tables 2023-05-01 03:59:05 -07:00
Brandon Thomas a5ce9a3cc4 analytics 2023-04-30 08:16:27 -07:00
Brandon Thomas 6ad2468e59 analytics queries 2023-04-30 08:09:07 -07:00
Brandon Thomas c59695343f extend media/symphonia to work with webm+opus 2023-04-30 05:03:40 -07:00
Brandon Thomas 52a83609b6 test case for failing web browser uploads 2023-04-30 00:31:03 -07:00
Brandon Thomas f710b68a3e Fix broken tests, add testing script 2023-04-29 23:56:48 -07:00
Brandon Thomas 3d63e34ca1 analytics queries 2023-04-29 23:36:02 -07:00
Brandon Thomas 4a1f1441bf split analytics and operational queries 2023-04-29 06:08:34 -07:00
Brandon Thomas ee90f03436 add extra inference job stats 2023-04-29 05:11:57 -07:00
Brandon Thomas 1858aea619 new job queue stats endpoint 2023-04-29 04:58:51 -07:00
Brandon Thomas 592ba627be documentation 2023-04-29 03:53:31 -07:00
Brandon Thomas f754c6e41f add execution time to job queries 2023-04-29 03:10:31 -07:00
Brandon Thomas 54af3d301c Add execution millis columns to jobs tables 2023-04-29 02:41:49 -07:00
Brandon Thomas 22eeacf355 stricter compiler flags 2023-04-29 02:30:41 -07:00
Brandon Thomas 630aa497f3 note 2023-04-29 02:28:32 -07:00
Brandon Thomas 6e9c05c596 bootstrap / env config improved, on-prem, etc. 2023-04-29 02:26:13 -07:00
Brandon Thomas 3f781ad98f clean up worker hostname / cluster name in jobs 2023-04-29 02:16:17 -07:00
Brandon Thomas 5d038fdf8f codegen db 2023-04-29 01:50:14 -07:00
Brandon Thomas a09acf7c53 add extra metadata to inference and download jobs 2023-04-29 01:49:25 -07:00
Brandon Thomas 3ba64618c3 add tracking columns to generic_inference_job too 2023-04-29 00:17:44 -07:00
Brandon Thomas 73e583c7ed Add extra metadata tracking to generic download jobs table 2023-04-29 00:08:54 -07:00
Brandon Thomas 1d7a54f640 python for docker image 2023-04-28 16:09:38 -07:00
Brandon Thomas 552fae54a7 fix 2023-04-28 16:02:04 -07:00
Brandon Thomas 4d2ae85fd9 send hubert path for docker 2023-04-28 16:01:18 -07:00
Brandon Thomas 76775dec60 hubert path config 2023-04-28 15:54:53 -07:00
Brandon Thomas 22bc8d54a0 organize settings 2023-04-28 18:46:18 -04:00
Brandon Thomas 878bff867a fix dev env vars 2023-04-28 02:01:11 -04:00
Brandon Thomas 05d5bfc1a7 rename 2023-04-27 23:00:16 -07:00
Brandon Thomas 3acdd0b5e2 rebase fix 2023-04-28 01:47:40 -04:00
Brandon Thomas 1a7a74ee8a so-vits-svc auto_predict_f0 default to false, add option 2023-04-27 22:45:28 -07:00
Brandon Thomas 820f4ebc32 fix firefox/opus again 2023-04-27 15:54:13 -07:00
Brandon Thomas 423fb369db add audio/opus 2023-04-27 08:15:46 -07:00
Brandon Thomas 2a58079289 copy all env vars to child process 2023-04-27 07:19:46 -07:00
Brandon Thomas b2df674178 report mimetype errors 2023-04-27 02:00:31 -07:00
Brandon Thomas 1fd33e76b4 update base image 2023-04-27 01:02:23 -07:00
Brandon Thomas 824683b974 fixup dockerfile 2023-04-27 00:50:45 -07:00
Brandon Thomas 4bed11d21d change name again 2023-04-27 00:12:48 -07:00
Brandon Thomas 13bdcbdda6 fix names of actions 2023-04-27 00:11:40 -07:00
Brandon Thomas f49c724303 GPU + CPU dockerfiles 2023-04-27 00:09:31 -07:00
Brandon Thomas a9502c183b flexible config path for inference job 2023-04-26 10:17:49 -07:00
Brandon Thomas b469a237ce temporarily add nvidia/sound packages to rust monorepo images 2023-04-26 09:14:17 -07:00
Brandon Thomas 0df93c48c3 configs for download job 2023-04-26 07:48:31 -07:00
Brandon Thomas 070c192633 set config and test wav upfront and at runtime 2023-04-26 07:43:59 -07:00
Brandon Thomas 75a68c7e0f install python 2023-04-26 05:45:28 -07:00
Brandon Thomas b2db079cf5 env vars for docker 2023-04-26 04:46:40 -07:00
Brandon Thomas 6658281a1c try more env vars for caching 2023-04-26 04:38:27 -07:00
Brandon Thomas 8cb04f1dcb huggingface+nltk caches 2023-04-26 04:25:43 -07:00
Brandon Thomas 58f6ee68df more flexible command specification 2023-04-26 04:11:06 -07:00
Brandon Thomas d0cef7bec9 hack 2023-04-26 03:30:38 -07:00
Brandon Thomas 8eed406fbd inference-job hack (see if we can run without 'svc' command) 2023-04-26 01:31:02 -07:00
Brandon Thomas 44586c4cee copy the correct env var files 2023-04-25 20:56:18 -07:00
Brandon Thomas 02f5aacb8e more robust configuration of download-job 2023-04-25 20:55:18 -07:00
Brandon Thomas 001ff86ed3 robust configuration for download-job 2023-04-25 20:51:51 -07:00
Brandon Thomas 94b406eca2 much more robust app initialization 2023-04-25 20:44:59 -07:00
Brandon Thomas f8bdea1b3b build error fix 2023-04-25 17:20:21 -07:00
Brandon Thomas 8a37a7240c more DDoS IPs 2023-04-25 17:16:29 -07:00
Brandon Thomas a4c1abfe9c codegen 2023-04-25 06:07:01 -07:00
Brandon Thomas 6bb7a18676 report model title 2023-04-25 04:13:28 -07:00
Brandon Thomas a8173226ea report bucket hash in results 2023-04-25 03:00:31 -07:00
Brandon Thomas 692c3f64b6 two different firehose notifications 2023-04-25 01:33:47 -07:00
Brandon Thomas 4842b9bbc1 local dev config changes 2023-04-25 04:28:00 -04:00
Brandon Thomas a507f8bc38 nope, didn't work 2023-04-25 01:27:28 -07:00
Brandon Thomas 24f2c07199 try to fix duration bug 2023-04-25 01:25:13 -07:00
Brandon Thomas e871dde078 add upload source 2023-04-25 01:09:24 -07:00
Brandon Thomas 47ff379018 timeout 2023-04-24 02:53:59 -07:00
Brandon Thomas cdb0f37889 downgrode symphonia off-master branch to support opus for browsers 2023-04-24 02:32:13 -07:00
Brandon Thomas 6d7c3c6e5f maybe build with correct codecs? 2023-04-24 01:46:52 -07:00
Brandon Thomas 7b72d51bd3 debug logging 2023-04-24 01:11:37 -07:00
Brandon Thomas 11a9e1249c remove inference args (for now) 2023-04-23 23:29:09 -07:00
Brandon Thomas f3a6ddb70a premium priority levels 2023-04-23 23:05:24 -07:00
Brandon Thomas d2aa07228b simplify upload endpoint 2023-04-23 22:30:13 -07:00
Brandon Thomas a2c3668beb upload audio endpoint 2023-04-23 22:25:46 -07:00
Brandon Thomas 15d66a4530 propagate media input token to inference result 2023-04-23 20:48:09 -07:00
Brandon Thomas 75523811e4 ops query 2023-04-23 13:59:01 -07:00
Brandon Thomas 4672102da4 code changes stemming from schema changes 2023-04-23 05:03:37 -07:00
Brandon Thomas ca59189dd9 simplify media_uploads schema 2023-04-23 04:31:00 -07:00
Brandon Thomas 3564c1b459 more schema mods 2023-04-23 04:13:50 -07:00
Brandon Thomas 78263e3c49 media token type 2023-04-23 03:58:16 -07:00
Brandon Thomas e36fb66e05 migrate voice_conversion_results 2023-04-23 03:24:05 -07:00
Brandon Thomas 1540d87018 cleanup 2023-04-23 02:12:46 -07:00
Brandon Thomas 61f0869359 calculate result metadata 2023-04-23 02:02:49 -07:00
Brandon Thomas d23c7abfeb remove deprecated crate -> move hashing + mimetype functions out 2023-04-23 01:31:58 -07:00
Brandon Thomas 2d59891dee organize "file"-related/adjacent crates together 2023-04-23 00:27:09 -07:00
Brandon Thomas 2f86bc75ac crate to handle just mimetype ops 2023-04-23 00:08:59 -07:00
Brandon Thomas 8c5fb0bee2 badge granter for voice conversion models 2023-04-22 06:22:06 -07:00
Brandon Thomas b9f0d7749d fix transaction 2023-04-22 05:36:22 -07:00
Brandon Thomas b2caa3758a fix synthetic id 2023-04-22 05:22:06 -07:00
Brandon Thomas de656d4d74 fix 2023-04-22 04:47:09 -07:00
Brandon Thomas c803232a52 creator synthetic id 2023-04-22 04:44:40 -07:00
Brandon Thomas cd9b0080dd fix result upload directory 2023-04-22 04:04:15 -07:00
Brandon Thomas 6885eb5fc9 temporarily don't get file metadata 2023-04-22 03:55:25 -07:00
Brandon Thomas 100ad0da35 use public bucket client 2023-04-22 03:48:52 -07:00
Brandon Thomas 7010d56bc3 error handling json hydration 2023-04-22 03:44:10 -07:00
Brandon Thomas b34371eef0 try to only parse payload if not empty string 2023-04-22 03:42:29 -07:00
Brandon Thomas e6542438b5 create model storage directory 2023-04-22 03:29:26 -07:00
Brandon Thomas 287e3e5f0c inference for local dev 2023-04-22 02:17:58 -07:00
Brandon Thomas 8fcb908af9 code compiles 2023-04-22 02:14:44 -07:00
Brandon Thomas 56e84f434f forgot schema migrations 2023-04-22 02:05:44 -07:00
Brandon Thomas 925f2d78ae more sane schema for voice conversion results (bucket storage) 2023-04-22 02:04:44 -07:00
Brandon Thomas 90219594bb insert result record 2023-04-22 01:43:24 -07:00
Brandon Thomas 08e8560499 voice conversion result upload (WIP) 2023-04-21 23:27:20 -07:00
Brandon Thomas 9e38b9a2fc progress on so-vits-svc inference 2023-04-21 23:12:24 -07:00
Brandon Thomas e9a6320eab so-vits-svc inference (wip) 2023-04-21 21:51:37 -07:00
Brandon Thomas da05885d7d don't upload duplicates 2023-04-21 05:54:10 -07:00
Brandon Thomas ba9f716ff8 encode fewer bytes in inference jobs 2023-04-21 02:24:23 -07:00
Brandon Thomas 2633c5f0ef clean up tokens in vc inference 2023-04-21 02:05:14 -07:00
Brandon Thomas da805b4f1d clean upload hashing, better error messages 2023-04-21 00:22:58 -07:00
Brandon Thomas 9eb75c7eba list media uploads by session 2023-04-20 01:40:36 -07:00
Brandon Thomas 75607b3c12 tests, aspath 2023-04-20 00:27:37 -07:00
Brandon Thomas ce69b1b055 filesys crate cleanup 2023-04-20 00:18:29 -07:00
Brandon Thomas 9ee7fdbac5 move endpoint 2023-04-19 01:18:07 -07:00
Brandon Thomas 67e3ecebc1 Voice conversion model list endpoint 2023-04-19 00:43:27 -07:00
Brandon Thomas 52db0b7796 python3.6 2023-04-18 15:46:08 -07:00
Brandon Thomas 15fa5a2bee update image 2023-04-18 15:44:58 -07:00
Brandon Thomas 32babc99f0 update image 2023-04-18 12:47:58 -07:00
Brandon Thomas bdac796e51 update tt2 legacy inference to support docker, etc, unfront config 2023-04-18 12:37:30 -07:00
Brandon Thomas 18c50af218 Add "Deepfake CNN" level 2023-04-16 02:54:57 -07:00
Brandon Thomas 62cbde94bc anderson cooper voice config 2023-04-15 23:43:54 -07:00
Brandon Thomas b2f9b44e96 uncommitted changes 2023-04-15 23:36:26 -07:00
Brandon Thomas 6a48a5372c fix arg 2023-04-13 16:58:26 -07:00
Brandon Thomas 1b0368664a update image 2023-04-13 19:53:37 -04:00
Brandon Thomas 6a83524fd9 switch from 'onnx' to 'infer' for checking model integrity 2023-04-13 16:48:14 -07:00
Brandon Thomas 233247f3c0 config path 2023-04-13 15:59:16 -07:00
Brandon Thomas 60045a01d0 fix command 2023-04-13 13:33:57 -07:00
Brandon Thomas dc5dfd9831 update docker image 2023-04-13 13:24:07 -07:00
Brandon Thomas 7b36fc0b98 Update model check command (so-vits-svc), upgrade easyenv 2023-04-13 12:52:18 -07:00
Brandon Thomas 92e1d10809 wip so-vits-svc 2023-04-12 02:53:57 -07:00
Brandon Thomas 4a486cedd2 add so-vits-svc download type 2023-04-10 01:39:54 -07:00
Brandon Thomas 004cde84a7 move enum 2023-04-09 23:03:15 -07:00
Brandon Thomas 61b74500d8 codegen, a few enums 2023-04-09 22:55:21 -07:00
Brandon Thomas 8285826ed0 move where config lives 2023-04-09 20:16:13 -07:00
Brandon Thomas 03d0110ee6 ml docker image 2023-04-09 23:02:57 -04:00
Brandon Thomas 34517fbaff fix build errors 2023-04-09 19:18:07 -07:00
Brandon Thomas 839f7885fb try another path 2023-04-09 02:58:23 -07:00
Brandon Thomas cee3ffb217 fix docker env vars 2023-04-09 02:29:22 -07:00
Brandon Thomas 90198252b8 nltk env var 2023-04-09 02:24:41 -07:00
Brandon Thomas 165130321f try setting cache dir with docker now 2023-04-09 02:10:34 -07:00
Brandon Thomas 061c2c7b07 try to move cache dir again 2023-04-09 01:46:37 -07:00
Brandon Thomas 413960b6cf actually pass env to popen 2023-04-09 01:37:33 -07:00
Brandon Thomas cc4b7deaa9 huggingface cache dir 2023-04-09 01:27:50 -07:00
Brandon Thomas 8229a3cfb3 record entity token/type after job completes 2023-04-08 22:59:16 -07:00
Brandon Thomas b461c7e8e7 make field optional 2023-04-08 21:03:07 -07:00
Brandon Thomas c58f23c117 fixup inference-job 2023-04-08 20:52:51 -07:00
Brandon Thomas 048cc26b6b fixup storyteller-web 2023-04-08 20:50:22 -07:00
Brandon Thomas 9b5508d8c0 fixup mysql queries 2023-04-08 20:41:10 -07:00
Brandon Thomas a81428913d migrate generic_inference_jobs to include better indices/foreign keys 2023-04-08 19:54:58 -07:00
Brandon Thomas 756c8e09ae inference status endpoints 2023-04-08 18:49:59 -07:00
Brandon Thomas 5b97360724 update upload routes 2023-04-08 01:09:22 -07:00
Brandon Thomas 79ad78bdde header to route TT2 requests to new worker 2023-04-06 22:00:44 -07:00
Brandon Thomas 311299105b updated docker image 2023-04-07 00:48:24 -04:00
Brandon Thomas 9dad3a153c ml repo update 2023-04-06 22:50:21 -04:00
Brandon Thomas 93157b50c8 vits inference command roughly done, need to test 2023-04-06 18:58:07 -07:00
Brandon Thomas 47fbc1704d analytics 2023-04-06 16:48:31 -07:00
Brandon Thomas efba106d3c analytics query 2023-04-06 16:26:06 -07:00
Brandon Thomas e340eee250 progress on VITS (WIP) 2023-04-06 16:02:01 -07:00
Brandon Thomas 73be1bbf05 git rid of dated enum, start work on VITS inference 2023-04-06 14:35:29 -07:00
Brandon Thomas 81306d1a56 (untested) route VITS tts to generic job type 2023-04-05 01:48:50 -07:00
Brandon Thomas 8e341f7a83 strongly typed tts model type 2023-04-05 01:21:31 -07:00
Brandon Thomas 1978e5e653 db index on tts_models.tts_model_type 2023-04-05 00:53:52 -07:00
Brandon Thomas 8eaaad9b55 fix path error 2023-04-04 15:01:04 -07:00
Brandon Thomas 082c284add debugging 2023-04-04 14:47:15 -07:00
Brandon Thomas a83e5ff224 logging 2023-04-04 14:25:50 -07:00
Brandon Thomas abaaaf2fdb dev 2023-04-04 14:12:33 -07:00
Brandon Thomas 3409689566 fix path handling, introduce another (smaller scope) filesystem crate 2023-04-04 13:59:21 -07:00
Brandon Thomas 84c0e42964 fmt 2023-04-04 12:53:09 -07:00
Brandon Thomas b848c2b549 update docker image for appropriate cuda version 2023-04-04 15:50:06 -04:00
Brandon Thomas 85abbd8587 set python intepreter, fix path 2023-04-04 03:14:40 -07:00
Brandon Thomas b844191db7 downloader image 2023-04-04 06:08:19 -04:00
Brandon Thomas 0267a4799d fix a few errors with paths and quoting 2023-04-04 03:07:54 -07:00
Brandon Thomas c50060b161 no vits download venv 2023-04-04 02:57:39 -07:00
Brandon Thomas a508a843bd root dir 2023-04-04 02:56:25 -07:00
Brandon Thomas d0bad0c8fb docker image for testing 2023-04-04 05:50:48 -04:00
Brandon Thomas d2c99a7bad configure download-job for VITS (wip) 2023-04-04 00:24:28 -07:00
Brandon Thomas 681d923ae0 Add 'vits' enum to tts model tables 2023-04-04 00:11:48 -07:00
Brandon Thomas 9e563a0640 VITS download WIP (nearly done) 2023-04-03 23:41:18 -07:00
Brandon Thomas db30096cb9 rename module in inference-job 2023-04-03 21:43:42 -07:00
Brandon Thomas 76f9f5a850 Refactor download job, begin to work on VITS downloading 2023-04-03 21:37:07 -07:00
Brandon Thomas 3a0eafee11 report back on how to handle the upload 2023-04-02 21:34:38 -07:00
Brandon Thomas 9fbecd5568 enqueue vits uploads (in theory) 2023-04-02 21:21:16 -07:00
Brandon Thomas b3dedfc5a8 WIP VITS uploads 2023-04-02 21:05:05 -07:00
Brandon Thomas 8ded313e7b configure storyteller-web with more db (why so slow in dev?!) 2023-04-02 20:23:12 -07:00
Brandon Thomas e305928b45 flexible docker image sha 2023-04-02 20:01:45 -07:00
Brandon Thomas db48ee0fd8 mac frontend cors 2023-04-01 05:40:25 -04:00
Brandon Thomas 5beedcb5e3 add one color 2023-03-25 23:12:14 -04:00
Brandon Thomas e43feeb700 add random avatar/color to several endpoints 2023-03-25 19:54:12 -04:00
Brandon Thomas 38dc835ff4 add to event feed 2023-03-25 19:33:59 -04:00
Brandon Thomas 62b19b2b0e functions to generate random avatar + color 2023-03-25 19:04:37 -04:00
Brandon Thomas b7b92f4419 reduce user tokens to a single list 2023-03-23 02:49:33 -04:00
Brandon Thomas 7ee7ff3875 split ipv4/ipv6 files 2023-03-23 02:44:28 -04:00
Brandon Thomas 29237d3ead user tokens 2023-03-23 02:42:05 -04:00
Brandon Thomas 5afbfc0ec4 change troll sequences 2023-03-23 02:32:05 -04:00
Brandon Thomas 6e5a2d1789 more accounts 2023-03-23 02:13:07 -04:00
Brandon Thomas 13281ea3b1 more accounts 2023-03-23 02:10:36 -04:00
Brandon Thomas 98f80a68de documentation on removed ipv6 bans (in cloudflare, not our code) 2023-03-23 01:55:34 -04:00
Brandon Thomas 075fcfb81e unblock ipv6 2023-03-23 01:42:27 -04:00
Brandon Thomas a8c45cfac2 more accounts 2023-03-23 01:40:56 -04:00
Brandon Thomas f0a4f0a4f7 more ips / accounts 2023-03-23 01:09:24 -04:00
Brandon Thomas 3b78853d7c new user tokens and ip addresses 2023-03-23 01:03:58 -04:00
Brandon Thomas 98b6bb34a7 lighten up on the troll text 2023-03-23 01:02:18 -04:00
Brandon Thomas 4d759719f6 more IPs and user tokens 2023-03-23 00:52:41 -04:00
Brandon Thomas ac28ff8a39 start blocking 101soundboards IPs too 2023-03-23 00:50:03 -04:00
Brandon Thomas 43a33a00ee gitignore 2023-03-23 00:43:27 -04:00
Brandon Thomas 8bbc490b61 ignore vim temp files 2023-03-23 00:43:01 -04:00
Brandon Thomas 168a476b72 user token + ip address troll bans 2023-03-23 00:28:00 -04:00
Brandon Thomas 2cebfbb3fc more 101soundboards user tokens 2023-03-23 00:12:44 -04:00
Brandon Thomas d57e070c8c dedup 2023-03-22 23:58:06 -04:00
Brandon Thomas bde6b4d562 more user tokens 2023-03-22 23:56:12 -04:00
Brandon Thomas 9cde097d38 more stupid accounts 2023-03-22 23:53:13 -04:00
Brandon Thomas 1d7d1ba194 more 101soundboards user tokens 2023-03-22 23:50:36 -04:00
Brandon Thomas 632cf5a710 more 101soundboards user tokens 2023-03-22 23:40:19 -04:00
Brandon Thomas c2e287f6f4 more damned accounts 2023-03-22 22:55:26 -04:00
Brandon Thomas 844799e30e more 101soundboards accounts 2023-03-22 22:49:38 -04:00
Brandon Thomas c1bd8ed611 actually fix builds 2023-03-22 19:57:04 -04:00
Brandon Thomas 1466bca4d7 fix build 2023-03-22 18:32:36 -04:00
Brandon Thomas 12fdf24028 temp disable build 2023-03-22 18:28:24 -04:00
Brandon Thomas cefb770340 codegen db 2023-03-22 16:49:24 -04:00
Brandon Thomas e971ea98dc fix troll bans 2023-03-22 16:47:10 -04:00
Brandon Thomas 9ab8b366e9 ban 101 soundboards 2023-03-22 16:24:23 -04:00
Brandon Thomas 96563fa345 add a means to ban user tokens (or disable the service in weird ways) 2023-03-22 16:05:09 -04:00
Brandon Thomas 67ab94664c working locally 2023-03-22 15:34:02 -04:00
Brandon Thomas 99f1226115 I have to run this under Docker locally since it's ancient 2023-03-21 05:35:08 -04:00
Brandon Thomas 9c45a17b8d new inference subprocess command 2023-03-21 05:18:07 -04:00
Brandon Thomas 2cf5a6f942 TTS inference almost working on generic-inference-job 2023-03-21 02:01:13 -04:00
Brandon Thomas 071928d7bf port more TT2 logic 2023-03-21 00:49:21 -04:00
Brandon Thomas b8442b54ee cleanup 2023-03-21 00:18:39 -04:00
Brandon Thomas 530d891ce9 about to bolt on TT2 2023-03-21 00:11:42 -04:00
Brandon Thomas 972f119468 query tts model 2023-03-20 23:57:44 -04:00
Brandon Thomas 9004432620 generic inference jobs can be listed (hacky fix) 2023-03-20 23:42:23 -04:00
Brandon Thomas 81a3bc270b fix generic job list query 2023-03-20 23:11:38 -04:00
Brandon Thomas 84fe5a5762 enqueue generic inference jobs for tt2 2023-03-20 22:28:59 -04:00
Brandon Thomas a02934ca4e Add routing column to inference jobs (wip) 2023-03-20 21:58:08 -04:00
Brandon Thomas 4ddcd43e33 remove a lot of garbage from inference-job 2023-03-20 20:04:49 -04:00
Brandon Thomas 37be0174af put inference job back into "working"(?) order 2023-03-20 19:29:06 -04:00
Brandon Thomas f2e314d168 make sure this gets put in the image 2023-03-20 19:23:54 -04:00
Brandon Thomas 3bd216f00d rename crate, fix path handling, move some env vars 2023-03-20 19:21:58 -04:00
Brandon Thomas dc5885114d env internal crate - search multiple directories for env files 2023-03-20 18:59:43 -04:00
Brandon Thomas 47873497b8 comment APIs needed disambiguation 2023-03-18 18:18:45 -04:00
Brandon Thomas 554766bd2a Don't load IP ban sets that are empty 2023-03-18 13:25:14 -04:00
Brandon Thomas 86382bf219 rename files for better sorting 2023-03-18 13:13:54 -04:00
Brandon Thomas 59b1e28a14 unban IP 2023-03-18 13:12:52 -04:00
Brandon Thomas 3f88a741c9 private model logging + fix(?) 2023-03-18 13:06:19 -04:00
Brandon Thomas 2efcba5da6 fix broken path 2023-03-18 13:00:19 -04:00
Brandon Thomas b4718a2f13 block broken python script IP 104.251.211.22 2023-03-18 12:59:19 -04:00
Brandon Thomas efbb0000f3 fix list comment route 2023-03-18 07:02:50 -04:00
Brandon Thomas 0280e6b706 let's not do this table just yet 2023-03-18 05:37:14 -04:00
Brandon Thomas 79d568ee14 codegen db 2023-03-18 04:51:35 -04:00
Brandon Thomas 85630390a0 route bindings, list endpoint 2023-03-18 04:33:53 -04:00
Brandon Thomas 215b727bc1 create comment, delete comment handlers (not tested) 2023-03-18 03:54:30 -04:00
Brandon Thomas e29c0b4c68 edit comment query 2023-03-18 02:13:46 -04:00
Brandon Thomas c81e6af507 fix codegen script 2023-03-18 01:35:40 -04:00
Brandon Thomas 98d30917e5 rename crate 'database_queries' -> 'mysql_queries' because sqlite 2023-03-18 01:19:15 -04:00
Brandon Thomas e62e409857 refactor package directory structure 2023-03-18 01:11:10 -04:00
Brandon Thomas 417137a9a8 deprecate some crates 2023-03-18 01:07:01 -04:00
Brandon Thomas 0da1994f0c 101soundboards user tokens 2023-03-18 00:45:33 -04:00
Brandon Thomas 36d016c3c7 todo 2023-03-17 09:34:58 -04:00
Brandon Thomas b22e978e54 cleanup tts authorization logic 2023-03-17 08:52:04 -04:00
Brandon Thomas c387f47c97 (untested) disallow use of private models unless owner 2023-03-17 08:34:15 -04:00
Brandon Thomas 1a09676327 codegen db 2023-03-17 07:57:50 -04:00
Brandon Thomas e516f85e5f filter out models that are private/hidden 2023-03-17 07:54:57 -04:00
Brandon Thomas e16b86d36e analytics query for non-public tts models 2023-03-17 06:50:06 -04:00
Brandon Thomas 003a86cd31 delete comments 2023-03-17 06:42:04 -04:00
Brandon Thomas ebf48e20be list comments endpoint 2023-03-16 12:21:28 -04:00
Brandon Thomas df2444ddc0 insert comment 2023-03-16 11:09:26 -04:00
Brandon Thomas 6b6a2ceeba codegen 2023-03-16 10:42:46 -04:00
Brandon Thomas 80da0d9649 Add tts result audio path to result endpoint 2023-03-16 10:31:28 -04:00
Brandon Thomas b8fd0486c7 Untested query for inserting audit log items 2023-03-16 10:25:47 -04:00
Brandon Thomas 12ffb2ded1 new token types: comments, audit logs 2023-03-16 09:36:13 -04:00
Brandon Thomas f810256b9c new table enums 2023-03-16 09:28:49 -04:00
Brandon Thomas 461030b681 new tables (WIP) for comments + voice survey 2023-03-16 09:03:56 -04:00
Brandon Thomas a33ff3f060 20 trending english voices 2023-03-16 09:02:43 -04:00
Brandon Thomas 98736324dc 25 trending english voices 2023-03-16 09:01:57 -04:00
Brandon Thomas 89a6f36f1a gitignore for windows 2023-03-13 20:33:31 -04:00
Brandon Thomas ac5bcbdd16 aichatbot: handler for current level 2023-03-13 18:27:25 -04:00
Brandon Thomas 7566c0d71c use strum and default for more maintainable options 2023-03-13 18:20:58 -04:00
Brandon Thomas 0ca007b6e7 add level option for AiChatbotSidecar 2023-03-13 18:09:28 -04:00
Brandon Thomas cbe07e2b3e move test function out of aichatbot-sidecar 2023-03-13 17:50:04 -04:00
Brandon Thomas 495c01c38c Merge pull request #40 from storytold/bt-cache-session
cache sessions + purge cache on billing, edit profile, etc.
2023-03-12 05:19:28 -04:00
Brandon Thomas ff22319c77 purge session cache with billing endpoints 2023-03-12 05:17:37 -04:00
Brandon Thomas 16f2d5557b clear session cache when user is edited 2023-03-12 04:49:59 -04:00
Brandon Thomas e5cdb84c52 correct cache key 2023-03-12 04:34:50 -04:00
Brandon Thomas 8079be9f7e progress with generics 2023-03-12 04:25:44 -04:00
Brandon Thomas 2821240cc0 generic over executor types 2023-03-12 04:12:22 -04:00
Brandon Thomas ae0522419a this *should* work - need to work on non-pooled version 2023-03-12 03:11:33 -04:00
Brandon Thomas 46bb4274ca work in progress session caching (redis) 2023-03-12 03:00:47 -04:00
Brandon Thomas f2b6dc4349 Merge pull request #39 from storytold/bt-redis-cache-endpoint
Bt redis cache endpoint
2023-03-12 01:25:31 -05:00
Brandon Thomas a395c04265 Delete cache when tts model is edited 2023-03-12 01:24:23 -05:00
Brandon Thomas d3a4613cc9 cleanup closures, fail open to db 2023-03-12 00:04:25 -05:00
Brandon Thomas bdca25cf4f cache works! 2023-03-11 23:58:14 -05:00
Brandon Thomas 06a053b6d9 this compiles too 2023-03-11 23:43:39 -05:00
Brandon Thomas 4104ef0129 this compiles too 2023-03-11 23:33:29 -05:00
Brandon Thomas 0f076cbacd work in progress redis caching (this compiles) 2023-03-11 23:21:39 -05:00
Brandon Thomas 817b2c01df new redis ttl cache crate (untested) 2023-03-11 22:53:01 -05:00
Brandon Thomas c06c47f02e Merge pull request #38 from storytold/bt-fix
Bt fix
2023-03-11 21:57:42 -05:00
Brandon Thomas 23b0dafd6b fix compile errors 2023-03-11 21:57:13 -05:00
Brandon Thomas 91e83c8b90 notes 2023-03-11 21:57:13 -05:00
Brandon Thomas 4a32ced9cd Merge pull request #37 from storytold/cache-profiles-redis
cache user profiles with redis
2023-03-11 06:42:15 -05:00
Brandon Thomas 75014a673a cache user profiles with redis 2023-03-11 06:41:51 -05:00
Brandon Thomas 52afa5462d Merge pull request #36 from storytold/block-ips
block more IPs
2023-03-11 05:15:40 -05:00
Brandon Thomas a826d54311 block more IPs 2023-03-11 05:15:09 -05:00
Brandon Thomas 4f38e4b20a codegen 2023-03-11 03:44:54 -05:00
Brandon Thomas 6880efd2f0 Merge pull request #35 from storytold/bt-edit-mfactor
edit tts model m-factor (mods only)
2023-03-11 03:42:27 -05:00
Brandon Thomas e372a4b5ec edit tts model m-factor (mods only) 2023-03-11 03:41:59 -05:00
Brandon Thomas f978f1b055 Merge pull request #34 from storytold/bt-inference-test-jobs
test requests bypass the model cache
2023-03-11 02:36:11 -05:00
Brandon Thomas ee69e72661 test requests bypass the model cache 2023-03-11 02:35:50 -05:00
Brandon Thomas 6295fd9569 update queries codegen 2023-03-11 02:09:03 -05:00
Brandon Thomas 53d9d55036 re-build all the things 2023-03-11 01:13:39 -05:00
Brandon Thomas 7e236f1e81 tts job now conveys mel multiplier 2023-03-11 01:12:35 -05:00
Brandon Thomas 6b7370ee64 migrations for mel multiply factor 2023-03-10 23:49:52 -05:00
Brandon Thomas 406d2eb7af rename paths 2023-03-10 05:54:56 -05:00
Brandon Thomas 1cfb3663e9 endpoint disablement filter allows adjustment of online endpoints 2023-03-10 05:50:00 -05:00
Brandon Thomas aa24f781fb remove old ip banlist filter 2023-03-10 04:33:22 -05:00
Brandon Thomas 3a2dad2027 more cleanup, organization, refactor 2023-03-10 03:08:29 -05:00
Brandon Thomas 814c04cdac more cleanup 2023-03-10 02:59:54 -05:00
Brandon Thomas c45a6da8a5 rid database_queries of container_common::anyhow_result 2023-03-10 02:55:57 -05:00
Brandon Thomas a5b2028588 begin removing container_common stuff 2023-03-10 02:53:48 -05:00
Brandon Thomas 4a743bace1 New static IP filter + docker config includes 2023-03-10 02:45:36 -05:00
Brandon Thomas 5ef5d6832b IP lists of attackers to ban 2023-03-10 02:28:35 -05:00
Brandon Thomas 0ebb1e398b Directory to contain IP bans 2023-03-10 02:21:48 -05:00
Brandon Thomas 4be572c36b refactor / organize top level directories 2023-03-10 02:13:16 -05:00
Brandon Thomas 97bea31b1d load an entire directory of bans 2023-03-10 01:49:11 -05:00
Brandon Thomas f3dd785331 load ip sets from file 2023-03-10 01:34:57 -05:00
Brandon Thomas 0d99c2fc08 new ip address filter middleware (wip) 2023-03-10 01:12:37 -05:00
Brandon Thomas edba26a2db cache leaderboard 2023-03-09 18:29:15 -05:00
Brandon Thomas 89a9448c9a new caching logic for get pending tts counts 2023-03-09 18:16:02 -05:00
Brandon Thomas d557c78123 new LRU cache to bypass expiry 2023-03-09 18:06:21 -05:00
Brandon Thomas 9ac7f33008 feature flag to control frontend tts queue refresh rate 2023-03-09 10:47:59 -05:00
Brandon Thomas 716e7923ff Add IP addresses that attacked us 2023-03-09 02:19:51 -05:00
Brandon Thomas ad389491a2 mark dummy service logs 2023-03-09 00:31:00 -05:00
Brandon Thomas 85b5e427b9 Wrap forwarded ip 2023-03-09 00:30:20 -05:00
Brandon Thomas 74d7b543f2 dummy service too 2023-03-08 21:10:09 -05:00
Brandon Thomas 2078bac70f forwarded IP in logs 2023-03-08 21:09:47 -05:00
Brandon Thomas 2e0110b0d9 omfg I'm dumb 2023-03-08 20:49:59 -05:00
Brandon Thomas 80a32eedf3 default route 2023-03-08 20:37:54 -05:00
Brandon Thomas 539c5ae796 with and without compression (messy af hack) 2023-03-08 20:32:54 -05:00
Brandon Thomas 6440d519f9 build dummy service in docker image 2023-03-08 20:17:30 -05:00
Brandon Thomas 690f4f1064 dummy service for debugging 2023-03-08 20:16:35 -05:00
Brandon Thomas a1e4ca35cd configurable health check duration 2023-03-08 18:49:56 -05:00
Brandon Thomas d93c0a5a8d log dropped requests 2023-03-08 17:10:36 -05:00
Brandon Thomas 9cc5ce9a04 faster builds for outage 2023-03-08 16:53:15 -05:00
Brandon Thomas 202b6c4a97 always opt in health checkers 2023-03-08 16:32:09 -05:00
Brandon Thomas 71abf1caa2 fix the pushback filter for the global GKE load balancer 2023-03-08 15:31:52 -05:00
Brandon Thomas de01d0fde7 protect another endpoint (tts model list) with flag 2023-03-08 15:10:57 -05:00
Brandon Thomas bb5ef2a3fe 404 "None" job statuses from broken Python clients 2023-03-08 14:53:14 -05:00
Brandon Thomas a8ab9c1265 Middleware to disable site with 429 global pushback 2023-03-08 14:44:08 -05:00
Brandon Thomas 2412e15868 add a followup github action step 2023-03-08 12:48:12 -05:00
Brandon Thomas 4b45924455 one more disk space report 2023-03-08 12:30:06 -05:00
Brandon Thomas 72ce767337 bump github actions caching plugin 2023-03-08 12:28:06 -05:00
Brandon Thomas 76c562bf2e trying one more thing 2023-03-08 12:24:37 -05:00
Brandon Thomas 6ac8759aba remove check of filesystem at root due to permissions on /proc 2023-03-08 12:23:45 -05:00
Brandon Thomas 3503a4527c disable docker container build tests (for now - emergency) 2023-03-08 12:23:04 -05:00
Brandon Thomas 03160b73d4 Merge pull request #33 from storytold/bt-space-check
report disk usage
2023-03-08 12:15:42 -05:00
Brandon Thomas 601b786b06 report disk usage 2023-03-08 12:15:25 -05:00
Brandon Thomas 05503512d8 Merge pull request #32 from storytold/bt-space
attempt to fix github builds failing for space issues
2023-03-08 11:48:02 -05:00
Brandon Thomas 7db6f074b6 attempt to fix github builds failing for space issues 2023-03-08 11:47:31 -05:00
Brandon Thomas e7ad3a34de Merge pull request #31 from storytold/bt-ff
feature flag to disable tts queue length
2023-03-08 11:28:13 -05:00
Brandon Thomas 5ccd512a2a feature flag to disable tts queue length 2023-03-08 11:27:42 -05:00
Brandon Thomas c40333e2a2 Fixup sqlx offline query caching, fix failing tests, fix docker 2023-03-08 05:56:59 -05:00
Brandon Thomas edcfc9ff9b port final storyteller-web query out: enqueue infer w2l 2023-03-08 05:31:56 -05:00
Brandon Thomas 862be58f1a port "assign/unassign tts category" out of storyteller-web 2023-03-08 05:14:34 -05:00
Brandon Thomas 8b08f2ba1d port "edit w2l template" queries out of storyteller-web 2023-03-08 05:01:49 -05:00
Brandon Thomas fe3f8dec6c port "edit w2l result" queries 2023-03-08 03:30:09 -05:00
Brandon Thomas 8ae5d34074 port the two "edit tts result" queries 2023-03-08 03:14:54 -05:00
Brandon Thomas 89f8837706 port tts upload job status query 2023-03-08 01:05:35 -05:00
Brandon Thomas 03ed0b4c7b analytics queries 2023-03-07 23:57:43 -05:00
Brandon Thomas f1d8161481 port get pending w2l detailed stats out of storyteller-web 2023-03-06 20:03:43 -05:00
Brandon Thomas 2d20430f55 port tts inference stats from storyteller web 2023-03-06 19:56:26 -05:00
Brandon Thomas e2b98491cb port storyteller-web query: insert w2l template upload job 2023-03-06 19:21:14 -05:00
Brandon Thomas 910caa1000 port storyteller-web get w2l inference job status 2023-03-06 18:58:15 -05:00
Brandon Thomas 0e39999097 port query get upload w2l template status 2023-03-06 06:03:59 -05:00
Brandon Thomas 77779bc231 port insert tts upload job query 2023-03-06 05:47:51 -05:00
Brandon Thomas 898c22b9cc port "edit category" out of storyteller-web 2023-03-06 05:28:17 -05:00
Brandon Thomas 96b80b35a5 port query: set w2l template mod approval 2023-03-06 05:16:22 -05:00
Brandon Thomas d182f800f7 port query: inference job status 2023-03-06 05:07:43 -05:00
Brandon Thomas 60af92ea39 port storyteller-web query: pending w2l template list 2023-03-06 04:57:45 -05:00
Brandon Thomas da8c164b40 port storyteller-web query: create category 2023-03-06 04:49:36 -05:00
Brandon Thomas d304f40984 port useless query - should have just deleted this one 2023-03-06 04:41:05 -05:00
Brandon Thomas 8f0d347c38 move storyteller-web query: set user role 2023-03-06 04:27:34 -05:00
Brandon Thomas 73db1b1a49 move another storyteller web query: category soft delete 2023-03-06 04:18:58 -05:00
Brandon Thomas 97b7120ff8 move another storyteller-web query: ban user 2023-03-06 04:07:46 -05:00
Brandon Thomas 961c5cf43d remove another storyteller-web query: upsert ip ban 2023-03-06 03:58:47 -05:00
Brandon Thomas 4c2c54bd74 Merge pull request #30 from storytold/bt-extract-queries
Bt extract queries
2023-03-06 02:05:03 -05:00
Brandon Thomas c158097b42 move queries for public event feed out of storyteller-web 2023-03-06 02:01:46 -05:00
Brandon Thomas 1c9366da4b remove another storyteller-web query : staff 2023-03-06 02:01:46 -05:00
Brandon Thomas f648f7b714 port db query for toggle IP ban out of storyteller-web 2023-03-06 02:01:46 -05:00
Brandon Thomas c3db6ce24a remove another ip ban query from storyteller-web 2023-03-06 02:01:46 -05:00
Brandon Thomas 1910b6497c get rid of storyteller-web list ip bans query 2023-03-06 02:01:46 -05:00
Brandon Thomas ac90b89230 SQL codegen for MySQL + Sqlite 2023-03-02 05:46:53 -05:00
Brandon Thomas 70e6ba5aec codegen db 2023-02-26 00:12:58 -05:00
Brandon Thomas 5af6a68de7 Random init news story progress - better for initial mix of stories 2023-02-24 04:21:26 -05:00
Brandon Thomas 19532388a3 work on selecting random stories to scrape 2023-02-24 04:05:03 -05:00
Brandon Thomas 27adc9f73e gizmodo + kotaku in app scraping 2023-02-24 03:41:12 -05:00
Brandon Thomas 6d082f2b9e Kotaku + Gizmodo RSS indexers 2023-02-24 03:18:00 -05:00
Brandon Thomas 2c86a4189c kotaku scraper 2023-02-24 02:49:02 -05:00
Brandon Thomas bf5b2b385e CNN timestamps 2023-02-24 02:33:37 -05:00
Brandon Thomas b7c73930b4 CNN timestamps 2023-02-24 02:20:36 -05:00
Brandon Thomas f9d61a1482 Gizmodo scraper 2023-02-24 01:50:08 -05:00
Brandon Thomas 4799d3ceac CBS News scraper 2023-02-24 01:21:29 -05:00
Brandon Thomas 696fd2bd8d Add timestamp to theguardian scraper 2023-02-24 00:45:10 -05:00
Brandon Thomas 1cfb3bb715 TheGuardian scraper 2023-02-23 19:21:19 -05:00
Brandon Thomas ccb36f7f6e CLI utility to test parsing 2023-02-23 18:57:23 -05:00
Brandon Thomas 83a16f83e3 fix builds? 2023-02-23 17:19:16 -05:00
Brandon Thomas 8f9554be9f try to fix builds again 2023-02-23 05:10:10 -05:00
Brandon Thomas d987397586 fix builds? 2023-02-23 02:54:29 -05:00
Brandon Thomas 41e03feb85 more analytics queries 2023-02-23 02:15:04 -05:00
Brandon Thomas 5c8cab0d90 extra analysis query 2023-02-23 01:35:03 -05:00
Brandon Thomas 8f40db9a3e return short news title in HTTP endpoint 2023-02-22 08:36:18 -05:00
Brandon Thomas b0a7c953be Try to remove stories that have TTS strokes 2023-02-22 08:29:06 -05:00
Brandon Thomas a08bc3fa64 include outputs in table, cleanup bugs 2023-02-22 07:51:53 -05:00
Brandon Thomas 5d111f0a68 fix job queue state flow 2023-02-22 07:35:45 -05:00
Brandon Thomas 51a5571d84 new jobs: LLM title summary, LLM categorization 2023-02-22 07:28:04 -05:00
Brandon Thomas 95f2ec3e40 Add new status columns to list queries 2023-02-22 06:02:10 -05:00
Brandon Thomas b511420c03 Refactor to group news story tasks by phase 2023-02-22 05:14:07 -05:00
Brandon Thomas aeab9da077 Summary news title and categories DB migrations 2023-02-22 04:57:05 -05:00
Brandon Thomas 46452415fd hanashi v3 2023-02-21 23:06:42 -05:00
Brandon Thomas cecbc8e730 report headline image url 2023-02-20 05:41:59 -05:00
Brandon Thomas 1ba73c817c Avoid empty scraped articles 2023-02-20 05:37:59 -05:00
Brandon Thomas 8395739500 save debugging info 2023-02-20 05:23:07 -05:00
Brandon Thomas c537f09c8f Image generation works! 2023-02-20 05:09:35 -05:00
Brandon Thomas 1e7de6bf36 hanashi v2, include cnn entertainment feed 2023-02-19 06:35:22 -05:00
Brandon Thomas ab6e3ceb5a get rid of ads 2023-02-19 06:21:11 -05:00
Brandon Thomas 896938b762 begin work on per-website greenlighting 2023-02-19 06:05:48 -05:00
Brandon Thomas 486960905d Add web_content_type to news_stories and news_story_productions 2023-02-19 05:57:36 -05:00
Brandon Thomas 2a54d3aac9 switch voices at runtime 2023-02-18 06:58:13 -05:00
Brandon Thomas 10ac9fee82 GUI dropdown (non-functional), window size 2023-02-18 06:38:59 -05:00
Brandon Thomas cab4840a61 Sigil value in API for UNREAL's sake. Ugh. 2023-02-18 03:04:07 -05:00
Brandon Thomas 68a3c123eb Include all news stories if "recent" is an empty list 2023-02-18 01:19:41 -05:00
Brandon Thomas 582ce9aa93 more debugging 2023-02-18 01:13:27 -05:00
Brandon Thomas eaeb864c1c debugging for endpoints 2023-02-16 05:56:05 -05:00
Brandon Thomas 77d4bc3b75 working retry 2023-02-16 04:50:51 -05:00
Brandon Thomas b6be95144c FakeYou with backoff 2023-02-16 04:40:24 -05:00
Brandon Thomas 5ca4dd3600 use session cookie credentials instead, because API sessions broken 2023-02-16 03:53:00 -05:00
Brandon Thomas 294c3107b5 API token for channels 2023-02-16 02:41:45 -05:00
Brandon Thomas 2de7ce146f increase sqlite "connections"(??) to improve performance 2023-02-16 02:28:53 -05:00
Brandon Thomas f7ddd24325 Get next audio file in sequence 2023-02-16 02:26:48 -05:00
Brandon Thomas 1b1ed15f21 endpoint for random news story 2023-02-15 04:55:46 -05:00
Brandon Thomas dc93602306 track audio durations in db 2023-02-15 04:04:21 -05:00
Brandon Thomas 2898f40ad1 Fix errors 2023-02-15 03:34:27 -05:00
Brandon Thomas ced51c7f58 track extra metadata throughout production 2023-02-15 03:20:38 -05:00
Brandon Thomas b208847ec8 insert news story, tighten up timings 2023-02-15 02:48:15 -05:00
Brandon Thomas 744656cfd9 remove imgui (we're not using it) 2023-02-15 01:33:22 -05:00
Brandon Thomas a735d3e972 sequence length 2023-02-15 01:24:16 -05:00
Brandon Thomas 90aa091398 refactor tts_render_targets -> tts_render_tasks 2023-02-15 01:12:58 -05:00
Brandon Thomas f8e7ae3ced preproduction story finalization 2023-02-14 13:09:22 -05:00
Brandon Thomas a1b8a22225 Download files 2023-02-14 12:47:23 -05:00
Brandon Thomas 0a0105410d Get updated audio status 2023-02-14 05:13:57 -05:00
Brandon Thomas 69a79b76ea seems to work better? 2023-02-14 04:26:53 -05:00
Brandon Thomas 809387958c cleanup 2023-02-14 03:29:46 -05:00
Brandon Thomas 44f7824910 cleanup 2023-02-14 02:59:29 -05:00
Brandon Thomas 1e05dcb7e2 Add sequence order 2023-02-14 02:47:07 -05:00
Brandon Thomas 72bdea7d10 Record inference details 2023-02-14 02:22:00 -05:00
Brandon Thomas c3981e8554 idempotency crate, FakeYou requests to infer work 2023-02-14 02:03:31 -05:00
Brandon Thomas 6b937b7cd0 FakeYou rendering *almost* works 2023-02-14 01:37:26 -05:00
Brandon Thomas 5be10ae87a refactor/organize worker modules 2023-02-13 21:32:46 -05:00
Brandon Thomas 12f7e30047 fakeyou client 2023-02-13 21:25:43 -05:00
Brandon Thomas a5e0c2ab01 reorganize analytics queries 2023-02-13 17:39:58 -05:00
Brandon Thomas 0764711439 pause controls for scraping 2023-02-13 17:12:12 -05:00
Brandon Thomas 969be4726c easier concurrency atomic bools, add controls for pieces 2023-02-13 17:05:22 -05:00
Brandon Thomas 8244bac6e1 tweak timings 2023-02-13 04:52:41 -05:00
Brandon Thomas 1d173a74d5 split into paragraph heuristic 2023-02-13 04:34:24 -05:00
Brandon Thomas 3786a64eb1 text splitting 2023-02-13 03:49:01 -05:00
Brandon Thomas cc6cf0d6c0 "add dragon", as old colleagues would say
Maybe one day we can afford to buy Nintendo. (That's crazy.)
2023-02-12 22:53:56 -05:00
Brandon Thomas 144df6ffc0 refactor to make llm rendition a part of production flow 2023-02-12 17:52:18 -05:00
Brandon Thomas 85e0ce4b4a Greenlighting stories + production workflow (abstract, but will use) 2023-02-12 15:54:26 -05:00
Brandon Thomas 107d11f0f9 Analysis of paying subscribers 2023-02-12 02:40:11 -05:00
Brandon Thomas 7efb65ae08 new tables 2023-02-10 21:26:14 -05:00
Brandon Thomas ba3ff9768a WIP - tables for stories 2023-02-10 06:28:55 -05:00
Brandon Thomas b8e37d2e77 mark jobs done 2023-02-10 03:49:45 -05:00
Brandon Thomas 5a1e61b692 add some filters 2023-02-10 01:16:51 -05:00
Brandon Thomas 19b57b9c1d unused module 2023-02-10 00:41:57 -05:00
Brandon Thomas 6c33c31289 skip CNN video content 2023-02-08 05:13:45 -05:00
Brandon Thomas b1bbfe21ec OpenAI API calls 2023-02-08 03:36:41 -05:00
Brandon Thomas 5878224f7e rendition schema 2023-02-07 22:40:35 -05:00
Brandon Thomas 5497b7c0aa small refactor 2023-02-07 18:54:23 -05:00
Brandon Thomas bc58b50408 shared title/image extractors 2023-02-07 17:50:58 -05:00
Brandon Thomas ce17a3e1bf CNN articles, shared extractors 2023-02-07 17:13:07 -05:00
Brandon Thomas b8fe3a0e7d fix pagination bugs 2023-02-07 03:04:04 -05:00
Brandon Thomas d41cec6c90 cleanup log spam 2023-02-07 02:24:44 -05:00
Brandon Thomas 6a86f43a92 scraping appears to work 2023-02-07 02:18:00 -05:00
Brandon Thomas 65a7a46914 finish refactoring macros 2023-02-06 23:53:19 -05:00
Brandon Thomas 31eafed60d refactor database enum macros 2023-02-06 23:51:30 -05:00
Brandon Thomas 6abbbaae01 list query, enum macros for web_scraping_targets (sqlite) 2023-02-06 23:46:22 -05:00
Brandon Thomas 82efbf4d1f update docs 2023-02-06 22:10:12 -05:00
Brandon Thomas b1cefa66d5 docs about windows setup 2023-02-06 22:09:03 -05:00
Brandon Thomas 7f5f578abd ignore this mess 2023-02-06 21:58:47 -05:00
Brandon Thomas 0c574c31d6 update path 2023-02-06 18:42:31 -05:00
Brandon Thomas 393bc084d4 scope aichatbot to sqlite 2023-02-06 18:38:33 -05:00
Brandon Thomas 035faa0561 update launch script 2023-02-06 17:56:32 -05:00
Brandon Thomas 84e2bcd2c3 sqlite library for windows 2023-02-06 16:37:12 -05:00
Brandon Thomas bc69ecbda5 start script for windows 2023-02-06 16:17:16 -05:00
Brandon Thomas 5f35323a5f fixes for windows 2023-02-06 16:14:24 -05:00
Brandon Thomas 30c9f779bd outline remaining work 2023-02-06 05:00:32 -05:00
Brandon Thomas 4f7d03a505 index cnn + techcrunch 2023-02-06 04:56:49 -05:00
Brandon Thomas 5a031b1b80 indexer flow 2023-02-06 04:49:28 -05:00
Brandon Thomas d1b6facd95 worker threads 2023-02-06 04:46:10 -05:00
Brandon Thomas 79984058c0 Save webpage and scraping summary 2023-02-06 03:56:51 -05:00
Brandon Thomas adc52cd01e directory to persist html 2023-02-06 03:32:07 -05:00
Brandon Thomas aad257a1b2 fully refactor "hashing" out of container_common 2023-02-06 03:18:53 -05:00
Brandon Thomas b8d5a1fad1 hashing refactor 2023-02-06 03:06:01 -05:00
Brandon Thomas f757b94eaf refactor "hashing" 2023-02-06 03:02:23 -05:00
Brandon Thomas 8ff2408cbf begin to work on persisting scraping 2023-02-06 02:47:21 -05:00
Brandon Thomas 01fa2f8d67 serde 2023-02-05 17:35:44 -05:00
Brandon Thomas 25b7024655 title, more fields 2023-02-05 17:32:29 -05:00
Brandon Thomas f7b8423623 techcrunch parsing sort of works 2023-02-05 16:29:17 -05:00
Brandon Thomas 0f99360c20 the guardian 2023-02-05 05:54:25 -05:00
Brandon Thomas fe606c1610 three techcrunch feeds 2023-02-05 05:28:39 -05:00
Brandon Thomas 201481f969 handle TechCrunch venture feed 2023-02-05 05:24:54 -05:00
Brandon Thomas 665cd83739 techcrunch scraping of RSS feed 2023-02-05 05:12:42 -05:00
Brandon Thomas eefe48f8ca CNN candidate articles via RSS + Sqlite inserts 2023-02-05 05:02:13 -05:00
Brandon Thomas a1c5ef6eb2 add sqlite columns, move database 2023-02-05 03:44:02 -05:00
Brandon Thomas 2f4fe2dabc Web scraping WIP 2023-02-05 03:36:17 -05:00
Brandon Thomas d63a505b8b comments in .gitignore, aichatbot diesel configs 2023-02-05 01:41:08 -05:00
Brandon Thomas fb1bf9940e move migrations dir 2023-02-05 01:32:34 -05:00
Brandon Thomas d4de388bb6 new reserved usernames for channels 2023-02-05 01:21:57 -05:00
Brandon Thomas a0a5c68086 Project outline 2023-02-04 18:24:45 -05:00
Brandon Thomas ddb106a9af reqwest, ingestion modules (wip) 2023-02-03 23:57:12 -05:00
Brandon Thomas 7c229ba59b fix 2023-02-03 06:00:21 -05:00
Brandon Thomas d1978298f0 unixy paths 2023-02-03 05:57:41 -05:00
Brandon Thomas 1dcf06b571 fix? 2023-02-03 05:50:37 -05:00
Brandon Thomas 8af2368f32 fix? 2023-02-03 05:46:29 -05:00
Brandon Thomas 79fba33aae more debugging 2023-02-03 05:44:38 -05:00
Brandon Thomas bff0f9181d debugging 2023-02-03 05:42:27 -05:00
Brandon Thomas bd8f2570e2 report audio filename 2023-02-03 05:37:29 -05:00
Brandon Thomas 74c289b338 refactor sidecar, save dir 2023-02-03 05:17:09 -05:00
Brandon Thomas 63bb0e7253 cursor 2023-02-03 03:45:17 -05:00
Brandon Thomas 4140d07924 OpenAI API calls 2023-02-03 02:09:55 -05:00
Brandon Thomas aa03abd3b5 Merge pull request #28 from storytold/saj-unsubscribe-reason
endpoint for indicating why a user is unsubscribing
2023-02-03 01:33:54 -05:00
Paul Sajna fb8142fb49 endpoint for indicating why a user is unsubscribing 2023-02-02 22:25:00 -08:00
Brandon Thomas 362f41cbf3 Webserver + Egui synced 2023-02-02 17:55:04 -05:00
Brandon Thomas a79d3bcf9a fix windows builds? 2023-02-02 16:17:01 -05:00
Brandon Thomas 41e7780fa0 fix builds ? 2023-02-02 15:57:22 -05:00
Brandon Thomas 329e7defc5 update paths 2023-02-02 15:54:41 -05:00
Brandon Thomas 6ce0437aa2 ignore some code from Github language statistics 2023-02-02 15:52:33 -05:00
Brandon Thomas 34bb2c5266 ACTUALLY YOU CAN LAUNCH ACTIX FROM ANOTHER THREAD 2023-02-02 15:41:56 -05:00
Brandon Thomas 2b50d2bce5 new lib: actix_helpers (RouteBuilder), --gui, etc. 2023-02-02 15:33:01 -05:00
Brandon Thomas c9f55fbb7c Still issues with launching a gui on non-main thread; add fonts 2023-02-02 12:22:53 -05:00
Brandon Thomas 2da4971ec7 analytics query adjustments 2023-02-02 11:56:53 -05:00
Brandon Thomas 2cd6a98259 egui wants to run on main thread; so does actix. ugh 2023-02-02 04:38:43 -05:00
Brandon Thomas 7ba765b89c Setting up aichatbot-sidecar desktop program 2023-02-02 01:40:44 -05:00
Brandon Thomas 02d7495e54 kick this can down the road _again_ 2023-02-02 00:43:59 -05:00
Brandon Thomas 088535cb5a refactor/move "plugins" crate to pertain only to services 2023-02-02 00:40:01 -05:00
Brandon Thomas 4ef9ad35a7 fix migration dir config 2023-02-02 00:30:30 -05:00
Brandon Thomas f80f2c8962 Move all SQL stuff into single directory 2023-02-01 23:53:49 -05:00
Brandon Thomas 98fb5758e5 I'll see myself out 2023-02-01 19:32:03 -05:00
Brandon Thomas 06f219a8af more reserved names 2023-02-01 19:30:30 -05:00
Brandon Thomas 439527a504 more reserved words 2023-02-01 19:26:00 -05:00
Brandon Thomas 61e1cc62b6 analytics query 2023-01-30 01:20:06 -05:00
Brandon Thomas 633dfb5682 more queries 2023-01-29 20:58:03 -05:00
Brandon Thomas 8df0273ca8 more analysis 2023-01-29 20:17:50 -05:00
Brandon Thomas 41630e1fc5 paying user analytics 2023-01-29 20:09:28 -05:00
Brandon Thomas 40bc0cf883 never need 500 voices in analytics 2023-01-27 02:33:00 -05:00
Brandon Thomas 7fdb5cfe9c codegen db 2023-01-26 01:17:27 -05:00
Brandon Thomas a0da010dab Add model ratings to TTS list and get endpoints 2023-01-26 01:12:20 -05:00
Brandon Thomas 74ff632f4d update TTS statistics on model rate 2023-01-26 01:12:20 -05:00
Brandon Thomas e6d1f0db11 Alter tts_models to add ratings counts 2023-01-26 01:12:20 -05:00
Brandon Thomas d190173f4d new queries 2023-01-25 16:29:25 -05:00
Brandon Thomas 22e8a14170 Fix build errors and mistakes with user ratings 2023-01-25 16:24:44 -05:00
Brandon Thomas b6fce130b5 GET and POST endpoints for user ratings 2023-01-25 16:08:22 -05:00
Brandon Thomas 1bb0dda330 Rating type instead of bool, upsert query, enums 2023-01-25 02:33:56 -05:00
Brandon Thomas bcbb36a9ed User ratings table 2023-01-25 00:47:35 -05:00
Brandon Thomas dbfd80531d analytics query 2023-01-23 23:21:44 -05:00
Brandon Thomas 4152b346c1 Server info endpoint to report backend SHA 2023-01-21 03:17:49 -05:00
Brandon Thomas 3b37cf9e89 analytics query 2023-01-20 06:22:40 -05:00
Brandon Thomas c49bbd299a analytics queries for category assignments 2023-01-20 05:42:54 -05:00
Brandon Thomas 993fe647b4 remove whitespace from TTS model titles 2023-01-20 03:27:39 -05:00
Brandon Thomas d46778569c Add Arabic and Turkish language support (serverside) 2023-01-20 03:25:17 -05:00
Brandon Thomas 2ea0e1450c Sort tts models returned by category membership endpoint 2023-01-18 01:01:29 -05:00
Brandon Thomas b31bafd639 split up heavy category endpoint into modules 2023-01-17 23:58:53 -05:00
Brandon Thomas 9246ab83cf sort models in category flag 2023-01-17 21:39:23 -05:00
Brandon Thomas 93b06bd8b5 rename synthetic categories 2023-01-17 21:32:22 -05:00
Brandon Thomas 271bce9815 fix trending voices with hack 2023-01-17 07:28:10 -05:00
Brandon Thomas f0bebc6135 ugh, docker typo 2023-01-17 06:39:00 -05:00
Brandon Thomas 98ce37d9a4 re-codegen db 2023-01-17 05:55:29 -05:00
Brandon Thomas b0bc019db2 Merge pull request #27 from storytold/bt-trending-voices
Bt trending voices
2023-01-17 05:50:22 -05:00
Brandon Thomas f3c34d9a7b Trending voices / job 2023-01-17 05:49:23 -05:00
Brandon Thomas 98c8bbda57 Trending voices / analytics table 2023-01-16 16:28:17 -05:00
Brandon Thomas 18b20d6c4d cleanup analytics queries 2023-01-16 16:15:42 -05:00
Brandon Thomas 11fd4881ea re-codegen 2023-01-16 04:57:25 -05:00
Brandon Thomas 7ab39d0b5c Merge pull request #26 from storytold/bt-categories
Work on synthetic categories; "latest models" category
2023-01-16 04:22:39 -05:00
Brandon Thomas 77e16d4bd8 synthetic categories 2023-01-16 04:21:19 -05:00
Brandon Thomas 58c7695a2a Refactor enums 2023-01-16 01:56:38 -05:00
Brandon Thomas 140c93fc76 Work on categories 2023-01-16 01:37:24 -05:00
Brandon Thomas 2b58e3c32d Emit server build SHA from /_status endpoint 2023-01-15 01:40:58 -05:00
Brandon Thomas 142adf10ee ugh, that was stupid af 2023-01-15 01:24:39 -05:00
Brandon Thomas d1698ead1d fix build arg? 2023-01-15 01:24:03 -05:00
Brandon Thomas 2909e2dbb4 reintroduce GIT_SHA to container 2023-01-14 22:42:09 -05:00
Brandon Thomas 9015efdf9e real world language header test 2023-01-14 20:20:41 -05:00
Brandon Thomas 2a5634503f Reorganize tts category handlers 2023-01-14 19:07:57 -05:00
Brandon Thomas 623b82dd0e fix accept-language for q-factor 2023-01-14 06:54:34 -05:00
Brandon Thomas 9fbafd7fcd sqlx 0.4.x -> 0.6.x 2023-01-14 06:39:28 -05:00
Brandon Thomas cc573fe242 return even less nonessential data 2023-01-14 04:32:07 -05:00
Brandon Thomas c4225ce571 Cache computed TTS category assignments 2023-01-14 04:29:48 -05:00
Brandon Thomas 2f6747b98a Merge pull request #25 from storytold/bt-serverside-category-memberships
Compute and cache TTS model category assignments serverside
2023-01-14 00:17:03 -05:00
Brandon Thomas bc5090af54 Compute and cache TTS model category assignments serverside 2023-01-14 00:13:27 -05:00
Brandon Thomas 8062833e8d gzip response payloads 2023-01-12 05:36:14 -05:00
Paul Sajna e5a852acd6 remove rustup override from ci 2023-01-11 18:35:35 -08:00
Brandon Thomas 84ccda1960 default rustup to 1.66 2023-01-11 06:51:06 -05:00
Brandon Thomas 893a861d22 Bump to trigger rebuild (to test build caching) 2023-01-11 06:19:43 -05:00
Brandon Thomas 13b014e7fc bump rust version? 2023-01-11 05:17:41 -05:00
Brandon Thomas c8598bc9e3 Merge pull request #24 from storytold/saj-ci
CI MVP
2023-01-11 04:40:22 -05:00
Brandon Thomas ecf84c4b15 Fix codegen (for reals), notes for mac, perform codegen 2023-01-11 04:31:25 -05:00
Paul Sajna c4ea221c50 test 2023-01-11 00:37:09 -08:00
Brandon Thomas 8de1722466 fix migration script 2023-01-11 03:22:58 -05:00
Paul Sajna a716b8963f ;) 2023-01-11 00:09:39 -08:00
Paul Sajna 7f70de0148 ??? 2023-01-11 00:06:50 -08:00
Brandon Thomas bc033c2202 Merge pull request #23 from storytold/brandon-web-vc
Web-based Voice Conversion Part 1
2023-01-11 03:06:15 -05:00
Paul Sajna 756c357462 attempt to hide brandon's crimes 2023-01-10 23:57:53 -08:00
Paul Sajna 4b8c454c84 getting there? 2023-01-10 23:42:23 -08:00
Paul Sajna d2b3386fea urggggghhhhhhhh 2023-01-10 23:39:47 -08:00
Paul Sajna f458f29109 urgggggh 2023-01-10 23:38:15 -08:00
Paul Sajna aa3faca551 another test 2023-01-10 23:36:50 -08:00
Paul Sajna 2512810e81 another test 2023-01-10 23:35:25 -08:00
Paul Sajna db629a6a0d WIP for testing if github actions has mysql 2023-01-10 23:33:48 -08:00
Brandon Thomas 30202e6e5a Fix build errors. This is largely because inference_job is not done 2023-01-11 01:39:48 -05:00
Brandon Thomas 9a263a01a1 more reserved words 2023-01-11 00:33:40 -05:00
Brandon Thomas 85ae704ab5 more analytics queries 2023-01-11 00:33:40 -05:00
Brandon Thomas b128cdb3f5 inference job handlers 2023-01-11 00:33:40 -05:00
Brandon Thomas 8755e7a533 generic inference job queries 2023-01-11 00:33:40 -05:00
Brandon Thomas 9f873c33e7 Begin refactor of generic inference-job 2023-01-11 00:33:40 -05:00
Brandon Thomas 81302d0e1d Payload for voice conversion inference records 2023-01-11 00:33:40 -05:00
Brandon Thomas 9e589c2b72 Refactor - db enum types into enums crate 2023-01-11 00:33:40 -05:00
Brandon Thomas 7a33c0721a enqueue webvc inference work 2023-01-11 00:33:40 -05:00
Brandon Thomas e1793d71b5 enqueue voice conversion request handler, media synthetic ids, ... 2023-01-11 00:33:40 -05:00
Brandon Thomas 5b20710f96 Upload file to GCS bucket 2023-01-11 00:33:40 -05:00
Brandon Thomas 77e1319b81 'crockford' crate, use crockford entropy for bucket 2023-01-11 00:33:40 -05:00
Brandon Thomas 8061880a83 consolidate upload handling, use new bucket paths 2023-01-11 00:33:40 -05:00
Brandon Thomas 651ed42b64 New 'buckets' crate for cloud storage uploads 2023-01-11 00:33:40 -05:00
Brandon Thomas e870d6f4de rename storage_buckets_common crate -> cloud_storage 2023-01-11 00:33:40 -05:00
Brandon Thomas 16a2e765ca Handle video formats, too 2023-01-11 00:33:40 -05:00
Brandon Thomas ee7626602a Calculate duration for audio files without metadata 2023-01-11 00:33:40 -05:00
Brandon Thomas 533cd5e051 Tests + test data for media uploads 2023-01-11 00:33:40 -05:00
Brandon Thomas 7f51ccd01b file size bytes 2023-01-11 00:33:40 -05:00
Brandon Thomas f2bfcfeb75 audio codec/encoding 2023-01-11 00:33:40 -05:00
Brandon Thomas 603a678378 new errors crate, cleanup media duration calculation 2023-01-11 00:33:40 -05:00
Brandon Thomas 1ba3215881 organize media/files crates 2023-01-11 00:33:40 -05:00
Brandon Thomas c4c5b89118 Calculate audio duration millis 2023-01-11 00:33:40 -05:00
Brandon Thomas 9aaee506ed hash uploaded file 2023-01-11 00:33:40 -05:00
Brandon Thomas ff12990b01 sort _types crates at the top 2023-01-11 00:33:40 -05:00
Brandon Thomas 45b7af9bd2 detect upload mimetype 2023-01-11 00:33:39 -05:00
Brandon Thomas a34aedc375 move sqlx impls to reusable macro 2023-01-11 00:33:39 -05:00
Brandon Thomas cb1e092ccd tests on derived Display/Debug 2023-01-11 00:33:39 -05:00
Brandon Thomas 07d13a4ab5 proper case for enum mysql insert 2023-01-11 00:33:39 -05:00
Brandon Thomas 43c890b27c Hack for sqlx to insert enums into varchar, but case still wrong 2023-01-11 00:33:39 -05:00
Brandon Thomas a1510d45b2 Media uploads "working" from frontend. Need to handle file + upload 2023-01-11 00:33:39 -05:00
Brandon Thomas 32c7354798 Get rid of super legacy CreatorSetVisibility 2023-01-11 00:33:39 -05:00
Brandon Thomas 31bb03d9d3 Sayonara, RecordVisibility 2023-01-11 00:33:39 -05:00
Brandon Thomas 66bb76e60f Goodbye, 'EntityVisibility' 2023-01-11 00:33:39 -05:00
Brandon Thomas 68f2e46540 more tests on enum types 2023-01-11 00:33:39 -05:00
Brandon Thomas d08d3cd543 New 'enums' crate for db "enum-like" fields, composite keys, etc.
This should be useful for:

- Actual enum fields
- Enum-like char/varchar fields
- Composite keys, polymorphic record behavior, etc.

This should also define how these values are returned over the HTTP API
2023-01-11 00:33:39 -05:00
Brandon Thomas e7fc93de86 Mild refactor: tokens, reusable_types under types/ directory 2023-01-11 00:33:39 -05:00
Brandon Thomas deb3671be6 Endpoint for audio uploading 2023-01-11 00:33:39 -05:00
Brandon Thomas 8591f74ff2 Look at "started" w2l jobs too 2023-01-11 00:33:39 -05:00
Brandon Thomas 26587e51e3 More "analytics" (more operational) queries for w2l jobs 2023-01-11 00:33:39 -05:00
Brandon Thomas 2fad965446 "analytics" query to soft delete tts results for a given model 2023-01-11 00:33:39 -05:00
Brandon Thomas c2f4c2c057 Fix hifigan (softvc) model check 2023-01-11 00:33:39 -05:00
Brandon Thomas 51350e6e5c default parameters for local download job 2023-01-11 00:33:39 -05:00
Brandon Thomas 5f598dc516 Fix download-job queries and compile errors 2023-01-11 00:33:39 -05:00
Brandon Thomas 7bcde1e490 queries to handle softvc download (insert) 2023-01-11 00:33:39 -05:00
Brandon Thomas 13d00f6edf partially handle softvc model downloads 2023-01-11 00:33:39 -05:00
Brandon Thomas 91695cde00 downloader job: handle softvc hifigan 2023-01-11 00:33:39 -05:00
Brandon Thomas 91ac868369 new download types 2023-01-11 00:33:39 -05:00
Brandon Thomas 60af0ea36d enum refactor, whew 2023-01-11 00:33:39 -05:00
Brandon Thomas 46280c7877 3x voice conversion tables (models, results, synthetic_ids) 2023-01-11 00:33:39 -05:00
Brandon Thomas 08c2736ea4 More new tables: media_uploads, audit_logs 2023-01-11 00:33:39 -05:00
Brandon Thomas 02bf8808d0 Web + Job queries for generic_inference_jobs 2023-01-11 00:33:39 -05:00
Brandon Thomas 1de10d1b9f Move all service/web/job projects into grouped subdirectories by type 2023-01-11 00:33:39 -05:00
Brandon Thomas b649bb17c5 Web Voice Conversion 2023-01-11 00:33:39 -05:00
Brandon Thomas 587ea70d33 Merge pull request #22 from storytold/sajattack-kubernetes-localdev
Kubernetes localdev
2023-01-10 22:17:23 -05:00
Paul Sajna ffd7793a8d Update local_development_k8s.md 2023-01-10 19:12:27 -08:00
Paul Sajna 6e13777e84 docs? 2023-01-10 18:59:01 -08:00
Paul Sajna b7fd9aa8d1 x86_64-unknown-linux-musl compatibility and volume mount 2023-01-10 18:59:01 -08:00
Paul Sajna 26e91bd990 database migration bugfix 2023-01-10 18:59:01 -08:00
Paul Sajna 61d0cbd385 clean up something I was trying that I no longer need 2023-01-10 18:59:01 -08:00
Paul Sajna 28d7a26d97 storyteller-web api runs successfully 2023-01-10 18:59:01 -08:00
Brandon Thomas 4196a6499b fix download url check 2022-12-19 19:14:19 -05:00
Brandon Thomas 2cf07c1346 Block uploads of invalid video urls for w2l 2022-12-19 18:02:30 -05:00
Brandon Thomas f56ea64dce automate ubuntu setup 2022-12-15 03:59:28 -05:00
Brandon Thomas 5cfb3f50d7 codegen db 2022-12-13 20:52:41 -05:00
Brandon Thomas 5e0851eb09 fix session / loyalty plan test; mark legacy tokens deprecated 2022-12-13 18:42:18 -05:00
Brandon Thomas 0d3ffd3f3b use DownloadJobToken throughout codebase 2022-12-13 18:26:45 -05:00
Brandon Thomas 1b60427ab0 Add UserToken-specific tests so we have a backup in case the macro fails 2022-12-13 18:05:35 -05:00
Brandon Thomas 75ede876d5 More tests 2022-12-13 17:46:46 -05:00
Brandon Thomas 086980318c use enum variants for prefixes 2022-12-13 17:08:12 -05:00
Brandon Thomas c4ca48f399 prefix registry 2022-12-13 16:50:23 -05:00
Brandon Thomas ad88800b4e enum variants to control character set 2022-12-13 15:43:19 -05:00
Brandon Thomas 64e3864140 Macro-defined tests "kind of" work. 2022-12-13 15:32:23 -05:00
Brandon Thomas 81757870ab Crockford constructor 2022-12-13 02:22:23 -05:00
Brandon Thomas 2769a0b3f9 macro to implement common string token methods 2022-12-13 01:27:29 -05:00
Brandon Thomas 89e721e3bc derive serde traits 2022-12-13 00:20:49 -05:00
Brandon Thomas 353aa4211b more tests 2022-12-13 00:16:44 -05:00
Brandon Thomas 422e36b405 add tests 2022-12-12 23:54:09 -05:00
Brandon Thomas 110c7f828f simplify UserToken type as a wrapper type 2022-12-12 23:16:44 -05:00
Brandon Thomas b9e2c87025 use UserToken in an existing flow 2022-12-12 22:44:04 -05:00
Brandon Thomas b1d5244620 WIP tokens crate 2022-12-12 22:34:08 -05:00
Brandon Thomas 7bcb576436 also track subscription status 2022-12-07 18:09:13 -05:00
Brandon Thomas 2e561acbb4 Analytics over top contributors, change loyalty plan slug 2022-12-07 18:05:40 -05:00
Brandon Thomas c1860a0584 add powerstream to reserved usernames 2022-12-07 16:39:40 -05:00
Brandon Thomas 70140c0e7d new slurs I just found 2022-12-07 16:38:27 -05:00
Brandon Thomas cc56deb27c UserBadge moved to reusable_types 2022-12-06 06:39:10 -05:00
Brandon Thomas a15324adee CORS separation by environments + tests 2022-12-04 02:40:28 -05:00
Brandon Thomas fa108a5303 Add more german languages, fix failing test time bomb 2022-12-03 23:25:08 -05:00
Brandon Thomas 7193ddf18b Fix codegen, codegen db, and update docs for dev db setup 2022-12-03 22:30:57 -05:00
Brandon Thomas 21e74c5367 Fix build error with tts-download-job 2022-12-03 17:46:50 -05:00
Brandon Thomas 11304d77cb Italian TTS 2022-12-03 17:42:46 -05:00
Brandon Thomas ba52695f35 root directory option for downloader 2022-12-01 21:52:52 -05:00
Brandon Thomas d28fb07d6d Clean up new consolidated downloader so it can be deployed 2022-12-01 21:44:32 -05:00
Brandon Thomas 740b419989 codegen script for download job and inference job 2022-11-27 16:56:45 -05:00
Brandon Thomas 8f2640c5eb relabel docker image 2022-11-27 16:21:22 -05:00
Brandon Thomas 6e7c708374 Duplicate tts-inference-job into inference-job 2022-11-27 16:07:29 -05:00
Brandon Thomas 7b0066bea5 Bugfix; download-job handles TTS model download (locally tested) 2022-11-27 05:17:02 -05:00
Brandon Thomas 3d3dec1e23 download job can now handle tacotron (untested) 2022-11-27 04:37:49 -05:00
Brandon Thomas 1ac61b7748 GPU support for docker commands 2022-11-27 03:28:30 -05:00
Brandon Thomas 24c9cc2d08 subprocess stuff in its own lib 2022-11-27 03:10:01 -05:00
Brandon Thomas 2392062276 Download script works with docker image 2022-11-27 02:45:17 -05:00
Brandon Thomas 94c74eb9e0 Refactor download job to be easier to generalize 2022-11-26 21:44:41 -05:00
Brandon Thomas 7f5ccac55c rename generic-download-job -> download-job 2022-11-26 20:41:13 -05:00
Brandon Thomas 62c4f2cbe0 Merge branch 'master' of github.com:storytold/storyteller-rust 2022-11-19 02:56:38 -05:00
Brandon Thomas 507f97bef5 note on subscription statuses 2022-11-18 05:27:53 -05:00
Brandon Thomas a628e986e5 analytics query 2022-11-18 05:14:48 -05:00
Brandon Thomas 2fdd3b38ea codegen 2022-11-17 21:45:02 -05:00
Brandon Thomas a3234b3cb4 Add max_decoder_steps / max_duration_seconds to tts job 2022-11-17 21:41:16 -05:00
Brandon Thomas dbf3d541e2 Production plans 2022-11-16 06:05:59 -05:00
Brandon Thomas f690c73ebf Force environmental plans 2022-11-16 05:42:18 -05:00
Brandon Thomas 567f3143d4 fix test failure 2022-11-16 04:16:42 -05:00
Brandon Thomas 2416056f6f list subscriptions endpoint 2022-11-16 03:10:07 -05:00
Brandon Thomas e390a7d1ac fix endpoint to accept json 2022-11-16 01:28:23 -05:00
Brandon Thomas 00ab91b05c new development stripe plan, minor method name refactor 2022-11-15 23:31:30 -05:00
Brandon Thomas b403ed7c9e Customer portal JSON handler 2022-11-15 19:07:42 -05:00
Brandon Thomas 049b0cf375 rename directory 2022-11-14 21:36:07 -05:00
Brandon Thomas 0e6657e9b7 fix short sha tagging? 2022-11-14 11:13:10 -05:00
Brandon Thomas acdea58a81 tag with short SHA 2022-11-14 11:12:19 -05:00
Brandon Thomas 9711a60494 test build caching of leaf dependency 2022-11-14 05:51:02 -05:00
Brandon Thomas 8edbb3efda revert dockerfile 2022-11-14 04:51:25 -05:00
Brandon Thomas 87b319b99a tagging image again (this might work) 2022-11-14 04:46:49 -05:00
Brandon Thomas ed6f19c2ab test image tagging 2022-11-14 04:39:01 -05:00
Brandon Thomas 31fc96c356 attempt to tag image 2022-11-14 04:35:26 -05:00
Brandon Thomas 4b6eab5a1d fix image name? 2022-11-14 04:33:31 -05:00
Brandon Thomas 6af1234095 attempt to fix github action build (temporarily broke dockerfile) 2022-11-14 04:31:18 -05:00
Brandon Thomas 8132a0bcb0 Attempt to use build caching 2022-11-14 03:55:57 -05:00
Brandon Thomas c679aa3430 Clean up dockerfile, add notes 2022-11-14 03:07:19 -05:00
Brandon Thomas 33485670dd Remove Python models (see storyteller-ml repo), rework Dockerfile
- TTS and W2L were moved to storyteller-ml. TTS has been hosted there
  for a while, but W2L will need to be reworked.

- Restructure Dockerfile to remove old Python deps.

- Also begin using "cargo-chef". Unsure if this will work to speed things up.
2022-11-14 00:39:41 -05:00
Brandon Thomas 9008e7c044 codegen 2022-11-13 23:09:31 -05:00
Brandon Thomas 2d2a0b68ff fix errors from last yolo-commit 2022-11-13 17:37:12 -05:00
Brandon Thomas a211d45f26 on-prem worker stats 2022-11-13 16:42:18 -05:00
Brandon Thomas d20d8a4c1c Not a slur 2022-11-13 16:14:30 -05:00
Brandon Thomas 9aec48d237 placeholder 2022-11-07 12:47:38 -05:00
Brandon Thomas e4835258cb deletion queries 2022-11-02 23:24:35 -04:00
Brandon Thomas f34fd6fc4c re-codegen tts job queries 2022-11-02 23:02:20 -04:00
Brandon Thomas 413d1b7c1c Merge pull request #21 from storytold/tts-job-debugging
Log failure metadata for TTS inference jobs
2022-11-02 22:54:25 -04:00
Brandon Thomas fb99af8a23 Log failure metadata for TTS inference jobs 2022-11-02 22:51:47 -04:00
Brandon Thomas 23b0dab44f re-codegen sqlx 2022-11-02 16:41:03 -04:00
Brandon Thomas 8ee5eca076 Add debugging info to tts_inference_jobs table; move app routes 2022-11-02 16:28:45 -04:00
Brandon Thomas 9a1df0cd8c Merge pull request #20 from storytold/premium-tts
Premium tts
2022-11-02 05:28:54 -04:00
Brandon Thomas 5377cca3b1 TTS now has premium features 2022-11-02 04:36:19 -04:00
Brandon Thomas badcb4b058 Migrations to add duration controls to inference jobs 2022-11-02 00:36:36 -04:00
Brandon Thomas 28a4f5ca8d Merge pull request #19 from storytold/subscription-schema-migrations-2
Migrations to change/rename some columns
2022-11-01 23:39:23 -04:00
Brandon Thomas 3efe1afa48 Migrations to change/rename some columns 2022-11-01 23:33:59 -04:00
Brandon Thomas d4a7c06f72 Merge pull request #18 from storytold/premium-plans-sessions
Premium plans sessions
2022-11-01 06:56:19 -04:00
Brandon Thomas 6b4d0b3ad1 Adding premium info to sessions 2022-11-01 06:39:59 -04:00
Brandon Thomas 23f6e74fd8 ugh, a gross refactor commit 2022-11-01 03:19:08 -04:00
Brandon Thomas 778d7eba7e Premium plans + session changes 2022-11-01 01:54:07 -04:00
Brandon Thomas e5db702289 SSL local dev instructions 2022-10-31 01:46:31 -04:00
Brandon Thomas 4eb400867a Merge pull request #17 from storytold/url-configs
Url configs
2022-10-31 01:32:38 -04:00
Brandon Thomas 4584e9dbcf Cors and local nginx configs for dev.fakeyou.com etc. 2022-10-31 01:31:46 -04:00
Brandon Thomas 2ca477fd8c Better environment-based URL configuration 2022-10-31 00:07:34 -04:00
Brandon Thomas 13487a9046 Fix bug with upsert not changing the product key 2022-10-30 05:25:22 -04:00
Brandon Thomas aff94446ac Merge pull request #16 from storytold/stripe-customer-portal
Stripe customer portal (subscription cancellation / modification)
2022-10-30 05:04:36 -04:00
Brandon Thomas 15c9c1256b Stripe customer portal (subscription cancellation / modification) 2022-10-30 04:57:10 -04:00
Brandon Thomas 009d0eab87 CLI crates
(was building a stripe tool, but need to remember to make DB tools)
2022-10-29 22:20:26 -04:00
Brandon Thomas 0d9a882f3f Refactor stripe component modules 2022-10-27 04:36:43 -04:00
Brandon Thomas 4c878e332e upgrade breaking transitive dependency? 2022-10-25 05:13:24 -04:00
Brandon Thomas d22242ab69 Merge pull request #15 from storytold/product-integration-2
Continued work on product integration
2022-10-25 05:03:19 -04:00
Brandon Thomas 5ee51ed8e2 Continued work on product integration 2022-10-25 05:02:52 -04:00
Brandon Thomas 560448f1ad Merge pull request #14 from storytold/product-integration
Integrate stripe / product crate
2022-10-24 23:03:27 -04:00
Brandon Thomas 1b40495ef3 Integrate stripe / product crate
Associates internal metadata with stripe subscription and better
composes both systems
2022-10-24 23:02:16 -04:00
Brandon Thomas e8d376a3eb Merge pull request #13 from storytold/premium-plans
Premium plan definitions
2022-10-23 00:44:34 -04:00
Brandon Thomas 8e6c02d1b1 Premium plan definitions 2022-10-23 00:43:53 -04:00
Brandon Thomas 4e4dbf0688 Premium plans config (just getting started on this) 2022-10-21 19:18:37 -04:00
Brandon Thomas 1ca54927d7 fix compile errors 2022-10-21 03:19:28 -04:00
Brandon Thomas ddd29ada80 This appears to fix openssl!? Transitive dep update. 2022-10-21 03:17:00 -04:00
Brandon Thomas 5ef27bb86f Merge pull request #12 from storytold/tts-failure-slowdown
Slow down jobs on repeated failures
2022-10-21 00:46:34 -04:00
Brandon Thomas c03bdba0a6 Slow down jobs on repeated failures 2022-10-21 00:46:00 -04:00
Brandon Thomas 14432e9808 Fix build errors (couldn't run build on Linux due to SSL breaks) 2022-10-09 06:06:56 -04:00
Brandon Thomas 1204ac5399 Merge pull request #11 from storytold/desktop-app-api-stubs
Stub API for the desktop app
2022-10-09 05:47:39 -04:00
Brandon Thomas 468d2d1d75 stupid time bomb 2022-10-09 05:46:49 -04:00
Brandon Thomas aac2af635b Stub API for the desktop app 2022-10-09 05:45:11 -04:00
Brandon Thomas 90c96b5f50 codegen from mac (broken on Ubuntu?) 2022-10-09 04:47:32 -04:00
Brandon Thomas 207e63a5aa Merge pull request #10 from storytold/echelon-stripe
merge incomplete arc of work
2022-10-09 03:50:06 -04:00
Brandon Thomas 399ed6cb2e fscking sqlx and ubuntu 22.04 ssl - wtf
I can't link against Ubuntu 22.04 native tls

I can't get rustls to work

wtf
2022-10-09 03:48:23 -04:00
Brandon Thomas d51d6720e6 Setup on a more modern Ubuntu 2022-10-09 02:58:16 -04:00
Brandon Thomas 8f807a7719 wip 2022-09-22 05:36:16 -04:00
Brandon Thomas c8ba2d1863 include price, make adjustments to subscription product/price 2022-09-19 06:30:49 -04:00
Brandon Thomas 2f3cbd4523 handle terminated subscriptions 2022-09-19 05:16:56 -04:00
Brandon Thomas cf7cd9945d Handle grace period days 2022-09-19 04:39:51 -04:00
Brandon Thomas 6a2a99741e cancel_at_period_end and new test 2022-09-19 04:35:59 -04:00
Brandon Thomas dc115a7aa1 begin handling deleted subscriptions 2022-09-19 04:18:08 -04:00
Brandon Thomas 6ea1bf3226 handle events with idempotency by ignoring replays 2022-09-19 04:11:35 -04:00
Brandon Thomas 334fc3022e record whether webhook events had actions taken, idempotency flag 2022-09-19 03:54:32 -04:00
Brandon Thomas 3fb26771de subscription interval tracked 2022-09-19 03:35:30 -04:00
Brandon Thomas ba448ccc50 record subscription billing periods, start date 2022-09-19 02:09:35 -04:00
Brandon Thomas fd3081e440 Track status as an enum, don't update at terminal state 2022-09-19 01:36:01 -04:00
Brandon Thomas 66981c4d2c Track subscription status 2022-09-19 00:26:16 -04:00
Brandon Thomas c6a1fc18d6 coalesce nulls 2022-09-19 00:12:21 -04:00
Brandon Thomas afb77393c0 Don't update on create if already existing, make user token optional 2022-09-19 00:02:52 -04:00
Brandon Thomas a2e71d8944 Handle subscription update and create 2022-09-18 23:26:39 -04:00
Brandon Thomas ca63e00905 user subscriptions 2022-09-18 19:52:11 -04:00
Brandon Thomas faf689dc09 log more info from webhooks 2022-09-17 13:33:22 -04:00
Brandon Thomas aec31779b8 store webhook logs 2022-09-17 13:02:10 -04:00
Brandon Thomas 452a3473b3 WIP schema 2022-09-17 12:06:21 -04:00
Brandon Thomas 00322c6ed4 tests 2022-09-12 06:53:16 -04:00
Brandon Thomas 6dd02d48c4 extractor 2022-09-12 06:33:20 -04:00
Brandon Thomas 2eaf7c499e subscription extractor 2022-09-11 22:18:43 -04:00
Brandon Thomas 3b82e7a389 tests 2022-09-11 21:37:40 -04:00
Brandon Thomas c825f17672 wip 2022-09-11 03:40:18 -04:00
Brandon Thomas 6bbf4453da notes 2022-09-10 20:11:49 -04:00
Brandon Thomas dda247b5ea Handle payment intent success 2022-09-10 18:57:13 -04:00
Brandon Thomas f0435804ec one-time payment 2022-09-10 18:24:45 -04:00
Brandon Thomas 176feda73b wip 2022-09-10 17:41:45 -04:00
Brandon Thomas f81d40b5bb Make logging less verbose 2022-09-10 05:42:50 -04:00
Brandon Thomas c07f100986 wip 2022-09-10 04:26:24 -04:00
Brandon Thomas 9feded54bd most of the events we want 2022-09-10 04:26:24 -04:00
Brandon Thomas 4acec068aa asdhfahsdf 2022-09-10 04:26:24 -04:00
Brandon Thomas e1d4c0f5f3 ugh, I hate this part of the project 2022-09-10 04:26:24 -04:00
Brandon Thomas f066658c3c Move in-progress Stripe / billing work to shared component crate 2022-09-10 04:26:24 -04:00
Brandon Thomas 17021f04b9 fml payments 2022-09-10 04:26:24 -04:00
Brandon Thomas 0e5b4599bb stripe wip 2022-09-10 04:26:24 -04:00
Brandon Thomas 02e7d1f4fa Stripe WIP 2022-09-10 04:26:24 -04:00
Brandon Thomas 360a389e3d Add stripe payments support 2022-09-10 04:26:22 -04:00
Brandon Thomas 999d73db81 analytics queries 2022-09-10 00:53:25 -04:00
Brandon Thomas ec1f5edd5c on-prem analytics queries 2022-09-09 14:40:41 -04:00
Brandon Thomas 2bc00dd6ca comment describing why to include this in the dockerfile 2022-09-09 14:11:08 -04:00
Brandon Thomas 6e6253bf86 dockerfile fixes? 2022-09-09 04:41:48 -04:00
Brandon Thomas 97e6fdc51b Downgrade docker rust build Ubuntu 22.04 -> 20.04 for openssl bug 2022-09-09 04:01:43 -04:00
Brandon Thomas 3cb9afa074 Update Dockerfile to point to new base Rust image 2022-09-09 02:26:38 -04:00
Brandon Thomas 34d08bce61 Not sure what recently broke with the dockerfile. Print Rust versions 2022-09-09 01:25:49 -04:00
Brandon Thomas 3b3603d7cf How did I forget to include the lock file? ugh. 2022-09-09 01:09:44 -04:00
Brandon Thomas ab0180a591 Update s3 bucket client to respect timeout arg 2022-09-09 00:45:44 -04:00
Brandon Thomas 40e92a1b24 Use no-op Redis status logger optionally 2022-09-08 15:22:52 -04:00
Brandon Thomas bf9bc013df New dynamic job progress reporter with no-op version 2022-09-08 14:56:35 -04:00
Brandon Thomas 4a58f49d3d kill pending jobs 2022-09-04 21:34:50 -04:00
Brandon Thomas da7270e058 Queries to investigate service load, etc. 2022-09-04 19:22:02 -04:00
Brandon Thomas 420a2c8b40 fix gravatar test 2022-09-01 23:49:17 -04:00
Brandon Thomas d1e261e633 no longer fail tests (timebomb bump) 2022-09-01 23:43:31 -04:00
Brandon Thomas bfe4b8d090 Merge pull request #9 from storytold/echelon-billing-and-images
Pull user system into a reusable component library
2022-09-01 23:40:32 -04:00
Brandon Thomas 269145a395 codegen db 2022-09-01 23:38:51 -04:00
Brandon Thomas 22122046ce We're not ready to perform this migrations
I'm being lazy and not pulling the relevant commits out of history
2022-09-01 23:35:43 -04:00
Brandon Thomas 4284aeced6 Substantial refactor: pull user system (except mod controls) into crate
This has been tested in storyteller-web to ensure it still works
2022-09-01 23:33:21 -04:00
Brandon Thomas d047fa50a9 Successfully move one "user" endpoint into new package 2022-09-01 17:25:13 -04:00
Brandon Thomas 273b5f3c4e Move SessionCookieManager to users component 2022-08-29 05:39:00 -04:00
Brandon Thomas 3477cc395b refactor 2022-08-29 04:49:51 -04:00
Brandon Thomas 59f2c4a55d service stub for image-generation-service 2022-08-29 00:56:38 -04:00
Brandon Thomas 84c616b6f6 New lib and service crates 2022-08-29 00:28:26 -04:00
Brandon Thomas 57e3dd05c7 generated image data 2022-08-28 19:52:01 -04:00
Brandon Thomas 2b52488bfa generated images tables 2022-08-25 04:01:50 -04:00
Brandon Thomas 3d2f28431f add credits tables 2022-08-23 13:09:20 -04:00
Brandon Thomas f1c8364b72 First attempt at generic_workloads table 2022-08-23 10:32:09 -04:00
Brandon Thomas bb8ba60829 Initial schema migrations for generated images + billing 2022-08-23 10:07:15 -04:00
Brandon Thomas 50d6537a73 report worker node name, if available 2022-08-18 03:01:06 -04:00
Brandon Thomas e68b6dc72d Merge pull request #8 from storytold/echelon-list-tts-single-connector
Use single connector with list TTS endpoint
2022-08-17 19:42:33 -04:00
Brandon Thomas 1da020abd4 Use single connector with list TTS endpoint 2022-08-17 19:41:30 -04:00
2929 changed files with 404359 additions and 261815 deletions
+2
View File
@@ -1,9 +1,11 @@
*secret*sh
*~
.dockerignore
.env
.env-secrets
.git
.idea/
Dockerfile
__pycache__/
_ignored_schema.rs
models/Wav2Lip/python/
+15 -4
View File
@@ -1,16 +1,27 @@
SERVER_ENVIRONMENT=development
DATABASE_URL=mysql://storyteller:password@localhost/storyteller
#DATABASE_URL=mysql://root:root@localhost/storyteller
#DATABASE_URL=mysql://root@localhost/storyteller
# Diesel-cli reads this for the migration directory to use.
# We've renamed it so the migrations are sorted near the top of the project directory tree
# (since they kind of serve as documentation)
MIGRATION_DIRECTORY=_sql/migrations/
# SQLX normally requires a live database to reflect upon at build time.
# This setting turns that on and requires a `sql-data.json` cache file instead.
# See https://github.com/launchbadge/sqlx/tree/master/sqlx-cli#readme
#SQLX_OFFLINE=true
# We can't serve HTTPS locally without self-signed certificate nonsense.
COOKIE_SECURE=false
COOKIE_DOMAIN=.jungle.horse
WEBSITE_HOMEPAGE_REDIRECT=http://jungle.horse
# NB(bt, 2023-03-20):
# These are used in storyteller-web, image-generation-service, and websocket-gateway.
# I'm moving them to env configs that live under storyteller-web/.env.
# This will break the other services for now.
# # We can't serve HTTPS locally without self-signed certificate nonsense.
# COOKIE_SECURE=false
# COOKIE_DOMAIN=.jungle.horse
# WEBSITE_HOMEPAGE_REDIRECT=http://jungle.horse
# Bucket config (non-secret)
REGION_NAME=us-east1
+5
View File
@@ -0,0 +1,5 @@
# Ignore certain code for Github language statistics
# https://github.com/github/linguist/blob/master/docs/overrides.md
old_code/trumpet-trumped.com/dictionary/cmudict-0.7b linguist-vendored
old_code/voder-vocodes-1.0/frontends/admin/node_modules linguist-vendored
windows/sqlite linguist-vendored
+115
View File
@@ -0,0 +1,115 @@
# Adapted from
# https://github.com/actions/starter-workflows/ci/docker-publish.yml
# If using base images, don't forget to add READ access, eg. from a package settings page like:
# https://github.com/orgs/storytold/packages/container/docker-base-images-rust-ssl/settings/actions_access
name: "[CPU] Build GHCR Docker artifact"
on:
push:
branches:
# NB: Default-branch doesn't work, despite Github's documentation.
#- $default-branch
- master
env:
IMAGE_NAME: storyteller-rust
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
# See also https://depot.dev/blog/docker-layer-caching-in-github-actions
# See also https://evilmartians.com/chronicles/build-images-on-github-actions-with-docker-layer-caching
build-docker-image:
name: "Build Docker Image"
#runs-on: ubuntu-22.04 # runs-on: ubuntu-latest
#runs-on: github-ubuntu-16core # NB: Premium GitHub runner with more cores
runs-on: github-ubuntu-64core # NB: Premium GitHub runner with more cores
if: github.event_name == 'push'
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
# - uses: docker/setup-buildx-action@v1
# name: Set up Docker Buildx
- uses: docker/login-action@v1
name: Login to GitHub Container Registry
with:
registry: ghcr.io
username: ${{ github.actor }} # username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Calculate short SHA
id: vars
# echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
run: |
echo "sha_short=$(echo ${{ github.sha }} | cut -c1-12)" >> $GITHUB_OUTPUT
- name: Emit short SHA
run: |
echo "Full SHA: ${{ github.sha }}"
echo "Short SHA: ${{ steps.vars.outputs.sha_short }}"
#- uses: actions/cache@v2
# name: Cache Docker layers
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-buildx-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-buildx-
# Docs for this action are at https://github.com/marketplace/actions/build-docker-images-using-cache
- uses: whoan/docker-build-with-cache-action@v6
with:
registry: ghcr.io
username: ${{ github.actor }} # username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
image_name: storytold/storyteller-rust
dockerfile: service_cpu.Dockerfile
# NB: The `git_push_tag: true` option does not work as expected, so we put the sha in `image_tag`:
# https://github.com/whoan/docker-build-with-cache-action/issues/72
image_tag: latest,${{ github.sha }},${{ steps.vars.outputs.sha_short }}
# NB: Inject the Git SHA into the container so the servers can emit their own version:
build_extra_args: "--build-arg=GIT_SHA=${{ github.sha }}"
# - name: Build image
# run: |
# SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-12)
# docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" --build-arg GIT_SHA=${SHORT_SHA}
# - name: Push image to GitHub Container Registry
# run: |
# IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# # Change all uppercase to lowercase
# IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# # Strip git ref prefix from version
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# # Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# # Use Docker `latest` tag convention
# [ "$VERSION" == "$default-branch" ] && VERSION=latest
# echo IMAGE_ID=$IMAGE_ID
# echo VERSION=$VERSION
# docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
# docker push $IMAGE_ID:$VERSION
# SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-12)
# docker tag $IMAGE_NAME $IMAGE_ID:$SHORT_SHA
# docker push $IMAGE_ID:$SHORT_SHA
- name: Cleanup / Debug
# This job will run even on failures to help with debugging.
if: always()
run: |
echo "Report at final github action step:"
echo "Disk usage:"
pwd
du -hsc * | sort -hr
+115
View File
@@ -0,0 +1,115 @@
# Adapted from
# https://github.com/actions/starter-workflows/ci/docker-publish.yml
# If using base images, don't forget to add READ access, eg. from a package settings page like:
# https://github.com/orgs/storytold/packages/container/docker-base-images-rust-ssl/settings/actions_access
name: "[GPU] Build GHCR Docker artifact"
on:
push:
branches:
# NB: Default-branch doesn't work, despite Github's documentation.
#- $default-branch
- master
env:
IMAGE_NAME: storyteller-rust-gpu
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
# See also https://depot.dev/blog/docker-layer-caching-in-github-actions
# See also https://evilmartians.com/chronicles/build-images-on-github-actions-with-docker-layer-caching
build-docker-image:
name: "Build Docker Image"
#runs-on: ubuntu-22.04 # runs-on: ubuntu-latest
#runs-on: github-ubuntu-16core # NB: Premium GitHub runner with more cores
runs-on: github-ubuntu-64core # NB: Premium GitHub runner with more cores
if: github.event_name == 'push'
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
# - uses: docker/setup-buildx-action@v1
# name: Set up Docker Buildx
- uses: docker/login-action@v1
name: Login to GitHub Container Registry
with:
registry: ghcr.io
username: ${{ github.actor }} # username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Calculate short SHA
id: vars
# echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
run: |
echo "sha_short=$(echo ${{ github.sha }} | cut -c1-12)" >> $GITHUB_OUTPUT
- name: Emit short SHA
run: |
echo "Full SHA: ${{ github.sha }}"
echo "Short SHA: ${{ steps.vars.outputs.sha_short }}"
#- uses: actions/cache@v2
# name: Cache Docker layers
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-buildx-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-buildx-
# Docs for this action are at https://github.com/marketplace/actions/build-docker-images-using-cache
- uses: whoan/docker-build-with-cache-action@v6
with:
registry: ghcr.io
username: ${{ github.actor }} # username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
image_name: storytold/storyteller-rust-gpu
dockerfile: service_gpu.Dockerfile
# NB: The `git_push_tag: true` option does not work as expected, so we put the sha in `image_tag`:
# https://github.com/whoan/docker-build-with-cache-action/issues/72
image_tag: latest,${{ github.sha }},${{ steps.vars.outputs.sha_short }}
# NB: Inject the Git SHA into the container so the servers can emit their own version:
build_extra_args: "--build-arg=GIT_SHA=${{ github.sha }}"
# - name: Build image
# run: |
# SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-12)
# docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" --build-arg GIT_SHA=${SHORT_SHA}
# - name: Push image to GitHub Container Registry
# run: |
# IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# # Change all uppercase to lowercase
# IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# # Strip git ref prefix from version
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# # Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# # Use Docker `latest` tag convention
# [ "$VERSION" == "$default-branch" ] && VERSION=latest
# echo IMAGE_ID=$IMAGE_ID
# echo VERSION=$VERSION
# docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
# docker push $IMAGE_ID:$VERSION
# SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-12)
# docker tag $IMAGE_NAME $IMAGE_ID:$SHORT_SHA
# docker push $IMAGE_ID:$SHORT_SHA
- name: Cleanup / Debug
# This job will run even on failures to help with debugging.
if: always()
run: |
echo "Report at final github action step:"
echo "Disk usage:"
pwd
du -hsc * | sort -hr
-67
View File
@@ -1,67 +0,0 @@
# Adapted from
# https://github.com/actions/starter-workflows/ci/docker-publish.yml
# If using base images, don't forget to add READ access, eg. from a package settings page like:
# https://github.com/orgs/storytold/packages/container/docker-base-images-rust-ssl/settings/actions_access
name: Publish Docker Container to GHCR
on:
push:
branches:
# NB: Default-branch doesn't work, despite Github's documentation.
#- $default-branch
- master
env:
IMAGE_NAME: storyteller-rust
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
#username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: |
SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-12)
docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" --build-arg GIT_SHA=${SHORT_SHA}
- name: Push image to GitHub Container Registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "$default-branch" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-12)
docker tag $IMAGE_NAME $IMAGE_ID:$SHORT_SHA
docker push $IMAGE_ID:$SHORT_SHA
+52
View File
@@ -0,0 +1,52 @@
name: CI
on: [push, pull_request]
env:
MYSQL_URL: mysql://root:root@localhost/storyteller
DATABASE_URL: mysql://root:root@localhost/storyteller
REDIS_0_URL: redis://redisd@localhost/0
REDIS_1_URL: redis://redisd@localhost/1
DEBIAN_FRONTEND: noninteractive
jobs:
setup_build_test:
runs-on: ubuntu-20.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Setup mysql
run: |
sudo systemctl start mysql
sudo apt-get update
sudo apt-get -y install mysql-client libmysqlclient-dev
mysql -e "create user 'storyteller'@'localhost' IDENTIFIED BY 'password';" -uroot -proot
mysql -e "create database storyteller; grant all on storyteller.* to 'storyteller'@'localhost';" -uroot -proot
- name: Setup Redis
run: |
sudo apt-get -y install redis-server
sudo service redis-server start
- name: Setup Rust
run: |
rustup set profile minimal
rustup show
rustup install 1.66
rustup default 1.66
rustup show
cargo install sqlx-cli --features openssl-vendored
cargo install diesel_cli
- name: Run database migrations
run: |
# nothing to see here ;)
set +e +o pipefail
diesel migration run
set -e -o pipefail
- name: Build
run: cargo build --release
- name: Test
run: cargo test --release
+48 -11
View File
@@ -1,22 +1,59 @@
*.swo
*.swp
# Secrets are BAD!
*secret*sh
*~
.env
.env-aichatbot-secrets
.env-secrets
.idea/
__pycache__/
_ignored_schema.rs
db.secrets
db_secrets.toml
models/Wav2Lip/python/
models/tacotron2/python/
production_database_secret_connect.sh
production_database_secret_query.sh
production_database_voice_clone_report_download.sh
secrets.toml
secrets.yaml
target/
tools/.secrets
tools/db_secrets.toml
_develop/tools/.secrets
_develop/tools/db_secrets.toml
twitch_secrets.toml
crates/service/web/storyteller_web/config/storyteller-web.development-secrets.env
# New env secrets (per-app)
*-secrets.env
# Rust build directory
target/
crates/lib/database_queries/target/
crates/lib/sqlite_queries/target/
# Vim noise
*.swo
*.swp
*~
# IntelliJ/CLion noise
.idea/
# Python noise
__pycache__/
# We use diesel for DB migrations only. We don't care about its codgen.
_ignored_schema.rs
# AI Chat Sidecar has its own schema managed by diesel, but we don't care for diesel codegen.
crates/programs/aichatbot-sidecar/_ignored_schema.rs
# AI Chat sidecar's SQlite database shouldn't be checked in
crates/programs/aichatbot-sidecar/database.db
# Runtime data for the AI chatbot
runtime_data/
# Old Python virtual environments
models/Wav2Lip/python/
models/tacotron2/python/
# Stuff I want to keep around, but not commit
scraps/
# Windows build files
# These should be built by the platform
windows/sqlite/sqlite3.exp
windows/sqlite/sqlite3.lib
+31 -4
View File
@@ -1,18 +1,45 @@
<component name="ProjectDictionaryState">
<!--
Despite spellcheck dictionaries being created per-user, IntelliJ loads all of them, per:
https://stackoverflow.com/a/28151692
-->
<dictionary name="bt">
<words>
<w>arpabet</w>
<w>backfill</w>
<w>cashapp</w>
<w>cheermote</w>
<w>cidrs</w>
<w>crockford</w>
<w>culted</w>
<w>dalle</w>
<w>demuxer</w>
<w>dereferencing</w>
<w>downvote</w>
<w>fakeyou</w>
<w>ffprobe</w>
<w>greenlight</w>
<w>greenlighting</w>
<w>greenlit</w>
<w>hanashi</w>
<w>hifigan</w>
<w>hparams</w>
<w>huggingface</w>
<w>lipsync</w>
<w>pathbuf</w>
<w>replayable</w>
<w>retryably</w>
<w>scrollback</w>
<w>softvc</w>
<w>sql's</w>
<w>symphonia</w>
<w>tacotron</w>
<w>techcrunch</w>
<w>transcoded</w>
<w>transcodings</w>
<w>unpermitted</w>
<w>upserting</w>
<w>vits</w>
<w>vocoded</w>
<w>vocoder</w>
<w>vocoders</w>
<w>vocodes</w>
</words>
</dictionary>
</component>
Generated
+2898 -861
View File
File diff suppressed because it is too large Load Diff
+64 -19
View File
@@ -1,29 +1,74 @@
[workspace]
members = [
# Types: common strongly-typed tokens, ids, payloads, etc.
# Also common cloud buckets and other "strongly typed" configs.
"crates/_types/buckets",
"crates/_types/enums",
"crates/_types/reusable_types", # TODO(bt, 2022-12-21): Deprecate
"crates/_types/tokens",
# CLI tools for operations, etc.
"crates/cli/database_backup",
"crates/cli/database_cleanup",
"crates/cli/scrape_test",
# Shared libraries
"crates/lib/config",
"crates/lib/container_common",
"crates/lib/database_queries",
"crates/lib/google_drive_common",
"crates/lib/http_server_common",
"crates/lib/actix_helpers",
"crates/lib/api_clients/cloud_storage",
#"crates/lib/api_clients/fakeyou_client",
"crates/lib/api_clients/google_drive_common",
"crates/lib/api_clients/twitch_common",
"crates/lib/bootstrap",
"crates/lib/caching/memory_caching",
"crates/lib/caching/redis_caching",
"crates/lib/concurrency",
"crates/lib/crockford",
"crates/lib/datetimes",
"crates/lib/deprecated/config", # TODO(bt, 2023-02-13): Deprecate or repurpose
"crates/lib/deprecated/container_common", # TODO(bt, 2023-02-13): Pull apart and rehome pieces
"crates/lib/deprecated/http_server_common", # TODO(bt, 2023-03-20): Move useful pieces to actix_helpers
"crates/lib/envvar",
"crates/lib/errors",
"crates/lib/files/archives",
"crates/lib/files/filesys",
"crates/lib/files/hashing",
"crates/lib/files/media",
"crates/lib/files/mimetypes",
"crates/lib/idempotency",
"crates/lib/jobs_common",
"crates/lib/memory_caching",
"crates/lib/mysql_queries",
"crates/lib/redis_common",
"crates/lib/reusable_types",
"crates/lib/storage_buckets_common",
"crates/lib/server_environment",
#"crates/lib/sqlite_queries",
"crates/lib/sqlx_mysql_helpers",
"crates/lib/subprocess_common",
"crates/lib/tts_common",
"crates/lib/twitch_common",
"crates/lib/url_config",
"crates/lib/user_input_common",
"crates/lib/web_scrapers",
# Application
"crates/service/generic_download_job",
"crates/service/storyteller_web",
"crates/service/tts_download_job",
"crates/service/tts_inference_job",
"crates/service/twitch_pubsub_subscriber",
"crates/service/w2l_download_job",
"crates/service/w2l_inference_job",
"crates/service/websocket_gateway",
# Programs: Desktop apps
#"crates/programs/aichatbot-sidecar",
# Services: API servers, jobs, workers, etc.
"crates/service/job/analytics_job",
"crates/service/job/download_job",
"crates/service/job/inference_job",
"crates/service/job/tts_download_job",
"crates/service/job/tts_inference_job",
"crates/service/job/w2l_download_job",
"crates/service/job/w2l_inference_job",
"crates/service/other/twitch_pubsub_subscriber",
"crates/service/web/dummy_service",
"crates/service/web/storyteller_web",
"crates/service/web/websocket_gateway",
# Service Plugins: complete subsystems that can be plugged into services (users, billing, etc.)
"crates/service/plugins/billing",
"crates/service/plugins/inference_workloads",
"crates/service/plugins/users",
# Vendored code
"crates/vendor/newrelic-telemetry-sdk-rust",
]
+58
View File
@@ -0,0 +1,58 @@
# Persist clippy check configurations:
# https://github.com/ericseppanen/cargo-cranky
# Clippy doesn't allow this (yet):
# https://github.com/rust-lang/rust-clippy/issues/6625
deny = [
# Rust
"unsafe_code", # We may remove this if needed
# Clippy - "serious" lints
"clippy::borrow_interior_mutable_const", # Seems dangerous to allow this. Eg. `const F = Lazy::new()`;
# Clippy - bad math
#"clippy::cast_possible_truncation", # Seems dangerous, eg f64 to u64.
#"clippy::cast_possible_wrap",
# Clippy - pointer safety / readability / correctness
"clippy::as_ptr_cast_mut",
"clippy::borrow_as_ptr",
"clippy::borrow_deref_ref",
# Clippy - performance
"clippy::cmp_owned",
"clippy::useless_vec",
"clippy::format_in_format_args",
#"clippy::redundant_clone",
#"clippy::unnecessary_to_owned",
#"clippy::vec_init_then_push",
# Clippy - "ergonomic" / "usage" lints
"clippy::option_option", # Lint: Don't ever Option<Option<T>>! Enums instead.
"clippy::zero_sized_map_values", # Lint: use a HashSet instead of HashMap<T, ()>.
# Clippy - "aesthetic" / "style" lints
"clippy::clone_double_ref", # Lint: feels safer/hygienic to disallow this, but I'm not strongly opposed.
"clippy::double_comparisons", # Lint: readability
"clippy::empty_structs_with_brackets", # Lint: {} feels less aesthetic than ;
"clippy::implicit_clone", # Lint: Recommendation here seems more idiomatic.
"clippy::needless_return", # Lint: not the worst offender, but let's try to keep unnecessary returns out.
"clippy::redundant_field_names", # Lint: Duplicate names is a burden when reading: you wonder why they're dupes.
"clippy::redundant_static_lifetimes", # Lint: feels more modern to elide static lifetimes
# Possible:
# "clippy::ptr_arg",
# "clippy::too_many_lines" (note: this is configurable)
]
warn = [
]
allow = [
# Rust
"deprecated", # Other systems can handle deprecated code instead of the linter
"missing_docs", # Not everything needs documentation. Too much documentation is bad. Literate code.
# Clippy
"clippy::if_same_then_else", # There are cases this is clearer! Branches may have notes / considerations.
"clippy::single_char_pattern", # This is like punishing trailing commas. Chars are dumb.
]
-187
View File
@@ -1,187 +0,0 @@
# ==================== Python Build Base ====================
FROM ghcr.io/storytold/docker-base-images-nvidia-cuda-experimental:080f96bc7087 as pybuild-base
# The downloader needs youtube-dl as a python library
# NB: No longer maintained: https://news.ycombinator.com/item?id=28319624
#RUN pip3 install --upgrade youtube-dl
# Used by the downloader script.
# And it looks like youtube-dl is dead...
# Per the README, it looks like pip will always pull the latest version.
# https://github.com/yt-dlp/yt-dlp#update
RUN python3 -m pip install --upgrade yt-dlp
# ==================== Python Build Step 2: Wav2Lip Requirements ====================
FROM pybuild-base as pybuild-requirements
WORKDIR /
COPY models/Wav2Lip ./models/Wav2Lip
WORKDIR models/Wav2Lip
# NB: We need Python3.6
RUN python3.6 -m venv python
#RUN virtualenv -p /usr/bin/python3.6 ... wait
RUN . python/bin/activate \
&& pip install --upgrade pip \
&& pip install -r requirements.txt \
&& deactivate
WORKDIR /
COPY models/tts ./models/tts
WORKDIR models/tts
# NB: Not sure if we need Python3.6 for Tacotron2, but Python3.8 gave me trouble.
# NB: Setuptools fix: https://github.com/tensorflow/tensorflow/issues/34302#issuecomment-554450289
RUN python3.6 -m venv python
RUN . python/bin/activate \
&& pip install --upgrade pip setuptools \
&& pip install -r requirements-tacotron-python36.txt \
&& deactivate
# ==================== Rust Build Base ====================
# Custom base image
# Make sure to add this repository so it has read acces to the base image:
# https://github.com/orgs/storytold/packages/container/docker-base-images-rust-ssl/settings/actions_access
FROM ghcr.io/storytold/docker-base-images-rust-ssl:latest as rust-build
WORKDIR /tmp
COPY Cargo.lock .
COPY Cargo.toml .
COPY sqlx-data.json .
COPY crates/ ./crates
COPY db/ ./db
RUN $HOME/.cargo/bin/cargo fetch
ARG GIT_SHA
RUN echo -n ${GIT_SHA} > GIT_SHA
# Run all of the tests
RUN SQLX_OFFLINE=true \
LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \
$HOME/.cargo/bin/cargo test
# Build all the binaries.
RUN SQLX_OFFLINE=true \
LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \
$HOME/.cargo/bin/cargo build \
--release \
--bin storyteller-web
RUN SQLX_OFFLINE=true \
LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \
$HOME/.cargo/bin/cargo build \
--release \
--bin tts-download-job
RUN SQLX_OFFLINE=true \
LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \
$HOME/.cargo/bin/cargo build \
--release \
--bin w2l-download-job
RUN SQLX_OFFLINE=true \
LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \
$HOME/.cargo/bin/cargo build \
--release \
--bin generic-download-job
RUN SQLX_OFFLINE=true \
LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \
$HOME/.cargo/bin/cargo build \
--release \
--bin tts-inference-job
RUN SQLX_OFFLINE=true \
LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \
$HOME/.cargo/bin/cargo build \
--release \
--bin w2l-inference-job
RUN SQLX_OFFLINE=true \
LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \
$HOME/.cargo/bin/cargo build \
--release \
--bin websocket-gateway
RUN SQLX_OFFLINE=true \
LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \
$HOME/.cargo/bin/cargo build \
--release \
--bin twitch-pubsub-subscriber
# Final image
# FROM ubuntu:xenial
FROM pybuild-requirements as final
WORKDIR /
COPY scripts/ ./scripts
# See: https://github.com/opencontainers/image-spec/blob/master/annotations.md
LABEL org.opencontainers.image.authors='bt@brand.io, echelon@gmail.com'
LABEL org.opencontainers.image.url='https://github.com/storytold/storyteller-web'
LABEL org.opencontainers.image.documentation='https://github.com/storytold/storyteller-web'
LABEL org.opencontainers.image.source='https://github.com/storytold/storyteller-web'
# NB(echelon,2022-05-31): NVIDIA revoked some of their keys.
# A better long term fix is to remove these dependencies outright and not have ML deps in this repo.
# https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/
# https://forums.developer.nvidia.com/t/invalid-public-key-for-cuda-apt-repository/212901/11
RUN apt-key del 7fa2af80
# NB: Fix for 'E: Conflicting values set for option Signed-By regarding source'
# NB: We need to remove all sources
RUN rm $(find /etc/apt | grep cuda)
#RUN wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.0-1_all.deb
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
RUN dpkg -i cuda-keyring_1.0-1_all.deb
# NB: Comment this out for non-debug images
# TODO: Figure out how this is done elsewhere with just the static binaries
# Others: `mysql-client`
RUN apt-get update \
&& apt-get install -y \
curl \
python3-pip \
python3 \
wget
RUN python3 --version
# TODO: Use venv to do this instead.
RUN pip3 install gdown
# Copy all the binaries.
COPY --from=rust-build /tmp/target/release/storyteller-web /
COPY --from=rust-build /tmp/target/release/tts-download-job /
COPY --from=rust-build /tmp/target/release/tts-inference-job /
COPY --from=rust-build /tmp/target/release/w2l-download-job /
COPY --from=rust-build /tmp/target/release/w2l-inference-job /
COPY --from=rust-build /tmp/target/release/websocket-gateway /
COPY --from=rust-build /tmp/target/release/twitch-pubsub-subscriber /
COPY --from=rust-build /tmp/target/release/generic-download-job /
COPY --from=rust-build /tmp/GIT_SHA /
# SSL certs are required for crypto
COPY --from=rust-build /etc/ssl /etc/ssl
# Required dynamically linked libraries
COPY --from=rust-build /lib/x86_64-linux-gnu/libssl.* /lib/x86_64-linux-gnu/
COPY --from=rust-build /lib/x86_64-linux-gnu/libcrypto.* /lib/x86_64-linux-gnu/
# Make sure all the links resolve
RUN ldd storyteller-web
# Without a .env file, Rust crashes "mysteriously" (ugh)
RUN touch .env
RUN touch .env-secrets
EXPOSE 8080
CMD LD_LIBRARY_PATH=/usr/lib /storyteller-web
+42 -70
View File
@@ -1,77 +1,49 @@
storyteller-rust
================
Our Rust monorepo, which services our
API surface area.
Application overview
--------------------
* [FakeYou.com](https://fakeyou.com) is powered by:
* HTTP APIs:
* `storyteller-web` - HTTP + database monolith for FakeYou
* Asynchronous Jobs:
* `tts-download-job` - Async download of models
* `tts-inference-job` - Async TTS inference
* `w2l-download-job` - Async download of videos and images
* `w2l-inference-job` - Async W2L inference
* [StorytellerStream](https://storyteller.stream) is powered by:
* HTTP APIs:
* `storyteller-web` - HTTP + database monolith for FakeYou
* Websocket events:
* `websocket-gateway` - Websocket to pull down Twitch events.
* Twitch API integration:
* `twitch-pubsub-subscriber` - Dynamically subscribes to Twitch PubSub for "active" users
Schema and API notes
--------------------
* [Redis Schema Notes README](_docs/redis_schema.md)
Local development
-----------------
[Local development setup README](_docs/local_development_setup.md)
Production and Deployment
-------------------------
[Production builds and deployment README](_docs/production_builds_and_deployment.md)
Development notes
-----------------
[Development notes README](_docs/development_notes.md)
Dump a MySQL report
-------------------
Our Rust monorepo, which serves both our API surface area and our downloadable client applications.
```
mysql -u storyteller \
-pPasswordHere \
-h IP_HERE \
-P 3306 \
-D storyteller \
-B \
-e "select * from voice_clone_requests;" | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > voice_clone_report.csv
."-,.__
`. `. ,
.--' .._,'"-' `.
. .' `'
`. / ,'
` '--. ,-"'
`"` | \
-. \, |
`--Y.' ___.
\ L._, \
_., `. < <\ _
,' ' `, `. | \ ( `
../, `. ` | .\`. \ \_
,' ,.. . _.,' ||\l ) '".
, ,' \ ,'.-.`-._,' | . _._`.
,' / \ \ `' ' `--/ | \ / / ..\
.' / \ . |\__ - _ ,'` ` / / `.`.
| ' .. `-...-" | `-' / / . `.
| / |L__ | | / / `. `.
, / . . | | / / ` `
/ / ,. ,`._ `-_ | | _ ,-' / ` \
/ . \"`_/. `-_ \_,. ,' +-' `-' _, ..,-. \`.
. ' .-f ,' ` '. \__.---' _ .' ' \ \
' / `.' l .' / \.. ,_|/ `. ,'` L`
|' _.-""` `. \ _,' ` \ `.___`.'"`-. , | | | \
|| ,' `. `. ' _,...._ ` | `/ ' | ' .|
|| ,' `. ;.,.---' ,' `. `.. `-' .-' /_ .' ;_ ||
|| ' V / / ` | ` ,' ,' '. ! `. ||
||/ _,-------7 ' . | `-' l / `||
. | ,' .- ,' || | .-. `. .' ||
`' ,' `".' | | `. '. -.' `'
/ ,' | |,' \-.._,.'/'
. / . . \ .''
.`. | `. / :_,'.'
\ `...\ _ ,'-. .' /_.-' S T O R Y T E L L E R
`-.__ `, `' . _.>----''. _ __ / Turning memes into dreams
.' /"' | "' '_ One Rust Monorepo at a time
/_|.-'\ ,". '.'`__'-( \
/ ,"'"\,' `/ `-.|"
```
TODO
----
* Revise this README to be more useful.
Notes / TODOs:
* Examples for good Actix+Sqlx Tests:
https://stackoverflow.com/questions/65370752/how-do-i-create-an-actix-web-server-that-accepts-both-sqlx-database-pools-and-tr
* Actix/sqlx runtime compat:
https://github.com/launchbadge/sqlx/issues/1117#issuecomment-801237734
* Redis caching of more endpoints
* Jobs for analytics queries (#uses per model, etc)
* Jobs for ingesting Discord, Twitter, Reddit RPAN chat, Twitch chat (not PubSub), etc.
- [documentation](./_develop/docs)
- [tools, misc](./_develop)
+52
View File
@@ -0,0 +1,52 @@
README
======
This directory contains a collection of (hopefully organized and up to date) documentation on
running the various backend pieces, development setup, production maintenance, etc. Check out
all the markdown documents in this directory tree for information organized by topic.
Development / Setup
-------------------
- [Most of the general documents for cross-cutting setup of FakeYou.com live here.](./local_development)
- Some per-application documents (such as for `aichatbot-sidecar`) live as READMEs under that particular
application's code directory, eg. `/crates/{appCategory}/{appName}/README.md` (These are irrelevant
for most folks.)
Web API Overview
----------------
### FakeYou.com
* [FakeYou.com](https://fakeyou.com) is powered by the following applications:
* HTTP APIs:
* `storyteller-web` - HTTP API + database monolith for FakeYou
* Asynchronous Jobs:
* `download-job` - Handle async download of ML models (RVC, SVC, etc.)
* `inference-job` - Run async ML model inference (RVC, SVC, SadTalker, etc.)
This will handle most model inference going forward.
* `tts-download-job` - (*deprecated*) Async download of Tacotron2 models only
* `tts-inference-job` - (*deprecated*) Async TTS inference of Tacotron2 models only
* `w2l-download-job` - (*deprecated*) Async download of videos and images
* `w2l-inference-job` - (*deprecated*) Async W2L inference
### PowerStream
* [PowerStream](https://power.stream) (deprecated) is powered by the following applications:
* HTTP APIs:
* `storyteller-web` - HTTP + database monolith for FakeYou ***and*** PowerStream.
* Twitch API integration:
* `twitch-pubsub-subscriber` - Dynamically subscribes to Twitch PubSub for "active" users
* Websocket events:
* `websocket-gateway` - Websocket for users' browsers to pull down enriched Twitch events.
TODO
----
Notes / TODOs:
* Examples for good Actix+Sqlx Tests:
https://stackoverflow.com/questions/65370752/how-do-i-create-an-actix-web-server-that-accepts-both-sqlx-database-pools-and-tr
* Actix/sqlx runtime compat:
https://github.com/launchbadge/sqlx/issues/1117#issuecomment-801237734
+43
View File
@@ -0,0 +1,43 @@
Migrations guide
================
## Diesel Migrations
To run pending migrations, execute the following:
```bash
diesel migration run
```
To revert the last 3 migrations:
```bash
diesel migration revert -n 3
```
To reset the entire database (drop, migrate), run:
```bash
diesel database reset
```
## Server Query Codegen
We use SQLx instead of Diesel in the production server. It's typesafe
SQL instead of an ORM like Diesel.
SQLx connects to a database to derive type information, but obviously
cannot do this for builds in CI. In order to cache the types, we build
and check in a cache file (necessary for builds):
```bash
SQLX_OFFLINE=true cargo sqlx prepare
```
Now that we have multiple binaries, it's required to include all the queries in the main
binary so we can generate the cached queries as a single target. That's then executed
with:
```bash
SQLX_OFFLINE=true cargo sqlx prepare -- --bin storyteller-web
```
@@ -0,0 +1,207 @@
FakeYou Development Setup (bare metal)
======================================
This document describes how to run the FakeYou infrastructure on your development
machine's bare metal (no containers).
Setup instructions and development were tested and known to work on the following
platforms:
- Mac OS (Apple M2 silicon)
- Ubuntu 22.04
The applications (binary targets) you might be interested in running include, but
are not limited to:
- `storyteller-web`, the HTTP API server
- `download-job`, which downloads models from the web and stores them in GCS
- `inference-job`, which downloads models from GCS and runs inference with them
Setup Instructions
------------------
### (1) Install Rust
Install Rust [using this guide](https://www.rust-lang.org/learn/get-started). If it asks,
you'll want "stable" Rust, not "nightly" Rust. If it doesn't ask, it defaults to "stable".
### (2) Install the necessary libraries
Mac: (Lost the list, but it should match Linux. Install Homebrew.)
Ubuntu 22.04:
```bash
sudo apt install \
jq \
libmysqlclient-dev \
libsqlite3-dev \
pkgconf
```
(Note: jq is for combining mysql codegen outputs; pkgconf is if using openssl instead of rustls.)
### (3) Install MySQL server
Mac:
```bash
brew install mysql
```
If `mysql -uroot` fails, reboot the machine:
```bash
sudo reboot now
```
Ubuntu 22.04:
```bash
sudo apt install mysql-server
```
### (4) Install a `storyteller` user and table in MySQL
Connect to mysql:
```bash
# If the following command asks for a password, the password is typically "root"
sudo mysql -u root -p
```
Once in MySQL, run the following:
```mysql
use mysql;
CREATE DATABASE storyteller;
CREATE USER 'storyteller'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON storyteller.* TO 'storyteller'@'localhost';
```
Then verify access with `./dev_mysql_connect.sh`
### (5) Install Diesel CLI (for MySQL migrations):
```bash
cargo install diesel_cli \
--no-default-features \
--features mysql,sqlite
```
As of this writing, Mac [has some issues with Diesel CLI](https://github.com/diesel-rs/diesel/issues/2605)
and requires a few extra dependencies to be installed:
```bash
brew install libpq
```
### (6) Run the pending database migrations:
```bash
diesel migration run
```
You might get a scary message about `"Encountered unknown type for Mysql: enum"` -- you can ignore this
error (see below).
### (7) (optional) Install the SQLx CLI (if doing database development)
```bash
cargo install sqlx-cli --no-default-features --features rustls,mysql,sqlite
```
We'll be using diesel to manage the migrations, but sqlx within the app to actually perform queries.
Diesel is an immature ORM, which isn't a good tech bet, so we use sqlx as at-compile-time
typesafe SQL.
### (8) Install hosts file:
(This should be the same on Linux and Mac, but might differ for Windows.)
If you're developing against the frontend, it'll target development domains (eg. `dev.fakeyou.com`) instead
of `127.0.0.1` or `localhost`. You can make your machine route domains to localhost by editing your hosts
file (located at `/etc/hosts`) to include the following configuration lines:
```
127.0.0.1 dev.fakeyou.com
127.0.0.1 api.dev.fakeyou.com
127.0.0.1 devproxy.fakeyou.com
127.0.0.1 dev.storyteller.ai
127.0.0.1 api.dev.storyteller.ai
127.0.0.1 devproxy.storyteller.ai
```
### (9a) Install Redis
```
sudo apt install redis
```
### (9b) Run one or more applications:
DO NOT CHECK THESE TWO FILES INTO THE REPO
Ask Brandon for the .env-secrets and .storteller-web.development-secrets.env and place it in the root of the folder.
To start the HTTP API server,
```bash
cargo run --bin storyteller-web
```
Note that this compiles and runs the "development" binary. It's faster and easier to debug than the
optimized "production" build. To build a fully optimized production release,
run `cargo build --release --bin storyteller-web` . Note that this will take much longer.
DO NOT CHECK THESE TWO FILES INTO THE REPO
Ask Brandon for the .download-job.development-secrets.env and place it in
crates/service/job/download_job/config
Ask Brandon for the .inference-job.development-secrets.env and place it in
crates/service/job/inference_job/config
To download some ML models, run:
```bash
cargo run --bin download-job
cargo run --bin tts-download-job
```
If you want to run both the HTTP API and the jobs, you'll need to run both processes in different
terminals or tmux sessions.
Note also that the configurations pointing to the ML monorepo must be set up for each application.
Additionally, some development secrets may be needed (ask the team to share).
To execute ML inference, run:
```bash
cargo run --bin inference-job
cargo run --bin tts-inference-job
```
Again, note that the configurations pointing to the ML monorepo must be set up for each application.
Additionally, some development secrets may be needed (ask the team to share).
Solutions to Common Setup Problems
-----------------------------------
### [Fix] Sqlx Error when Performing Schema Migrations
You might get this error message during migration,
```
Encountered unknown type for Mysql: enum
thread 'main' panicked at 'internal error: entered unreachable code: Mysql only supports a closed set of types.
If you ever see this error message please open an issue at https://github.com/diesel-rs/diesel
containing a dump of your schema definition.', diesel_cli/src/print_schema.rs:310:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
I haven't found the cause (it doesn't happen on newer installs), but the migrations appear to work regardless
of this error message. You can essentially ignore it.
### [Fix] Can't connect to local MySQL after install on Ubuntu
- If MySql in local dev can't be connected to, [reset the accounts](https://linuxconfig.org/how-to-reset-root-mysql-mariadb-password-on-ubuntu-20-04-focal-fossa-linux).
@@ -0,0 +1,22 @@
# Local Kubernetes environment for standing up the APIs and their dependencies
(These are Paul's notes.)
- Install minikube, kubectl, docker, and musl from your OS package manager
- `rustup target add x86_64-unknown-linux-musl`
- `cargo build --release --bin storyteller-web --target=x86_64-unknown-linux-musl`
- `minikube start --extra-config=apiserver.service-node-port-range=1-65535`
- `eval $(minikube docker-env)`
- `minikube mount /path/to/storyteller-rust/:/storyteller-rust &> /dev/null &`
- `docker build -t storyteller-web -f localdev/Dockerfile .`
- `kubectl apply -f localdev/kubernetes.yml`
- Get the ip address of minikube with `minikube ip`, this is where all the services will be running on their
regular ports (12345 for the api, 6379 for redis, 3306 for mysql)
- That's it, we just spun up mysql, applied database migrations, spun up redis, and spun up our api
# Development tips
- Rebuild and "deploy" (locally) with `cargo build --release --bin storyteller-web --target=x86_64-unknown-linux-musl && kubectl rollout restart storyteller-web`
- View logs from the api with `kubectl logs storyteller-web<TAB>`
- Delete everything minikube (if you start running out of disk space or what-have-you) with `minikube delete`
- See pod status with `kubectl get pods`
- If there are errors you can get more info with `kubectl describe pods`
@@ -0,0 +1,56 @@
Local Development nginx proxy
=============================
It isn't necessary to use nginx for development, but it can be nice. Nginx allows for a more
sophisticated testing setup that makes cookie and CORS issues less of a pain.
You can use nginx to serve (locally-signed) SSL, redirect traffic to different ports, or run
multiple copies of the app side by side.
### Hosts file
Set the following configs in your `/etc/hosts` file (as you would probably do even without nginx),
```
127.0.0.1 dev.fakeyou.com
127.0.0.1 api.dev.fakeyou.com
127.0.0.1 devproxy.fakeyou.com
127.0.0.1 dev.storyteller.ai
127.0.0.1 api.dev.storyteller.ai
127.0.0.1 devproxy.storyteller.ai
# Deprecated development hostnames :
127.0.0.1 jungle.horse
127.0.0.1 api.jungle.horse
```
### Nginx installation and administration
Configure Nginx per the checked in Nginx configs (and instructions) in
the directory `/_develop/localdev/nginx-http-config`.
This should be straightforward, but if it isn't, contribute docs here.
### [Fix] Python 3.6 on Apple M1 Mac
Python3.6 isn't supported on Apple silicon, and it's not in homebrew. It can be installed with
[nix using Rosetta](https://stackoverflow.com/a/65980989):
Download: https://nixos.org/download.html#nix-quick-install
```
nix run nixpkgs.python36 -c python
```
Install venv:
```
nix run nixpkgs.python36 -c python -m venv python
```
Install other packages on Mac that aren't used in venv:
```
python3 -m pip install --user requests gdown youtube_dl
```
@@ -0,0 +1,17 @@
Production Database
===================
Secrets can be subbed in for `.env` and the standard diesel migration tooling will work.
Dump a MySQL report
-------------------
```bash
mysql -u storyteller \
-pPasswordHere \
-h IP_HERE \
-P 3306 \
-D storyteller \
-B \
-e "select * from voice_clone_requests;" | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > voice_clone_report.csv
```
@@ -1,6 +1,8 @@
database schema
================
(This is woefully incomplete and unmaintained.)
Twitch Model
------------
+23
View File
@@ -0,0 +1,23 @@
FROM rust:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y \
mariadb-client \
imagemagick \
libmariadb-dev \
&& rm -rf /var/lib/apt/lists/*
RUN cargo install diesel_cli --features mysql && \
cargo install sqlx-cli --features mysql
WORKDIR /storyteller-rust
ARG GIT_SHA
RUN echo -n ${GIT_SHA} > /GIT_SHA
CMD ["/storyteller-rust/localdev/startup.sh"]
+153
View File
@@ -0,0 +1,153 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
spec:
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- name: mysql
image: mysql:8.0.30
env:
- name: MYSQL_USER
value: storyteller
- name: MYSQL_PASSWORD
value: password
- name: MYSQL_DATABASE
value: storyteller
- name: MYSQL_ROOT_PASSWORD
value: password
ports:
- containerPort: 3306
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:7.0.4
ports:
- containerPort: 6379
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: storyteller-web
spec:
replicas: 1
selector:
matchLabels:
app: storyteller-web
template:
metadata:
labels:
app: storyteller-web
spec:
containers:
- name: storyteller-web
image: storyteller-web:latest
imagePullPolicy: Never
env:
- name: MYSQL_URL
value: mysql://storyteller:password@mysql.default/storyteller
- name: REDIS_0_URL
value: redis://redisd@redis.default/0
- name: REDIS_1_URL
value: redis://redisd@redis.default/1
- name: ACCESS_KEY
value: garbage
- name: SECRET_KEY
value: garbage
- name: REGION_NAME
value: garbage
- name: W2L_PRIVATE_DOWNLOAD_BUCKET_NAME
value: garbage
- name: W2L_PUBLIC_DOWNLOAD_BUCKET_NAME
value: garbage
- name: AUDIO_UPLOADS_BUCKET_ROOT
value: garbage
- name: TWITCH_USERNAME
value: garbage
- name: TWITCH_STREAM_KEY
value: garbage
- name: TWITCH_APP_CLIENT_ID
value: garbage
- name: TWITCH_APP_CLIENT_SECRET
value: garbage
ports:
- containerPort: 12345
volumeMounts:
- mountPath: /storyteller-rust
name: storyteller-rust-folder
volumes:
- name: storyteller-rust-folder
hostPath:
path: /storyteller-rust
---
apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
type: NodePort
ports:
- name: mysql
port: 3306
nodePort: 3306
selector:
app: mysql
---
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
type: NodePort
ports:
- name: redis
port: 6379
nodePort: 6379
selector:
app: redis
---
apiVersion: v1
kind: Service
metadata:
name: storyteller-web
spec:
type: NodePort
ports:
- name: storyteller-web
port: 12345
nodePort: 12345
selector:
app: storyteller-web
@@ -0,0 +1,258 @@
# Nginx configs for "jungle.horse" and "api.jungle.horse" (http)
#
# On Ubuntu Linux, this config is located at the following location:
#
# - /etc/nginx/sites-enabled/{name-of-site}
#
# Move this file there, and then restart with,
#
# sudo service nginx restart
#
# On Mac, this is located at the following locations:
#
# - /opt/homebrew/etc/nginx/servers/{name-of-site} (for nginx installed with homebrew)
# - /usr/local/etc/nginx/sites-enabled/{name-of-site} (for default nginx install)
#
#
# On Mac, verify configs and restart with,
#
# sudo nginx -t
# sudo nginx -s reload
#
# ================
# SSL Instructions
# ================
#
# You can launch Chrome in a way it disregards self-signed certs and CORS:
#
# chromium --disable-web-security --ignore-certificate-errors --user-data-dir=~/chromeTemp
#
# To create self-signed certs on Ubuntu Linux,
#
# sudo apt-get install openssl
#
# sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/localhost.key -out /etc/ssl/certs/localhost.crt
#
# ^ most fields can be blank, but the "Common Name" should be `*.jungle.horse`
#
# sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/devfakeyou.key -out /etc/ssl/certs/devfakeyou.crt
# sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/devstoryteller.key -out /etc/ssl/certs/devstoryteller.crt
#
# ^ most fields can be blank, but the "Common Name" should be `*.dev.fakeyou.com` and `*.dev.storyteller.io` respectively.
#
# For more: https://www.cloudsavvyit.com/1306/how-to-create-and-use-self-signed-ssl-on-nginx/
#
# To create self-signed certs on Mac,
#
# openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
#
# ^ most fields can be blank, but the "Common Name" should be `*.jungle.horse`
#
# On Mac, load the self signed cert into the keychain with the following command:
#
# sudo security add-trusted-cert \
# -d -r trustRoot \
# -k /Library/Keychains/System.keychain /etc/ssl/certs/localhost.crt
#
# Self signed certs might be considered insecure by the browser. In Firefox,
# set about:config `security.tls.insecure_fallback_hosts` to include a list of
# permitted domains. You may also need to configure other settings.
#
#
# ========================================================
# FAKEYOU
# ========================================================
# FakeYou javascript frontend over plain HTTP (launched by Yarn)
server {
listen 80;
server_name dev.fakeyou.com;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:7000;
proxy_redirect off;
}
}
# FakeYou API backend over plain HTTP (Rust app)
server {
listen 80;
server_name api.dev.fakeyou.com;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:12345;
proxy_redirect off;
}
}
# FakeYou javascript frontend over SSL (launched by Yarn)
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/ssl/certs/devfakeyou.crt;
ssl_certificate_key /etc/ssl/private/devfakeyou.key;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
server_name dev.fakeyou.com;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:7000;
proxy_redirect off;
}
}
# FakeYou API backend over SSL (Rust app)
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/ssl/certs/devfakeyou.crt;
ssl_certificate_key /etc/ssl/private/devfakeyou.key;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
server_name api.dev.fakeyou.com;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:12345;
proxy_redirect off;
}
}
# ========================================================
# STORYTELLER
# ========================================================
# Storyteller javascript frontend over plain HTTP (launched by Yarn)
server {
listen 80;
server_name dev.storyteller.io;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:7000;
proxy_redirect off;
}
}
# Storyteller API backend over plain HTTP
server {
listen 80;
server_name api.dev.storyteller.io;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:12345;
proxy_redirect off;
}
}
# Storyteller javascript frontend over SSL (launched by Yarn)
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/ssl/certs/devstoryteller.crt;
ssl_certificate_key /etc/ssl/private/devstoryteller.key;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
server_name dev.storyteller.io;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:7000;
proxy_redirect off;
}
}
# Storyteller API backend over SSL
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/ssl/certs/devstoryteller.crt;
ssl_certificate_key /etc/ssl/private/devstoryteller.key;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
server_name api.dev.storyteller.io;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:12345;
proxy_redirect off;
}
}
# ========================================================
# OLD PRODUCTS THAT NEED UPDATING
# ========================================================
# ## TODO(2022-02-13): This is new and untested
# # WebSocket API backend over plain HTTP
# server {
# listen 80;
# server_name ws.jungle.horse;
# location / {
# proxy_set_header Host $host;
# proxy_pass http://127.0.0.1:54321;
# proxy_redirect off;
# }
# }
#
# # Websocket API backend over SSL
# server {
# listen 443 ssl;
# listen [::]:443 ssl;
# ssl_certificate /etc/ssl/certs/localhost.crt;
# ssl_certificate_key /etc/ssl/private/localhost.key;
# ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
# server_name ws.jungle.horse;
# location / {
# proxy_set_header Host $host;
# proxy_pass http://127.0.0.1:54321;
# proxy_redirect off;
# }
# }
#
# # Javascript frontend over plain HTTP
# server {
# listen 80;
# server_name jungle.horse;
# location / {
# proxy_set_header Host $host;
# proxy_pass http://127.0.0.1:7000;
# proxy_redirect off;
# }
# }
#
# # TODO(2022-02-13): This is new and untested
# # Javascript frontend (OBS Layer) over plain HTTP
# server {
# listen 80;
# server_name obs.jungle.horse;
# location / {
# proxy_set_header Host $host;
# proxy_pass http://127.0.0.1:7007;
# proxy_redirect off;
# }
# }
#
# # Javascript frontend over SSL
# server {
# listen 443 ssl;
# listen [::]:443 ssl;
# ssl_certificate /etc/ssl/certs/localhost.crt;
# ssl_certificate_key /etc/ssl/private/localhost.key;
# ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
# server_name jungle.horse;
# location / {
# proxy_set_header Host $host;
# proxy_pass http://127.0.0.1:7000;
# proxy_redirect off;
# }
# }
#
# # Javascript frontend over SSL (OBS Layer)
# server {
# listen 443 ssl;
# listen [::]:443 ssl;
# ssl_certificate /etc/ssl/certs/localhost.crt;
# ssl_certificate_key /etc/ssl/private/localhost.key;
# ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
# server_name obs.jungle.horse;
# location / {
# proxy_set_header Host $host;
# proxy_pass http://127.0.0.1:7007;
# proxy_redirect off;
# }
# }
#
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set +e +o pipefail
diesel migration run --database-url="${MYSQL_URL}"
set -e -o pipefail
./target/x86_64-unknown-linux-musl/release/storyteller-web
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
echo 'Installing APT packages...'
# OpenSSL requirements: libssl-dev, pkg-config
# Database requirements: mysql-server, libmysqlclient-dev
# Other tools: jq (db codegen)
sudo apt-get install -y \
jq \
libmysqlclient-dev \
libssl-dev \
mysql-server \
pkg-config \
--no-install-recommends
echo 'Installing Cargo packages...'
# Install Diesel CLI for migrations
cargo install diesel_cli \
--no-default-features \
--features mysql
# Install SQLx for codegen
cargo install sqlx-cli \
--no-default-features \
--features rustls,mysql
echo 'Installing Database user...'
# Create DB account (using default system mysql password)
sudo mysql \
-u "root" \
-p"password" \
-e "use mysql; CREATE DATABASE IF NOT EXISTS storyteller; CREATE USER IF NOT EXISTS 'storyteller'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON storyteller.* TO 'storyteller'@'localhost';"
+6
View File
@@ -0,0 +1,6 @@
# Secrets
db_secrets.toml
# Python Virtual Env
python/
+100
View File
@@ -0,0 +1,100 @@
#!/usr/bin/env python
# FIXME: Needs packages 'toml' and 'mysql-connector-python'. Put in requirements.txt.
import time
import toml
import mysql.connector
DB_SECRETS_FILE = 'db_secrets.toml'
# TODO: Share db-related setup when more scripts are added.
def read_database_secrets(secrets_file = DB_SECRETS_FILE):
secrets = None
with open(secrets_file, "r") as f:
secrets = toml.load(f)
required_keys = ['database', 'hostname', 'port', 'password', 'username']
for key in required_keys:
if key not in secrets:
raise Exception(f"Required key '#{key}' not present")
return secrets
def connect_to_mysql():
secrets = read_database_secrets()
connection = mysql.connector.connect(
host = secrets['hostname'],
port = secrets['port'],
user = secrets['username'],
password = secrets['password'],
database = secrets['database'],
)
return connection
connection = connect_to_mysql()
cursor = connection.cursor()
SAFE_ID = 76000000 # Reasonably completed on 2022-06-24
LIMIT = 100000
#def get_record_count():
# query = f"SELECT COUNT(*) FROM tts_inference_jobs"
# cursor.execute(query)
# result = cursor.fetchall()
# print(result)
# return result[0]
#
##total_count = get_record_count()
#total_count = 75082057
total_count = 21925602
def get_user_tokens(cursor):
query = f"""
SELECT
r.maybe_creator_user_token, r.creator_ip_address
FROM
tts_results as r
LEFT OUTER JOIN
users as u
ON
r.maybe_creator_user_token = u.token
WHERE
r.raw_inference_text LIKE '%spidermant%'
AND r.created_at > ( CURDATE() - INTERVAL 1 HOUR )
"""
cursor.execute(query)
results = cursor.fetchall()
user_tokens = [row[0] for row in results]
user_tokens = [token for token in user_tokens if token is not None]
user_tokens = set(user_tokens)
ip_addresses = [row[1] for row in results]
ip_addresses = [ip for ip in ip_addresses if ip is not None]
ip_addresses = set(ip_addresses)
return (user_tokens, ip_addresses)
(user_tokens, ip_addresses) = get_user_tokens(cursor)
print(user_tokens)
print(len(user_tokens))
print(len(ip_addresses))
with open('101_user_tokens.txt', 'w') as f:
for user_token in user_tokens:
f.write(user_token)
f.write("\n")
with open('101_ip_addresses.txt', 'w') as f:
for ip in ip_addresses:
f.write(ip)
f.write("\n")
+3
View File
@@ -0,0 +1,3 @@
mysql-connector-python==8.0.32
protobuf==3.20.3
toml==0.10.2
-207
View File
@@ -1,207 +0,0 @@
dev setup
=========
[Back to main README](../README.md)
### Debugging and Fixing CUDA/PyTorch
See this spreadsheet for previous battles with version incompatibility:
https://docs.google.com/spreadsheets/d/1BEdLmwOzo3r83-iJn9sj6co1VT92t3lIeJ-lNH25bdQ/edit#gid=0
Ubuntu might upgrade the driver by accident, and it might need reinstallation. Who knows.
This stuff is a nightmare.
### Database Setup
Install the following libraries, and see the notes further below about MySQL on Ubuntu 20.04.
```
mysql-server
imagemagick
```
To manage the database and perform migrations, install the Rust tools diesel and sqlx.
We'll be using diesel to manage the migrations, but sqlx within the app to actually perform queries.
Diesel is an ORM, which is dumb, so we use sqlx as at-compile-time typesafe SQL.
```
sudo apt-get install libmysqlclient-dev
cargo install sqlx-cli --no-default-features --features mysql [2022-01-16: is this needed?]
```
To install a more modern version of Diesel (unreleased) that
supports the "migrations_dir" toml config option:
```
cargo install diesel_cli \
--git https://github.com/diesel-rs/diesel.git \
--rev a213fe232a122f35a812b0ce0269708a1845a4c9 \
--no-default-features \
--features mysql
```
#### Sqlx Error on Linux when Performing Schema Migrations
You might get this error message during migration,
```
Encountered unknown type for Mysql: enum
thread 'main' panicked at 'internal error: entered unreachable code: Mysql only supports a closed set of types.
If you ever see this error message please open an issue at https://github.com/diesel-rs/diesel containing a dump of your schema definition.', diesel_cli/src/print_schema.rs:310:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
I haven't found the cause (it doesn't happen on Mac), but the migrations appear to work regardless of the error message.
#### Linux database notes
If MySql in local dev can't be connected to, reset the accounts:
https://linuxconfig.org/how-to-reset-root-mysql-mariadb-password-on-ubuntu-20-04-focal-fossa-linux
#### Fixing dev MySql on Ubuntu 20.04
For some reason, the MySql default install on 20.04 gave me a bunch of trouble.
In retrospect, I _think_ this is because 'root@localhost' requires sudo to access, but if this
gives any trouble in the future, here's how I got around it (two full hours of distraction!)
```
sudo apt-get install mysql-server
# But for some reason the default password doesn't work and diesel/sqlx can't connect?
# Kill everything
sudo apt purge mysql-server mysql-client mysql-common
sudo apt autoremove
sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
sudo rm -rf /var/lib/mysql*
sudo /usr/bin/mysql_secure_installation
# still no work...
sudo systemctl stop mysql.service
# ugh, it wasn't chowned or created (both states observed in different installs)…
sudo mkdir -p /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld
sudo mysqld_safe --skip-grant-tables --skip-networking &
mysql -u root
flush privileges;
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
sudo killall -u mysql
sudo systemctl restart mysql.service
# now it works
sudo mysql -u root -p
# but now I have to use "sudo" !?!?
use mysql;
CREATE USER 'storyteller'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON storyteller.* TO 'storyteller'@'localhost';
```
### Install Diesel (migrations only)
We use Diesel to manage migrations, but we don't use it in server code.
Actual server code uses SQLx. To install the CLI tool, run the following:
```
cargo install diesel_cli
```
Mac [has issues](https://github.com/diesel-rs/diesel/issues/2605) and requires a few dependencies:
```
brew install libpq
```
### Database migrations
To reset the entire database (drop, migrate), run:
```
diesel database reset
```
To migrate at the current step and beyond:
```
diesel migration run
```
To undo migrations at the current step:
```
diesel migration redo
```
### Server Query Codegen
We use SQLx instead of Diesel in the production server. It's typesafe
SQL instead of an ORM like Diesel.
SQLx connects to a database to derive type information, but obviously
cannot do this for builds in CI. In order to cache the types, we build
and check in a cache file (necessary for builds):
```
SQLX_OFFLINE=true cargo sqlx prepare
```
Now that we have multiple binaries, it's required to include all the queries in the main
binary so we can generate the cached queries as a single target. That's then executed
with:
```
SQLX_OFFLINE=true cargo sqlx prepare -- --bin storyteller-web
```
### Setting Up a Local Nginx Proxy
Set up a local nginx to proxy to the frontend and backend so cookie issues aren't annoying
Configure Nginx per the checked in Nginx configs (and instructions) in `localdev/nginx-http-config`.
```
And in /etc/hosts,
```
127.0.0.1 jungle.horse
127.0.0.1 api.jungle.horse
```
### Python 3.6 on Apple M1 Mac
Python3.6 isn't supported on Apple silicon, and it's not in homebrew. It can be installed with
[nix using Rosetta](https://stackoverflow.com/a/65980989):
Download: https://nixos.org/download.html#nix-quick-install
```
nix run nixpkgs.python36 -c python
```
Install venv:
```
nix run nixpkgs.python36 -c python -m venv python
```
Install other packages on Mac that aren't used in venv:
```
python3 -m pip install --user requests gdown youtube_dl
```
-235
View File
@@ -1,235 +0,0 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
CREATE TABLE users (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- Visible "primary key"
token VARCHAR(32) NOT NULL,
-- Username is a lookup key; display_name allows the user to add custom case.
username VARCHAR(20) NOT NULL,
display_name VARCHAR(20) NOT NULL,
email_address VARCHAR(255) NOT NULL,
email_confirmed BOOLEAN NOT NULL DEFAULT false,
-- The role assigned to the user confers permissions.
user_role_slug VARCHAR(16) NOT NULL,
-- ========== CREDENTIALS ==========
-- Bcrypt password hash. Granted, there are newer methods:
-- https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html
-- Passwords may be a max of 64 characters per BCrypt.
password_hash BINARY(60) NOT NULL,
-- Incremented with every update to the password.
password_version INT NOT NULL DEFAULT 0,
-- ========== ABUSE TRACKING ==========
-- For abuse tracking.
-- Wide enough for IPv4/6
ip_address_creation VARCHAR(40) NOT NULL,
ip_address_last_login VARCHAR(40) NOT NULL,
ip_address_last_update VARCHAR(40) NOT NULL,
-- ========== DISPLAY / PROFILE ==========
-- Gravatar image hashes are precomputed.
email_gravatar_hash CHAR(32) NOT NULL,
-- The profile of the user in markdown (user editable).
profile_markdown TEXT NOT NULL,
-- Generated HTML (not user-editable).
profile_rendered_html TEXT NOT NULL,
-- An uploaded avatar. Public hash in our bucket.
-- avatar_public_bucket_hash CHAR(32) DEFAULT NULL,
-- ========== SOCIAL MEDIA ==========
-- Social media usernames
-- These are not confirmed. We'll need to build an OAuth system to handle that.
discord_username VARCHAR(36) DEFAULT NULL,
twitter_username VARCHAR(36) DEFAULT NULL,
twitch_username VARCHAR(36) DEFAULT NULL,
patreon_username VARCHAR(36) DEFAULT NULL,
github_username VARCHAR(36) DEFAULT NULL,
cashapp_username VARCHAR(36) DEFAULT NULL,
website_url VARCHAR(255) DEFAULT NULL,
-- ========== USER PREFERENCES ==========
-- If the user doesn't want to use gravatar and doesn't have an uploaded avatar.
disable_gravatar BOOLEAN NOT NULL DEFAULT false,
-- (THIS MIGHT NOT BE USED)
-- NB: DO NOT SORT!
-- THIS MUST MATCH THE RESPECTIVE JOBS TABLE.
-- Visibility preference used at TTS inference time (which can be changed on the result itself).
-- Moderators will still see them.
preferred_tts_result_visibility ENUM(
'public',
'hidden',
'private'
) NOT NULL DEFAULT 'public',
-- (THIS MIGHT NOT BE USED)
-- NB: DO NOT SORT!
-- THIS MUST MATCH THE RESPECTIVE JOBS TABLE.
-- Visibility preference used at TTS inference time (which can be changed on the result itself).
-- Moderators will still see them.
preferred_w2l_result_visibility ENUM(
'public',
'hidden',
'private'
) NOT NULL DEFAULT 'public',
-- Auto play preferences
-- Tri-state because we want to potentially change the default behavior.
auto_play_audio_preference BOOLEAN DEFAULT NULL,
auto_play_video_preference BOOLEAN DEFAULT NULL,
-- Favorite TTS voice to use by default
-- maybe_preferred_tts_model_token VARCHAR(32) DEFAULT NULL,
-- Favorite W2L model to use by default
-- maybe_preferred_w2l_template_token VARCHAR(32) DEFAULT NULL,
-- Settings
-- DO NOT REORDER.
-- dark_mode_preference ENUM(
-- 'light-mode',
-- 'dark-mode',
-- 'use-clock'
-- ) NOT NULL DEFAULT 'light-mode',
-- ========== STATS ==========
-- For tracking stats.
-- The "cached" values are updated by a background job.
-- cached_tts_rendered_counter INT(10) NOT NULL DEFAULT 0,
-- cached_w2l_rendered_counter INT(10) NOT NULL DEFAULT 0,
-- ========== MODERATION DETAILS ==========
-- Different than deleted.
-- Users still show up, but can't do anything.
is_banned BOOLEAN NOT NULL DEFAULT false,
-- If a moderator has comments.
maybe_mod_comments VARCHAR(255) DEFAULT NULL,
-- The last moderator that made changes.
maybe_mod_user_token VARCHAR(32) DEFAULT NULL,
-- ========== VECTOR CLOCK ==========
-- Incremented with every update.
version INT NOT NULL DEFAULT 0,
-- ========== TIMESTAMPS ==========
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- If the user is deleted, we set this.
-- This is different than banned. These users won't show up at all.
user_deleted_at TIMESTAMP NULL,
mod_deleted_at TIMESTAMP NULL,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (token),
UNIQUE KEY (username),
UNIQUE KEY (email_address),
KEY fk_user_role_slug (user_role_slug)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE user_roles (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- Effective "primary key"
slug CHAR(16) NOT NULL,
name VARCHAR(255) NOT NULL,
-- Usage
can_use_tts BOOLEAN NOT NULL DEFAULT FALSE,
can_use_w2l BOOLEAN NOT NULL DEFAULT FALSE,
can_delete_own_tts_results BOOLEAN NOT NULL DEFAULT FALSE,
can_delete_own_w2l_results BOOLEAN NOT NULL DEFAULT FALSE,
can_delete_own_account BOOLEAN NOT NULL DEFAULT FALSE,
-- Contribution
can_upload_tts_models BOOLEAN NOT NULL DEFAULT FALSE,
can_upload_w2l_templates BOOLEAN NOT NULL DEFAULT FALSE,
can_delete_own_tts_models BOOLEAN NOT NULL DEFAULT FALSE,
can_delete_own_w2l_templates BOOLEAN NOT NULL DEFAULT FALSE,
-- Moderation
can_approve_w2l_templates BOOLEAN NOT NULL DEFAULT FALSE,
-- Edit includes "lock_from_use" and "lock_from_modification"
can_edit_other_users_profiles BOOLEAN NOT NULL DEFAULT FALSE,
can_edit_other_users_tts_models BOOLEAN NOT NULL DEFAULT FALSE,
can_edit_other_users_w2l_templates BOOLEAN NOT NULL DEFAULT FALSE,
can_delete_other_users_tts_models BOOLEAN NOT NULL DEFAULT FALSE,
can_delete_other_users_tts_results BOOLEAN NOT NULL DEFAULT FALSE,
can_delete_other_users_w2l_templates BOOLEAN NOT NULL DEFAULT FALSE,
can_delete_other_users_w2l_results BOOLEAN NOT NULL DEFAULT FALSE,
can_ban_users BOOLEAN NOT NULL DEFAULT FALSE,
can_delete_users BOOLEAN NOT NULL DEFAULT FALSE,
-- Incremented with every update.
version INT NOT NULL DEFAULT 0,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (slug)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE user_sessions (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- Session entropy
token VARCHAR(32) NOT NULL,
-- Foreign key to user
user_token VARCHAR(32) NOT NULL,
-- Track each session's creation IP.
-- Wide enough for IPv4/6
ip_address_creation VARCHAR(40) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- Session termination time.
-- This must be set by the server code, or the session is invalid
expires_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- deletion = session termination
-- Typically these are destroyed by users, but if in the future we allow mods to
-- delete them, it doesn't really matter who did the deletion: sessions are not
-- designed to be recoverable.
deleted_at TIMESTAMP NULL,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (token),
KEY fk_user_token (user_token),
KEY index_ip_address_creation (ip_address_creation)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
@@ -1,110 +0,0 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
CREATE TABLE generic_download_jobs (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- Effective "primary key" (PUBLIC)
-- This is so the in-progress results can be looked up by the UI.
token VARCHAR(32) NOT NULL,
-- Idempotency token
-- This is so the frontend client doesn't submit duplicate jobs.
uuid_idempotency_token VARCHAR(36) NOT NULL,
-- ========== SUCCESS CASE ==========
-- If the job completes successfully, this is the result token.
-- This is only populated on a successful result.
on_success_downloaded_entity_token VARCHAR(32) DEFAULT NULL,
-- The type of the object will vary based on the type of the upload,
-- and we may include heuristics that auto-detect types in the future
on_success_downloaded_entity_type VARCHAR(32) DEFAULT NULL,
-- ========== UPLOAD DETAILS ==========
-- A "well defined" type of upload
-- The first upload type will be "hifigan_model"
download_type VARCHAR(32) NOT NULL,
-- Assume the same URL can be uploaded more than once (in case of errors or
-- people sharing models)
download_url VARCHAR(512) NOT NULL,
-- The user-supplied title of the upload
-- This might have different meanings for different upload types
-- The "name" of the voice model, which might be complicated.
-- If maybe_subject_token (etc.) is set, then it's authoritative instead.
title VARCHAR(255) NOT NULL,
-- ========== CREATOR DETAILS AND PREFERENCES ==========
-- Foreign key to user
creator_user_token VARCHAR(32) NOT NULL,
-- For abuse tracking.
-- Wide enough for IPv4/6
creator_ip_address VARCHAR(40) NOT NULL,
-- The creator can set a desired visibility for their data.
-- This does not always apply to every upload type.
-- Additionally, some upload types may require moderator approval prior
-- to being publicly listed, and this field has no bearing on that.
-- NB: DO NOT CHANGE THE ORDER OF THE ENUM VALUES DURING SCHEMA MIGRATIONS.
creator_set_visibility ENUM(
'public',
'hidden',
'private'
) NOT NULL DEFAULT 'public',
-- ========== JOB SYSTEM DETAILS ==========
-- Jobs begin as "pending", then transition to other states.
--
-- * Pending = job is ready to go
-- * Started = job is running
-- * Complete_Success = job is done (success)
-- * Complete_Failure = job is done (failure)
-- * Attempt_Failed = job failed but may retry.
-- * Dead = job failed permanently.
--
-- Pending -> Started -> Complete_Success
-- |-> Complete_Failure
-- \-> Attempt_Failed -> Started -> { Complete, Failed, Dead }
status ENUM(
'pending',
'started',
'complete_success',
'complete_failure',
'attempt_failed',
'dead') NOT NULL DEFAULT 'pending',
-- We can track this against a "max_attempt_count"
attempt_count INT(3) NOT NULL DEFAULT 0,
-- If there is a failure, tell the user why.
failure_reason VARCHAR(512) DEFAULT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- Failed jobs will set a next attempt time.
-- Subsequent tries can increase the timeout.
-- Failures because of permissions require human intervention => [retry_at=null].
-- Failures because of invalid files are dead => [status=dead].
retry_at TIMESTAMP NULL,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (token),
UNIQUE KEY (uuid_idempotency_token),
KEY fk_on_download_type (download_type),
KEY fk_creator_user_token (creator_user_token),
KEY index_status (status),
KEY index_creator_ip_address (creator_ip_address)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
@@ -1,128 +0,0 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
CREATE TABLE vocoder_models (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- Effective "primary key" (PUBLIC)
token VARCHAR(32) NOT NULL,
-- The architecture of the vocoder.
-- Currently supported values: 'hifigan'
vocoder_type VARCHAR(32) NOT NULL,
-- ========== MUTABLE METADATA ==========
-- The "name" of the vocoder, which might be complicated.
title VARCHAR(255) NOT NULL,
-- The description of the model in markdown.
description_markdown TEXT NOT NULL,
-- Generated HTML (not user-editable).
description_rendered_html TEXT NOT NULL,
-- ========== MUTABLE MOD-ONLY METADATA ==========
-- Whether the vocoder is recommended for use
is_staff_recommended BOOLEAN NOT NULL DEFAULT FALSE,
-- ========== IMMUTABLE PROVENANCE AND METADATA ==========
-- Where the file was originally downloaded (if it was downloaded)
original_download_url VARCHAR(512) DEFAULT NULL,
-- The filename that was used at upload time (if available)
original_filename VARCHAR(255) DEFAULT NULL,
-- File characteristics
file_size_bytes INT(10) NOT NULL DEFAULT 0,
-- ========== CREATOR DETAILS ==========
-- The person that created the template.
creator_user_token VARCHAR(32) NOT NULL,
-- For abuse tracking.
-- Wide enough for IPv4/6
creator_ip_address_creation VARCHAR(40) NOT NULL,
creator_ip_address_last_update VARCHAR(40) NOT NULL,
-- (THIS MIGHT NOT BE USED)
-- NB: DO NOT SORT!
-- THIS MUST MATCH THE RESPECTIVE JOBS TABLE.
creator_set_visibility ENUM(
'public',
'hidden',
'private'
) NOT NULL DEFAULT 'public',
-- ========== BUCKET STORAGE ==========
-- The pytorch model
-- For now, this will be a hash of the file contents.
-- NB: NOT UNIQUE! We can allow duplicate uploads.
private_bucket_hash CHAR(64) NOT NULL,
-- The "full url" of the bucket path, not including the hostname
private_bucket_object_name VARCHAR(255) NOT NULL,
-- ========== MODERATION DETAILS ==========
-- Mods have locked the ability for non-authors (ie. people who didn't upload this)
-- to assign the vocoder for use with their TTS models.
-- TTS models that already incorporate the vocoder will not be affected.
-- The vocoder will remain visible.
-- This is independent of other visibility controls (is_mod_disabled_from_author_use,
-- deleted_at, and creator_set_visibility)
is_mod_disabled_from_public_use BOOLEAN NOT NULL DEFAULT FALSE,
-- Mods have locked the ability for the author (ie. the person that uploaded this)
-- to assign the vocoder for use with their TTS models.
-- TTS models that already incorporate the vocoder will not be affected.
-- The vocoder will remain visible.
-- This is independent of other visibility controls (is_mod_disabled_from_public_use,
-- deleted_at, and creator_set_visibility)
is_mod_disabled_from_author_use BOOLEAN NOT NULL DEFAULT FALSE,
-- Extremely popular models may be locked from deletion or modification by users.
-- If true, only moderators can edit or delete the vocoder.
is_mod_author_editing_locked BOOLEAN NOT NULL DEFAULT FALSE,
-- If a moderator has comments.
maybe_mod_comments VARCHAR(255) DEFAULT NULL,
-- The last moderator that made changes.
maybe_mod_user_token VARCHAR(32) DEFAULT NULL,
-- ========== VECTOR CLOCK ==========
-- Incremented with every update.
version INT NOT NULL DEFAULT 0,
-- ========== TIMESTAMPS ==========
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- If this is removed by a mod.
-- It completely disappears from the system.
user_deleted_at TIMESTAMP NULL,
mod_deleted_at TIMESTAMP NULL,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (token),
KEY fk_creator_user_token (creator_user_token),
KEY fk_maybe_mod_user_token (maybe_mod_user_token),
KEY index_creator_ip_address_creation (creator_ip_address_creation),
KEY index_creator_ip_address_last_update (creator_ip_address_last_update),
KEY index_creator_set_visibility (creator_set_visibility),
KEY index_private_bucket_hash (private_bucket_hash),
KEY index_is_mod_disabled_from_public_use (is_mod_disabled_from_public_use),
KEY index_is_mod_disabled_from_author_use (is_mod_disabled_from_author_use),
KEY index_is_mod_author_editing_locked (is_mod_author_editing_locked)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
@@ -1,124 +0,0 @@
-- NB: This is a manually squashed view of all the CREATE and ALTER statements,
-- with comments attached to the fields for centralized documentation.
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
CREATE TABLE tts_inference_jobs (
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- Effective "primary key" (PUBLIC)
-- This is so the in-progress results can be looked up by the UI.
token VARCHAR(32) NOT NULL,
-- Idempotency token from client
-- This is so the frontend client doesn't submit duplicate jobs.
uuid_idempotency_token VARCHAR(36) NOT NULL,
-- ========== SUCCESS CASE ==========
-- If the job completes successfully, this is the result token.
-- This is only populated on a successful result.
on_success_result_token VARCHAR(32) DEFAULT NULL,
-- ========== INFERENCE DETAILS ==========
-- The model to use.
-- This also determines which architecture we're using.
model_token VARCHAR(32) NOT NULL,
-- If set, use a different pretrained vocoder.
maybe_override_pretrained_vocoder VARCHAR(64) DEFAULT NULL,
-- The raw, unprocessed user input.
raw_inference_text TEXT NOT NULL,
-- ========== CREATOR DETAILS ==========
-- Foreign key to user
-- If no user is logged in, this is null.
maybe_creator_user_token VARCHAR(32) DEFAULT NULL,
-- Based on a cookie sent by the frontend.
-- We'll save this even if the user is logged in.
maybe_creator_anonymous_visitor_token VARCHAR(32) DEFAULT NULL,
-- For abuse tracking.
-- Wide enough for IPv4/6
creator_ip_address VARCHAR(40) NOT NULL,
-- (THIS MIGHT NOT BE USED)
-- NB: DO NOT SORT!
-- THIS MUST MATCH THE RESPECTIVE JOBS TABLE.
creator_set_visibility ENUM(
'public',
'hidden',
'private'
) NOT NULL DEFAULT 'public',
-- ========== SOURCE METADATA ==========
is_from_api BOOLEAN NOT NULL DEFAULT FALSE,
is_for_twitch BOOLEAN NOT NULL DEFAULT FALSE,
-- If true, the request gets routed to a special "debug" worker.
is_debug_request BOOLEAN NOT NULL DEFAULT FALSE,
-- ========== JOB SYSTEM DETAILS ==========
-- Jobs begin as "pending", then transition to other states.
--
-- * Pending = job is ready to go
-- * Started = job is running
-- * Complete_Success = job is done (success)
-- * Complete_Failure = job is done (failure)
-- * Attempt_Failed = job failed but may retry.
-- * Dead = job failed permanently.
--
-- Pending -> Started -> Complete_Success
-- |-> Complete_Failure
-- \-> Attempt_Failed -> Started -> { Complete, Failed, Dead }
status ENUM(
'pending',
'started',
'complete_success',
'complete_failure',
'attempt_failed',
'dead') NOT NULL DEFAULT 'pending',
-- Priority *increases*, so a level of 2 will be higher than 1.
-- These are the level semantics currently:
-- - All jobs from anonymous FakeYou users have level 0.
-- - All jobs from logged in FakeYou users have level 1.
-- - All jobs from Twitch TTS (unpaid) have level 10 (ten).
-- - (There will be future levels for paid Twitch and social FakeYou rewards.)
priority_level TINYINT UNSIGNED NOT NULL DEFAULT 0,
-- We can track this against a "max_attempt_count"
attempt_count INT(3) NOT NULL DEFAULT 0,
-- If there is a failure, tell the user why.
failure_reason VARCHAR(512) DEFAULT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- Failed jobs will set a next attempt time.
-- Subsequent tries can increase the timeout.
-- Failures because of permissions require human intervention => [retry_at=null].
-- Failures because of invalid files are dead => [status=dead].
retry_at TIMESTAMP NULL,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (token),
UNIQUE KEY (uuid_idempotency_token),
KEY fk_on_success_result_token (on_success_result_token),
KEY fk_model_token (model_token),
KEY fk_maybe_creator_user_token (maybe_creator_user_token),
KEY index_status (status),
KEY index_creator_ip_address (creator_ip_address),
KEY index_is_debug_request (is_debug_request)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
@@ -1,217 +0,0 @@
-- NB: This is a manually squashed view of all the CREATE and ALTER statements,
-- with comments attached to the fields for centralized documentation.
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
CREATE TABLE tts_models (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- Effective "primary key" (PUBLIC)
token VARCHAR(32) NOT NULL,
-- NB: DO NOT CHANGE ORDER; APPEND ONLY!
-- THIS MUST MATCH THE RESPECTIVE JOBS TABLE.
tts_model_type ENUM(
'not-set',
'tacotron2',
'glowtts',
'glowtts-vocodes',
'talknet'
) NOT NULL DEFAULT 'not-set',
-- The name of the type of pipeline to use, eg "legacy_fakeyou", "legacy_vocodes", "english_v1", etc.
-- New pipelines may be added at any point in the future and the source of truth for them will mostly
-- live in the `storyteller-ml` repository.
-- Older models and brand new models will have this field set to null, and we'll infer which value to
-- lazily backfill based on the creation date and language setting.
text_pipeline_type VARCHAR(64) DEFAULT NULL,
-- For models distributed as archives/bundles (eg. TalkNet), we can pack
-- in a vocoder. Note that this vocoder does not have to be used.
has_self_contained_vocoder BOOLEAN NOT NULL DEFAULT FALSE,
-- For models distributed as archives/bundles (eg. TalkNet), we can pack
-- in a duration model.
has_self_contained_duration_model BOOLEAN NOT NULL DEFAULT FALSE,
-- For models distributed as archives/bundles (eg. TalkNet), we can pack
-- in a pitch model.
has_self_contained_pitch_model BOOLEAN NOT NULL DEFAULT FALSE,
-- NB(2022-07-05): THIS IS NOW MEANINGLESS AND SUPERSEDED BY `TEXT_PIPELINE_TYPE`.
-- NB: DO NOT CHANGE ORDER; APPEND ONLY!
-- How text should be handled.
text_preprocessing_algorithm ENUM(
'basic',
'arpabet'
) NOT NULL DEFAULT 'basic',
-- If set, use a different pretrained vocoder.
-- If not set, use the website default. (Currently HifiGan-SS)
maybe_default_pretrained_vocoder VARCHAR(64) DEFAULT NULL,
-- If set, we'll use a custom vocoder (from table vocoder_models) instead of a default vocoder.
-- If not set, we'll use `maybe_default_pretrained_vocoder` (or the website default).
maybe_custom_vocoder_token VARCHAR(32) DEFAULT NULL,
-- Optional Pointer to a newer version of the voice
-- If there's a newer version, we can disable this one.
-- maybe_updated_model_token VARCHAR(32) DEFAULT NULL,
-- We can set as a combination of ['username' + 'voice-name']
-- There can be public aliases for voices, eg. a voice's default model.
-- A user can change this.
-- As such, these should not be foreign keys.
-- updatable_slug VARCHAR(64) NOT NULL,
-- Can be linked to a well-known voice
-- maybe_subject_token VARCHAR(32) DEFAULT NULL,
-- maybe_actor_subject_token VARCHAR(32) DEFAULT NULL,
-- ========== UNSTRUCTURED METADATA ==========
-- The full IETF BCP47 language tag (eg. en, en-US, es-419, ja-JP, pt, etc.)
ietf_language_tag VARCHAR(64) NOT NULL DEFAULT 'en',
-- The IETF BCP47 language tag's primary language subtag (eg. "es-419" becomes "es")
ietf_primary_language_subtag VARCHAR(12) NOT NULL DEFAULT 'en',
-- The "name" of the voice model, which might be complicated.
-- If maybe_subject_token (etc.) is set, then it's authoritative instead.
title VARCHAR(255) NOT NULL,
-- The description of the model in markdown.
description_markdown TEXT NOT NULL,
-- Generated HTML (not user-editable).
description_rendered_html TEXT NOT NULL,
-- eg. Bill Clinton, Batman, or Goku.
voice_name VARCHAR(255) DEFAULT NULL,
-- Optional; eg. Sean Schemmel
actor_name VARCHAR(255) DEFAULT NULL,
-- Optional; eg. if the voice is "happy" or a singer "a-capella", etc.
characteristic VARCHAR(255) DEFAULT NULL,
-- Optional; eg. if you train the model more than once.
version_string VARCHAR(255) DEFAULT NULL,
-- Whether the voice features on the front of FakeYou or Storyteller Twitch TTS
is_front_page_featured BOOLEAN NOT NULL DEFAULT FALSE,
is_twitch_featured BOOLEAN NOT NULL DEFAULT FALSE,
-- A suggested bot command prefix, eg. 'sonic' that could be interpreted as '/sonic'
-- by a TTS system. These are unique strings that can only be applied to one model at
-- a time at most. Only moderators can set this, and it's only for the best voices.
maybe_suggested_unique_bot_command VARCHAR(255) DEFAULT NULL,
-- ========== IMMUTABLE PROVENANCE AND METADATA ==========
-- Where the file was originally downloaded (if it was downloaded)
original_download_url VARCHAR(512) DEFAULT NULL,
-- The filename that was used at upload time (if available)
original_filename VARCHAR(255) DEFAULT NULL,
-- File characteristics
file_size_bytes INT(10) NOT NULL DEFAULT 0,
-- ========== CREATOR DETAILS ==========
-- The person that created the template.
creator_user_token VARCHAR(32) NOT NULL,
-- For abuse tracking.
-- Wide enough for IPv4/6
creator_ip_address_creation VARCHAR(40) NOT NULL,
creator_ip_address_last_update VARCHAR(40) NOT NULL,
-- (THIS MIGHT NOT BE USED)
-- NB: DO NOT SORT!
-- THIS MUST MATCH THE RESPECTIVE JOBS TABLE.
creator_set_visibility ENUM(
'public',
'hidden',
'private'
) NOT NULL DEFAULT 'public',
-- ========== BUCKET STORAGE ==========
-- The pytorch model
-- For now, this will be a hash of the file contents.
-- NB: NOT UNIQUE! We can allow duplicate uploads.
private_bucket_hash CHAR(64) NOT NULL,
-- The "full url" version of the path
private_bucket_object_name VARCHAR(255) NOT NULL,
-- Whether the file is a zip archive (rather than a model file).
private_bucket_object_is_archive BOOLEAN NOT NULL DEFAULT FALSE,
-- ========== RATING AND RANKING ==========
-- Calculated average, on a scale of 0-100
-- Null with zero ratings.
-- calculated_average_score INT(3) DEFAULT NULL,
-- Other metrics
-- calculated_total_ratings_submitted_count INT(10) NOT NULL DEFAULT 0,
-- calculated_total_uses_count BIGINT(10) NOT NULL DEFAULT 0,
-- ========== MODERATION DETAILS ==========
-- Mods have to approve of tts models for them to show up in a public index.
-- Models can be used by the author (or other parties that know the URL) before
-- they're approved, but unapproved models won't show up in public indices.
-- This is independent of other visibility controls (is_mod_disabled, deleted_at,
-- and creator_set_visibility)
is_public_listing_approved BOOLEAN DEFAULT NULL,
-- Extremely popular models may be locked from deletion or modification by users.
is_locked_from_user_modification BOOLEAN NOT NULL DEFAULT FALSE,
-- In this case, a moderator disables it from being used for inference.
-- This also disables it for the creator.
-- Unlike deletion, it remains "visible" to those that have access.
is_locked_from_use BOOLEAN NOT NULL DEFAULT FALSE,
-- If a moderator has comments.
maybe_mod_comments VARCHAR(255) DEFAULT NULL,
-- The last moderator that made changes.
maybe_mod_user_token VARCHAR(32) DEFAULT NULL,
-- ========== VECTOR CLOCK ==========
-- Incremented with every update.
version INT NOT NULL DEFAULT 0,
-- ========== TIMESTAMPS ==========
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- If this is removed by a mod.
-- It completely disappears from the system.
user_deleted_at TIMESTAMP NULL,
mod_deleted_at TIMESTAMP NULL,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (token),
KEY fk_creator_user_token (creator_user_token),
KEY fk_maybe_mod_user_token (maybe_mod_user_token),
KEY fk_maybe_custom_vocoder_token (maybe_custom_vocoder_token),
KEY index_creator_ip_address_creation (creator_ip_address_creation),
KEY index_creator_ip_address_last_update (creator_ip_address_last_update),
KEY index_creator_set_visibility (creator_set_visibility),
KEY index_private_bucket_hash (private_bucket_hash),
KEY index_is_public_listing_approved (is_public_listing_approved),
KEY index_is_locked_from_user_modification (is_locked_from_user_modification),
KEY index_is_locked_from_use (is_locked_from_use)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+48
View File
@@ -0,0 +1,48 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- 1) Find uploads that failed (recently)
select
id,
token,
download_type,
title,
download_url,
status,
attempt_count
from generic_download_jobs
where status IN ('started', 'attempt_failed', 'complete_failure', 'dead')
and download_type NOT IN ('vits', 'hifigan')
and created_at > NOW() - INTERVAL 15 DAY;
-- 2) Then restart them
-- NB: Double inner query is to get away from query optimizer:
-- "You can't specify target table 'generic_download_jobs' for update in FROM clause"
update generic_download_jobs
set
status='pending',
attempt_count=0
where token IN (
select token from (
select token
from generic_download_jobs
where status IN ('started', 'attempt_failed', 'complete_failure', 'dead')
and download_type NOT IN ('vits', 'hifigan')
and created_at > NOW() - INTERVAL 15 DAY
) as x
);
-- Kill bad pending downloads
-- eg. awful voices, like Hitler
update generic_download_jobs
set
status='dead',
download_url = CONCAT('NOPE', download_url)
where token = 'jdown_ssape40dxbfgvhtsmedt34418x'
limit 1;
+13
View File
@@ -0,0 +1,13 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Kill routed jobs
update generic_inference_jobs set status = 'dead' where maybe_routing_tag IS NOT NULL limit 100;
-- Get pending jobs
select count(*) from generic_inference_jobs where status = 'pending';
update generic_inference_jobs
set status = 'dead'
where status IN ('pending', 'started', 'attempt_failed');
+24
View File
@@ -0,0 +1,24 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Kill pending jobs
update tts_inference_jobs set status = 'dead' where status = 'pending';
-- Kill all low priority pending, waiting, and in-progress jobs
update tts_inference_jobs
set status = 'dead'
where status IN ('pending', 'started', 'attempt_failed')
and priority_level IN (0, 1);
-- Kill all pending jobs
update tts_inference_jobs
set status = 'dead'
where status = 'pending';
-- Kill all waiting and in-progress jobs
update tts_inference_jobs
set status = 'dead'
where status IN ('pending', 'started', 'attempt_failed');
+11
View File
@@ -0,0 +1,11 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Delete TTS results for a single model
-- Do this in short batches so a lock isn't held for prohibitively long.
update tts_results
set mod_deleted_at = NOW()
where model_token = 'TM:ztt5s1be5tq6'
and mod_deleted_at IS NULL
limit 5000;
+35
View File
@@ -0,0 +1,35 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Upgrade top TTS model uploaders to a loyalty plan
update users
set maybe_loyalty_program_key = 'fakeyou_contributor'
where token IN (
select creator_user_token from
(
select count(*) as upload_count,
creator_user_token
from tts_models
group by creator_user_token
having upload_count >= 10
order by upload_count desc
) as t
);
-- Upgrade top VC model uploaders to a loyalty plan
update users
set maybe_loyalty_program_key = 'fakeyou_contributor'
where token IN (
select creator_user_token from
(
select count(*) as upload_count,
creator_user_token
from voice_conversion_models
group by creator_user_token
having upload_count >= 10
order by upload_count desc
) as t
);
+312
View File
@@ -0,0 +1,312 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Remove temporary test models
update voice_conversion_models
set
mod_deleted_at = NOW(),
maybe_mod_comments = 'temporary test model'
where token IN (
'vcm_jt9mdz9xjjcb',
'vcm_4xzkzdhs4kk5',
'vcm_502wkt2pca3y'
);
-- Remove broken models
update voice_conversion_models
set
mod_deleted_at = NOW(),
maybe_mod_comments = 'broken model'
where token IN (
'vcm_982y9g6v3jrg',
'vcm_16rpyehf7f0a',
'vcm_8vjtz3dbnw17',
'vcm_tc9mwr60cjth',
'vcm_bshsyp01w9vg',
'vcm_31whj8apmqj7',
'vcm_84qa0an44p8p',
'vcm_9xx4v5qz5fbg',
'vcm_7zp2b2hs2at2',
'vcm_zhvk0mnnb7zp',
'vcm_1vc4scq9qp6m',
'vcm_sr1b54mwy0ym',
'vcm_qx96y8aasydk'
);
-- Remove duplicate models
update voice_conversion_models
set
mod_deleted_at = NOW(),
maybe_mod_comments = 'duplicate model'
where token IN (
'vcm_6w21em1bs7q3',
'vcm_sbhvyj7926w4',
'vcm_anv469g89adz',
'vcm_xsx5yx585c7x',
'vcm_dpahzjjpkf18',
'vcm_y09dqe6zgwyk',
'vcm_xrp96dwgppv2',
'vcm_84awjbjxts6n',
'vcm_b2x2sn8kf28j',
'vcm_41nw6xgr5x3v',
'vcm_a6x83tk0ttf2',
'vcm_dgjgqxq5w97j',
'vcm_59k5j452x7xy',
'vcm_09p6vqnk7n05',
'vcm_attanwh383hg',
'vcm_t8d4f6w9pa8t',
'vcm_s8s4q4c65xsy',
'vcm_6e2av8pmkyz5',
'vcm_82x5f330z4wf',
'vcm_z6bax4kvjdx6',
'vcm_v8hf35cyq3ft',
'vcm_1h9b4v6nxmf5',
'vcm_781bzn81qf6k',
'vcm_w0xjjsexktby',
'vcm_awsq3q4c711w',
'vcm_kttxt7wgb6s6',
'vcm_ets26z5fpt8d',
'vcm_wjrw59wmwcrr',
'vcm_bebgka17n0sr',
'vcm_6mj0x3qd7yfd',
'vcm_b71ke4fm61nx',
'vcm_srz3gas5ra4d',
'vcm_k64jj2t2j05b',
'vcm_140rd035642m',
'vcm_5y93wgr90s91',
'vcm_jwp6p08byjn9',
'vcm_ets26z5fpt8d',
'vcm_7yfwzsyvrpq4',
'vcm_f1vq0hp0tes2',
'vcm_9f05kg36q4fg',
'vcm_1xs9c2sgykgy',
'vcm_hnd9z2fxq661',
'vcm_jxd74xhcszry',
'vcm_tvk0g6dwg3yv',
'vcm_vrsdv4ahterx',
'vcm_e2debszbm8vt',
'vcm_rh98fw9a9an1',
'vcm_2bvd1gmysaxf',
'vcm_2cqq1j33y2hr',
'vcm_ysj7kwb96kcp',
'vcm_ef0eaneyr72p',
'vcm_t59d7vdxtqs4',
'vcm_90hrepevshtg',
'vcm_4st9ex13vnbh',
'vcm_30fne697qhab',
'vcm_qy7evy03p6tg',
'vcm_775eze19tv0n',
'vcm_4bzkfvaexbv3',
'vcm_08v2tdga8v93',
'vcm_whxeyxzw12q6',
'vcm_0rj5b6npxfkh',
'vcm_hv22emyfkex4',
'vcm_a1fmtgthezs0',
'vcm_z9fpz1p5bpr2',
'vcm_2y8ck2dbppkq',
'vcm_0c9h3mzc4kre',
'vcm_m0z3tt4gytm9'
);
-- Remove duplicate models (2)
update voice_conversion_models
set
mod_deleted_at = NOW(),
maybe_mod_comments = 'duplicate model'
where token IN (
'vcm_v790w43dv3ce',
'vcm_xmzm7eextc3n',
'vcm_r3b91dr0eta5',
'vcm_p1rpmfmckd5c',
'vcm_cpajdgenjfw7',
'vcm_qchjs52fsr9y',
'vcm_pkkjy8c6cpt3',
'vcm_f8ra6j8d6wgv',
'vcm_mhsz9bjn19tw',
'vcm_btd5zab2jdqv',
'vcm_q5evptaaqne3',
'vcm_wqtqs4gj2zmj',
'vcm_14rv35fct2ay',
'vcm_418j0h41qy8a',
'vcm_3m5m6bpm0rt2',
'vcm_gdw4krmaxpza',
'vcm_b3xhdb8zymvf',
'vcm_aak9m6nvj3am',
'vcm_mcw5kn21bbjh',
'vcm_fydr6ts21mtf',
'vcm_zpw560jzyqpw',
'vcm_w24wcctnxbxf',
'vcm_ya5tpzdcvvcz',
'vcm_1ctmgrjtn1j7',
'vcm_rk8fycc0reb2',
'vcm_e2c8942vky34',
'vcm_wevg8cf3hcw8',
'vcm_6hzbyg453xb9',
'vcm_xqfffshe2g0q',
'vcm_32j1zmcvn61n'
);
-- Remove duplicate models (3)
update voice_conversion_models
set
mod_deleted_at = NOW(),
maybe_mod_comments = 'duplicate model'
where token IN (
'vcm_46sbq0r9hfjk',
'vcm_k8nseqy8jyte',
'vcm_gs8qam6npe46',
'vcm_djh15g49cxm8',
'vcm_d7zygjnp35my',
'vcm_334yqeq11rpm',
'vcm_6m3b6121318k',
'vcm_a419w7gw6jrt',
'vcm_wtyszwjwq0ts',
'vcm_0q9t2azhqvf1',
'vcm_fx2k40ffzjqg',
'vcm_wvjqmzd8y4mt',
'vcm_b2635v3p50je',
'vcm_zfyr07z2d0rb',
'vcm_yn2sn5j2jwed',
'vcm_z596ja3yvyy9',
'vcm_a1p854bn1sjs',
'vcm_fv24vmr93805',
'vcm_0y7vsc2e9s3r',
'vcm_5aqzq0d246rm',
'vcm_trvge62x7je9',
'vcm_sghga68kwggk',
'vcm_raxcc33pj608',
'vcm_a66b3va0sj64',
'vcm_bd1rjawqypw6',
'vcm_evzff14n721p',
'vcm_jnrr4ht9f42f'
);
-- Remove duplicate models (4)
update voice_conversion_models
set
mod_deleted_at = NOW(),
maybe_mod_comments = 'duplicate model'
where token IN (
'vcm_ds2pz63sagan',
'vcm_wkczgvq2fjqq',
'vcm_z8137w1rddse',
'vcm_gknzxybf4erw',
'vcm_z0m1qtmawccn',
'vcm_yek6pmgvbb1s',
'vcm_qqhnjwsjrvnx',
'vcm_8fetm7qz94cp',
'vcm_kz1zm1d269j0',
'vcm_rfnkc8g5gbbv',
'vcm_4ncqxetfe7dm',
'vcm_qkpfem2a153n',
'vcm_z5jkd9r4cawf',
'vcm_vgh6ja6zzj0p',
'vcm_bd473tdrrzhk',
'vcm_2k7tmx3ndd3y',
'vcm_weyxz516dd2m',
'vcm_1j4kpjvgsj6k',
'vcm_211g17ea44fw',
'vcm_7zkbj6be0yr5',
'vcm_nnaaxeqy4xj6',
'vcm_wp7sgtz6mhc4',
'vcm_h5w7fzhxcpxm',
'vcm_7d5rxpqkjy07',
'vcm_9vhjvrptygfz',
'vcm_4qbbawahnkvb',
'vcm_am870m8162at',
'vcm_cftdb5227qt5',
'vcm_m7vv1mcxfxvm',
'vcm_qn8vsvvh1rqc',
'vcm_erhvqjvk1dsk',
'vcm_4zs8tdrw971e',
'vcm_4zs8tdrw971e',
'vcm_z8htjaejr1wx',
'vcm_99wdsazefjwr',
'vcm_k1at1sbepvqv',
'vcm_xcp34f5d7ygs',
'vcm_8v8srq9sx7cq',
'vcm_f2yf7bxmk8h5',
'vcm_gvtrjte4as1s',
'vcm_2s0y50avy43b',
'vcm_r638ygfxkpmq',
'vcm_1ttm6pxcpqna',
'vcm_0ytfkxh6pm4f',
'vcm_zderdrfmgq6c',
'vcm_jvdpr6mtddb8',
'vcm_9tvcv961g09x',
'vcm_aynpmxbhpy7n',
'vcm_2gzsjb5bdsdq',
'vcm_a0vep64tz56n',
'vcm_zt4hgc9pyv11',
'vcm_szfxm0crd8y8',
'vcm_3q89kba3cy5z',
'vcm_ywpwnhk4pv4x',
'vcm_4he8jjmengb3',
'vcm_jpdfswn0empy',
'vcm_2nztkt3rgm1q',
'vcm_q5gyxf5a11zf',
'vcm_sa7k9ycne147',
'vcm_p6gxtj9qefsg',
'vcm_j2fvzdyachtw',
'vcm_ecbv0rhc6br3',
'vcm_jrgwspz2wt7p',
'vcm_f5b4j3rt180n',
'vcm_pzajxdfcjfpa',
'vcm_rq4f2cbbm6j1',
'vcm_rdmfpbnab47w',
'vcm_03dtk4xtggm6',
'vcm_zx7mdkh9s9qb',
'vcm_e0megdtf71x6'
);
-- Remove older models replaced by new versions
update voice_conversion_models
set
mod_deleted_at = NOW(),
maybe_mod_comments = 'replaced with new version'
where token IN (
'vcm_gdg3najz6j3g'
);
-- Remove takedown request models
update voice_conversion_models
set
mod_deleted_at = NOW(),
maybe_mod_comments = 'takedown request'
where token IN (
'vcm_2af74np3jh6q',
'vcm_8kk7355dc184',
'vcm_nsh89pcx4569',
'vcm_q7ewn3yym4gy',
'vcm_cwngb21xsf66',
'vcm_jmzjrky179cm',
'vcm_hj6a1nt1yvh9',
'vcm_6wwx1e3cd48s',
'vcm_pc76gc1xh7jg',
'vcm_gb0p1wmtk9wp',
'vcm_pbs955dvaeq6',
'vcm_x2wyzr6h6539',
'vcm_py7qwz310qff',
'vcm_k01bqvh0dseq',
'vcm_5m4dsn2fwa0q',
'vcm_hn9m98g1am3z',
'vcm_f9168tyyn6ex',
'vcm_03y9w4h99r1h',
'vcm_yr9f1s0xc7pc',
'vcm_45767r26a9bb',
'vcm_rq3cvp3x3hnh',
'vcm_ng1nz8d67z4v',
'vcm_f5arabzrk4en',
'vcm_d379600cr8yx',
'vcm_p7m9jw1krrkr',
'vcm_x7v3m9mcvten',
'vcm_6r057m7594bv',
'vcm_wkm9e42d3spm'
);
+25
View File
@@ -0,0 +1,25 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Kill pending jobs
update w2l_inference_jobs set status='dead' where status IN ('pending', 'started', 'attempt_failed');
-- Unstick old jobs that might be stuck as "started"
update w2l_template_upload_jobs
set status='dead'
where status='started'
and created_at < ( CURDATE() - INTERVAL 1 DAY );
-- Kill pending jobs with tiktok URLs:
-- These need to be blocked in the server and job directly.
update w2l_template_upload_jobs
set status='dead'
where status='pending'
and download_url LIKE '%tiktok%';
-- Kill all pending jobs
update w2l_template_upload_jobs
set status='dead'
where status IN ('pending', 'started', 'attempt_failed');
@@ -0,0 +1,36 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- NB: These are for use in Stripe Sigma, not MySQL
-- NB: You must use single quotes instead of double quotes when comparing string values.
-- Histogram of customers by country
select address_country, count(*)
from customers
group by address_country
select customer_id, subscriptions.status
from subscriptions
select distinct customer_id
from subscriptions
where subscriptions.status = 'active'
or subscriptions.status = 'past_due'
select address_country, count(*) as country_count
from customers
where id IN (
select distinct customer_id
from subscriptions
where subscriptions.status = 'active'
or subscriptions.status = 'past_due'
)
group by address_country
-- Histogram
select address_country, count(*)
from customers
group by address_country
@@ -0,0 +1,90 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- NB: These are for use in Stripe Sigma, not MySQL
-- NB: You must use single quotes instead of double quotes when comparing string values.
-- Status values: past_due, incomplete, active, canceled, incomplete_expired (perhaps not exhaustive)
select distinct status
from subscriptions
select count(*)
from subscriptions
where status IN ('active');
-- Metadata is in the 'subscriptions_metadata' table, and we store 'username', 'email', and 'user_token'
select
m.value,
m.key,
s.id,
s.created,
s.cancel_at,
s.canceled_at
from subscriptions as s
join subscriptions_metadata as m
on m.subscription_id = s.id
where m.key = 'username'
-- Full mapping of Stripe subscribers to FakeYou users
select
s.id as subscription_id,
user_tokens.user_token,
usernames.username,
emails.email,
s.status as subscription_status,
s.created,
s.cancel_at,
s.canceled_at
from subscriptions as s
join (
select
m.subscription_id,
m.value as username
from subscriptions_metadata as m
where m.key = 'username'
) as usernames
on s.id = usernames.subscription_id
join (
select m.subscription_id,
m.value as email
from subscriptions_metadata as m
where m.key = 'email'
) as emails
on s.id = emails.subscription_id
join (
select m.subscription_id,
m.value as user_token
from subscriptions_metadata as m
where m.key = 'user_token'
) as user_tokens
on s.id = user_tokens.subscription_id
order by s.id asc
-- Without emails
select
s.id as subscription_id,
user_tokens.user_token,
usernames.username,
s.status as subscription_status,
s.created,
s.cancel_at,
s.canceled_at
from subscriptions as s
join (
select
m.subscription_id,
m.value as username
from subscriptions_metadata as m
where m.key = 'username'
) as usernames
on s.id = usernames.subscription_id
join (
select m.subscription_id,
m.value as user_token
from subscriptions_metadata as m
where m.key = 'user_token'
) as user_tokens
on s.id = user_tokens.subscription_id
order by s.id asc
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- NB: These are for use in Stripe Sigma, not MySQL
-- NB: You must use single quotes instead of double quotes when comparing string values.
@@ -0,0 +1,196 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- See how long recent jobs are taking
select
id,
maybe_input_source_token,
assigned_worker,
assigned_cluster,
success_execution_millis / 1000 / 60 as minutes
from generic_inference_jobs
where status != 'pending'
and success_execution_millis IS NOT NULL
order by id desc
limit 50;
-- Detailed report on most recent jobs, ordered by worst performing.
-- TODO: Determine if the problem is in downloading models. Make sure the job timer doesn't include
-- sections where models / files get downloaded.
select *
from (
select
jobs.created_at,
jobs.first_started_at,
jobs.id,
jobs.status,
jobs.attempt_count as attempts,
trim(replace(replace(jobs.internal_debugging_failure_reason, "\n", ""), "\r", ""))
as i_failure_reason,
-- u.username,
jobs.assigned_worker,
jobs.assigned_cluster,
jobs.maybe_input_source_token,
jobs.maybe_model_type,
jobs.maybe_model_token,
m.media_source,
m.maybe_original_mime_type as mime_type,
TRUNCATE(jobs.success_execution_millis / 1000 / 60, 2) as execution_mins,
TRUNCATE(jobs.success_inference_execution_millis / 1000 / 60, 2) as inference_mins,
TRUNCATE((jobs.success_execution_millis - jobs.success_inference_execution_millis) / 1000 / 60, 2) as extra_mins,
TRUNCATE(m.original_duration_millis / 1000 / 60, 2) as input_mins,
jobs.success_execution_millis / m.original_duration_millis as ratio
from generic_inference_jobs AS jobs
left join users AS u on
u.token = jobs.maybe_creator_user_token
left join media_uploads AS m on
m.token = jobs.maybe_input_source_token
where
jobs.status != 'pending'
AND jobs.created_at > NOW() - INTERVAL 20 MINUTE
order by id desc
limit 200
) as t
order by execution_mins desc;
order by assigned_worker desc, first_started_at asc;
order by first_started_at asc;
order by assigned_worker desc, execution_mins desc;
-- Get pending so-vits-svc jobs
select count(*)
from generic_inference_jobs
where maybe_model_type = 'so_vits_svc'
and status='pending';
-- Get jobs that have routing tags
select
id,
maybe_input_source_token,
maybe_creator_user_token,
maybe_routing_tag,
status
from generic_inference_jobs
where maybe_routing_tag IS NOT NULL
limit 10;
-- Debug that we're setting the correct metadata on jobs
-- For some reasons storyteller-web is enqueuing the wrong type!
select
jobs.id,
jobs.token,
jobs.maybe_model_type as jobs_model_type,
jobs.maybe_model_token as jobs_model_token,
models.token as model_token,
models.model_type as model_type
from generic_inference_jobs as jobs
left outer join voice_conversion_models as models
on jobs.maybe_model_token = models.token
order by jobs.id
desc
limit 100;
-- Generic inference jobs + legacy TTS (this is a production endpoint)
-- UPDATED QUERY: Queues as named rows
SELECT
maybe_model_type as queue_type,
count(*) as pending_job_count,
NOW() as present_time
FROM (
SELECT
token,
maybe_model_type
FROM generic_inference_jobs
WHERE status IN ("pending", "attempt_failed")
UNION
SELECT
token,
maybe_model_type
FROM generic_inference_jobs
WHERE status IN ("started")
AND created_at > (CURDATE() - INTERVAL 15 MINUTE)
) as generic_inner
GROUP BY queue_type
UNION
SELECT
"legacy_tts" as queue_type,
count(*) as pending_job_count,
NOW() as present_time
FROM
(
SELECT token
FROM tts_inference_jobs
WHERE status IN ("pending", "attempt_failed")
UNION
SELECT token
FROM tts_inference_jobs
WHERE status IN ("started")
AND created_at > (CURDATE() - INTERVAL 15 MINUTE)
) as legacy_inner
GROUP BY queue_type;
-- Generic inference jobs + legacy TTS (this was a production endpoint)
-- OLD QUERY: Queues as columns
SELECT
(
SELECT
COUNT(distinct token) as generic_job_count
FROM
(
SELECT token
FROM generic_inference_jobs
WHERE status = "started"
AND created_at > (CURDATE() - INTERVAL 5 MINUTE)
UNION
SELECT token
FROM generic_inference_jobs
WHERE status IN ("pending", "attempt_failed")
) as g
) as generic_job_count,
(
SELECT
COUNT(distinct token) as legacy_tts_job_count
FROM
(
SELECT token
FROM tts_inference_jobs
WHERE status = "started"
AND created_at > (CURDATE() - INTERVAL 5 MINUTE)
UNION
SELECT token
FROM tts_inference_jobs
WHERE status IN ("pending", "attempt_failed")
) as t
) as legacy_tts_job_count,
NOW() as present_time;
-- Histogram of inference
select
date(created_at) as created_date,
count(*) as job_count
from generic_inference_jobs
group by created_date
-- Histogram of inference (within range)
select
date(created_at) as created_date,
count(*) as job_count
from generic_inference_jobs
where created_at > (CURDATE() - INTERVAL 5 DAY)
group by created_date
-- Histogram of inference (within range)
select
date(created_at) as created_date,
count(*) as job_count
from generic_inference_jobs
where date(created_at) >= "2023-01-01"
group by created_date
@@ -0,0 +1,50 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
select
mu.id,
mu.token,
u.username,
mu.media_source,
maybe_original_filename as filename,
original_file_size_bytes as size_bytes,
original_duration_millis as duration_millis,
maybe_original_mime_type as mime_type
from media_uploads as mu
left join users AS u
on u.token = mu.maybe_creator_user_token
order by id desc limit 10;
-- Analyze all media
select
mu.id,
mu.token,
u.username,
mu.media_source,
maybe_original_filename as filename,
original_file_size_bytes as size_bytes,
original_duration_millis as duration_millis,
maybe_original_mime_type as mime_type
from media_uploads as mu
left join users AS u
on u.token = mu.maybe_creator_user_token
order by id desc
limit 40;
-- Analyze broken media (no duration)
select
mu.id,
mu.token,
u.username,
mu.media_source,
maybe_original_filename as filename,
original_file_size_bytes as size_bytes,
original_duration_millis as duration_millis,
maybe_original_mime_type as mime_type
from media_uploads as mu
left join users AS u
on u.token = mu.maybe_creator_user_token
where mu.original_duration_millis = 0
order by id desc
limit 40;
@@ -0,0 +1,43 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Select TTS models within a category
-- (NOTE CATEGORIES ARE *SOFT DELETED* AND THIS MAY MIS-ATTRIBUTE)
select
tts.token,
tts.ietf_language_tag,
tts.title
from tts_category_assignments as cat
join tts_models as tts
on tts.token = cat.model_token
where
cat.category_token = 'CAT:n06k9gfgq20';
-- Select TTS models within a category
select
tts.token,
tts.ietf_language_tag,
tts.title
from tts_category_assignments as cat
join tts_models as tts
on tts.token = cat.model_token
where
cat.category_token = 'CAT:jtdwpy6ptrn'
AND cat.deleted_at IS NULL;
-- Select TTS models within a category
-- Exclude given languages.
select
tts.token,
tts.ietf_language_tag,
tts.title
from tts_category_assignments as cat
join tts_models as tts
on tts.token = cat.model_token
where
cat.category_token = 'CAT:jtdwpy6ptrn'
AND tts.ietf_language_tag NOT IN ('es', 'es-419', 'es-ES', 'es-MX')
AND cat.deleted_at IS NULL;
+85
View File
@@ -0,0 +1,85 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Total pending jobs
select count(*)
from tts_inference_jobs
where status = 'pending';
-- Total pending API jobs
select count(*)
from tts_inference_jobs
where status = 'pending'
and is_from_api = true;
-- Top IP addresses making requests
select distinct creator_ip_address, count(*) as attempts
from tts_inference_jobs
where status = 'pending'
group by creator_ip_address
order by attempts desc
limit 50;
-- Top (IP addresses, usernames) making requests
select distinct j.creator_ip_address, u.username, count(*) as attempts
from tts_inference_jobs AS j
left outer join users AS u
on u.token = j.maybe_creator_user_token
where j.status = 'pending'
group by j.creator_ip_address, u.username
order by attempts desc
limit 50;
-- Find a job by an IP
select *
from tts_inference_jobs
where status = 'pending'
and creator_ip_address = '186.188.28.73'
limit 1;
-- Top voices in requests
select distinct model_token, count(*) as attempts
from tts_inference_jobs
where status = 'pending'
group by model_token
order by attempts desc
limit 50;
-- Sample the pending inference text
select creator_ip_address,
model_token,
maybe_creator_user_token,
raw_inference_text
from tts_inference_jobs
where status = 'pending';
-- Sample the pending inference text (truncated)
select creator_ip_address,
model_token,
maybe_creator_user_token,
TRIM(REPLACE(SUBSTRING(raw_inference_text, 1, 50), '\n', ''))
from tts_inference_jobs
where status = 'pending'
limit 100;
-- Sample long pending texts
select creator_ip_address,
model_token,
maybe_creator_user_token,
raw_inference_text
from tts_inference_jobs
where status = 'pending'
and length(raw_inference_text) > 100
limit 100;
-- Delete old TTS inference jobs (1)
DELETE FROM tts_inference_jobs
WHERE status IN ('dead', 'complete_success', 'complete_failure')
LIMIT 100000;
-- Delete old TTS inference jobs (2)
-- Roughly 20 seconds to delete 100k, 4 minutes for 1M.
DELETE FROM tts_inference_jobs
WHERE created_at < ( CURDATE() - INTERVAL 1 DAY )
LIMIT 100000;
+380
View File
@@ -0,0 +1,380 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
--
-- Top 100 models all time by use count
--
select
m.token,
m.text_pipeline_type,
m.ietf_language_tag,
m.title,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
order by r.use_count desc
limit 100;
--
-- Same, but simpler...
--
select m.token, m.title, r.use_count from (
select model_token, count(*) as use_count from tts_results
group by model_token
order by use_count desc limit 100
) as r
join tts_models as m
on m.token = r.model_token;
--
-- Top 100 models by use count, last 5 days
-- Limited due to tmux scrollback.
--
select
m.token,
m.text_pipeline_type,
m.ietf_language_tag,
m.title,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 12 HOUR )
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
order by r.use_count desc
limit 100;
--
-- Top models binned by IP address.
-- Should give us a look at demand independent of model quality / repeated use.
--
select
m.token,
m.title,
m.user_ratings_positive_count / m.user_ratings_total_count as rating,
m.text_pipeline_type,
m.ietf_language_tag,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from (
select model_token, creator_ip_address
from tts_results
where created_at > (CURDATE() - INTERVAL 12 HOUR)
group by model_token, creator_ip_address
) as x
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
where m.ietf_language_tag IN ('en', 'en-US', 'en-AU', 'en-CA', 'en-GB')
order by r.use_count desc
limit 100;
--
-- Top 20 ***NEW*** models to share in #announcements
-- Can be scoped by creator.
--
select
m.token,
m.text_pipeline_type,
m.ietf_language_tag,
m.creator_set_visibility,
m.title,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 5 DAY )
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
where m.created_at > ( CURDATE() - INTERVAL 31 DAY )
-- AND u.username IN ( 'vegito1089', 'justinjohn0306')
order by r.use_count desc
limit 100;
--
-- Top 100 models by use count, last 5 days, not spanish, etc.
-- Limited due to tmux scrollback.
--
select
m.token,
m.text_pipeline_type,
m.ietf_language_tag,
m.title,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 5 DAY )
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
where m.ietf_language_tag NOT IN ('es', 'es-419', 'es-ES', 'es-MX', 'pt-BR')
order by r.use_count desc
limit 100;
--
-- Top 100 models by use count, last 5 days, in specific language.
-- Limited due to tmux scrollback.
--
-- English: ('en', 'en-US', 'en-AU', 'en-CA', 'en-GB')
-- Spanish: ('es', 'es-419', 'es-AR', 'es-CL', 'es-CO', 'es-ES', 'es-MX', 'es-PE', 'es-US')
-- Italian: ('it', 'it-CH', 'it-IT')
-- Portuguese: ('pt', 'pt-BR')
--
select
m.token,
m.title,
m.text_pipeline_type,
m.ietf_language_tag,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 30 DAY )
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
where m.ietf_language_tag IN ('en', 'en-US', 'en-AU', 'en-CA', 'en-GB')
order by r.use_count desc
limit 100;
--
-- Most popular voices by use count over 5-day window, single language, single user.
--
select
m.token,
m.title,
m.ietf_language_tag,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 5 DAY )
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
where
m.ietf_language_tag NOT IN ('es', 'es-419', 'es-ES', 'es-MX', 'pt-BR')
AND u.username = 'vegito1089'
order by r.use_count desc
limit 100;
--
-- Most popular deleted models
--
select
m.token,
m.title,
m.ietf_language_tag,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where model_token IN (
select token
from tts_models
where
user_deleted_at IS NOT NULL
OR mod_deleted_at IS NOT NULL
)
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
order by r.use_count desc
limit 100;
--
-- Most popular deleted models (only by users, not mods)
-- Mod-deleted models were probably on purpose
--
select
m.token,
m.title,
m.ietf_language_tag,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where model_token IN (
select token
from tts_models
where
user_deleted_at IS NOT NULL
)
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
order by r.use_count desc
limit 100;
--
-- Models uploaded recently (to check if they use the right text_pipeline_type,
-- vocoder -todo-, etc.)
--
select
m.token,
m.title,
m.text_pipeline_type,
m.ietf_language_tag,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 5 DAY )
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
order by m.created_at desc
limit 100;
-- Histogram of model contributions
select
date(created_at) as created_date,
count(*) as model_count
from tts_models
group by created_date
-- Histogram of model contributions (within range)
select
date(created_at) as created_date,
count(*) as model_count
from tts_models
where created_at > (CURDATE() - INTERVAL 5 DAY)
group by created_date
--
-- Models deleted recently (voice actor take down)
--
select
m.token,
m.title,
m.text_pipeline_type,
m.ietf_language_tag,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 30 DAY )
group by model_token
) as r
join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
where m.mod_deleted_at > ( CURDATE() - INTERVAL 14 DAY )
or m.user_deleted_at > ( CURDATE() - INTERVAL 14 DAY )
order by r.use_count desc
limit 500;
--
-- Non-public models
--
select
m.token,
m.title,
m.text_pipeline_type,
m.ietf_language_tag,
m.creator_set_visibility,
u.username,
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 30 DAY )
group by model_token
) as r
left outer join tts_models as m
on m.token = r.model_token
join users as u
on u.token = m.creator_user_token
where m.creator_set_visibility != 'public'
order by r.use_count desc
limit 500;
+149
View File
@@ -0,0 +1,149 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
--
-- Usage count in the past 24 hours
--
select count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 1 DAY )
--
-- Usage count in the past week
--
select count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 7 DAY )
-- On-prem worker mix
select count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 1 MINUTE )
and is_generated_on_prem IS TRUE
-- Calculate a percentage of on-prem worker capacity
select count(*) as on_prem_count
from (
select is_generated_on_prem
from tts_results
order by id desc limit 1000
) as sample
where sample.is_generated_on_prem IS TRUE;
-- Histogram of days of content per day
select
date(created_at) as created_date,
sum(duration_millis) / 1000 / 60 / 60 / 24 as days
from tts_results
group by created_date
-- Histogram of days of content per day (range)
select
date(created_at) as created_date,
sum(duration_millis) / 1000 / 60 / 60 / 24 as days
from tts_results
where date(created_at) >= "2023-01-01"
group by created_date
-- Histogram of days of content per day (range)
-- Maybe non-tablescan?
select
date(created_at) as created_date,
sum(duration_millis) / 1000 / 60 / 60 / 24 as days
from tts_results
where created_at > (CURDATE() - INTERVAL 30 DAY)
group by created_date
-- Find TTS results for a single model
select count(*) from tts_results
where model_token = 'TM:ztt5s1be5tq6';
-- Find TTS results for a single model that are not deleted
select count(*) from tts_results
where model_token = 'TM:ztt5s1be5tq6'
and mod_deleted_at is NULL;
-- Sample results for a single model
select
TRIM(REPLACE(SUBSTRING(raw_inference_text, 1, 50), '\n', ''))
from tts_results
where model_token='TM:yt4gfbkngsjj'
order by id desc
limit 150;
-- Search for results by eminem
select
token,
created_at,
raw_inference_text
from tts_results
where
model_token IN ('TM:27fj0gsh11pd', 'TM:8h9bfjgabeer', 'TM:pdf9c1anbdjq')
AND raw_inference_text LIKE "%rave%"
AND raw_inference_text LIKE "%sound%"
AND created_at > ( CURDATE() - INTERVAL 5 MONTH )
ORDER BY created_at DESC
--- Search for particular text by a particular model
SELECT
raw_inference_text,
maybe_creator_user_token,
created_at
FROM
tts_results
WHERE
model_token = 'TM:ztt5s1be5tq6'
AND raw_inference_text LIKE '%fakeyou%'
--- Search for 101soundboards.com using us
SELECT
r.raw_inference_text,
r.maybe_creator_user_token,
u.username,
u.ip_address_creation,
r.creator_ip_address,
r.created_at
FROM
tts_results as r
LEFT OUTER JOIN
users as u
ON
r.maybe_creator_user_token = u.token
WHERE
r.raw_inference_text LIKE '%bananas%'
AND r.created_at > ( CURDATE() - INTERVAL 1 HOUR )
--- Search for 101soundboards.com using us
SELECT
r.maybe_creator_user_token, r.creator_ip_address, r.raw_inference_text
FROM
tts_results as r
LEFT OUTER JOIN
users as u
ON
r.maybe_creator_user_token = u.token
WHERE
r.raw_inference_text LIKE '%pickle%'
AND r.created_at > ( CURDATE() - INTERVAL 1 HOUR )
---
-- WTF WHY IS THIS SLOW???
SELECT
res.id,
model.title,
res.raw_inference_text,
res.maybe_creator_user_token
FROM
tts_results AS res
JOIN
tts_models as model
ON
res.model_token = model.token
ORDER BY res.id
LIMIT 10;
@@ -0,0 +1,56 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Example query for date ranges:
select count(*)
from users
where created_at BETWEEN '2023-07-01 00:00:00' AND '2023-07-30 00:00:00';
--
-- Month by month subscriber usages.
SELECT
username,
count(*) as total_use_count
FROM (
SELECT
u.username as username,
j.token as token
FROM users AS u
JOIN tts_inference_jobs AS j
ON u.token = j.maybe_creator_user_token
WHERE u.token IN (
SELECT DISTINCT user_token
FROM user_subscriptions
)
AND j.created_at BETWEEN '2022-12-01 00:00:00' AND '2023-01-01 00:00:00'
UNION
SELECT
u.username as username,
j.token as token
FROM users AS u
JOIN generic_inference_jobs AS j
ON u.token = j.maybe_creator_user_token
WHERE u.token IN (
SELECT DISTINCT user_token
FROM user_subscriptions
)
AND j.created_at BETWEEN '2022-12-01 00:00:00' AND '2023-01-01 00:00:00'
UNION
SELECT
u.username as username,
j.token as token
FROM users AS u
JOIN w2l_inference_jobs AS j
ON u.token = j.maybe_creator_user_token
WHERE u.token IN (
SELECT DISTINCT user_token
FROM user_subscriptions
)
AND j.created_at BETWEEN '2022-12-01 00:00:00' AND '2023-01-01 00:00:00'
) as t
GROUP BY username
ORDER BY total_use_count desc;
@@ -0,0 +1,161 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- TODO: Do an analysis of voice binned by # of paying customers that use it.
-- The most popular models amongst paying subscribers.
-- This should give us insight as to which models subscribers pay us for.
SELECT *
FROM (
SELECT
t.token,
t.title,
count(*) as use_count,
t.text_pipeline_type,
t.ietf_language_tag,
t.created_at,
t.user_deleted_at,
t.mod_deleted_at
FROM
tts_inference_jobs as j
JOIN
tts_models as t
ON
t.token = j.model_token
WHERE j.maybe_creator_user_token IN
(
select distinct user_token
from user_subscriptions
)
AND
j.created_at > ( CURDATE() - INTERVAL 1 DAY )
GROUP BY t.token
ORDER BY use_count DESC
) as x
WHERE
x.use_count > 10;
-- The first TTS voice a paying customer uses
-- TODO: List *all* of the voices a paying customer uses before they subscribe, not just the first.
-- select first row of partially aggregate query: https://stackoverflow.com/a/73157541
SELECT *
FROM (
SELECT
t.token,
t.title,
count(*) as use_count,
t.text_pipeline_type,
t.ietf_language_tag,
t.created_at,
t.user_deleted_at,
t.mod_deleted_at
FROM tts_models AS t
JOIN
(
SELECT
model_token
FROM (
SELECT
model_token,
maybe_creator_user_token,
row_number() over(partition by maybe_creator_user_token order by id asc) as rownum
FROM
tts_inference_jobs
WHERE maybe_creator_user_token IN
(
select distinct user_token
from user_subscriptions
where created_at > (CURDATE() - INTERVAL 2 DAY)
)
) AS x
WHERE rownum = 1
ORDER BY model_token desc
) AS y
ON t.token = y.model_token
GROUP BY t.token
) AS z
ORDER BY use_count desc
-- The first VC voice a paying customer uses
-- TODO: List *all* of the voices a paying customer uses before they subscribe, not just the first.
-- select first row of partially aggregate query: https://stackoverflow.com/a/73157541
SELECT *
FROM (
SELECT
m.token,
m.title,
count(*) as use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
FROM voice_conversion_models AS m
JOIN
(
SELECT
model_token
FROM (
SELECT
maybe_model_token as model_token,
maybe_creator_user_token,
row_number() over(partition by maybe_creator_user_token order by id asc) as rownum
FROM
generic_inference_jobs
WHERE maybe_model_token IS NOT NULL
AND maybe_creator_user_token IN
(
select distinct user_token
from user_subscriptions
where created_at > (CURDATE() - INTERVAL 2 DAY)
)
) AS x
WHERE rownum = 1
ORDER BY model_token desc
) AS y
ON m.token = y.model_token
GROUP BY m.token
) AS z
ORDER BY use_count desc
-- The last voice a paying customer uses
-- select first row of partially aggregate query: https://stackoverflow.com/a/73157541
SELECT *
FROM (
SELECT
t.token,
t.title,
count(*) as use_count,
t.text_pipeline_type,
t.ietf_language_tag,
t.created_at,
t.user_deleted_at,
t.mod_deleted_at
FROM tts_models AS t
JOIN
(
SELECT
model_token
FROM (
SELECT
model_token,
maybe_creator_user_token,
row_number() over(partition by maybe_creator_user_token order by id desc) as rownum
FROM
tts_inference_jobs
WHERE maybe_creator_user_token IN
(
select distinct user_token
from user_subscriptions
)
) AS x
WHERE rownum = 1
ORDER BY model_token desc
) AS y
ON t.token = y.model_token
GROUP BY t.token
) AS z
ORDER BY use_count desc
@@ -0,0 +1,170 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Number of paid users (inaccurate)
select count(*) from users where maybe_stripe_customer_id IS NOT NULL;
-- Number of paid users (inaccurate)
select count(*) from user_subscriptions;
-- Number of paid users
-- NB: "active" status users are current, treating "past_due" as active too (for now)
select count(*) from user_subscriptions where maybe_stripe_subscription_status NOT IN ("canceled", "incomplete", "incomplete_expired");
-- ==================== TTS + VC + W2L ====================
-- Make sure the time intervals are the same!
SELECT
username,
count(*) as total_use_count
FROM (
SELECT
u.username as username,
j.token as token
FROM users AS u
JOIN tts_inference_jobs AS j
ON u.token = j.maybe_creator_user_token
WHERE u.token IN (
SELECT DISTINCT user_token
FROM user_subscriptions
)
AND j.created_at > NOW() - INTERVAL 31 DAY
UNION
SELECT
u.username as username,
j.token as token
FROM users AS u
JOIN generic_inference_jobs AS j
ON u.token = j.maybe_creator_user_token
WHERE u.token IN (
SELECT DISTINCT user_token
FROM user_subscriptions
)
AND j.created_at > NOW() - INTERVAL 31 DAY
UNION
SELECT
u.username as username,
j.token as token
FROM users AS u
JOIN w2l_inference_jobs AS j
ON u.token = j.maybe_creator_user_token
WHERE u.token IN (
SELECT DISTINCT user_token
FROM user_subscriptions
)
AND j.created_at > NOW() - INTERVAL 31 DAY
) as t
GROUP BY username
ORDER BY total_use_count desc
-- ==================== TEXT TO SPEECH====================
-- All paid subscribers generating results in the last week
select u.username, count(*) as use_count
from users as u
join tts_inference_jobs as j
on u.token = j.maybe_creator_user_token
WHERE u.token IN (
select distinct user_token
from user_subscriptions
-- where maybe_stripe_subscription_status NOT IN ("canceled", "incomplete", "incomplete_expired")
)
AND j.created_at > NOW() - interval 7 day
GROUP BY u.username
ORDER BY use_count desc
-- Paid subscribers generating results in the last month (with # threshold)
select username, use_count
FROM (
select u.username, count(*) as use_count
from users as u
join tts_inference_jobs as j
on u.token = j.maybe_creator_user_token
WHERE u.token IN (
select distinct user_token
from user_subscriptions
where maybe_stripe_subscription_status NOT IN ("canceled", "incomplete", "incomplete_expired")
)
AND j.created_at > NOW() - interval 31 day
GROUP BY u.username
ORDER BY use_count desc
) as t
WHERE use_count > 10
-- Paid users generating results in the last month
select u.username, count(*) as use_count
from users as u
join tts_inference_jobs as j
on u.token = j.maybe_creator_user_token
WHERE u.token IN (
select distinct user_token
from user_subscriptions
where maybe_stripe_subscription_status NOT IN ("canceled", "incomplete", "incomplete_expired")
)
AND j.created_at > NOW() - interval 1 day
GROUP BY u.username
ORDER BY use_count desc
-- ==================== WAV2LIP ====================
select u.username, count(*) as use_count
from users as u
join w2l_inference_jobs as j
on u.token = j.maybe_creator_user_token
WHERE u.token IN (
select distinct user_token
from user_subscriptions
where maybe_stripe_subscription_status NOT IN ("canceled", "incomplete", "incomplete_expired")
)
AND j.created_at > NOW() - interval 31 day
GROUP BY u.username
ORDER BY use_count desc
select username, use_count
FROM (
select u.username, count(*) as use_count
from users as u
join w2l_inference_jobs as j
on u.token = j.maybe_creator_user_token
WHERE u.token IN (
select distinct user_token
from user_subscriptions
where maybe_stripe_subscription_status NOT IN ("canceled", "incomplete", "incomplete_expired")
)
AND j.created_at > NOW() - interval 31 day
GROUP BY u.username
ORDER BY use_count desc
) as t
WHERE use_count >=5;
-- ==================== TTS MODELS ====================
select u.username, count(*) as use_count
from users as u
join tts_model_upload_jobs as j
on u.token = j.creator_user_token
WHERE u.token IN (
select distinct user_token
from user_subscriptions
where maybe_stripe_subscription_status NOT IN ("canceled", "incomplete", "incomplete_expired")
)
AND j.created_at > NOW() - interval 1 day
GROUP BY u.username
ORDER BY use_count desc
-- ==================== W2L TEMPLATES ====================
select u.username, count(*) as use_count
from users as u
join w2l_template_upload_jobs as j
on u.token = j.creator_user_token
WHERE u.token IN (
select distinct user_token
from user_subscriptions
where maybe_stripe_subscription_status NOT IN ("canceled", "incomplete", "incomplete_expired")
)
AND j.created_at > NOW() - interval 1 day
GROUP BY u.username
ORDER BY use_count desc
@@ -0,0 +1,53 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
SELECT
u.username as username,
j.token as token
FROM users AS u
JOIN tts_inference_jobs AS j
ON u.token = j.maybe_creator_user_token
AND j.created_at > NOW() - INTERVAL 31 DAY
SELECT
t.maybe_creator_user_token as user_token,
u.username,
count(*) as usage_count,
u.created_at
FROM tts_results as t
JOIN users as u
ON u.token = t.maybe_creator_user_token
WHERE t.maybe_creator_user_token IS NOT NULL
GROUP BY t.maybe_creator_user_token
ORDER BY usage_count DESC
LIMIT 50000;
SELECT
v.maybe_creator_user_token as user_token,
u.username,
count(*) as usage_count
FROM voice_conversion_results as v
JOIN users as u
ON u.token = v.maybe_creator_user_token
WHERE v.maybe_creator_user_token IS NOT NULL
GROUP BY v.maybe_creator_user_token
ORDER BY usage_count DESC
LIMIT 5000;
SELECT
w.maybe_creator_user_token as user_token,
u.username,
count(*) as usage_count
FROM w2l_results as w
JOIN users as u
ON u.token = w.maybe_creator_user_token
WHERE w.maybe_creator_user_token IS NOT NULL
GROUP BY w.maybe_creator_user_token
ORDER BY usage_count DESC
LIMIT 5000;
@@ -0,0 +1,19 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- All users
select count(*) from users;
-- Users registered in the last year
select count(*)
from users
where created_at > ( CURDATE() - INTERVAL 365 DAY )
-- Histogram of user signups
select
date(created_at) as created_date,
count(*) as registered
from users
where date(created_at) >= "2023-01-01"
group by created_date

Some files were not shown because too many files have changed in this diff Show More