Compare commits

..
248 Commits
Author SHA1 Message Date
Kasisnu 7f8d1f113b funky dev setup 2024-07-24 16:17:50 +05:30
Kasisnu a2c1ae7c9b let existing tts enqueue route accept gptsovits 2024-07-22 19:35:01 +05:30
Kasisnu f47b729a46 gpt-sovits: inference works 2024-07-22 18:21:36 +05:30
Kasisnu 4f506f05cd gptsovits: working model upload inference job 2024-07-22 18:21:36 +05:30
Kasisnu a7d688d750 wip: super basic gptsovits 2024-07-22 18:21:36 +05:30
Brandon Thomas b6344a681f all payload types 2024-07-21 10:24:04 -04:00
Brandon Thomas 0454db0aa7 get the maximum use between stores 2024-07-21 10:03:44 -04:00
Brandon Thomas 233523c6b5 premium store is self-contained 2024-07-21 09:51:02 -04:00
Brandon Thomas e5e93364ae usage tracker wip 2024-07-21 09:25:04 -04:00
Brandon Thomas f17a9a034f premium keys 2024-07-21 00:17:47 -04:00
Brandon Thomas a06b583488 user token premium redis key 2024-07-21 00:09:16 -04:00
Brandon Thomas 96021d4507 add redis_schema lib (wip) 2024-07-20 23:51:11 -04:00
Brandon Thomas 7686eff0c1 better response type typing, less boilerplate 2024-07-19 23:44:45 -04:00
Brandon Thomas 705013f5e0 top models analytics query 2024-07-18 21:31:34 -04:00
Kasisnu 3f48bb217c fix: thumbnails outptu extension for requests (#360) 2024-07-18 21:31:47 +05:30
Brandon Thomas f72b4c973e updated queue stats endpoint 2024-07-17 16:49:45 -04:00
Brandon Thomas 5300902939 report on other queue stats 2024-07-17 16:26:30 -04:00
Kasisnu 9036f0993a make making thumbnails easier (#358) 2024-07-17 22:00:19 +05:30
Brandon Thomas 783ffef82c permanently fail on face detection errors 2024-07-17 08:04:24 -04:00
Brandon Thomas 5153bda209 fix command line arg 2024-07-16 22:34:42 -04:00
Brandon Thomas 0fdfc3b8fc move server "state" / configs to module 2024-07-16 22:28:43 -04:00
Brandon Thomas 17ce397d09 fixup args 2024-07-16 22:10:57 -04:00
Brandon Thomas 278d821207 reorganize file modules 2024-07-16 22:08:02 -04:00
Brandon Thomas 6352f710e0 cleanup and reorganize job code 2024-07-16 22:02:55 -04:00
Brandon Thomas e76d30caf7 make downloader common code 2024-07-16 21:39:25 -04:00
Brandon Thomas 576af78b2c input is image argument 2024-07-16 21:31:43 -04:00
Brandon Thomas d88ace6706 don't log routing tag mismatch 2024-07-16 21:08:31 -04:00
Brandon Thomas 13fe465740 fix job selection for empty scoping 2024-07-16 20:34:06 -04:00
Brandon Thomas 00ad03a819 analytics query 2024-07-16 20:25:03 -04:00
Brandon Thomas de36342731 fix model scoping for empty string 2024-07-16 19:52:15 -04:00
Brandon Thomas dafeb616a5 scope jobs by type 2024-07-16 19:10:26 -04:00
Brandon Thomas 9708e91137 public-facing inference job type 2024-07-16 17:37:58 -04:00
Brandon Thomas 06ac75a569 let users use upscaler 2024-07-16 15:54:20 -04:00
Brandon Thomas 142519b97f fix api docs 2024-07-16 15:29:14 -04:00
Brandon Thomas 8639788706 rename live portrait endpoint 2024-07-16 15:11:36 -04:00
Brandon Thomas 6af2b3f173 add support for mp4 image planes 2024-07-16 13:27:13 -04:00
Brandon Thomas 2bee82f0ae connect the last few pieces 2024-07-16 03:45:24 -04:00
Brandon Thomas 7c5ba2542c inference job - upload results 2024-07-16 03:28:39 -04:00
Brandon Thomas 7644c6813c new enum to begin field deprecation 2024-07-16 02:54:39 -04:00
Brandon Thomas 84c5ae9d18 move inference job CLI so we can reuse it 2024-07-16 02:01:32 -04:00
Brandon Thomas cc41641b2b extractor 2024-07-16 00:26:11 -04:00
Brandon Thomas b573860068 cleanup dead code, polymorphic args extraction 2024-07-16 00:00:17 -04:00
Brandon Thomas c40ffa7346 refactor module names 2024-07-15 22:58:18 -04:00
Brandon Thomas 93ce89e060 cleanup job 2024-07-15 22:54:22 -04:00
Brandon Thomas 59c4574d4d dead code 2024-07-15 22:33:18 -04:00
Brandon Thomas 6ad5a39bba reorganize workflow job module 2024-07-15 22:26:02 -04:00
Brandon Thomas 6f568087c6 share request/response 2024-07-15 21:00:17 -04:00
Brandon Thomas 5111254eaf extra test 2024-07-15 20:22:18 -04:00
Brandon Thomas 1ae84a406d use cinematic fix 2024-07-15 20:20:55 -04:00
Brandon Thomas f49e49832b document new endpoints 2024-07-15 20:11:02 -04:00
Brandon Thomas 0bf9e7b5aa share media token cleaning 2024-07-15 20:00:40 -04:00
Brandon Thomas 92338e5f66 mount workflow routes 2024-07-15 19:41:45 -04:00
Brandon Thomas e09130a1b5 remove unused portrait workflow args 2024-07-15 18:31:20 -04:00
Brandon Thomas 0465f5236f enable cinematic 2024-07-15 17:56:54 -04:00
Brandon Thomas 12cf9730f8 share debug + routing tag headers 2024-07-15 17:16:54 -04:00
Brandon Thomas bfa842b123 add new endpoints (wip) 2024-07-15 17:01:13 -04:00
Brandon Thomas 3faf22e9c5 comments 2024-07-15 16:03:04 -04:00
Brandon Thomas d87814bc41 make this clearer 2024-07-15 09:52:03 -04:00
Brandon Thomas cf057d26ec fix enum compile error 2024-07-15 09:49:23 -04:00
Brandon Thomas 2d294ce7ad enum for LivePortrait 2024-07-15 01:33:42 -04:00
Brandon Thomas 4e6285acd2 use publicweightstype in server 2024-07-15 01:27:04 -04:00
Brandon Thomas 114cdc10a0 prepare to hide some public-facing enums 2024-07-15 01:01:55 -04:00
Brandon Thomas 53e7ca28c6 new enum variant for gpt_so_vits 2024-07-14 22:10:16 -04:00
Brandon Thomas 854fe4b340 fix query 2024-07-13 23:35:45 -04:00
Brandon Thomas 330712407d anlaytics query 2024-07-13 23:24:51 -04:00
Brandon Thomas b708e5f9f6 allow people access to outputs even without studio access 2024-07-13 13:38:26 -04:00
Brandon Thomas 4146e922d8 analytics query 2024-07-12 23:48:46 -04:00
Brandon Thomas 1789918913 codegen build fix 2024-07-12 12:10:40 -04:00
Brandon Thomas 357691be20 report cached results 2024-07-12 10:18:35 -04:00
Brandon Thomas 8889299cc7 in-memory cache featured item list 2024-07-12 01:29:58 -04:00
Brandon Thomas a4023278bc add sieve 2024-07-12 00:37:59 -04:00
Brandon Thomas 73119ac9e3 fix compile errors 2024-07-12 00:01:34 -04:00
Brandon Thomas ec46833726 enroll new users in studio 2024-07-11 23:59:40 -04:00
Brandon Thomas e63ec3ae34 fix string quoting 2024-07-11 00:42:28 -04:00
Brandon Thomas aabaf0a5a5 fix query 2024-07-10 23:01:40 -04:00
Brandon Thomas 4146261806 cleanup 2024-07-10 21:57:39 -04:00
Brandon Thomas 10cc6198d9 fix pathing... 2024-07-10 21:25:51 -04:00
Brandon Thomas b8fb1b9a5e cleanup pathing (wip) (#357) 2024-07-10 20:59:18 -04:00
Brandon Thomas ab645cacc6 fix more batch queries with empty tokens in where in clause 2024-07-10 19:02:48 -04:00
Brandon Thomas ad4b297b55 stop invalid batch queries 2024-07-10 18:52:11 -04:00
Brandon Thomas b1b7f4e0ee comfy refactoring of pathing 2024-07-10 00:12:48 -04:00
Brandon Thomas 77bebd4833 cleaning up pathing 2024-07-09 23:15:08 -04:00
Brandon Thomas 9383ba42fb more refactor 2024-07-09 22:14:56 -04:00
Brandon Thomas 2e79eb9c3a this refactor might make things clearer or might be horrible 2024-07-09 22:06:02 -04:00
Brandon Thomas 55deba82ae download, process, and pass (depth,normal,outline) map videos 2024-07-09 21:33:58 -04:00
Brandon Thomas e0121dffeb download secondary videos 2024-07-09 18:38:07 -04:00
Brandon Thomas 62d4e260a0 new video inputs to vst 2024-07-09 17:04:18 -04:00
Brandon Thomas ea1435ad6e doc queue stats 2024-07-09 16:32:51 -04:00
Brandon Thomas 34d19adc1e form validation 2024-07-09 15:22:47 -04:00
Brandon Thomas 7e630bf588 validate frame skip in enqueue vst 2024-07-08 23:34:59 -04:00
Brandon Thomas c1544535df consolidate pathinfo type 2024-07-07 23:54:21 -04:00
Brandon Thomas e6a18f7974 new endpoint to modify media file animation type 2024-07-07 23:37:21 -04:00
Brandon Thomas 783d73a48b better organize media file queries 2024-07-07 23:13:43 -04:00
Brandon Thomas 3f51515b17 new endpoint to modify engine category 2024-07-07 22:51:22 -04:00
Brandon Thomas c44efc2a18 update elasticsearch cli search to match update job 2024-07-07 20:07:48 -04:00
Brandon Thomas 7fcaf61170 es-update-job: update media files relevant to the engine 2024-07-07 20:06:47 -04:00
Brandon Thomas f31a1bb12e fix discord username validation 2024-07-07 19:30:47 -04:00
Brandon Thomas 113ed359fd start using Json() for better typing, correctness, testability 2024-07-07 19:23:57 -04:00
Brandon Thomas 17a4cf774d remove lazy_static from storyteller-web 2024-07-07 18:38:42 -04:00
Brandon Thomas 7bfd38a382 merge users component with storyteller-web
This will make adding SSO functions easier without all of the package
indirections.
2024-07-07 18:25:55 -04:00
Brandon Thomas 970e802f14 get rid of top level model module 2024-07-07 17:31:23 -04:00
Brandon Thomas ce186179ce move api docs into module 2024-07-07 17:23:19 -04:00
Brandon Thomas 45792890b7 report new prompt fields in API 2024-07-07 11:13:03 -04:00
Brandon Thomas 776c086470 save frame skip to prompt record 2024-07-07 11:07:23 -04:00
Brandon Thomas b666858b21 save travel prompt 2024-07-06 23:50:24 -04:00
Brandon Thomas 4ca8932591 inference job: add prompt travel and skip frame 2024-07-06 18:37:50 -04:00
Brandon Thomas 004e8c27d4 read frame skip and travel prompt in enqueue VST endpoint 2024-07-06 17:28:20 -04:00
Brandon Thomas 70c2c995ee improve comfy estimates code 2024-07-06 08:43:25 -04:00
Brandon Thomas 54b7e182b0 added tests for job progress 2024-07-05 22:15:26 -04:00
Brandon Thomas 50807429ad bad comparison 2024-07-05 22:04:04 -04:00
Brandon Thomas 1cd3175e13 move memory caching module 2024-07-05 22:02:15 -04:00
Brandon Thomas bbaed857d0 move server_state into module 2024-07-05 20:56:00 -04:00
Brandon Thomas 37ccf0f60d reduce unused code and module subscriptions 2024-07-05 20:51:01 -04:00
Brandon Thomas c95ad4dd55 refactor away more useless modules 2024-07-05 20:45:07 -04:00
Brandon Thomas 7609c040cc move module routes 2024-07-05 20:40:54 -04:00
Brandon Thomas 076a865747 move validations module 2024-07-05 20:38:20 -04:00
Brandon Thomas 972e8199e7 pull routes out of users component, remove unused module 2024-07-05 20:35:19 -04:00
Brandon Thomas 175035000b better doc 2024-07-05 16:04:02 -04:00
Brandon Thomas 807c8fd4f8 add progress estimation to job status endpoints (this is incomplete) (#353)
This adds a progress indicator to the three job status endpoints. 

There's a function to calculate progress, which is mostly left as a stub
for now.

In the future we may even want to do dynamically updating averages.
2024-07-05 15:23:00 -04:00
Brandon Thomas e1370a7b6d add new engine categories 2024-07-04 14:06:35 -04:00
Brandon Thomas 716aca1e3d session media file search 2024-07-02 23:54:29 -04:00
dependabot[bot] c1996011b0 Bump quick-xml from 0.30.0 to 0.35.0 (#352)
Bumps [quick-xml](https://github.com/tafia/quick-xml) from 0.30.0 to
0.35.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tafia/quick-xml/releases">quick-xml's
releases</a>.</em></p>
<blockquote>
<h2>v0.35.0 - a couple of bugfixes</h2>
<h2>What's Changed</h2>
<h3>New Features</h3>
<ul>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/772">#772</a>:
Add <code>reader::Config::allow_unmatched_ends</code> to permit dangling
end tags.</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/773">#773</a>:
Fixed reporting incorrect end position in
<code>Reader::read_to_end</code> family of methods and trimming of the
trailing spaces in <code>Reader::read_text</code> when
<code>trim_text_start</code> is set and the last event is not a
<code>Text</code> event.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
Character references now allow any number of leading zeroes as it
should. As a result, the following variants of
<code>quick_xml::escape::EscapeError</code> are removed:
<ul>
<li><code>TooLongDecimal</code></li>
<li><code>TooLongHexadecimal</code></li>
</ul>
</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
Fixed <code>Attribute::unescape_value</code> which does not unescape
predefined values since 0.32.0.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/774">#774</a>:
Fixed regression since 0.33.0: <code>Text</code> event may be skipped in
<code>read_event_into()</code> and <code>read_event_into_async()</code>
in some circumstances.</li>
</ul>
<h3>Misc Changes</h3>
<ul>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
<code>EscapeError::UnrecognizedSymbol</code> renamed to
<code>EscapeError::UnrecognizedEntity</code>.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
Implemented <code>PartialEq</code> for <code>EscapeError</code>.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
Replace the following variants of <code>EscapeError</code> by
<code>InvalidCharRef</code> variant with a new
<code>ParseCharRefError</code> inside:
<ul>
<li><code>EntityWithNull</code></li>
<li><code>InvalidDecimal</code></li>
<li><code>InvalidHexadecimal</code></li>
<li><code>InvalidCodepoint</code></li>
</ul>
</li>
</ul>
<p><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
<a
href="https://redirect.github.com/tafia/quick-xml/pull/771">tafia/quick-xml#771</a>
<a
href="https://redirect.github.com/tafia/quick-xml/issues/772">#772</a>:
<a
href="https://redirect.github.com/tafia/quick-xml/pull/772">tafia/quick-xml#772</a>
<a
href="https://redirect.github.com/tafia/quick-xml/issues/773">#773</a>:
<a
href="https://redirect.github.com/tafia/quick-xml/pull/773">tafia/quick-xml#773</a>
<a
href="https://redirect.github.com/tafia/quick-xml/issues/774">#774</a>:
<a
href="https://redirect.github.com/tafia/quick-xml/issues/774">tafia/quick-xml#774</a></p>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/torokati44"><code>@​torokati44</code></a> made
their first contribution in <a
href="https://redirect.github.com/tafia/quick-xml/pull/772">tafia/quick-xml#772</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/tafia/quick-xml/compare/v0.34.0...v0.35.0">https://github.com/tafia/quick-xml/compare/v0.34.0...v0.35.0</a></p>
<h2>v0.34.0 - allow to read 4GB+ files on 32-bit targets</h2>
<h2>What's Changed</h2>
<h3>Bug Fixes</h3>
<ul>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/751">#751</a>:
Fix internal overflow when read 4GB+ files on 32-bit targets using
<code>Reader&lt;impl BufRead&gt;</code> readers.</li>
</ul>
<h3>Misc Changes</h3>
<ul>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/760">#760</a>:
<code>Attribute::decode_and_unescape_value</code> and
<code>Attribute::decode_and_unescape_value_with</code> now accepts
<code>Decoder</code> instead of <code>Reader</code>. Use
<code>Reader::decoder()</code> to get it.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/760">#760</a>:
<code>Writer::write_event</code> now consumes event. Use
<code>Event::borrow()</code> if you want to keep ownership.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/751">#751</a>:
Type of <code>Reader::error_position()</code> and
<code>Reader::buffer_position()</code> changed from <code>usize</code>
to <code>u64</code>.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/751">#751</a>:
Type alias <code>Span</code> changed from
<code>Range&lt;usize&gt;</code> to <code>Range&lt;u64&gt;</code>.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tafia/quick-xml/blob/master/Changelog.md">quick-xml's
changelog</a>.</em></p>
<blockquote>
<h2>0.35.0 -- 2024-06-29</h2>
<h3>New Features</h3>
<ul>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/772">#772</a>:
Add <code>reader::Config::allow_unmatched_ends</code> to permit dangling
end tags</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/773">#773</a>:
Fixed reporting incorrect end position in
<code>Reader::read_to_end</code> family
of methods and trimming of the trailing spaces in
<code>Reader::read_text</code> when
<code>trim_text_start</code> is set and the last event is not a
<code>Text</code> event.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
Character references now allow any number of leading zeroes as it
should.
As a result, the following variants of
<code>quick_xml::escape::EscapeError</code> are removed:
<ul>
<li><code>TooLongDecimal</code></li>
<li><code>TooLongHexadecimal</code></li>
</ul>
</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
Fixed <code>Attribute::unescape_value</code> which does not unescape
predefined values since 0.32.0.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/774">#774</a>:
Fixed regression since 0.33.0: <code>Text</code> event may be skipped in
<code>read_event_into()</code>
and <code>read_event_into_async()</code> in some circumstances.</li>
</ul>
<h3>Misc Changes</h3>
<ul>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
<code>EscapeError::UnrecognizedSymbol</code> renamed to
<code>EscapeError::UnrecognizedEntity</code>.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
Implemented <code>PartialEq</code> for <code>EscapeError</code>.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
Replace the following variants of <code>EscapeError</code> by
<code>InvalidCharRef</code> variant
with a new <code>ParseCharRefError</code> inside:
<ul>
<li><code>EntityWithNull</code></li>
<li><code>InvalidDecimal</code></li>
<li><code>InvalidHexadecimal</code></li>
<li><code>InvalidCodepoint</code></li>
</ul>
</li>
</ul>
<p><a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>:
<a
href="https://redirect.github.com/tafia/quick-xml/pull/771">tafia/quick-xml#771</a>
<a
href="https://redirect.github.com/tafia/quick-xml/issues/772">#772</a>:
<a
href="https://redirect.github.com/tafia/quick-xml/pull/772">tafia/quick-xml#772</a>
<a
href="https://redirect.github.com/tafia/quick-xml/issues/773">#773</a>:
<a
href="https://redirect.github.com/tafia/quick-xml/pull/773">tafia/quick-xml#773</a>
<a
href="https://redirect.github.com/tafia/quick-xml/issues/774">#774</a>:
<a
href="https://redirect.github.com/tafia/quick-xml/issues/774">tafia/quick-xml#774</a></p>
<h2>0.34.0 -- 2024-06-25</h2>
<h3>Bug Fixes</h3>
<ul>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/751">#751</a>:
Fix internal overflow when read 4GB+ files on 32-bit targets using
<code>Reader&lt;impl BufRead&gt;</code> readers.</li>
</ul>
<h3>Misc Changes</h3>
<ul>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/760">#760</a>:
<code>Attribute::decode_and_unescape_value</code> and
<code>Attribute::decode_and_unescape_value_with</code> now
accepts <code>Decoder</code> instead of <code>Reader</code>. Use
<code>Reader::decoder()</code> to get it.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/760">#760</a>:
<code>Writer::write_event</code> now consumes event. Use
<code>Event::borrow()</code> if you want to keep ownership.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/751">#751</a>:
Type of <code>Reader::error_position()</code> and
<code>Reader::buffer_position()</code> changed from <code>usize</code>
to <code>u64</code>.</li>
<li><a
href="https://redirect.github.com/tafia/quick-xml/issues/751">#751</a>:
Type alias <code>Span</code> changed from
<code>Range&lt;usize&gt;</code> to <code>Range&lt;u64&gt;</code>.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/tafia/quick-xml/commit/22b3e458d193e6937882ba6b643ec8c31a671de5"><code>22b3e45</code></a>
Release 0.35.0</li>
<li><a
href="https://github.com/tafia/quick-xml/commit/ae9fca6c7c71f1ce431a01759b8fc84a8ccc4c8c"><code>ae9fca6</code></a>
Add link to issue that when resolved may allow us to not exclude tests
&amp; exam...</li>
<li><a
href="https://github.com/tafia/quick-xml/commit/0534c8736a14d5a2c466ed5b35edaa8cefbc1374"><code>0534c87</code></a>
Fix missing text events in some circumstances</li>
<li><a
href="https://github.com/tafia/quick-xml/commit/022441fd8d68d5ef5f63a731d49c33b4833d51b4"><code>022441f</code></a>
Add regression tests for <a
href="https://redirect.github.com/tafia/quick-xml/issues/774">#774</a></li>
<li><a
href="https://github.com/tafia/quick-xml/commit/9a72c7bb38f26e9913912861829ae2a6cdbc41d1"><code>9a72c7b</code></a>
Merge pull request <a
href="https://redirect.github.com/tafia/quick-xml/issues/771">#771</a>
from Mingun/escape-fixes</li>
<li><a
href="https://github.com/tafia/quick-xml/commit/0315ed0a479d3c5b7a1ce8f1bbcde312221e2a2d"><code>0315ed0</code></a>
Fix Attribute::unescape_value does not unescape predefined entities
since <a
href="https://redirect.github.com/tafia/quick-xml/issues/739">#739</a></li>
<li><a
href="https://github.com/tafia/quick-xml/commit/aa1d391e206fa9630e22241082b89a4e693f1ccd"><code>aa1d391</code></a>
Reuse existing method with does the same thing when
<code>encoding</code> feature is dis...</li>
<li><a
href="https://github.com/tafia/quick-xml/commit/80bf12d79e0ef85e19276e033b005578a4d893b0"><code>80bf12d</code></a>
Add helper to decoder Cow data, which retains original lifetime</li>
<li><a
href="https://github.com/tafia/quick-xml/commit/42d71232f5456ddb160216ece8d9e15e5245adbf"><code>42d7123</code></a>
Do not allow (positive) sign in character references</li>
<li><a
href="https://github.com/tafia/quick-xml/commit/04bddd65f9de3e9f25779751fcdcb1b4512d3e25"><code>04bddd6</code></a>
Use standard methods to parse character reference to a number</li>
<li>Additional commits viewable in <a
href="https://github.com/tafia/quick-xml/compare/v0.30.0...v0.35.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=quick-xml&package-manager=cargo&previous-version=0.30.0&new-version=0.35.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 23:49:07 -04:00
dependabot[bot] 878c93f34c Bump tokio from 1.37.0 to 1.38.0 (#347)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.37.0 to 1.38.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tokio/releases">tokio's
releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.38.0</h2>
<p>This release marks the beginning of stabilization for runtime
metrics. It
stabilizes <code>RuntimeMetrics::worker_count</code>. Future releases
will continue to
stabilize more metrics.</p>
<h3>Added</h3>
<ul>
<li>fs: add <code>File::create_new</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6573">#6573</a>)</li>
<li>io: add <code>copy_bidirectional_with_sizes</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6500">#6500</a>)</li>
<li>io: implement <code>AsyncBufRead</code> for <code>Join</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6449">#6449</a>)</li>
<li>net: add Apple visionOS support (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6465">#6465</a>)</li>
<li>net: implement <code>Clone</code> for <code>NamedPipeInfo</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6586">#6586</a>)</li>
<li>net: support QNX OS (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6421">#6421</a>)</li>
<li>sync: add <code>Notify::notify_last</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6520">#6520</a>)</li>
<li>sync: add <code>mpsc::Receiver::{capacity,max_capacity}</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6511">#6511</a>)</li>
<li>sync: add <code>split</code> method to the semaphore permit (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6472">#6472</a>,
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6478">#6478</a>)</li>
<li>task: add
<code>tokio::task::join_set::Builder::spawn_blocking</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6578">#6578</a>)</li>
<li>wasm: support rt-multi-thread with wasm32-wasi-preview1-threads (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6510">#6510</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>macros: make <code>#[tokio::test]</code> append <code>#[test]</code>
at the end of the attribute list (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6497">#6497</a>)</li>
<li>metrics: fix <code>blocking_threads</code> count (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6551">#6551</a>)</li>
<li>metrics: stabilize <code>RuntimeMetrics::worker_count</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6556">#6556</a>)</li>
<li>runtime: move task out of the <code>lifo_slot</code> in
<code>block_in_place</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6596">#6596</a>)</li>
<li>runtime: panic if <code>global_queue_interval</code> is zero (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6445">#6445</a>)</li>
<li>sync: always drop message in destructor for oneshot receiver (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6558">#6558</a>)</li>
<li>sync: instrument <code>Semaphore</code> for task dumps (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6499">#6499</a>)</li>
<li>sync: use FIFO ordering when waking batches of wakers (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6521">#6521</a>)</li>
<li>task: make <code>LocalKey::get</code> work with Clone types (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6433">#6433</a>)</li>
<li>tests: update nix and mio-aio dev-dependencies (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6552">#6552</a>)</li>
<li>time: clean up implementation (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6517">#6517</a>)</li>
<li>time: lazily init timers on first poll (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6512">#6512</a>)</li>
<li>time: remove the <code>true_when</code> field in
<code>TimerShared</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6563">#6563</a>)</li>
<li>time: use sharding for timer implementation (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6534">#6534</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>taskdump: allow building taskdump docs on non-unix machines (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6564">#6564</a>)</li>
<li>time: check for overflow in <code>Interval::poll_tick</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6487">#6487</a>)</li>
<li>sync: fix incorrect <code>is_empty</code> on mpsc block boundaries
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6603">#6603</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>fs: rewrite file system docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6467">#6467</a>)</li>
<li>io: fix <code>stdin</code> documentation (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6581">#6581</a>)</li>
<li>io: fix obsolete reference in <code>ReadHalf::unsplit()</code>
documentation (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6498">#6498</a>)</li>
<li>macros: render more comprehensible documentation for
<code>select!</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6468">#6468</a>)</li>
<li>net: add missing types to module docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6482">#6482</a>)</li>
<li>net: fix misleading <code>NamedPipeServer</code> example (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6590">#6590</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/tokio-rs/tokio/commit/14c17fc09656a30230177b600bacceb9db33e942"><code>14c17fc</code></a>
chore: prepare Tokio v1.38.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6601">#6601</a>)</li>
<li><a
href="https://github.com/tokio-rs/tokio/commit/65cbf730de48ef9d3c84959d26ab717a85a5de62"><code>65cbf73</code></a>
chore: prepare tokio-macros v2.3.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6600">#6600</a>)</li>
<li><a
href="https://github.com/tokio-rs/tokio/commit/dbf93c71844a01574a10f9dee0d4d9655a569f0a"><code>dbf93c7</code></a>
sync: fix incorrect is_empty on mpsc block boundaries (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6603">#6603</a>)</li>
<li><a
href="https://github.com/tokio-rs/tokio/commit/873cb8ae2fc291eaffbd71e3c83d17b2f0ed7abf"><code>873cb8a</code></a>
runtime: move task out of the <code>lifo_slot</code> in
<code>block_in_place</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6596">#6596</a>)</li>
<li><a
href="https://github.com/tokio-rs/tokio/commit/97bb47b480c66083397c21d54e7ae33cab6c1b20"><code>97bb47b</code></a>
task: fix a typo in doc of <code>LocalSet::run_until</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6599">#6599</a>)</li>
<li><a
href="https://github.com/tokio-rs/tokio/commit/86658bd87dc470f8e36eb6b893cc403820cfb7ee"><code>86658bd</code></a>
metrics: stabilize <code>RuntimeMetrics::worker_count</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6556">#6556</a>)</li>
<li><a
href="https://github.com/tokio-rs/tokio/commit/9e00b266e08d263c497dc9de57d9acbc049ae69b"><code>9e00b26</code></a>
sync: add <code>Notify::notify_last</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6520">#6520</a>)</li>
<li><a
href="https://github.com/tokio-rs/tokio/commit/6c42d286b343f498ce29de2aab9358a0aedb081c"><code>6c42d28</code></a>
net: fix misleading <code>NamedPipeServer</code> example (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6590">#6590</a>)</li>
<li><a
href="https://github.com/tokio-rs/tokio/commit/3a6fdc05681841c30fe4e27b63924c7908ea4634"><code>3a6fdc0</code></a>
license: fix formatting and remove year in licenses (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6451">#6451</a>)</li>
<li><a
href="https://github.com/tokio-rs/tokio/commit/2890d0c3db4f595330d8d223bfbfeb81e205b048"><code>2890d0c</code></a>
metrics: fix blocking_threads count (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6551">#6551</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.37.0...tokio-1.38.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.37.0&new-version=1.38.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 23:48:20 -04:00
dependabot[bot] f642a5ac39 Bump diesel from 2.1.4 to 2.2.1 (#346)
Bumps [diesel](https://github.com/diesel-rs/diesel) from 2.1.4 to 2.2.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/diesel-rs/diesel/blob/v2.2.1/CHANGELOG.md">diesel's
changelog</a>.</em></p>
<blockquote>
<h2>[2.2.1] 2024-06-12</h2>
<h2>Fixed</h2>
<ul>
<li>Fixed using <code>#[dsl::auto_type]</code> with functions that
accept reference arguments</li>
<li>Fixed using <code>#[derive(Queryable)]</code> with structs that use
a type named <code>Row</code> as field type</li>
<li>Fixed a regression that prevented using <code>mysqlclient-sys</code>
0.2.x with diesel 2.2</li>
<li>Fixed connecting to postgres database using the scram-sha-256
authentication method on windows while using the bundled postgres
builds</li>
<li>Improved the error messages in diesel-cli for cases where a
file/folder was not found</li>
<li>Fixed several version detection bugs in mysqlclient-sys to use
pre-generated bindings in more situations</li>
</ul>
<h2>[2.2.0] 2024-05-31</h2>
<h3>Added</h3>
<ul>
<li>Support <code>[print_schema] except_custom_type_definitions =
[&quot;Vector&quot;]</code>. If a <code>custom type</code> matches one
element on the list it's skipped.</li>
<li>Added automatic usage of all sqlite <code>rowid</code> aliases when
no explicit primary key is defined for <code>print-schema</code></li>
<li>Added a <code>#[dsl::auto_type]</code> attribute macro, allowing to
infer type of query fragment functions</li>
<li>Added the same type inference on <code>Selectable</code> derives,
which allows skipping specifying <code>select_expression_type</code>
most of the time, in turn enabling most queries to be written using just
a <code>Selectable</code> derive.</li>
<li>Added an optional <code>#[diesel(skip_insertion)]</code> field
attribute to the <code>Insertable</code> derive macro, allowing fields
which map to generated columns to be skipped during insertion.</li>
<li>Support for connection instrumentation. This allows to inspect any
query run by your application</li>
<li>Logging in diesel-cli</li>
<li>Support for libsqlite3-sys 0.28</li>
<li>Add <code>sqlite-integer-primary-key-is-bigint</code> configuration
option, usable with SQLite 3.37 or above, allowing to use
<code>BigInt</code> for <code>INTEGER PRIMARY KEY</code> columns in
SQLite for tables without the <code>WITHOUT ROWID</code> attribute (<a
href="https://www.sqlite.org/lang_createtable.html#rowid">SQLite
doc</a>).</li>
<li>Support for multiple <code>print_schema</code> entry in
<code>diesel.toml</code> (e.g. <code>[print_schema.user1]</code>), which
allows generating multiple schema.rs files</li>
<li>Add support for <code>COPY TO</code> and <code>COPY FROM</code>
statements</li>
<li>Add support for mapping <code>chrono::Duration</code> to
postgresql's <code>INTERVAL</code> sql type</li>
<li>Added <code>serialize_database_to_buffer</code> and
<code>deserialize_readonly_database_from_buffer</code> methods in
<code>SqliteConnection</code> to support serialization/deserialization
of SQLite databases to and from byte buffers.</li>
<li>Added <code>SerializedDatabase</code> wrapper type for a serialized
database that is dynamically allocated by calling
<code>serialize_database_to_buffer</code>. This RAII wrapper deallocates
the memory when it goes out of scope with
<code>sqlite3_free</code>.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>The minimal officially supported rustc version is now 1.78.0</li>
<li>Deprecated <code>sql_function!</code> in favour of
<code>define_sql_function!</code> which provides compatibility with
<code>#[dsl::auto_type]</code></li>
<li>Deserialization error messages now contain information about the
field that failed to deserialize</li>
</ul>
<h2>[2.1.6] 2024-04-19</h2>
<ul>
<li>Fix using <code>BoxableExpression</code> with having clauses</li>
<li>Fix using numeric expressions with aliased fields</li>
<li>Minor documentation fixes</li>
</ul>
<h2>[2.1.5] 2024-03-15</h2>
<ul>
<li>Fix <code>impl SqlOrd</code> postgres &gt; postgres_backend feature
flag.</li>
<li>Allow <code>Queryable</code> to be used with multiple table
names.</li>
<li>Fix an inconsistent unit test</li>
<li>Fix a clippy lint</li>
<li>Fix ./bin/test feature flag calls.</li>
<li>Update <code>libsqlite3-sys</code> to allow version 0.28 as
well</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/diesel-rs/diesel/commit/08be4f21e500fce5fff0b4b19ebab208ff26de9d"><code>08be4f2</code></a>
Merge pull request <a
href="https://redirect.github.com/diesel-rs/diesel/issues/4071">#4071</a>
from weiznich/prepare/2.2.1</li>
<li><a
href="https://github.com/diesel-rs/diesel/commit/8c47c6f867f524a1878070ce8f5faa954501eed7"><code>8c47c6f</code></a>
Bump mysqlclient-sys to 0.4</li>
<li><a
href="https://github.com/diesel-rs/diesel/commit/96a822a8950c2dbf3b90c2c663eb9351bece3228"><code>96a822a</code></a>
Prepare a 2.2.1 release</li>
<li><a
href="https://github.com/diesel-rs/diesel/commit/1ae7a0aed78522bb45aa886cf7bd65737bc95545"><code>1ae7a0a</code></a>
Merge pull request <a
href="https://redirect.github.com/diesel-rs/diesel/issues/4057">#4057</a>
from weiznich/fix/4055</li>
<li><a
href="https://github.com/diesel-rs/diesel/commit/4d5fb4fd96614d19344f7fabad14e140565e2418"><code>4d5fb4f</code></a>
Merge pull request <a
href="https://redirect.github.com/diesel-rs/diesel/issues/4054">#4054</a>
from weiznich/fix/auto_type_lifetimes</li>
<li><a
href="https://github.com/diesel-rs/diesel/commit/1062c2732fad9c88f3809089866d31addac8139f"><code>1062c27</code></a>
Merge pull request <a
href="https://redirect.github.com/diesel-rs/diesel/issues/4063">#4063</a>
from sugar700/allow-type-name-conflicting-with-trait...</li>
<li><a
href="https://github.com/diesel-rs/diesel/commit/5c870f7c60229e700cf0a3339acb58f0d4dd21c5"><code>5c870f7</code></a>
Merge pull request <a
href="https://redirect.github.com/diesel-rs/diesel/issues/4067">#4067</a>
from weiznich/fix/cli_diff_schema_default_schema</li>
<li><a
href="https://github.com/diesel-rs/diesel/commit/48ccc7804c7e0399bfcb6df97ee71e35820f20b5"><code>48ccc78</code></a>
Merge pull request <a
href="https://redirect.github.com/diesel-rs/diesel/issues/4064">#4064</a>
from weiznich/fix/mysqlclient_regression_with_old_ve...</li>
<li><a
href="https://github.com/diesel-rs/diesel/commit/f6da5f5311d1afe7fdca6d2b5730332eda024c48"><code>f6da5f5</code></a>
Merge pull request <a
href="https://redirect.github.com/diesel-rs/diesel/issues/4065">#4065</a>
from weiznich/fix/scram</li>
<li><a
href="https://github.com/diesel-rs/diesel/commit/197f06d8d1c0f66774b1ab24c5db93d28962e07a"><code>197f06d</code></a>
Fix the includes in all <code>Cargo.toml</code> files</li>
<li>Additional commits viewable in <a
href="https://github.com/diesel-rs/diesel/compare/v2.1.4...v2.2.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=diesel&package-manager=cargo&previous-version=2.1.4&new-version=2.2.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 23:48:07 -04:00
Brandon Thomas 26c7ac8037 search featured media files handler 2024-07-01 21:51:11 -04:00
Brandon Thomas 26153f46b1 backfill media files in es for "is_featured" 2024-07-01 21:51:11 -04:00
Kasisnu ed8d78b127 audio extraction reencodes audio incorrectly (#351) 2024-07-01 17:04:54 +05:30
Brandon Thomas 6f4e780c7d search endpoint + docs 2024-06-30 22:23:07 -04:00
Brandon Thomas 47a3c7935a functional search prototype 2024-06-30 21:19:20 -04:00
Brandon Thomas d8ea5054de tests 2024-06-30 20:45:10 -04:00
Brandon Thomas 10b8e29b56 wip es search predicates 2024-06-30 20:14:04 -04:00
Brandon Thomas 38619270ef cleanup imports 2024-06-30 15:52:22 -04:00
Brandon Thomas e7134fa84f fix build errors 2024-06-30 15:43:25 -04:00
Brandon Thomas 2bb2cdf70a need elasticsearch queries for build 2024-06-30 15:32:29 -04:00
Brandon Thomas 1feb21625d enroll new users in studio for a bit 2024-06-30 14:52:36 -04:00
Brandon Thomas 1a0a71dca4 es wip 2024-06-30 14:43:59 -04:00
Brandon Thomas c8127d99fd update fields, search template 2024-06-29 22:59:21 -04:00
Brandon Thomas 8e1f49a588 search work in progress 2024-06-29 22:40:32 -04:00
Brandon Thomas 24f5660d2f elasticsearch utility for media files 2024-06-29 20:51:02 -04:00
Brandon Thomas 1b4c70281f more idiomatic 2024-06-29 20:33:23 -04:00
Brandon Thomas 9dc6676621 switch query to use dynamic predicates 2024-06-29 20:27:40 -04:00
Brandon Thomas f02476e916 refactor for maintainability 2024-06-29 16:35:49 -04:00
Brandon Thomas 1b3c88e93b support upload of image planes 2024-06-29 16:12:16 -04:00
Brandon Thomas c8e19250b2 deprecate media uploads endpoints 2024-06-29 15:47:23 -04:00
Brandon Thomas 8675b78f2d codegen db 2024-06-29 15:44:45 -04:00
Brandon Thomas 25df92c9ff remove config crate dep in mysql_queries 2024-06-28 22:48:16 -04:00
Brandon Thomas 805765f302 new query for listing media files 2024-06-28 22:42:17 -04:00
Brandon Thomas 8bea5bebab maybe there was clock skew ? 2024-06-28 21:57:29 -04:00
Brandon Thomas 9a938954a0 media file elasticsearch wip 2024-06-28 21:27:49 -04:00
Brandon Thomas 7abf70771c downsample on session jobs successfully completed 2024-06-28 16:58:20 -04:00
Brandon Thomas 409eadbfe5 ES SQL dialect doesn't support all data types 2024-06-28 12:11:08 -04:00
Brandon Thomas d634fd9e6b add new StyleTransferName; fix broken tests due to serde toml change 2024-06-27 20:33:10 -04:00
Brandon Thomas 7afb56519c sort by job type instead of category (soon) 2024-06-27 13:32:00 -04:00
Brandon Thomas 4dde614b15 don't deactivate face detailer for lipsync (for now) 2024-06-27 12:59:49 -04:00
Kasisnu 44a26c56ac comfy: pass audio for lipsyncing (#349) 2024-06-27 16:50:42 +05:30
Brandon Thomas 76db576c84 return IPA image token in prompt handler 2024-06-26 18:38:28 -04:00
Brandon Thomas a87e19b402 save ip adapter image with prompt 2024-06-26 18:32:41 -04:00
Brandon Thomas 3a3e85abd0 fix frontend bug sending empty IPA tokens to VST 2024-06-26 02:04:49 -04:00
Brandon Thomas 4def6ebd47 frontend is sending empty string IPA token - clear it 2024-06-26 02:04:49 -04:00
Kasisnu 1215df5844 disable comfy startup check via env var (#348) 2024-06-25 16:44:37 +05:30
Brandon Thomas 362afd9d6c codegen db 2024-06-22 22:07:04 -04:00
Brandon Thomas e0180712f7 pass ipa file and strength to comfy 2024-06-22 19:34:47 -04:00
Brandon Thomas d81bd219a2 cleanup modules, rename 2024-06-22 18:31:50 -04:00
Brandon Thomas 4e6f25db83 organize post-process steps into modules 2024-06-22 18:29:50 -04:00
Brandon Thomas adbf268985 trim/resample video moved to module 2024-06-22 17:56:29 -04:00
Brandon Thomas 80aff2bfff download IPAdapter image 2024-06-22 17:22:10 -04:00
Brandon Thomas 6f69a2715a refactor job steps into module 2024-06-22 16:32:23 -04:00
Brandon Thomas 5a18c51c11 VST: pass ip adapter token to jobs 2024-06-22 16:24:55 -04:00
Brandon Thomas cb98541c54 fix to read query.filter 2024-06-22 13:05:16 -04:00
Brandon Thomas 8782c6808c fix filter param 2024-06-22 13:04:47 -04:00
Brandon Thomas 032705ac45 query param 2024-06-21 23:59:25 -04:00
Brandon Thomas 4c8ad1be04 new list option 2024-06-21 23:56:00 -04:00
Brandon Thomas 203f4e5998 enable 7 second generations 2024-06-19 16:57:26 -04:00
Brandon Thomas 84b7bae839 postman collections -> _develop 2024-06-17 22:51:20 -04:00
Brandon Thomas 317d56dbd0 more cleanup 2024-06-17 22:34:43 -04:00
Brandon Thomas fc83fcd490 further cleanup 2024-06-17 22:25:19 -04:00
Brandon Thomas 1ac50b19b1 cleanup and reduce deprecated library usage 2024-06-17 22:14:55 -04:00
Brandon Thomas a56166c6a1 cleanup deps 2024-06-17 21:57:25 -04:00
Brandon Thomas f458a26f48 expand the model 2024-06-16 17:22:11 -04:00
Brandon Thomas 1c79e6a062 api docs options 2024-06-16 17:21:05 -04:00
Brandon Thomas f95c0b355f update api docs html + css + configs 2024-06-16 17:08:58 -04:00
Brandon Thomas af38e923c7 upgrade swagger-ui from v3 -> v5 2024-06-16 16:59:51 -04:00
Brandon Thomas 8a6dcb1868 hakari optimize deps 2024-06-16 16:53:43 -04:00
Brandon Thomas e07e0ab349 upgrade strum_macros 2024-06-16 16:50:39 -04:00
Brandon Thomas dbd431090f upgrade mockall 2024-06-16 16:49:03 -04:00
Brandon Thomas ee8596488c remove storyteller-web http 2024-06-16 16:47:38 -04:00
Brandon Thomas 311252d953 update utoipa-swagger-ui 2024-06-16 16:45:20 -04:00
Brandon Thomas dfbd3001f1 hakari optimize 2024-06-16 16:39:42 -04:00
Brandon Thomas 6e546894b2 update opentelemetry packages 2024-06-16 16:37:01 -04:00
Brandon Thomas 4f9e23250d further cleanup of hyper --> reqwest 2024-06-16 16:32:22 -04:00
Brandon Thomas a5f967d6d5 upgrade hyper; change inference-job to use reqwest instead 2024-06-16 16:24:18 -04:00
Brandon Thomas 7a17d1f20b codegen db, fix compile error 2024-06-16 16:05:11 -04:00
Brandon Thomas 31733b2063 upgrade reqwest 2024-06-16 15:57:55 -04:00
Brandon Thomas c55ad1f2b3 get rid of twitch endpoints, websocket-gateway service 2024-06-16 15:48:13 -04:00
Brandon Thomas d04458f000 deps 2024-06-16 14:47:18 -04:00
Brandon Thomas cd848319eb update more dependencies 2024-06-16 14:41:22 -04:00
Brandon Thomas 6a1f4dc3bc remove twitch-pubsub-subscriber service 2024-06-16 14:30:13 -04:00
Brandon Thomas 826d710979 more package upgrades 2024-06-16 14:17:08 -04:00
Brandon Thomas a9ec812e82 more dependency upgrades 2024-06-16 14:04:53 -04:00
Brandon Thomas 3aca9b9090 actix upgrades 2024-06-16 13:58:45 -04:00
Brandon Thomas c0db177d4e tool to upgrade actix libraries 2024-06-16 13:50:01 -04:00
Brandon Thomas 2cb19357ab bump versions 2024-06-16 13:41:06 -04:00
Brandon Thomas 04a19ec4e3 docs, revert endpoint path change 2024-06-16 13:28:44 -04:00
Brandon Thomas f6f769476f change route, document more endpoints 2024-06-16 13:23:18 -04:00
Brandon Thomas b53e93773d new endpoint to dismiss jobs 2024-06-16 13:19:05 -04:00
Brandon Thomas 38d174df83 simplify evaluating boolean flags 2024-06-16 11:57:28 -04:00
Brandon Thomas 1ddd3e75dc fix docs 2024-06-15 21:09:51 -04:00
dependabot[bot] c60d8b6115 Bump serial_test from 2.0.0 to 3.0.0 (#339)
Bumps [serial_test](https://github.com/palfrey/serial_test) from 2.0.0
to 3.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/palfrey/serial_test/releases">serial_test's
releases</a>.</em></p>
<blockquote>
<h2>v3.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Multi key support <a
href="https://redirect.github.com/palfrey/serial_test/pull/102">palfrey/serial_test#102</a>
<ul>
<li>Attributes like <code>#[serial(one, two)]</code> are now supported
(for all attributes)</li>
<li>This is a breaking change, as <code>file_serial</code> paths now
need to be done separately <code>#[file_serial(key, path =&gt;
&quot;/tmp/foo&quot;)]</code></li>
</ul>
</li>
<li>Attributes at a mod-level <a
href="https://redirect.github.com/palfrey/serial_test/pull/104">palfrey/serial_test#104</a>
<ul>
<li>You can set any of the attributes on a <code>mod</code> and all
<code>#[test]</code> fn's in that mod will have the attribute
applied.</li>
</ul>
</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/palfrey/serial_test/compare/v2.0.0...v3.0.0">https://github.com/palfrey/serial_test/compare/v2.0.0...v3.0.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/palfrey/serial_test/commit/bba3db847f10b0fbcbd71465cc233b0d510a3dd0"><code>bba3db8</code></a>
3.0.0</li>
<li><a
href="https://github.com/palfrey/serial_test/commit/ae14645ea14fd1f3b8ddd09601062b3c9fbd5a42"><code>ae14645</code></a>
Merge pull request <a
href="https://redirect.github.com/palfrey/serial_test/issues/104">#104</a>
from palfrey/serial-for-mod</li>
<li><a
href="https://github.com/palfrey/serial_test/commit/0dec256fe181fd9660077515f861614dd012ead2"><code>0dec256</code></a>
Merge branch 'main' into serial-for-mod</li>
<li><a
href="https://github.com/palfrey/serial_test/commit/cee1dc17dbc7b90ab2c0d7fa81761871b1772fa1"><code>cee1dc1</code></a>
Add testing and parallel to package keywords</li>
<li><a
href="https://github.com/palfrey/serial_test/commit/2a4b641ea9b6664ec3165826fcd4c93bcfd53b6a"><code>2a4b641</code></a>
Merge branch 'main' into serial-for-mod</li>
<li><a
href="https://github.com/palfrey/serial_test/commit/288d933b77721f617b8e6e03e3c98515ae7876a1"><code>288d933</code></a>
Merge pull request <a
href="https://redirect.github.com/palfrey/serial_test/issues/105">#105</a>
from palfrey/upgrade-rustix</li>
<li><a
href="https://github.com/palfrey/serial_test/commit/cf9d7fef6223d73d69f1c14197b4f79df994046f"><code>cf9d7fe</code></a>
Upgrade rustix</li>
<li><a
href="https://github.com/palfrey/serial_test/commit/a8d985d9fde5aff6fe8822f71775f66c21a72a62"><code>a8d985d</code></a>
Replace a single-use match with if let</li>
<li><a
href="https://github.com/palfrey/serial_test/commit/67d22ff9eef867032031e30fc65a58154f588364"><code>67d22ff</code></a>
Fix some clippy issues</li>
<li><a
href="https://github.com/palfrey/serial_test/commit/ff2890d91b18e5d2b5e8ea546636a261a051ead2"><code>ff2890d</code></a>
Update docs for mod-level functionality</li>
<li>Additional commits viewable in <a
href="https://github.com/palfrey/serial_test/compare/v2.0.0...v3.0.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serial_test&package-manager=cargo&previous-version=2.0.0&new-version=3.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-15 21:09:30 -04:00
dependabot[bot] 56e6d61a8d Bump actix-http from 3.4.0 to 3.7.0 (#337)
Bumps [actix-http](https://github.com/actix/actix-web) from 3.4.0 to
3.7.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actix/actix-web/releases">actix-http's
releases</a>.</em></p>
<blockquote>
<h2>actix-http: v3.7.0</h2>
<h3>Added</h3>
<ul>
<li>Add <code>rustls-0_23</code> crate feature</li>
<li>Add <code>{h1::H1Service, h2::H2Service,
HttpService}::rustls_0_23()</code> and
<code>HttpService::rustls_0_23_with_config()</code> service
constructors.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Update <code>brotli</code> dependency to <code>6</code>.</li>
<li>Minimum supported Rust version (MSRV) is now 1.72.</li>
</ul>
<h2>actix-http: v3.6.0</h2>
<h3>Added</h3>
<ul>
<li>Add <code>rustls-0_22</code> crate feature.</li>
<li>Add <code>{h1::H1Service, h2::H2Service,
HttpService}::rustls_0_22()</code> and
<code>HttpService::rustls_0_22_with_config()</code> service
constructors.</li>
<li>Implement <code>From&lt;&amp;HeaderMap&gt;</code> for
<code>http::HeaderMap</code>.</li>
</ul>
<h2>actix-http: v3.5.1</h2>
<h3>Fixed</h3>
<ul>
<li>Prevent hang when returning zero-sized response bodies through
compression layer.</li>
</ul>
<h2>actix-http: v3.5.0</h2>
<h3>Added</h3>
<ul>
<li>Implement <code>From&lt;HeaderMap&gt;</code> for
<code>http::HeaderMap</code>.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Updated <code>zstd</code> dependency to <code>0.13</code>.</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Prevent compression of zero-sized response bodies.</li>
</ul>
<h2>awc: v3.5.0</h2>
<ul>
<li>Add <code>rustls-0_23</code>, <code>rustls-0_23-webpki-roots</code>,
and <code>rustls-0_23-native-roots</code> crate features.</li>
<li>Add <code>awc::Connector::rustls_0_23()</code> constructor.</li>
<li>Fix <code>rustls-0_22-native-roots</code> root store lookup</li>
<li>Update <code>brotli</code> dependency to <code>6</code>.</li>
<li>Minimum supported Rust version (MSRV) is now 1.72.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/actix/actix-web/commit/acb740584c759499000cc19d322d4f0293389631"><code>acb7405</code></a>
fix: correct aws rustls v0.23 feature gating</li>
<li><a
href="https://github.com/actix/actix-web/commit/9a437fe8357a74d4ab04e6df1c431d499a334413"><code>9a437fe</code></a>
chore(awc): prepare release 3.5.0</li>
<li><a
href="https://github.com/actix/actix-web/commit/59115bca49bbbb539c6774d613165f424df29a49"><code>59115bc</code></a>
chore(actix-web): prepare release 4.6.0</li>
<li><a
href="https://github.com/actix/actix-web/commit/fe7268487aa89fe92fac92a547c9fd23dd37508e"><code>fe72684</code></a>
chore(actix-http): prepare release 3.7.0</li>
<li><a
href="https://github.com/actix/actix-web/commit/e8262da1381c24a265747ac604e45aee635e00b8"><code>e8262da</code></a>
chore: update rcgen to 0.13</li>
<li><a
href="https://github.com/actix/actix-web/commit/18e02b83d5e160d3fe7e051104eea700f8eaa3af"><code>18e02b8</code></a>
docs: fix middleware docs warning</li>
<li><a
href="https://github.com/actix/actix-web/commit/2e63ff5928abc0704cadf330bcbf630162a37fa8"><code>2e63ff5</code></a>
actix-web: Add rustls 0.23 (<a
href="https://redirect.github.com/actix/actix-web/issues/3363">#3363</a>)</li>
<li><a
href="https://github.com/actix/actix-web/commit/48d7adb7bfee8e373e31e9fe6c78a7da4cec5bec"><code>48d7adb</code></a>
Documentation for actix multipart (<a
href="https://redirect.github.com/actix/actix-web/issues/3344">#3344</a>)</li>
<li><a
href="https://github.com/actix/actix-web/commit/0a2788d6627ed26d3fec560474b1c7f9febd78db"><code>0a2788d</code></a>
actix-test: re-export types from awc (<a
href="https://redirect.github.com/actix/actix-web/issues/3349">#3349</a>)</li>
<li><a
href="https://github.com/actix/actix-web/commit/2d035c066ea60e9113ce9a710728a59ad03a0066"><code>2d035c0</code></a>
actix-http: Add rustls 0.23 (<a
href="https://redirect.github.com/actix/actix-web/issues/3361">#3361</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/actix/actix-web/compare/awc-v3.4.0...http-v3.7.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actix-http&package-manager=cargo&previous-version=3.4.0&new-version=3.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-15 21:09:09 -04:00
dependabot[bot] 65b14a6486 Bump unicode-normalization from 0.1.22 to 0.1.23 (#340)
Bumps
[unicode-normalization](https://github.com/unicode-rs/unicode-normalization)
from 0.1.22 to 0.1.23.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/unicode-rs/unicode-normalization/commit/32659a77b041e64e1e101322da6b5f20353f8450"><code>32659a7</code></a>
Merge pull request <a
href="https://redirect.github.com/unicode-rs/unicode-normalization/issues/91">#91</a>
from Marcondiro/master</li>
<li><a
href="https://github.com/unicode-rs/unicode-normalization/commit/af878a3f5cf634ec0f1af91e0d7d0423ec6e13f8"><code>af878a3</code></a>
Add regen CI</li>
<li><a
href="https://github.com/unicode-rs/unicode-normalization/commit/dba608164e26b9f50b25f7bbd0ee49dd8c89c072"><code>dba6081</code></a>
Bump version to 0.1.23</li>
<li><a
href="https://github.com/unicode-rs/unicode-normalization/commit/2810fe2c6340f9d92c1ca638635450218ecbd952"><code>2810fe2</code></a>
Bump Unicode to version 15.1.0, regenerate tables</li>
<li>See full diff in <a
href="https://github.com/unicode-rs/unicode-normalization/compare/v0.1.22...v0.1.23">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=unicode-normalization&package-manager=cargo&previous-version=0.1.22&new-version=0.1.23)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-15 21:08:38 -04:00
dependabot[bot] eadb0eded0 Bump either from 1.9.0 to 1.12.0 (#338)
Bumps [either](https://github.com/rayon-rs/either) from 1.9.0 to 1.12.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rayon-rs/either/commit/1cea51a48affacb7b3573f8d0bfe5e2d5100471a"><code>1cea51a</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/either/issues/106">#106</a>
from cuviper/nth_back</li>
<li><a
href="https://github.com/rayon-rs/either/commit/a4382cb23198e99c6700615b46bd245a1e18a04a"><code>a4382cb</code></a>
Release 1.12.0</li>
<li><a
href="https://github.com/rayon-rs/either/commit/abb6f04e9185142fb282a65c0bdd9f8cdf0f0993"><code>abb6f04</code></a>
Specialize <code>nth_back</code> (MSRV 1.37)</li>
<li><a
href="https://github.com/rayon-rs/either/commit/864eae45407c6e25b55a39c9f9b09a0aca9928f2"><code>864eae4</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/either/issues/104">#104</a>
from cuviper/release-1.11.0</li>
<li><a
href="https://github.com/rayon-rs/either/commit/0bdb5831888349b93d920560d81638ff416c2955"><code>0bdb583</code></a>
Release 1.11.0</li>
<li><a
href="https://github.com/rayon-rs/either/commit/e385751eda844aee9576b78c10f99710845f64b7"><code>e385751</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/either/issues/101">#101</a>
from SFM61319/feat/into-either</li>
<li><a
href="https://github.com/rayon-rs/either/commit/d62efa6fffde2c90dc60aaa80301f9ab83010dd8"><code>d62efa6</code></a>
Feat: Implement trait <code>IntoEither</code></li>
<li><a
href="https://github.com/rayon-rs/either/commit/d48ab1b312ca6af8c859c308574eb27bae075452"><code>d48ab1b</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/either/issues/103">#103</a>
from masklinn/patch-1</li>
<li><a
href="https://github.com/rayon-rs/either/commit/365f674f6d8dbb2cd75c186d0c0daa794c89949a"><code>365f674</code></a>
Enable <code>serde</code> feature on playgrounds</li>
<li><a
href="https://github.com/rayon-rs/either/commit/ede3c47ed7f17b2d2ce78c6507b2c9af94c3df6e"><code>ede3c47</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/either/issues/98">#98</a>
from cuviper/release-1.10.0</li>
<li>Additional commits viewable in <a
href="https://github.com/rayon-rs/either/compare/1.9.0...1.12.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=either&package-manager=cargo&previous-version=1.9.0&new-version=1.12.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-15 21:08:21 -04:00
dependabot[bot] eb68ab54c4 Bump env_logger from 0.10.1 to 0.10.2 (#341)
Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.10.1
to 0.10.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-cli/env_logger/releases">env_logger's
releases</a>.</em></p>
<blockquote>
<h2>v0.10.2</h2>
<h2>What's Changed</h2>
<ul>
<li>refactor: Move impls next to types by <a
href="https://github.com/epage"><code>@​epage</code></a> in <a
href="https://redirect.github.com/rust-cli/env_logger/pull/283">rust-cli/env_logger#283</a></li>
<li>chore(deps): update github/codeql-action action to v3 by <a
href="https://github.com/renovate"><code>@​renovate</code></a> in <a
href="https://redirect.github.com/rust-cli/env_logger/pull/292">rust-cli/env_logger#292</a></li>
<li>chore(deps): update actions/setup-python action to v5 by <a
href="https://github.com/renovate"><code>@​renovate</code></a> in <a
href="https://redirect.github.com/rust-cli/env_logger/pull/291">rust-cli/env_logger#291</a></li>
<li>fix(fmt): Address a couple of bugs by <a
href="https://github.com/epage"><code>@​epage</code></a> in <a
href="https://redirect.github.com/rust-cli/env_logger/pull/296">rust-cli/env_logger#296</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/rust-cli/env_logger/compare/v0.10.1...v0.10.2">https://github.com/rust-cli/env_logger/compare/v0.10.1...v0.10.2</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md">env_logger's
changelog</a>.</em></p>
<blockquote>
<h2>[0.10.2] - 2024-01-18</h2>
<h3>Performance</h3>
<ul>
<li>Avoid extra UTF-8 validation performed in some cases</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>Ensure custom pipes/stdout get flushed</li>
<li>Don't panic on broken pipes when <code>color</code> is disabled</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rust-cli/env_logger/commit/7929b7fc3df3223320c3cdd346138965f2c7e52f"><code>7929b7f</code></a>
chore: Release env_logger version 0.10.2</li>
<li><a
href="https://github.com/rust-cli/env_logger/commit/3df552c315f00f4bce6e8dfd7b0ab56210e8a74b"><code>3df552c</code></a>
docs: Update changelog</li>
<li><a
href="https://github.com/rust-cli/env_logger/commit/6ec4104864ed6bf6694988d30611ee736d2dcb5e"><code>6ec4104</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-cli/env_logger/issues/296">#296</a>
from epage/refactor</li>
<li><a
href="https://github.com/rust-cli/env_logger/commit/939687dd75b606186989aa72fe43e716eaca5659"><code>939687d</code></a>
style: Make clippy happy</li>
<li><a
href="https://github.com/rust-cli/env_logger/commit/c088820ae84318077e5a37a3bed6d20b3f7aa3f3"><code>c088820</code></a>
fix(fmt): Ensure stream gets flushed</li>
<li><a
href="https://github.com/rust-cli/env_logger/commit/2b3f26fc29952296fdf79fa43d5beb35ddacbf40"><code>2b3f26f</code></a>
perf(fmt): Avoid UTF-8 validation</li>
<li><a
href="https://github.com/rust-cli/env_logger/commit/7428386da32c2a78b80f7e67a04b5fd5449601d5"><code>7428386</code></a>
refactor(fmt): Pull out stream lookup from write</li>
<li><a
href="https://github.com/rust-cli/env_logger/commit/e8674a237b62460b6dbc4ed8d8b48b6db0a97de4"><code>e8674a2</code></a>
refactor(fmt): Consolidate target printing</li>
<li><a
href="https://github.com/rust-cli/env_logger/commit/f5f3392886cb3f2a1a3180122666fa40a2150efe"><code>f5f3392</code></a>
refactor(fmt): Pull is_test into the target</li>
<li><a
href="https://github.com/rust-cli/env_logger/commit/87008fdf78b861202ca9da4869475649e72b8e82"><code>87008fd</code></a>
fix(fmt): Don't panic on broken pipes without termcolor</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-cli/env_logger/compare/v0.10.1...v0.10.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=env_logger&package-manager=cargo&previous-version=0.10.1&new-version=0.10.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-15 21:07:53 -04:00
Brandon Thomas e947e118e3 new endpoint 2024-06-15 00:00:47 -04:00
Brandon Thomas 8cc2e334b9 new endpoint for scene snapshots 2024-06-14 23:55:46 -04:00
Brandon Thomas b680dbc895 one day analysis 2024-06-13 23:44:19 -04:00
Brandon Thomas 68b1f9851c this shouldn't require a redeploy of the job 2024-06-13 00:51:43 -04:00
Brandon Thomas 6c62851ab4 clean up enqueue vst flags 2024-06-13 00:33:00 -04:00
Brandon Thomas 0d3e2e87bc cleanup 2024-06-12 23:59:27 -04:00
Brandon Thomas 6f62958c12 user access 2024-06-12 23:24:35 -04:00
Brandon Thomas a6f96e019a coordinate arguments to VST 2024-06-11 17:17:24 -04:00
Kasisnu 61a84134d4 thumbnails: fix typo (#342)
use basic auth,
2024-06-11 18:36:04 +05:30
Brandon Thomas 43abb4f4b1 another internal account 2024-06-08 10:23:39 -04:00
Brandon Thomas 1fc62e37b6 record job start / end 2024-06-07 00:01:00 -04:00
Brandon Thomas 1455138351 http status endpoint: job state, job duration 2024-06-06 23:49:04 -04:00
Brandon Thomas aad1dbfbdb enroll internal accounts 2024-06-05 23:43:11 -04:00
Brandon Thomas af326ad6c9 trim or empty 2024-06-04 16:43:18 -04:00
Brandon Thomas 678cd391f6 CORS configs for new "proper" branch deploys 2024-06-03 18:55:32 -04:00
Brandon Thomas 2548ab880a better name 2024-06-03 13:35:33 -04:00
Brandon Thomas 32d44d7070 don't discard pmx zips with more than one pmx; keep the biggest 2024-06-03 13:34:36 -04:00
Brandon Thomas 0f7853314d ignore blank titles when uploading 2024-06-03 13:13:13 -04:00
Brandon Thomas bc48f9c129 trim title on videos 2024-06-02 23:58:28 -04:00
Brandon Thomas f12b94752f move to moderator field 2024-05-31 10:17:41 -04:00
Brandon Thomas 64b1dfb5ec report inference duration in prompt handler 2024-05-31 10:02:06 -04:00
Brandon Thomas 9467cc2fe0 log for debugging 2024-05-31 09:54:23 -04:00
Kasisnu 489aabda3d generated thumbnails extension fix (#336) 2024-05-31 10:43:59 +05:30
Brandon Thomas 93e413dd88 plumb cinematic mode flag 2024-05-31 00:22:57 -04:00
Brandon Thomas 8820e82971 --use-cinematic 2024-05-31 00:17:56 -04:00
Brandon Thomas 9c18e6d1ca cinematic mode 2024-05-30 23:55:32 -04:00
Brandon Thomas 48949ce4b7 report strength 2024-05-29 22:55:49 -04:00
Brandon Thomas cdcb083369 fix thumbnail extensions 2024-05-29 21:23:45 -04:00
Brandon Thomas 858c93e4c3 disable lcm flag 2024-05-29 20:30:12 -04:00
Brandon Thomas 1e1d8ab6ca document and deprecate job types 2024-05-29 19:58:28 -04:00
Brandon Thomas 56bffa9297 document inference category 2024-05-29 19:48:35 -04:00
Brandon Thomas 3f1125f59c record lipsync state for debugging 2024-05-29 10:24:49 -04:00
Brandon Thomas 639ace9fd4 record and report workflow versions for internal debugging 2024-05-29 10:15:05 -04:00
Brandon Thomas 07e3eed1c7 documentation on subscriptions 2024-05-29 00:42:31 -04:00
Brandon Thomas ae7b910671 add test 2024-05-29 00:33:30 -04:00
Brandon Thomas d2fd811e41 ffprobe (#335) 2024-05-29 00:27:12 -04:00
781 changed files with 16329 additions and 9685 deletions
+7 -7
View File
@@ -26,14 +26,14 @@ MIGRATION_DIRECTORY=_sql/migrations/
# Bucket config (non-secret)
REGION_NAME=us-east1
TTS_DOWNLOAD_BUCKET_NAME=dev-vocodes-private-uploads
TTS_DOWNLOAD_BUCKET_ROOT=/user_uploaded_tts_models
#TTS_DOWNLOAD_BUCKET_NAME=kasisnu-t
#TTS_DOWNLOAD_BUCKET_ROOT=/user_uploaded_tts_models
W2L_PRIVATE_DOWNLOAD_BUCKET_NAME=dev-vocodes-private-uploads
W2L_PUBLIC_DOWNLOAD_BUCKET_NAME=dev-vocodes-public
#W2L_PRIVATE_DOWNLOAD_BUCKET_NAME=dev-vocodes-private-uploads
#W2L_PUBLIC_DOWNLOAD_BUCKET_NAME=dev-vocodes-public
PRIVATE_BUCKET_NAME=dev-vocodes-private-uploads
PUBLIC_BUCKET_NAME=dev-vocodes-public
#PRIVATE_BUCKET_NAME=kasisnu-test-area-private
#PUBLIC_BUCKET_NAME=kasisnu-test-area-public
# Bucket roots
AUDIO_UPLOADS_BUCKET_ROOT=/user_uploaded_w2l_audio
@@ -64,7 +64,7 @@ HIFIGAN_ROOT_CODE_DIRECTORY=/home/bt/dev/storyteller/storyteller-ml/tts
HIFIGAN_VIRTUAL_ENV_ACTIVATION_COMMAND="source python/bin/activate"
HIFIGAN_MODEL_CHECK_SCRIPT_NAME="vocodes_model_check_hifigan.py"
DOWNLOAD_SCRIPT="/home/tensor/code/storyteller/web-downloader/.venv/bin/python3.11 /home/tensor/code/storyteller/web-downloader/download_internet_file.py"
#; DOWNLOAD_SCRIPT="/home/tensor/code/storyteller/web-downloader/.venv/bin/python3.11 /home/tensor/code/storyteller/web-downloader/download_internet_file.py"
TTS_INFERENCE_SIDECAR_HOSTNAME=localhost:8000
@@ -1,47 +0,0 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n maybe_model_type as queue_type,\n count(*) as pending_job_count,\n NOW() as present_time\n FROM (\n SELECT\n token,\n maybe_model_type\n FROM generic_inference_jobs\n WHERE status IN (\"pending\", \"attempt_failed\")\n AND maybe_model_type IS NOT NULL\n UNION\n SELECT\n token,\n maybe_model_type\n FROM generic_inference_jobs\n WHERE status IN (\"started\")\n AND created_at > (CURDATE() - INTERVAL 15 MINUTE)\n AND maybe_model_type IS NOT NULL\n) as generic_inner\nGROUP BY queue_type\nUNION\nSELECT\n \"legacy_tts\" as queue_type,\n count(*) as pending_job_count,\n NOW() as present_time\nFROM (\n SELECT\n token\n FROM tts_inference_jobs\n WHERE status IN (\"pending\", \"attempt_failed\")\n UNION\n SELECT\n token\n FROM tts_inference_jobs\n WHERE status IN (\"started\")\n AND created_at > (CURDATE() - INTERVAL 15 MINUTE)\n) as legacy_inner\nGROUP BY queue_type\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "queue_type",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 1,
"name": "pending_job_count",
"type_info": {
"type": "LongLong",
"flags": "NOT_NULL | BINARY",
"char_set": 63,
"max_size": 21
}
},
{
"ordinal": 2,
"name": "present_time",
"type_info": {
"type": "Datetime",
"flags": "NOT_NULL",
"char_set": 224,
"max_size": 76
}
}
],
"parameters": {
"Right": 0
},
"nullable": [
true,
false,
false
]
},
"hash": "074307d7cd5c9a6f27e4d5ecce3072dcd13914a6f7f5f27f0f7232ae6c4813b4"
}
@@ -1,6 +1,6 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n token as `token: tokens::tokens::users::UserToken`,\n username,\n email_address,\n password_hash as `password_hash: crate::queries::users::user::lookup_user_for_login_result::VecBytes`,\n password_version,\n is_banned\nFROM users\nWHERE email_address = ?\nLIMIT 1\n ",
"query": "\nSELECT\n token as `token: tokens::tokens::users::UserToken`,\n username,\n email_address,\n password_hash as `password_hash: crate::queries::users::user::lookup_user_for_login_result::VecBytes`,\n password_version,\n is_banned,\n maybe_feature_flags\nFROM users\nWHERE email_address = ?\nLIMIT 1\n ",
"describe": {
"columns": [
{
@@ -62,6 +62,16 @@
"char_set": 63,
"max_size": 1
}
},
{
"ordinal": 6,
"name": "maybe_feature_flags",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 1020
}
}
],
"parameters": {
@@ -73,8 +83,9 @@
false,
false,
false,
false
false,
true
]
},
"hash": "e8705ee9b3bc3213e806946fef651e9bb8c2cb5cc2ac8eff3eaed82d9a88f90e"
"hash": "48889cc9c9b8dbe482e74687629a6958c1c9bf8a1cd5ae177afea0ad0709736d"
}
@@ -1,6 +1,6 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n m.token as `token: tokens::tokens::media_files::MediaFileToken`,\n\n m.media_class as `media_class: enums::by_table::media_files::media_file_class::MediaFileClass`,\n m.media_type as `media_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n\n m.maybe_engine_category as `maybe_engine_category: enums::by_table::media_files::media_file_engine_category::MediaFileEngineCategory`,\n m.maybe_animation_type as `maybe_animation_type: enums::by_table::media_files::media_file_animation_type::MediaFileAnimationType`,\n\n m.maybe_media_subtype as `maybe_media_subtype: enums::by_table::media_files::media_file_subtype::MediaFileSubtype`,\n\n users.token as `maybe_creator_user_token: tokens::tokens::users::UserToken`,\n users.username as maybe_creator_username,\n users.display_name as maybe_creator_display_name,\n users.email_gravatar_hash as maybe_creator_gravatar_hash,\n\n m.maybe_creator_anonymous_visitor_token as `maybe_creator_anonymous_visitor_token: tokens::tokens::anonymous_visitor_tracking::AnonymousVisitorTrackingToken`,\n\n m.maybe_batch_token as `maybe_batch_token: tokens::tokens::batch_generations::BatchGenerationToken`,\n\n m.maybe_style_transfer_source_media_file_token as `maybe_style_transfer_source_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n m.maybe_scene_source_media_file_token as `maybe_scene_source_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n\n\n m.maybe_title,\n m.maybe_text_transcript,\n\n m.maybe_origin_filename,\n\n m.maybe_duration_millis,\n\n m.maybe_prompt_token as `maybe_prompt_token: tokens::tokens::prompts::PromptToken`,\n prompts.maybe_other_args as maybe_other_prompt_args,\n\n media_file_cover_image.public_bucket_directory_hash as maybe_file_cover_image_public_bucket_hash,\n media_file_cover_image.maybe_public_bucket_prefix as maybe_file_cover_image_public_bucket_prefix,\n media_file_cover_image.maybe_public_bucket_extension as maybe_file_cover_image_public_bucket_extension,\n\n m.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n model_weights.token as `maybe_model_weights_token: tokens::tokens::model_weights::ModelWeightToken`,\n model_weights.title as maybe_model_weights_title,\n model_weights.weights_type as `maybe_model_weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n model_weights.weights_category as `maybe_model_weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n\n model_weight_cover_image.public_bucket_directory_hash as maybe_model_cover_image_public_bucket_hash,\n model_weight_cover_image.maybe_public_bucket_prefix as maybe_model_cover_image_public_bucket_prefix,\n model_weight_cover_image.maybe_public_bucket_extension as maybe_model_cover_image_public_bucket_extension,\n\n model_weight_creator.token as `maybe_model_weight_creator_user_token: tokens::tokens::users::UserToken`,\n model_weight_creator.username as maybe_model_weight_creator_username,\n model_weight_creator.display_name as maybe_model_weight_creator_display_name,\n model_weight_creator.email_gravatar_hash as maybe_model_weight_creator_gravatar_hash,\n\n m.public_bucket_directory_hash,\n m.maybe_public_bucket_prefix,\n m.maybe_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n featured_items.entity_token IS NOT NULL AS is_featured,\n\n m.created_at,\n m.updated_at\n\nFROM media_files AS m\nLEFT OUTER JOIN users\n ON m.maybe_creator_user_token = users.token\nLEFT OUTER JOIN model_weights\n ON m.maybe_origin_model_token = model_weights.token\nLEFT OUTER JOIN media_files as media_file_cover_image\n ON media_file_cover_image.token = m.maybe_cover_image_media_file_token\nLEFT OUTER JOIN media_files as model_weight_cover_image\n ON model_weight_cover_image.token = model_weights.maybe_cover_image_media_file_token\nLEFT OUTER JOIN users as model_weight_creator\n ON model_weight_creator.token = model_weights.creator_user_token\nLEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"media_file\"\n AND entity_stats.entity_token = m.token\nLEFT OUTER JOIN prompts\n ON prompts.token = m.maybe_prompt_token\nLEFT OUTER JOIN featured_items\n ON featured_items.entity_type = 'media_file'\n AND featured_items.entity_token = m.token\n AND featured_items.deleted_at IS NULL\nWHERE\n m.token = ?\n AND m.user_deleted_at IS NULL\n AND m.mod_deleted_at IS NULL\n ",
"query": "\nSELECT\n m.token as `token: tokens::tokens::media_files::MediaFileToken`,\n\n m.media_class as `media_class: enums::by_table::media_files::media_file_class::MediaFileClass`,\n m.media_type as `media_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n\n m.maybe_engine_category as `maybe_engine_category: enums::by_table::media_files::media_file_engine_category::MediaFileEngineCategory`,\n m.maybe_animation_type as `maybe_animation_type: enums::by_table::media_files::media_file_animation_type::MediaFileAnimationType`,\n\n m.maybe_media_subtype as `maybe_media_subtype: enums::by_table::media_files::media_file_subtype::MediaFileSubtype`,\n\n m.maybe_mime_type,\n\n users.token as `maybe_creator_user_token: tokens::tokens::users::UserToken`,\n users.username as maybe_creator_username,\n users.display_name as maybe_creator_display_name,\n users.email_gravatar_hash as maybe_creator_gravatar_hash,\n\n m.maybe_creator_anonymous_visitor_token as `maybe_creator_anonymous_visitor_token: tokens::tokens::anonymous_visitor_tracking::AnonymousVisitorTrackingToken`,\n\n m.maybe_batch_token as `maybe_batch_token: tokens::tokens::batch_generations::BatchGenerationToken`,\n\n m.maybe_style_transfer_source_media_file_token as `maybe_style_transfer_source_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n m.maybe_scene_source_media_file_token as `maybe_scene_source_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n\n\n m.maybe_title,\n m.maybe_text_transcript,\n\n m.maybe_origin_filename,\n\n m.maybe_duration_millis,\n\n m.maybe_prompt_token as `maybe_prompt_token: tokens::tokens::prompts::PromptToken`,\n prompts.maybe_other_args as maybe_other_prompt_args,\n\n media_file_cover_image.public_bucket_directory_hash as maybe_file_cover_image_public_bucket_hash,\n media_file_cover_image.maybe_public_bucket_prefix as maybe_file_cover_image_public_bucket_prefix,\n media_file_cover_image.maybe_public_bucket_extension as maybe_file_cover_image_public_bucket_extension,\n\n m.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n model_weights.token as `maybe_model_weights_token: tokens::tokens::model_weights::ModelWeightToken`,\n model_weights.title as maybe_model_weights_title,\n model_weights.weights_type as `maybe_model_weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n model_weights.weights_category as `maybe_model_weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n\n model_weight_cover_image.public_bucket_directory_hash as maybe_model_cover_image_public_bucket_hash,\n model_weight_cover_image.maybe_public_bucket_prefix as maybe_model_cover_image_public_bucket_prefix,\n model_weight_cover_image.maybe_public_bucket_extension as maybe_model_cover_image_public_bucket_extension,\n\n model_weight_creator.token as `maybe_model_weight_creator_user_token: tokens::tokens::users::UserToken`,\n model_weight_creator.username as maybe_model_weight_creator_username,\n model_weight_creator.display_name as maybe_model_weight_creator_display_name,\n model_weight_creator.email_gravatar_hash as maybe_model_weight_creator_gravatar_hash,\n\n m.public_bucket_directory_hash,\n m.maybe_public_bucket_prefix,\n m.maybe_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n featured_items.entity_token IS NOT NULL AS is_featured,\n\n m.created_at,\n m.updated_at\n\nFROM media_files AS m\nLEFT OUTER JOIN users\n ON m.maybe_creator_user_token = users.token\nLEFT OUTER JOIN model_weights\n ON m.maybe_origin_model_token = model_weights.token\nLEFT OUTER JOIN media_files as media_file_cover_image\n ON media_file_cover_image.token = m.maybe_cover_image_media_file_token\nLEFT OUTER JOIN media_files as model_weight_cover_image\n ON model_weight_cover_image.token = model_weights.maybe_cover_image_media_file_token\nLEFT OUTER JOIN users as model_weight_creator\n ON model_weight_creator.token = model_weights.creator_user_token\nLEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"media_file\"\n AND entity_stats.entity_token = m.token\nLEFT OUTER JOIN prompts\n ON prompts.token = m.maybe_prompt_token\nLEFT OUTER JOIN featured_items\n ON featured_items.entity_type = 'media_file'\n AND featured_items.entity_token = m.token\n AND featured_items.deleted_at IS NULL\nWHERE\n m.token = ?\n AND m.user_deleted_at IS NULL\n AND m.mod_deleted_at IS NULL\n ",
"describe": {
"columns": [
{
@@ -65,6 +65,16 @@
},
{
"ordinal": 6,
"name": "maybe_mime_type",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 7,
"name": "maybe_creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
@@ -74,7 +84,7 @@
}
},
{
"ordinal": 7,
"ordinal": 8,
"name": "maybe_creator_username",
"type_info": {
"type": "VarString",
@@ -84,7 +94,7 @@
}
},
{
"ordinal": 8,
"ordinal": 9,
"name": "maybe_creator_display_name",
"type_info": {
"type": "VarString",
@@ -94,7 +104,7 @@
}
},
{
"ordinal": 9,
"ordinal": 10,
"name": "maybe_creator_gravatar_hash",
"type_info": {
"type": "String",
@@ -104,7 +114,7 @@
}
},
{
"ordinal": 10,
"ordinal": 11,
"name": "maybe_creator_anonymous_visitor_token: tokens::tokens::anonymous_visitor_tracking::AnonymousVisitorTrackingToken",
"type_info": {
"type": "VarString",
@@ -114,7 +124,7 @@
}
},
{
"ordinal": 11,
"ordinal": 12,
"name": "maybe_batch_token: tokens::tokens::batch_generations::BatchGenerationToken",
"type_info": {
"type": "VarString",
@@ -124,7 +134,7 @@
}
},
{
"ordinal": 12,
"ordinal": 13,
"name": "maybe_style_transfer_source_media_file_token: tokens::tokens::media_files::MediaFileToken",
"type_info": {
"type": "VarString",
@@ -134,7 +144,7 @@
}
},
{
"ordinal": 13,
"ordinal": 14,
"name": "maybe_scene_source_media_file_token: tokens::tokens::media_files::MediaFileToken",
"type_info": {
"type": "VarString",
@@ -144,7 +154,7 @@
}
},
{
"ordinal": 14,
"ordinal": 15,
"name": "maybe_title",
"type_info": {
"type": "VarString",
@@ -154,7 +164,7 @@
}
},
{
"ordinal": 15,
"ordinal": 16,
"name": "maybe_text_transcript",
"type_info": {
"type": "Blob",
@@ -164,7 +174,7 @@
}
},
{
"ordinal": 16,
"ordinal": 17,
"name": "maybe_origin_filename",
"type_info": {
"type": "VarString",
@@ -174,7 +184,7 @@
}
},
{
"ordinal": 17,
"ordinal": 18,
"name": "maybe_duration_millis",
"type_info": {
"type": "Long",
@@ -184,7 +194,7 @@
}
},
{
"ordinal": 18,
"ordinal": 19,
"name": "maybe_prompt_token: tokens::tokens::prompts::PromptToken",
"type_info": {
"type": "VarString",
@@ -194,7 +204,7 @@
}
},
{
"ordinal": 19,
"ordinal": 20,
"name": "maybe_other_prompt_args",
"type_info": {
"type": "Blob",
@@ -204,7 +214,7 @@
}
},
{
"ordinal": 20,
"ordinal": 21,
"name": "maybe_file_cover_image_public_bucket_hash",
"type_info": {
"type": "VarString",
@@ -214,7 +224,7 @@
}
},
{
"ordinal": 21,
"ordinal": 22,
"name": "maybe_file_cover_image_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -224,7 +234,7 @@
}
},
{
"ordinal": 22,
"ordinal": 23,
"name": "maybe_file_cover_image_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -234,7 +244,7 @@
}
},
{
"ordinal": 23,
"ordinal": 24,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
@@ -244,7 +254,7 @@
}
},
{
"ordinal": 24,
"ordinal": 25,
"name": "maybe_model_weights_token: tokens::tokens::model_weights::ModelWeightToken",
"type_info": {
"type": "VarString",
@@ -254,7 +264,7 @@
}
},
{
"ordinal": 25,
"ordinal": 26,
"name": "maybe_model_weights_title",
"type_info": {
"type": "VarString",
@@ -264,7 +274,7 @@
}
},
{
"ordinal": 26,
"ordinal": 27,
"name": "maybe_model_weights_type: enums::by_table::model_weights::weights_types::WeightsType",
"type_info": {
"type": "VarString",
@@ -274,7 +284,7 @@
}
},
{
"ordinal": 27,
"ordinal": 28,
"name": "maybe_model_weights_category: enums::by_table::model_weights::weights_category::WeightsCategory",
"type_info": {
"type": "VarString",
@@ -284,7 +294,7 @@
}
},
{
"ordinal": 28,
"ordinal": 29,
"name": "maybe_model_cover_image_public_bucket_hash",
"type_info": {
"type": "VarString",
@@ -294,7 +304,7 @@
}
},
{
"ordinal": 29,
"ordinal": 30,
"name": "maybe_model_cover_image_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -304,7 +314,7 @@
}
},
{
"ordinal": 30,
"ordinal": 31,
"name": "maybe_model_cover_image_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -314,7 +324,7 @@
}
},
{
"ordinal": 31,
"ordinal": 32,
"name": "maybe_model_weight_creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
@@ -324,7 +334,7 @@
}
},
{
"ordinal": 32,
"ordinal": 33,
"name": "maybe_model_weight_creator_username",
"type_info": {
"type": "VarString",
@@ -334,7 +344,7 @@
}
},
{
"ordinal": 33,
"ordinal": 34,
"name": "maybe_model_weight_creator_display_name",
"type_info": {
"type": "VarString",
@@ -344,7 +354,7 @@
}
},
{
"ordinal": 34,
"ordinal": 35,
"name": "maybe_model_weight_creator_gravatar_hash",
"type_info": {
"type": "String",
@@ -354,7 +364,7 @@
}
},
{
"ordinal": 35,
"ordinal": 36,
"name": "public_bucket_directory_hash",
"type_info": {
"type": "VarString",
@@ -364,7 +374,7 @@
}
},
{
"ordinal": 36,
"ordinal": 37,
"name": "maybe_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -374,7 +384,7 @@
}
},
{
"ordinal": 37,
"ordinal": 38,
"name": "maybe_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -384,7 +394,7 @@
}
},
{
"ordinal": 38,
"ordinal": 39,
"name": "maybe_ratings_positive_count",
"type_info": {
"type": "Long",
@@ -394,7 +404,7 @@
}
},
{
"ordinal": 39,
"ordinal": 40,
"name": "maybe_ratings_negative_count",
"type_info": {
"type": "Long",
@@ -404,7 +414,7 @@
}
},
{
"ordinal": 40,
"ordinal": 41,
"name": "maybe_bookmark_count",
"type_info": {
"type": "Long",
@@ -414,7 +424,7 @@
}
},
{
"ordinal": 41,
"ordinal": 42,
"name": "is_featured",
"type_info": {
"type": "LongLong",
@@ -424,7 +434,7 @@
}
},
{
"ordinal": 42,
"ordinal": 43,
"name": "created_at",
"type_info": {
"type": "Timestamp",
@@ -434,7 +444,7 @@
}
},
{
"ordinal": 43,
"ordinal": 44,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
@@ -471,6 +481,7 @@
true,
true,
true,
true,
false,
true,
true,
@@ -494,5 +505,5 @@
false
]
},
"hash": "beda05b1f3e3f78ca2610c491e682ea1c76fb5effccd5d710761353baf8ce161"
"hash": "58cb3fd03fb215b1d323f6aa6a5fd713900b9d931700c4226a1d9713b5e469c7"
}
@@ -0,0 +1,47 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n job_type as queue_type,\n count(*) as pending_job_count,\n NOW() as present_time\n FROM (\n SELECT\n token,\n job_type\n FROM generic_inference_jobs\n WHERE status IN (\"pending\", \"attempt_failed\")\n AND job_type IS NOT NULL\n UNION\n SELECT\n token,\n job_type\n FROM generic_inference_jobs\n WHERE status IN (\"started\")\n AND created_at > (CURDATE() - INTERVAL 15 MINUTE)\n AND job_type IS NOT NULL\n) as generic_inner\nGROUP BY queue_type\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "queue_type",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 1,
"name": "pending_job_count",
"type_info": {
"type": "LongLong",
"flags": "NOT_NULL | BINARY",
"char_set": 63,
"max_size": 21
}
},
{
"ordinal": 2,
"name": "present_time",
"type_info": {
"type": "Datetime",
"flags": "NOT_NULL | BINARY",
"char_set": 63,
"max_size": 19
}
}
],
"parameters": {
"Right": 0
},
"nullable": [
true,
false,
false
]
},
"hash": "73dc054488b2fa3efc923d3a90914a1450b73e99a377562484a0498ccce1676f"
}
@@ -1,6 +1,6 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n token as `token: tokens::tokens::users::UserToken`,\n username,\n email_address,\n password_hash as `password_hash: crate::queries::users::user::lookup_user_for_login_result::VecBytes`,\n password_version,\n is_banned\nFROM users\nWHERE username = ?\nLIMIT 1\n ",
"query": "\nSELECT\n token as `token: tokens::tokens::users::UserToken`,\n username,\n email_address,\n password_hash as `password_hash: crate::queries::users::user::lookup_user_for_login_result::VecBytes`,\n password_version,\n is_banned,\n maybe_feature_flags\nFROM users\nWHERE username = ?\nLIMIT 1\n ",
"describe": {
"columns": [
{
@@ -62,6 +62,16 @@
"char_set": 63,
"max_size": 1
}
},
{
"ordinal": 6,
"name": "maybe_feature_flags",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 1020
}
}
],
"parameters": {
@@ -73,8 +83,9 @@
false,
false,
false,
false
false,
true
]
},
"hash": "5795b8579a458706077b1fa95e4627b90eac6606bde543b6406233d081fd0eb5"
"hash": "8e577db7abde571a0f29fc9d678891349918f0882136d9f7a39b338f66270f11"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\nUPDATE media_files\nSET\n maybe_animation_type = ?\nWHERE\n token = ?\nLIMIT 1\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "930cfd52f78fa14a86bd1a67c5fe36d8c8961079b2bd684a0d4da315bf3ce16e"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\nUPDATE generic_inference_jobs\nSET\n is_dismissed_by_user = TRUE\nWHERE maybe_creator_user_token = ?\nAND status IN (\n 'dead',\n 'cancelled_by_system',\n 'cancelled_by_user',\n 'complete_failure',\n 'complete_success'\n )\nAND created_at > DATE_SUB(NOW(), INTERVAL 36 HOUR)\nLIMIT 1000\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 1
},
"nullable": []
},
"hash": "a1d44611ee4a0ecc54548f95719f01341eb242460c79ef75423de96b31ed5385"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\nINSERT INTO users (\n token,\n username,\n display_name,\n email_address,\n email_gravatar_hash,\n profile_markdown,\n profile_rendered_html,\n user_role_slug,\n password_hash,\n ip_address_creation,\n ip_address_last_login,\n ip_address_last_update,\n can_access_studio\n)\nVALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? , ?)\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 13
},
"nullable": []
},
"hash": "a3066dd68c77b5381104a754b2774506990f659c9a0ed2de1fcb8e6fd953e726"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\nUPDATE media_files\nSET\n maybe_engine_category = ?\nWHERE\n token = ?\nLIMIT 1\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "b56ee40be840cdec013f3f99eb585e4ac333ccfe563ba3da4c9a80df33dccd57"
}
@@ -1,6 +1,6 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n jobs.token as `job_token: tokens::tokens::generic_inference_jobs::InferenceJobToken`,\n\n jobs.status as `status: enums::common::job_status_plus::JobStatusPlus`,\n jobs.attempt_count,\n\n jobs.maybe_creator_user_token as `maybe_creator_user_token: tokens::tokens::users::UserToken`,\n jobs.maybe_creator_anonymous_visitor_token as `maybe_creator_anonymous_visitor_token: tokens::tokens::anonymous_visitor_tracking::AnonymousVisitorTrackingToken`,\n jobs.creator_ip_address,\n\n jobs.inference_category as `inference_category: enums::by_table::generic_inference_jobs::inference_category::InferenceCategory`,\n jobs.maybe_model_type,\n jobs.maybe_model_token,\n jobs.maybe_raw_inference_text,\n jobs.maybe_inference_args,\n\n jobs.frontend_failure_category as `maybe_frontend_failure_category: enums::by_table::generic_inference_jobs::frontend_failure_category::FrontendFailureCategory`,\n\n jobs.on_success_result_entity_type as maybe_result_entity_type,\n jobs.on_success_result_entity_token as maybe_result_entity_token,\n\n model_weights.title as maybe_model_weights_title,\n tts_models.title as maybe_tts_model_title,\n voice_conversion_models.title as maybe_voice_conversion_model_title,\n\n tts_results.public_bucket_wav_audio_path as maybe_tts_public_bucket_path,\n voice_conversion_results.public_bucket_hash as maybe_voice_conversion_public_bucket_hash,\n\n media_files.public_bucket_directory_hash as maybe_media_file_public_bucket_directory_hash,\n media_files.maybe_public_bucket_prefix as maybe_media_file_public_bucket_prefix,\n media_files.maybe_public_bucket_extension as maybe_media_file_public_bucket_extension,\n\n jobs.assigned_worker as maybe_assigned_worker,\n jobs.assigned_cluster as maybe_assigned_cluster,\n\n jobs.is_keepalive_required,\n\n jobs.created_at,\n jobs.updated_at,\n\n jobs.first_started_at as maybe_first_started_at,\n jobs.successfully_completed_at as maybe_successfully_completed_at\n\nFROM generic_inference_jobs as jobs\n\nLEFT OUTER JOIN model_weights ON jobs.maybe_model_token = model_weights.token\nLEFT OUTER JOIN tts_models ON jobs.maybe_model_token = tts_models.token\nLEFT OUTER JOIN voice_conversion_models ON jobs.maybe_model_token = voice_conversion_models.token\n\nLEFT OUTER JOIN tts_results ON jobs.on_success_result_entity_token = tts_results.token\nLEFT OUTER JOIN voice_conversion_results ON jobs.on_success_result_entity_token = voice_conversion_results.token\nLEFT OUTER JOIN media_files ON jobs.on_success_result_entity_token = media_files.token\n\nWHERE jobs.token = ?\n ",
"query": "\nSELECT\n jobs.token as `job_token: tokens::tokens::generic_inference_jobs::InferenceJobToken`,\n\n jobs.status as `status: enums::common::job_status_plus::JobStatusPlus`,\n jobs.attempt_count,\n\n jobs.maybe_creator_user_token as `maybe_creator_user_token: tokens::tokens::users::UserToken`,\n jobs.maybe_creator_anonymous_visitor_token as `maybe_creator_anonymous_visitor_token: tokens::tokens::anonymous_visitor_tracking::AnonymousVisitorTrackingToken`,\n jobs.creator_ip_address,\n\n jobs.inference_category as `inference_category: enums::by_table::generic_inference_jobs::inference_category::InferenceCategory`,\n jobs.maybe_model_type,\n jobs.maybe_model_token,\n jobs.maybe_raw_inference_text,\n jobs.maybe_inference_args,\n\n jobs.frontend_failure_category as `maybe_frontend_failure_category: enums::by_table::generic_inference_jobs::frontend_failure_category::FrontendFailureCategory`,\n\n jobs.on_success_result_entity_type as maybe_result_entity_type,\n jobs.on_success_result_entity_token as maybe_result_entity_token,\n\n model_weights.title as maybe_model_weights_title,\n tts_models.title as maybe_tts_model_title,\n voice_conversion_models.title as maybe_voice_conversion_model_title,\n\n tts_results.public_bucket_wav_audio_path as maybe_tts_public_bucket_path,\n voice_conversion_results.public_bucket_hash as maybe_voice_conversion_public_bucket_hash,\n\n media_files.public_bucket_directory_hash as maybe_media_file_public_bucket_directory_hash,\n media_files.maybe_public_bucket_prefix as maybe_media_file_public_bucket_prefix,\n media_files.maybe_public_bucket_extension as maybe_media_file_public_bucket_extension,\n\n jobs.assigned_worker as maybe_assigned_worker,\n jobs.assigned_cluster as maybe_assigned_cluster,\n\n jobs.is_keepalive_required,\n\n jobs.created_at,\n jobs.updated_at,\n\n jobs.first_started_at as maybe_first_started_at,\n jobs.successfully_completed_at as maybe_successfully_completed_at,\n\n NOW() as database_clock\n\nFROM generic_inference_jobs as jobs\n\nLEFT OUTER JOIN model_weights ON jobs.maybe_model_token = model_weights.token\nLEFT OUTER JOIN tts_models ON jobs.maybe_model_token = tts_models.token\nLEFT OUTER JOIN voice_conversion_models ON jobs.maybe_model_token = voice_conversion_models.token\n\nLEFT OUTER JOIN tts_results ON jobs.on_success_result_entity_token = tts_results.token\nLEFT OUTER JOIN voice_conversion_results ON jobs.on_success_result_entity_token = voice_conversion_results.token\nLEFT OUTER JOIN media_files ON jobs.on_success_result_entity_token = media_files.token\n\nWHERE jobs.token = ?\n ",
"describe": {
"columns": [
{
@@ -292,6 +292,16 @@
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 29,
"name": "database_clock",
"type_info": {
"type": "Datetime",
"flags": "NOT_NULL | BINARY",
"char_set": 63,
"max_size": 19
}
}
],
"parameters": {
@@ -326,8 +336,9 @@
false,
false,
true,
true
true,
false
]
},
"hash": "7d5030b221e9b470ee7af4b73539fd2ef477e6f3c98c56422016449c6775222d"
"hash": "e5121d132d93ec43e48197e00b19040a50ff2942224dc70b0faa0ec988aee7cf"
}
@@ -1,6 +1,6 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n m.token as `token: tokens::tokens::media_files::MediaFileToken`,\n\n m.media_class as `media_class: enums::by_table::media_files::media_file_class::MediaFileClass`,\n m.media_type as `media_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n\n m.maybe_engine_category as `maybe_engine_category: enums::by_table::media_files::media_file_engine_category::MediaFileEngineCategory`,\n m.maybe_animation_type as `maybe_animation_type: enums::by_table::media_files::media_file_animation_type::MediaFileAnimationType`,\n\n m.maybe_media_subtype as `maybe_media_subtype: enums::by_table::media_files::media_file_subtype::MediaFileSubtype`,\n\n users.token as `maybe_creator_user_token: tokens::tokens::users::UserToken`,\n users.username as maybe_creator_username,\n users.display_name as maybe_creator_display_name,\n users.email_gravatar_hash as maybe_creator_gravatar_hash,\n\n m.maybe_creator_anonymous_visitor_token as `maybe_creator_anonymous_visitor_token: tokens::tokens::anonymous_visitor_tracking::AnonymousVisitorTrackingToken`,\n\n m.maybe_batch_token as `maybe_batch_token: tokens::tokens::batch_generations::BatchGenerationToken`,\n\n m.maybe_style_transfer_source_media_file_token as `maybe_style_transfer_source_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n m.maybe_scene_source_media_file_token as `maybe_scene_source_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n\n m.maybe_title,\n m.maybe_text_transcript,\n\n m.maybe_origin_filename,\n\n m.maybe_duration_millis,\n\n m.maybe_prompt_token as `maybe_prompt_token: tokens::tokens::prompts::PromptToken`,\n prompts.maybe_other_args as maybe_other_prompt_args,\n\n media_file_cover_image.public_bucket_directory_hash as maybe_file_cover_image_public_bucket_hash,\n media_file_cover_image.maybe_public_bucket_prefix as maybe_file_cover_image_public_bucket_prefix,\n media_file_cover_image.maybe_public_bucket_extension as maybe_file_cover_image_public_bucket_extension,\n\n m.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n model_weights.token as `maybe_model_weights_token: tokens::tokens::model_weights::ModelWeightToken`,\n model_weights.title as maybe_model_weights_title,\n model_weights.weights_type as `maybe_model_weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n model_weights.weights_category as `maybe_model_weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n\n model_weight_cover_image.public_bucket_directory_hash as maybe_model_cover_image_public_bucket_hash,\n model_weight_cover_image.maybe_public_bucket_prefix as maybe_model_cover_image_public_bucket_prefix,\n model_weight_cover_image.maybe_public_bucket_extension as maybe_model_cover_image_public_bucket_extension,\n\n model_weight_creator.token as `maybe_model_weight_creator_user_token: tokens::tokens::users::UserToken`,\n model_weight_creator.username as maybe_model_weight_creator_username,\n model_weight_creator.display_name as maybe_model_weight_creator_display_name,\n model_weight_creator.email_gravatar_hash as maybe_model_weight_creator_gravatar_hash,\n\n m.public_bucket_directory_hash,\n m.maybe_public_bucket_prefix,\n m.maybe_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n featured_items.entity_token IS NOT NULL AS is_featured,\n\n m.created_at,\n m.updated_at\n\nFROM media_files AS m\nLEFT OUTER JOIN users\n ON m.maybe_creator_user_token = users.token\nLEFT OUTER JOIN model_weights\n ON m.maybe_origin_model_token = model_weights.token\nLEFT OUTER JOIN media_files as media_file_cover_image\n ON media_file_cover_image.token = m.maybe_cover_image_media_file_token\nLEFT OUTER JOIN media_files as model_weight_cover_image\n ON model_weight_cover_image.token = model_weights.maybe_cover_image_media_file_token\nLEFT OUTER JOIN users as model_weight_creator\n ON model_weight_creator.token = model_weights.creator_user_token\nLEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"media_file\"\n AND entity_stats.entity_token = m.token\nLEFT OUTER JOIN prompts\n ON prompts.token = m.maybe_prompt_token\nLEFT OUTER JOIN featured_items\n ON featured_items.entity_type = 'media_file'\n AND featured_items.entity_token = m.token\n AND featured_items.deleted_at IS NULL\nWHERE\n m.token = ?\n ",
"query": "\nSELECT\n m.token as `token: tokens::tokens::media_files::MediaFileToken`,\n\n m.media_class as `media_class: enums::by_table::media_files::media_file_class::MediaFileClass`,\n m.media_type as `media_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n\n m.maybe_engine_category as `maybe_engine_category: enums::by_table::media_files::media_file_engine_category::MediaFileEngineCategory`,\n m.maybe_animation_type as `maybe_animation_type: enums::by_table::media_files::media_file_animation_type::MediaFileAnimationType`,\n\n m.maybe_media_subtype as `maybe_media_subtype: enums::by_table::media_files::media_file_subtype::MediaFileSubtype`,\n\n m.maybe_mime_type,\n\n users.token as `maybe_creator_user_token: tokens::tokens::users::UserToken`,\n users.username as maybe_creator_username,\n users.display_name as maybe_creator_display_name,\n users.email_gravatar_hash as maybe_creator_gravatar_hash,\n\n m.maybe_creator_anonymous_visitor_token as `maybe_creator_anonymous_visitor_token: tokens::tokens::anonymous_visitor_tracking::AnonymousVisitorTrackingToken`,\n\n m.maybe_batch_token as `maybe_batch_token: tokens::tokens::batch_generations::BatchGenerationToken`,\n\n m.maybe_style_transfer_source_media_file_token as `maybe_style_transfer_source_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n m.maybe_scene_source_media_file_token as `maybe_scene_source_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n\n m.maybe_title,\n m.maybe_text_transcript,\n\n m.maybe_origin_filename,\n\n m.maybe_duration_millis,\n\n m.maybe_prompt_token as `maybe_prompt_token: tokens::tokens::prompts::PromptToken`,\n prompts.maybe_other_args as maybe_other_prompt_args,\n\n media_file_cover_image.public_bucket_directory_hash as maybe_file_cover_image_public_bucket_hash,\n media_file_cover_image.maybe_public_bucket_prefix as maybe_file_cover_image_public_bucket_prefix,\n media_file_cover_image.maybe_public_bucket_extension as maybe_file_cover_image_public_bucket_extension,\n\n m.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n model_weights.token as `maybe_model_weights_token: tokens::tokens::model_weights::ModelWeightToken`,\n model_weights.title as maybe_model_weights_title,\n model_weights.weights_type as `maybe_model_weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n model_weights.weights_category as `maybe_model_weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n\n model_weight_cover_image.public_bucket_directory_hash as maybe_model_cover_image_public_bucket_hash,\n model_weight_cover_image.maybe_public_bucket_prefix as maybe_model_cover_image_public_bucket_prefix,\n model_weight_cover_image.maybe_public_bucket_extension as maybe_model_cover_image_public_bucket_extension,\n\n model_weight_creator.token as `maybe_model_weight_creator_user_token: tokens::tokens::users::UserToken`,\n model_weight_creator.username as maybe_model_weight_creator_username,\n model_weight_creator.display_name as maybe_model_weight_creator_display_name,\n model_weight_creator.email_gravatar_hash as maybe_model_weight_creator_gravatar_hash,\n\n m.public_bucket_directory_hash,\n m.maybe_public_bucket_prefix,\n m.maybe_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n featured_items.entity_token IS NOT NULL AS is_featured,\n\n m.created_at,\n m.updated_at\n\nFROM media_files AS m\nLEFT OUTER JOIN users\n ON m.maybe_creator_user_token = users.token\nLEFT OUTER JOIN model_weights\n ON m.maybe_origin_model_token = model_weights.token\nLEFT OUTER JOIN media_files as media_file_cover_image\n ON media_file_cover_image.token = m.maybe_cover_image_media_file_token\nLEFT OUTER JOIN media_files as model_weight_cover_image\n ON model_weight_cover_image.token = model_weights.maybe_cover_image_media_file_token\nLEFT OUTER JOIN users as model_weight_creator\n ON model_weight_creator.token = model_weights.creator_user_token\nLEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"media_file\"\n AND entity_stats.entity_token = m.token\nLEFT OUTER JOIN prompts\n ON prompts.token = m.maybe_prompt_token\nLEFT OUTER JOIN featured_items\n ON featured_items.entity_type = 'media_file'\n AND featured_items.entity_token = m.token\n AND featured_items.deleted_at IS NULL\nWHERE\n m.token = ?\n ",
"describe": {
"columns": [
{
@@ -65,6 +65,16 @@
},
{
"ordinal": 6,
"name": "maybe_mime_type",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 7,
"name": "maybe_creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
@@ -74,7 +84,7 @@
}
},
{
"ordinal": 7,
"ordinal": 8,
"name": "maybe_creator_username",
"type_info": {
"type": "VarString",
@@ -84,7 +94,7 @@
}
},
{
"ordinal": 8,
"ordinal": 9,
"name": "maybe_creator_display_name",
"type_info": {
"type": "VarString",
@@ -94,7 +104,7 @@
}
},
{
"ordinal": 9,
"ordinal": 10,
"name": "maybe_creator_gravatar_hash",
"type_info": {
"type": "String",
@@ -104,7 +114,7 @@
}
},
{
"ordinal": 10,
"ordinal": 11,
"name": "maybe_creator_anonymous_visitor_token: tokens::tokens::anonymous_visitor_tracking::AnonymousVisitorTrackingToken",
"type_info": {
"type": "VarString",
@@ -114,7 +124,7 @@
}
},
{
"ordinal": 11,
"ordinal": 12,
"name": "maybe_batch_token: tokens::tokens::batch_generations::BatchGenerationToken",
"type_info": {
"type": "VarString",
@@ -124,7 +134,7 @@
}
},
{
"ordinal": 12,
"ordinal": 13,
"name": "maybe_style_transfer_source_media_file_token: tokens::tokens::media_files::MediaFileToken",
"type_info": {
"type": "VarString",
@@ -134,7 +144,7 @@
}
},
{
"ordinal": 13,
"ordinal": 14,
"name": "maybe_scene_source_media_file_token: tokens::tokens::media_files::MediaFileToken",
"type_info": {
"type": "VarString",
@@ -144,7 +154,7 @@
}
},
{
"ordinal": 14,
"ordinal": 15,
"name": "maybe_title",
"type_info": {
"type": "VarString",
@@ -154,7 +164,7 @@
}
},
{
"ordinal": 15,
"ordinal": 16,
"name": "maybe_text_transcript",
"type_info": {
"type": "Blob",
@@ -164,7 +174,7 @@
}
},
{
"ordinal": 16,
"ordinal": 17,
"name": "maybe_origin_filename",
"type_info": {
"type": "VarString",
@@ -174,7 +184,7 @@
}
},
{
"ordinal": 17,
"ordinal": 18,
"name": "maybe_duration_millis",
"type_info": {
"type": "Long",
@@ -184,7 +194,7 @@
}
},
{
"ordinal": 18,
"ordinal": 19,
"name": "maybe_prompt_token: tokens::tokens::prompts::PromptToken",
"type_info": {
"type": "VarString",
@@ -194,7 +204,7 @@
}
},
{
"ordinal": 19,
"ordinal": 20,
"name": "maybe_other_prompt_args",
"type_info": {
"type": "Blob",
@@ -204,7 +214,7 @@
}
},
{
"ordinal": 20,
"ordinal": 21,
"name": "maybe_file_cover_image_public_bucket_hash",
"type_info": {
"type": "VarString",
@@ -214,7 +224,7 @@
}
},
{
"ordinal": 21,
"ordinal": 22,
"name": "maybe_file_cover_image_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -224,7 +234,7 @@
}
},
{
"ordinal": 22,
"ordinal": 23,
"name": "maybe_file_cover_image_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -234,7 +244,7 @@
}
},
{
"ordinal": 23,
"ordinal": 24,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
@@ -244,7 +254,7 @@
}
},
{
"ordinal": 24,
"ordinal": 25,
"name": "maybe_model_weights_token: tokens::tokens::model_weights::ModelWeightToken",
"type_info": {
"type": "VarString",
@@ -254,7 +264,7 @@
}
},
{
"ordinal": 25,
"ordinal": 26,
"name": "maybe_model_weights_title",
"type_info": {
"type": "VarString",
@@ -264,7 +274,7 @@
}
},
{
"ordinal": 26,
"ordinal": 27,
"name": "maybe_model_weights_type: enums::by_table::model_weights::weights_types::WeightsType",
"type_info": {
"type": "VarString",
@@ -274,7 +284,7 @@
}
},
{
"ordinal": 27,
"ordinal": 28,
"name": "maybe_model_weights_category: enums::by_table::model_weights::weights_category::WeightsCategory",
"type_info": {
"type": "VarString",
@@ -284,7 +294,7 @@
}
},
{
"ordinal": 28,
"ordinal": 29,
"name": "maybe_model_cover_image_public_bucket_hash",
"type_info": {
"type": "VarString",
@@ -294,7 +304,7 @@
}
},
{
"ordinal": 29,
"ordinal": 30,
"name": "maybe_model_cover_image_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -304,7 +314,7 @@
}
},
{
"ordinal": 30,
"ordinal": 31,
"name": "maybe_model_cover_image_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -314,7 +324,7 @@
}
},
{
"ordinal": 31,
"ordinal": 32,
"name": "maybe_model_weight_creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
@@ -324,7 +334,7 @@
}
},
{
"ordinal": 32,
"ordinal": 33,
"name": "maybe_model_weight_creator_username",
"type_info": {
"type": "VarString",
@@ -334,7 +344,7 @@
}
},
{
"ordinal": 33,
"ordinal": 34,
"name": "maybe_model_weight_creator_display_name",
"type_info": {
"type": "VarString",
@@ -344,7 +354,7 @@
}
},
{
"ordinal": 34,
"ordinal": 35,
"name": "maybe_model_weight_creator_gravatar_hash",
"type_info": {
"type": "String",
@@ -354,7 +364,7 @@
}
},
{
"ordinal": 35,
"ordinal": 36,
"name": "public_bucket_directory_hash",
"type_info": {
"type": "VarString",
@@ -364,7 +374,7 @@
}
},
{
"ordinal": 36,
"ordinal": 37,
"name": "maybe_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -374,7 +384,7 @@
}
},
{
"ordinal": 37,
"ordinal": 38,
"name": "maybe_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -384,7 +394,7 @@
}
},
{
"ordinal": 38,
"ordinal": 39,
"name": "maybe_ratings_positive_count",
"type_info": {
"type": "Long",
@@ -394,7 +404,7 @@
}
},
{
"ordinal": 39,
"ordinal": 40,
"name": "maybe_ratings_negative_count",
"type_info": {
"type": "Long",
@@ -404,7 +414,7 @@
}
},
{
"ordinal": 40,
"ordinal": 41,
"name": "maybe_bookmark_count",
"type_info": {
"type": "Long",
@@ -414,7 +424,7 @@
}
},
{
"ordinal": 41,
"ordinal": 42,
"name": "is_featured",
"type_info": {
"type": "LongLong",
@@ -424,7 +434,7 @@
}
},
{
"ordinal": 42,
"ordinal": 43,
"name": "created_at",
"type_info": {
"type": "Timestamp",
@@ -434,7 +444,7 @@
}
},
{
"ordinal": 43,
"ordinal": 44,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
@@ -471,6 +481,7 @@
true,
true,
true,
true,
false,
true,
true,
@@ -494,5 +505,5 @@
false
]
},
"hash": "bfbe17ad0d993033c1015881f679fc27f5f16fb3edb24e30295c8188ff63d5cd"
"hash": "f1861dc84015b5c753cb5c31313c747386bce56983108fd6a01815d02d429630"
}
Generated
+1513 -1307
View File
File diff suppressed because it is too large Load Diff
+2 -4
View File
@@ -7,6 +7,7 @@ members = [
"crates/_types/buckets",
"crates/_types/composite_identifiers",
"crates/_types/enums",
"crates/_types/enums_public",
"crates/_types/reusable_types", # TODO(bt, 2022-12-21): Deprecate
"crates/_types/tokens",
@@ -27,7 +28,6 @@ members = [
"crates/lib/api_clients/cloud_storage",
"crates/lib/api_clients/google_drive_common",
"crates/lib/api_clients/thumbnail_generator",
"crates/lib/api_clients/twitch_common",
"crates/lib/bootstrap",
"crates/lib/caching/memory_caching",
"crates/lib/caching/redis_caching",
@@ -60,6 +60,7 @@ members = [
"crates/lib/password",
"crates/lib/prompt_engineering",
"crates/lib/redis_common",
"crates/lib/redis_schema",
"crates/lib/server_environment",
"crates/lib/sqlx_mysql_helpers",
"crates/lib/storyteller_root",
@@ -82,16 +83,13 @@ members = [
"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/user_traits_component",
"crates/service/plugins/users",
# Vendored code
"crates/vendor/limitation",
+47
View File
@@ -0,0 +1,47 @@
# -*- mode: Python -*-
if k8s_context() != 'black1':
fail("failing early to avoid overwriting prod")
local_resource('storyteller-web-binary',
cmd='SQLX_OFFLINE=true cargo build --release --bin storyteller-web --target=x86_64-unknown-linux-musl',
)
allow_k8s_contexts('black1')
sync_src_crates = sync('./crates', '/storyteller-rust/source/crates')
sync_src_sql = sync('./_sql', '/storyteller-rust/source/_sql')
sync_src_cargo_lock = sync('./Cargo.lock', '/storyteller-rust/source/Cargo.lock')
sync_src_cargo = sync('./Cargo.toml', '/storyteller-rust/source/Cargo.toml')
sync_src_env = sync('./.env', '/storyteller-rust/source/.env')
sync_src_startup = sync('./_develop/localdev/startup.sh', '/storyteller-rust/_develop/localdev/startup.sh')
sync_src_storyteller_binary = sync('./target/x86_64-unknown-linux-musl/release/storyteller-web', '/storyteller-rust/target/x86_64-unknown-linux-musl/release/storyteller-web')
docker_build('storyteller-web',
'.',
dockerfile='_develop/localdev/Dockerfile',
platform='linux/amd64',
only=[
'./target/x86_64-unknown-linux-musl/release/storyteller-web',
'_develop/localdev/Dockerfile',
'./_develop/localdev/startup.sh',
'crates/service/web/storyteller_web/config/storyteller-web.development.env',
'_sql', 'diesel.toml', '.env'],
live_update = [
sync_src_crates,
sync_src_sql,
sync_src_cargo_lock,
sync_src_cargo,
sync_src_env,
sync_src_startup,
sync_src_storyteller_binary,
run('date > /restart.txt')
],
)
k8s_yaml('_develop/localdev/kubernetes.yml',
)
k8s_resource(
objects=['ssd-hostpath:storageclass', 'test-pvc:persistentvolumeclaim'],
new_name='storyteller-web-pvc',
trigger_mode=TRIGGER_MODE_MANUAL,
)
k8s_resource('mysql', port_forwards='3307:3306')
k8s_resource('storyteller-web', port_forwards=12345)
+12 -1
View File
@@ -6,9 +6,20 @@ RUN apt-get update && \
apt-get install -y \
mariadb-client \
imagemagick \
python3-pip \
libmariadb-dev \
&& rm -rf /var/lib/apt/lists/*
RUN cd /tmp && \
wget -O entr.zip https://github.com/eradman/entr/archive/refs/tags/5.6.zip && \
unzip entr.zip && \
cd entr-5.6 && \
./configure && \
make test && \
make install \
&& rm -rf /tmp/entr-5.6
RUN cargo install diesel_cli --features mysql && \
cargo install sqlx-cli --features mysql
@@ -19,5 +30,5 @@ ARG GIT_SHA
RUN echo -n ${GIT_SHA} > /GIT_SHA
CMD ["/storyteller-rust/localdev/startup.sh"]
CMD ["/storyteller-rust/_develop/localdev/startup.sh"]
+79 -15
View File
@@ -27,6 +27,38 @@ spec:
ports:
- containerPort: 3306
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ssd-hostpath
provisioner: microk8s.io/hostpath
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
parameters:
pvDir: /home/kasisnu/microk8s/hostpath-provisioner
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-pvc
spec:
storageClassName: ssd-hostpath
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: storyteller-config
data:
buckets.vocodes_bucket_region: us-east1
buckets.vocodes_private_bucket_name: kasisnu-test-area-private
buckets.vocodes_public_bucket_name: kasisnu-test-area-public
---
apiVersion: apps/v1
@@ -65,29 +97,57 @@ spec:
labels:
app: storyteller-web
spec:
runtimeClassName: nvidia
containers:
- name: gpt-sovitsdir
image: localhost:32000/some-gpt-sovits:latest
imagePullPolicy: Always
command: ["sleep", "infinity"]
resources:
limits:
nvidia.com/gpu: "1"
requests:
nvidia.com/gpu: "1"
volumeMounts:
- mountPath: /application-dir
name: application-dir
- name: storyteller-web
image: storyteller-web:latest
imagePullPolicy: Never
imagePullPolicy: Always
env:
- name: MYSQL_URL
value: mysql://storyteller:password@mysql.default/storyteller
value: mysql://storyteller:password@mysql/storyteller
- name: REDIS_0_URL
value: redis://redisd@redis.default/0
value: redis://redisd@redis/0
- name: REDIS_1_URL
value: redis://redisd@redis.default/1
value: redis://redisd@redis/1
- name: ACCESS_KEY
value: garbage
valueFrom:
secretKeyRef:
name: bucket-secrets
key: access-key
- name: SECRET_KEY
value: garbage
valueFrom:
secretKeyRef:
name: bucket-secrets
key: secret-key
- name: REGION_NAME
value: garbage
valueFrom:
configMapKeyRef:
name: storyteller-config
key: buckets.vocodes_bucket_region
- name: W2L_PRIVATE_DOWNLOAD_BUCKET_NAME
value: garbage
valueFrom:
configMapKeyRef:
name: storyteller-config
key: buckets.vocodes_private_bucket_name
- name: W2L_PUBLIC_DOWNLOAD_BUCKET_NAME
value: garbage
valueFrom:
configMapKeyRef:
name: storyteller-config
key: buckets.vocodes_public_bucket_name
- name: AUDIO_UPLOADS_BUCKET_ROOT
value: garbage
value: /user_uploaded_w2l_audio
- name: TWITCH_USERNAME
value: garbage
- name: TWITCH_STREAM_KEY
@@ -101,10 +161,14 @@ spec:
volumeMounts:
- mountPath: /storyteller-rust
name: storyteller-rust-folder
- mountPath: /application-dir
name: application-dir
volumes:
- name: storyteller-rust-folder
hostPath:
path: /storyteller-rust
persistentVolumeClaim:
claimName: test-pvc
- name: application-dir
emptyDir: {}
---
apiVersion: v1
@@ -116,7 +180,7 @@ spec:
ports:
- name: mysql
port: 3306
nodePort: 3306
nodePort: 32206
selector:
app: mysql
@@ -131,7 +195,7 @@ spec:
ports:
- name: redis
port: 6379
nodePort: 6379
nodePort: 32379
selector:
app: redis
@@ -146,7 +210,7 @@ spec:
ports:
- name: storyteller-web
port: 12345
nodePort: 12345
nodePort: 32345
selector:
app: storyteller-web
+5 -2
View File
@@ -2,5 +2,8 @@
set +e +o pipefail
diesel migration run --database-url="${MYSQL_URL}"
set -e -o pipefail
./target/x86_64-unknown-linux-musl/release/storyteller-web
echo 'hello world in startup.sh'
#sleep infinity
date > /restart.txt
echo /restart.txt | entr -nrz /storyteller-rust/target/x86_64-unknown-linux-musl/release/storyteller-web
#/storyteller-rust/target/x86_64-unknown-linux-musl/release/storyteller-web
@@ -0,0 +1,53 @@
{
"settings" : {
"index.number_of_shards" : 3,
"index.number_of_replicas" : 2
},
"mappings" : {
"properties" : {
"token" : { "type" : "keyword" },
"media_class" : { "type" : "keyword" },
"media_type" : { "type" : "keyword" },
"maybe_media_subtype" : { "type" : "keyword" },
"maybe_engine_category" : { "type" : "keyword" },
"maybe_animation_type" : { "type" : "keyword" },
"maybe_mime_type" : { "type" : "keyword" },
"public_bucket_hash" : { "type" : "keyword" },
"public_bucket_prefix" : { "type" : "keyword" },
"public_bucket_extension" : { "type" : "keyword" },
"creator_set_visibility" : { "type" : "keyword" },
"maybe_title" : { "type" : "search_as_you_type" },
"maybe_title_as_keyword" : { "type" : "keyword" },
"maybe_cover_image_media_file_token" : { "type" : "keyword" },
"maybe_cover_image_public_bucket_hash" : { "type" : "keyword" },
"maybe_cover_image_public_bucket_prefix" : { "type" : "keyword" },
"maybe_cover_image_public_bucket_extension" : { "type" : "keyword" },
"maybe_creator_user_token" : { "type" : "keyword" },
"maybe_creator_username" : { "type" : "keyword" },
"maybe_creator_display_name" : { "type" : "text" },
"maybe_creator_gravatar_hash" : { "type" : "text" },
"created_at" : { "type" : "date" },
"updated_at" : { "type" : "date" },
"user_deleted_at" : { "type" : "date" },
"mod_deleted_at" : { "type" : "date" },
"is_featured" : {
"type": "boolean",
"index": true
},
"is_deleted" : {
"type": "boolean",
"index": true
}
}
}
}
@@ -13,6 +13,7 @@
"weights_category" : { "type" : "keyword" },
"title" : { "type" : "search_as_you_type" },
"title_as_keyword" : { "type" : "keyword" },
"maybe_cover_image_media_file_token" : { "type" : "keyword" },
"maybe_cover_image_public_bucket_hash" : { "type" : "keyword" },
@@ -0,0 +1,67 @@
{
"query": {
"bool": {
"must": [
{
"bool": {
"must" : [
{
"term": {
"is_deleted": false
}
},
{
"term": {
"media_class": "dimensional"
}
},
{
"term": {
"media_type": "glb"
}
},
{
"bool": {
"should": [
{ "term": { "maybe_engine_category": "object"} },
{ "term": { "maybe_engine_category": "image_plane"} }
]
}
}
],
"should": [
{
"fuzzy": {
"maybe_title": {
"value": "REPLACE_ME",
"fuzziness": 2
}
}
},
{
"match": {
"maybe_title": {
"query": "REPLACE_ME",
"boost": 1
}
}
},
{
"multi_match": {
"query": "REPLACE_ME",
"type": "bool_prefix",
"fields": [
"maybe_title",
"maybe_title._2gram",
"maybe_title._3gram"
],
"boost": 50
}
}
]
}
}
]
}
}
}
@@ -0,0 +1,42 @@
{
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"fuzzy": {
"title": {
"value": "REPLACE_ME",
"fuzziness": 2
}
}
},
{
"match": {
"title": {
"query": "REPLACE_ME",
"boost": 1
}
}
},
{
"multi_match": {
"query": "REPLACE_ME",
"type": "bool_prefix",
"fields": [
"title",
"title._2gram",
"title._3gram"
],
"boost": 50
}
}
]
}
}
]
}
}
}
@@ -19,3 +19,29 @@ where
and m.mod_deleted_at IS NULL
order by m.title asc;
-- Top models within time period
-- NB: id threshold is to avoid a full table scan
select
mw.token,
mw.title,
mw.weights_type,
mw.weights_category,
u.username as creator_username,
r.use_count,
mw.created_at,
mw.user_deleted_at,
mw.mod_deleted_at
from (
select maybe_model_token, count(*) as use_count
from generic_inference_jobs
where maybe_model_token IS NOT NULL
and created_at > NOW() - INTERVAL 1 DAY
and id > 40000000
group by maybe_model_token
) as r
join model_weights as mw
on mw.token = r.maybe_model_token
join users as u
on u.token = mw.creator_user_token
order by r.use_count desc
limit 100;
@@ -94,6 +94,7 @@ SET
can_access_studio = false,
maybe_feature_flags = 'studio,video_style_transfer'
WHERE username IN (
'FoxtailStudio',
'chechisauri0',
'dakrid',
'omega7321',
@@ -0,0 +1,29 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
select *
from generic_inference_jobs
where job_type = 'comfy_ui'
and status NOT IN (
'pending',
'started',
'complete_success'
)
order by id desc
limit 5\G
-- List started jobs
select *
from generic_inference_jobs
where job_type = 'comfy_ui'
and status IN ('started')
order by id desc
limit 50\G
update generic_inference_jobs
set inference_category = 'convert_bvh_to_workflow'
where inference_category = 'deprecated_field'
limit 5;
[2024-07-16T22:53:07Z ERROR inference_job::job::job_loop::main_loop] Error querying jobs: error: ""
@@ -6,3 +6,8 @@
select username from users where maybe_feature_flags like '%studio%';
select username from users where can_access_studio = true;
-- Who signed up recently and has access?
select username, maybe_source
from users where can_access_studio = true
and created_at > NOW() - interval 20 minute;
@@ -11,8 +11,72 @@ from media_files as m
join users as u
on m.maybe_creator_user_token = u.token
where u.can_access_studio = true
and m.created_at > (CURDATE() - INTERVAL 1 WEEK)
and m.created_at > (CURDATE() - INTERVAL 14 DAY)
and m.is_intermediate_system_file = false
and m.media_class = 'video'
group by u.token
order by video_count desc;
-- Without internal users
select
u.username,
count(*) as video_count,
u.maybe_source,
u.created_at
from media_files as m
join users as u
on m.maybe_creator_user_token = u.token
where u.maybe_feature_flags LIKE '%studio%'
and m.created_at > (CURDATE() - INTERVAL 1 DAY)
and m.is_intermediate_system_file = false
and m.media_class = 'video'
and u.username NOT IN (
'bflat',
'candyfoxxx',
'crossproduct1',
'echelon',
'endtimes',
'heart_ribbon',
'kasisnu',
'mechacosm',
'moonchamp',
'olivicmic',
'printrman',
'vegito1089',
'wilwong',
'yae_ph'
)
group by u.token
order by created_at desc;
-- See videos generated
-- and m.is_intermediate_system_file IS TRUE
-- where u.maybe_feature_flags LIKE '%studio%'
select
u.username,
u.maybe_source,
m.token,
m.is_intermediate_system_file as sys_file,
m.created_at
from media_files as m
join users as u
on m.maybe_creator_user_token = u.token
WHERE m.created_at > (CURDATE() - INTERVAL 1 DAY)
and m.media_class = 'video'
and u.username NOT IN (
'bflat',
'candyfoxxx',
'crossproduct1',
'echelon',
'endtimes',
'heart_ribbon',
'kasisnu',
'mechacosm',
'moonchamp',
'olivicmic',
'printrman',
'vegito1089',
'wilwong',
'yae_ph'
)
order by m.created_at desc;
@@ -0,0 +1,17 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Enroll internal accounts in studio + loyalty features
UPDATE users
SET
can_access_studio = true,
maybe_feature_flags = 'explore_media,studio,video_style_transfer',
maybe_loyalty_program_key = 'fakeyou_contributor',
user_role_slug = "admin"
WHERE username IN (
'48hourfilm',
'intro_video',
'zzz_last_item'
)
LIMIT 5;
@@ -199,7 +199,7 @@ CREATE TABLE generic_inference_jobs (
attempt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- If the user chooses to no longer display or poll the job, we mark this flag true.
-- This can only be set for terminal state (completed or failed) jobs.
-- This should only be set for terminal state (completed or failed) jobs.
-- We use this flag to remove the job from the user's view.
is_dismissed_by_user BOOLEAN NOT NULL DEFAULT FALSE,
+15 -5
View File
@@ -6,6 +6,12 @@
-- noinspection SqlResolveForFile
-- This table contains both user uploads and inference or processing results.
--
-- The fields in media_files that should be filterable are:
-- * media_class ("audio", "video", "image", "dimensional")
-- * media_type ("fbx", "glb", "scene_json", "png", "jpg", etc.)
-- * engine_category ("scene", "character", "animation", "object", "image_plane", etc.)
--
CREATE TABLE media_files (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
@@ -109,6 +115,11 @@ CREATE TABLE media_files (
-- * `glb` for GLB files
-- * `gltf` for GLTF files
-- * `scene_ron` for SCN.RON files
-- * `scene_json` for scene files for three.js
-- * `pmd`
-- * `vmd`
-- * `pmx`
-- * `csv`
media_type VARCHAR(16) NOT NULL,
-- Broad class of media:
@@ -117,16 +128,15 @@ CREATE TABLE media_files (
-- * 'audio' for wav, mp3, etc.
-- * 'image' for a variety of video types.
-- * 'video' for a variety of video types.
-- * 'animation' for animations (engine)
-- * 'character' for characters (engine)
-- * 'prop' for props (engine)
-- * 'scene' for scenes (engine; internal and external scenes)
-- * 'dimensional' for a variety of 3d types
media_class VARCHAR(16) NOT NULL DEFAULT "unknown",
-- A media file's possible subtype. Typically used for Storyteller Studio.
-- * 'mixamo' for mixamo animations (eg. for BVH, GLB, FBX, etc. files)
-- * 'mocap_net' for mocapnet animations (eg. for BVH files)
-- * 'scene' for generic scenes (eg. for BVH, GLB, FBX, etc. files)
-- * 'scene'
-- * 'character'
-- * 'animation'
maybe_media_subtype VARCHAR(32) DEFAULT NULL,
-- The file's mime type.
+26 -21
View File
@@ -1,29 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="//unpkg.com/swagger-ui-dist@3/swagger-ui.css">
<title>Storyteller API</title>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="SwaggerUI" />
<title>Storyteller API</title>
<link rel="stylesheet" href="//unpkg.com/swagger-ui-dist@5.11.0/swagger-ui.css" />
</head>
<body>
<div id="app-docs" />
<script src="//unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script>
<script>
<div id="swagger-ui"></div>
window.onload = function () {
const ui = SwaggerUIBundle({
url: "api.json",
dom_id: "#app-docs",
<script src="//unpkg.com/swagger-ui-dist@5.11.0/swagger-ui-bundle.js" crossorigin></script>
<script src="//unpkg.com/swagger-ui-dist@5.11.0/swagger-ui-standalone-preset.js" crossorigin></script>
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: 'api.json',
dom_id: '#swagger-ui',
deepLinking: true,
})
}
</script>
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
layout: "StandaloneLayout",
tagsSorter: 'alpha', // Sort tags (endpoint groupings) alphabetically
defaultModelRendering: 'model', // Show model instead of "example request"
defaultModelExpandDepth: 6,
});
};
</script>
</body>
</html>
+2 -2
View File
@@ -34,8 +34,8 @@ utoipa = { version = "4", features = ["chrono","actix_extras"] }
[dev-dependencies]
# Enum utilities
strum = { version = "0.25", features = ["derive"] }
strum = { version = "0.26", features = ["derive"] }
# Test serialization
serde_json = "1.0.108"
toml = "0.5.8"
toml = "0.8.14"
@@ -16,32 +16,50 @@ use utoipa::ToSchema;
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, Default, ToSchema)]
pub enum InferenceCategory {
/// Eg. SadTalker and possibly Wav2Lip
/// Deprecate this field !!!
/// We should drain all jobs from using this database field, then remove it.
#[serde(rename = "deprecated_field")]
DeprecatedField,
/// Facial lipsync animation (eg. SadTalker, Wav2Lip)
#[serde(rename = "lipsync_animation")]
#[default]
LipsyncAnimation,
/// FakeYou's text to speech (eg. Tacotron2)
#[serde(rename = "text_to_speech")]
TextToSpeech,
/// FakeYou's voice conversion (eg. svc, rvc)
#[serde(rename = "voice_conversion")]
VoiceConversion,
#[serde(rename = "video_filter")]
VideoFilter,
/// Image generation (eg. Stable Diffusion 1.5)
#[serde(rename = "image_generation")]
ImageGeneration,
/// Turn video into animation data with mocap processing (eg. Mocapnet).
#[serde(rename = "mocap")]
Mocap,
/// ComfyUI workflows
/// This is what powers Storyteller Studio!
#[serde(rename = "workflow")]
Workflow,
/// FBX to GLTF/GLB.
/// Still supported, but few people will use it.
#[serde(rename = "format_conversion")]
FormatConversion,
/// DEPRECATED. Do not use.
/// This was for ReRenderAVideo, which we never productionized.
#[deprecated(note = "This was for ReRenderAVideo, which we never productionized.")]
#[serde(rename = "video_filter")]
VideoFilter,
/// DEPRECATED. Bevy engine serverside rendering.
#[deprecated(note = "This was for Bevy engine's server side rendering.")]
#[serde(rename = "convert_bvh_to_workflow")]
ConvertBvhToWorkflow,
}
@@ -55,28 +73,30 @@ impl_mysql_from_row!(InferenceCategory);
impl InferenceCategory {
pub fn to_str(&self) -> &'static str {
match self {
Self::DeprecatedField => "deprecated_field",
Self::LipsyncAnimation => "lipsync_animation",
Self::TextToSpeech => "text_to_speech",
Self::VoiceConversion => "voice_conversion",
Self::VideoFilter => "video_filter",
Self::ImageGeneration => "image_generation",
Self::Mocap => "mocap",
Self::Workflow => "workflow",
Self::FormatConversion => "format_conversion",
Self::VideoFilter => "video_filter",
Self::ConvertBvhToWorkflow => "convert_bvh_to_workflow",
}
}
pub fn from_str(value: &str) -> Result<Self, String> {
match value {
"deprecated_field" => Ok(Self::DeprecatedField),
"lipsync_animation" => Ok(Self::LipsyncAnimation),
"text_to_speech" => Ok(Self::TextToSpeech),
"voice_conversion" => Ok(Self::VoiceConversion),
"video_filter" => Ok(Self::VideoFilter),
"image_generation" => Ok(Self::ImageGeneration),
"mocap" => Ok(Self::Mocap),
"workflow" => Ok(Self::Workflow),
"format_conversion" => Ok(Self::FormatConversion),
"video_filter" => Ok(Self::VideoFilter),
"convert_bvh_to_workflow" => Ok(Self::ConvertBvhToWorkflow),
_ => Err(format!("invalid value: {:?}", value)),
}
@@ -86,14 +106,15 @@ impl InferenceCategory {
// NB: BTreeSet is sorted
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
BTreeSet::from([
Self::DeprecatedField,
Self::LipsyncAnimation,
Self::TextToSpeech,
Self::VoiceConversion,
Self::VideoFilter,
Self::ImageGeneration,
Self::Mocap,
Self::Workflow,
Self::FormatConversion,
Self::VideoFilter,
Self::ConvertBvhToWorkflow,
])
}
@@ -109,40 +130,43 @@ mod tests {
#[test]
fn test_serialization() {
assert_serialization(InferenceCategory::DeprecatedField, "deprecated_field");
assert_serialization(InferenceCategory::LipsyncAnimation, "lipsync_animation");
assert_serialization(InferenceCategory::TextToSpeech, "text_to_speech");
assert_serialization(InferenceCategory::VoiceConversion, "voice_conversion");
assert_serialization(InferenceCategory::VideoFilter, "video_filter");
assert_serialization(InferenceCategory::ImageGeneration, "image_generation");
assert_serialization(InferenceCategory::Mocap, "mocap");
assert_serialization(InferenceCategory::Workflow, "workflow");
assert_serialization(InferenceCategory::FormatConversion, "format_conversion");
assert_serialization(InferenceCategory::VideoFilter, "video_filter");
assert_serialization(InferenceCategory::ConvertBvhToWorkflow, "convert_bvh_to_workflow");
}
#[test]
fn to_str() {
assert_eq!(InferenceCategory::DeprecatedField.to_str(), "deprecated_field");
assert_eq!(InferenceCategory::LipsyncAnimation.to_str(), "lipsync_animation");
assert_eq!(InferenceCategory::TextToSpeech.to_str(), "text_to_speech");
assert_eq!(InferenceCategory::VoiceConversion.to_str(), "voice_conversion");
assert_eq!(InferenceCategory::VideoFilter.to_str(), "video_filter");
assert_eq!(InferenceCategory::ImageGeneration.to_str(), "image_generation");
assert_eq!(InferenceCategory::Mocap.to_str(), "mocap");
assert_eq!(InferenceCategory::Workflow.to_str(), "workflow");
assert_eq!(InferenceCategory::FormatConversion.to_str(), "format_conversion");
assert_eq!(InferenceCategory::VideoFilter.to_str(), "video_filter");
assert_eq!(InferenceCategory::ConvertBvhToWorkflow.to_str(), "convert_bvh_to_workflow");
}
#[test]
fn from_str() {
assert_eq!(InferenceCategory::from_str("deprecated_field").unwrap(), InferenceCategory::DeprecatedField);
assert_eq!(InferenceCategory::from_str("lipsync_animation").unwrap(), InferenceCategory::LipsyncAnimation);
assert_eq!(InferenceCategory::from_str("text_to_speech").unwrap(), InferenceCategory::TextToSpeech);
assert_eq!(InferenceCategory::from_str("voice_conversion").unwrap(), InferenceCategory::VoiceConversion);
assert_eq!(InferenceCategory::from_str("video_filter").unwrap(), InferenceCategory::VideoFilter);
assert_eq!(InferenceCategory::from_str("image_generation").unwrap(), InferenceCategory::ImageGeneration);
assert_eq!(InferenceCategory::from_str("mocap").unwrap(), InferenceCategory::Mocap);
assert_eq!(InferenceCategory::from_str("workflow").unwrap(), InferenceCategory::Workflow);
assert_eq!(InferenceCategory::from_str("format_conversion").unwrap(), InferenceCategory::FormatConversion);
assert_eq!(InferenceCategory::from_str("video_filter").unwrap(), InferenceCategory::VideoFilter);
assert_eq!(InferenceCategory::from_str("convert_bvh_to_workflow").unwrap(), InferenceCategory::ConvertBvhToWorkflow);
}
@@ -150,15 +174,16 @@ mod tests {
fn all_variants() {
// Static check
let mut variants = InferenceCategory::all_variants();
assert_eq!(variants.len(), 9);
assert_eq!(variants.len(), 10);
assert_eq!(variants.pop_first(), Some(InferenceCategory::DeprecatedField));
assert_eq!(variants.pop_first(), Some(InferenceCategory::LipsyncAnimation));
assert_eq!(variants.pop_first(), Some(InferenceCategory::TextToSpeech));
assert_eq!(variants.pop_first(), Some(InferenceCategory::VoiceConversion));
assert_eq!(variants.pop_first(), Some(InferenceCategory::VideoFilter));
assert_eq!(variants.pop_first(), Some(InferenceCategory::ImageGeneration));
assert_eq!(variants.pop_first(), Some(InferenceCategory::Mocap));
assert_eq!(variants.pop_first(), Some(InferenceCategory::Workflow));
assert_eq!(variants.pop_first(), Some(InferenceCategory::FormatConversion));
assert_eq!(variants.pop_first(), Some(InferenceCategory::VideoFilter));
assert_eq!(variants.pop_first(), Some(InferenceCategory::ConvertBvhToWorkflow));
assert_eq!(variants.pop_first(), None);
@@ -15,11 +15,21 @@ use strum::EnumIter;
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, Default)]
#[serde(rename_all = "snake_case")]
pub enum InferenceJobType {
/// Job that converts bevy to workflow files
#[serde(rename = "bevy_to_workflow")]
BevyToWorkflow,
/// Storyteller Studio and Video Style Transfer Jobs (which we may want to split).
/// These run in Comfy.
/// TODO(bt,2024-07-15): We may segregate these two job types in the future
VideoRender,
/// Live Portrait Jobs.
/// These run in Comfy.
LivePortrait,
/// Voice jobs that use GPT-Sovits
GptSovits,
/// Jobs that run ComfyUI workflows
/// This is actually just for Video Style Transfer and Storyteller Studio.
#[deprecated(note = "Use VideoRender instead.")]
ComfyUi,
/// A job that turns "FBX" game engine files into "GLTF" files (Bevy-compatible).
@@ -29,10 +39,6 @@ pub enum InferenceJobType {
/// Process a video into BVH mocap animation data for game engines
MocapNet,
/// Re-render a video is a video style transfer algorithm. We developed code
/// around it, but chose to develop AnimateDiff / ComfyUI support instead.
RerenderAVideo,
/// RVC is a voice conversion model. RVCv2 is the most popular such model currently.
#[serde(rename = "rvc_v2")]
RvcV2,
@@ -58,6 +64,18 @@ pub enum InferenceJobType {
/// (i.e. when we backfill the database column and make it non-nullable)
#[default]
Unknown,
/// DEPRECATED. DO NOT USE.
/// Job that converts bevy to workflow files
#[deprecated(note = "This was for Bevy engine's server side rendering.")]
#[serde(rename = "bevy_to_workflow")]
BevyToWorkflow,
#[deprecated(note = "This was for ReRenderAVideo, which we never productionized.")]
/// DEPRECATED. DO NOT USE.
/// Re-render a video is a video style transfer algorithm. We developed code
/// around it, but chose to develop AnimateDiff / ComfyUI support instead.
RerenderAVideo,
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
@@ -68,11 +86,12 @@ impl_mysql_enum_coders!(InferenceJobType);
impl InferenceJobType {
pub fn to_str(&self) -> &'static str {
match self {
Self::BevyToWorkflow => "bevy_to_workflow",
Self::VideoRender => "video_render",
Self::LivePortrait => "live_portrait",
Self::GptSovits => "gpt_sovits",
Self::ComfyUi => "comfy_ui",
Self::ConvertFbxToGltf => "convert_fbx_gltf",
Self::MocapNet => "mocap_net",
Self::RerenderAVideo => "rerender_a_video",
Self::RvcV2 => "rvc_v2",
Self::SadTalker => "sad_talker",
Self::SoVitsSvc => "so_vits_svc",
@@ -80,16 +99,19 @@ impl InferenceJobType {
Self::StyleTTS2 => "styletts2",
Self::Tacotron2 => "tacotron2",
Self::Unknown => "unknown",
Self::BevyToWorkflow => "bevy_to_workflow",
Self::RerenderAVideo => "rerender_a_video",
}
}
pub fn from_str(value: &str) -> Result<Self, String> {
match value {
"bevy_to_workflow" => Ok(Self::BevyToWorkflow),
"video_render" => Ok(Self::VideoRender),
"live_portrait" => Ok(Self::LivePortrait),
"gpt_sovits" => Ok(Self::GptSovits),
"comfy_ui" => Ok(Self::ComfyUi),
"convert_fbx_gltf" => Ok(Self::ConvertFbxToGltf),
"mocap_net" => Ok(Self::MocapNet),
"rerender_a_video" => Ok(Self::RerenderAVideo),
"rvc_v2" => Ok(Self::RvcV2),
"sad_talker" => Ok(Self::SadTalker),
"so_vits_svc" => Ok(Self::SoVitsSvc),
@@ -97,6 +119,8 @@ impl InferenceJobType {
"styletts2" => Ok(Self::StyleTTS2),
"tacotron2" => Ok(Self::Tacotron2),
"unknown" => Ok(Self::Unknown),
"bevy_to_workflow" => Ok(Self::BevyToWorkflow),
"rerender_a_video" => Ok(Self::RerenderAVideo),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -105,11 +129,12 @@ impl InferenceJobType {
// NB: BTreeSet is sorted
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
BTreeSet::from([
Self::BevyToWorkflow,
Self::VideoRender,
Self::LivePortrait,
Self::GptSovits,
Self::ComfyUi,
Self::ConvertFbxToGltf,
Self::MocapNet,
Self::RerenderAVideo,
Self::RvcV2,
Self::SadTalker,
Self::SoVitsSvc,
@@ -117,6 +142,8 @@ impl InferenceJobType {
Self::StyleTTS2,
Self::Tacotron2,
Self::Unknown,
Self::BevyToWorkflow,
Self::RerenderAVideo,
])
}
}
@@ -136,11 +163,12 @@ mod tests {
#[test]
fn test_serialization() {
assert_serialization(InferenceJobType::BevyToWorkflow, "bevy_to_workflow");
assert_serialization(InferenceJobType::VideoRender, "video_render");
assert_serialization(InferenceJobType::LivePortrait, "live_portrait");
assert_serialization(InferenceJobType::GptSovits, "gpt_sovits");
assert_serialization(InferenceJobType::ComfyUi, "comfy_ui");
assert_serialization(InferenceJobType::ConvertFbxToGltf, "convert_fbx_gltf");
assert_serialization(InferenceJobType::MocapNet, "mocap_net");
assert_serialization(InferenceJobType::RerenderAVideo, "rerender_a_video");
assert_serialization(InferenceJobType::RvcV2, "rvc_v2");
assert_serialization(InferenceJobType::SadTalker, "sad_talker");
assert_serialization(InferenceJobType::SoVitsSvc, "so_vits_svc");
@@ -148,15 +176,18 @@ mod tests {
assert_serialization(InferenceJobType::StyleTTS2, "styletts2");
assert_serialization(InferenceJobType::Tacotron2, "tacotron2");
assert_serialization(InferenceJobType::Unknown, "unknown");
assert_serialization(InferenceJobType::BevyToWorkflow, "bevy_to_workflow");
assert_serialization(InferenceJobType::RerenderAVideo, "rerender_a_video");
}
#[test]
fn to_str() {
assert_eq!(InferenceJobType::BevyToWorkflow.to_str(), "bevy_to_workflow");
assert_eq!(InferenceJobType::VideoRender.to_str(), "video_render");
assert_eq!(InferenceJobType::LivePortrait.to_str(), "live_portrait");
assert_eq!(InferenceJobType::GptSovits.to_str(), "gpt_sovits");
assert_eq!(InferenceJobType::ComfyUi.to_str(), "comfy_ui");
assert_eq!(InferenceJobType::ConvertFbxToGltf.to_str(), "convert_fbx_gltf");
assert_eq!(InferenceJobType::MocapNet.to_str(), "mocap_net");
assert_eq!(InferenceJobType::RerenderAVideo.to_str(), "rerender_a_video");
assert_eq!(InferenceJobType::RvcV2.to_str(), "rvc_v2");
assert_eq!(InferenceJobType::SadTalker.to_str(), "sad_talker");
assert_eq!(InferenceJobType::SoVitsSvc.to_str(), "so_vits_svc");
@@ -164,15 +195,18 @@ mod tests {
assert_eq!(InferenceJobType::StyleTTS2.to_str(), "styletts2");
assert_eq!(InferenceJobType::Tacotron2.to_str(), "tacotron2");
assert_eq!(InferenceJobType::Unknown.to_str(), "unknown");
assert_eq!(InferenceJobType::BevyToWorkflow.to_str(), "bevy_to_workflow");
assert_eq!(InferenceJobType::RerenderAVideo.to_str(), "rerender_a_video");
}
#[test]
fn from_str() {
assert_eq!(InferenceJobType::from_str("bevy_to_workflow").unwrap(), InferenceJobType::BevyToWorkflow);
assert_eq!(InferenceJobType::from_str("video_render").unwrap(), InferenceJobType::VideoRender);
assert_eq!(InferenceJobType::from_str("live_portrait").unwrap(), InferenceJobType::LivePortrait);
assert_eq!(InferenceJobType::from_str("gpt_sovits").unwrap(), InferenceJobType::GptSovits);
assert_eq!(InferenceJobType::from_str("comfy_ui").unwrap(), InferenceJobType::ComfyUi);
assert_eq!(InferenceJobType::from_str("convert_fbx_gltf").unwrap(), InferenceJobType::ConvertFbxToGltf);
assert_eq!(InferenceJobType::from_str("mocap_net").unwrap(), InferenceJobType::MocapNet);
assert_eq!(InferenceJobType::from_str("rerender_a_video").unwrap(), InferenceJobType::RerenderAVideo);
assert_eq!(InferenceJobType::from_str("rvc_v2").unwrap(), InferenceJobType::RvcV2);
assert_eq!(InferenceJobType::from_str("sad_talker").unwrap(), InferenceJobType::SadTalker);
assert_eq!(InferenceJobType::from_str("so_vits_svc").unwrap(), InferenceJobType::SoVitsSvc);
@@ -180,18 +214,21 @@ mod tests {
assert_eq!(InferenceJobType::from_str("styletts2").unwrap(), InferenceJobType::StyleTTS2);
assert_eq!(InferenceJobType::from_str("tacotron2").unwrap(), InferenceJobType::Tacotron2);
assert_eq!(InferenceJobType::from_str("unknown").unwrap(), InferenceJobType::Unknown);
assert_eq!(InferenceJobType::from_str("bevy_to_workflow").unwrap(), InferenceJobType::BevyToWorkflow);
assert_eq!(InferenceJobType::from_str("rerender_a_video").unwrap(), InferenceJobType::RerenderAVideo);
}
#[test]
fn all_variants() {
// Static check
let mut variants = InferenceJobType::all_variants();
assert_eq!(variants.len(), 12);
assert_eq!(variants.pop_first(), Some(InferenceJobType::BevyToWorkflow));
assert_eq!(variants.len(), 15);
assert_eq!(variants.pop_first(), Some(InferenceJobType::VideoRender));
assert_eq!(variants.pop_first(), Some(InferenceJobType::LivePortrait));
assert_eq!(variants.pop_first(), Some(InferenceJobType::GptSovits));
assert_eq!(variants.pop_first(), Some(InferenceJobType::ComfyUi));
assert_eq!(variants.pop_first(), Some(InferenceJobType::ConvertFbxToGltf));
assert_eq!(variants.pop_first(), Some(InferenceJobType::MocapNet));
assert_eq!(variants.pop_first(), Some(InferenceJobType::RerenderAVideo));
assert_eq!(variants.pop_first(), Some(InferenceJobType::RvcV2));
assert_eq!(variants.pop_first(), Some(InferenceJobType::SadTalker));
assert_eq!(variants.pop_first(), Some(InferenceJobType::SoVitsSvc));
@@ -199,6 +236,8 @@ mod tests {
assert_eq!(variants.pop_first(), Some(InferenceJobType::StyleTTS2));
assert_eq!(variants.pop_first(), Some(InferenceJobType::Tacotron2));
assert_eq!(variants.pop_first(), Some(InferenceJobType::Unknown));
assert_eq!(variants.pop_first(), Some(InferenceJobType::BevyToWorkflow));
assert_eq!(variants.pop_first(), Some(InferenceJobType::RerenderAVideo));
assert_eq!(variants.pop_first(), None);
// Generated check
@@ -17,6 +17,10 @@ use strum::EnumIter;
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize)]
pub enum InferenceModelType {
// TODO(bt,2024-07-15): This is too generic. We probably need "StorytellerStudio", "LivePortrait", etc.
#[serde(rename = "comfy_ui")]
ComfyUi,
#[serde(rename = "rvc_v2")]
RvcV2,
// NB: sad_talker does use user-supplied models, so there is no "model token"
@@ -37,8 +41,6 @@ pub enum InferenceModelType {
StableDiffusion,
#[serde(rename = "mocap_net")]
MocapNet,
#[serde(rename = "comfy_ui")]
ComfyUi,
#[serde(rename = "styletts2")]
StyleTTS2,
/// A job that turns "FBX" game engine files into "GLTF" files (Bevy-compatible).
@@ -21,17 +21,39 @@ pub enum MediaFileEngineCategory {
/// A 3D character model.
Character,
/// A 3D animation.
/// A 3D non-humanoid model, e.g. dragon, wolf, slime creature, etc.
/// These may or may not have a skeleton that can be animated with IK/FK.
Creature,
/// A 3D skeletal animation sequence that can be applied to a character,
/// creature, etc. Typically, these use Mixamo or Move.ai.
Animation,
/// A facial blend shape / shape key animation.
/// A facial blend shape / shape key animation. Currently, these
/// are 100% ARKit.
Expression,
/// A large 3D object that can be used as a backdrop for a scene,
/// a.k.a. "set", "stage", etc. These are typically self-contained
/// locations, buildings, or environments.
Location,
/// All items used to add atmosphere to a scene, e.g. furniture, plants,
/// vehicles, radios, and certain props. (We'll reserve the word props for
/// "hand props" later.)
SetDressing,
/// A 3D object that doesn't fit with the other types.
Object,
/// A 3D skybox.
Skybox,
/// An Image Plane (texture that spawns as an object)
ImagePlane,
/// A Video Plane (texture that spawns as an object)
VideoPlane,
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
@@ -45,10 +67,15 @@ impl MediaFileEngineCategory {
match self {
Self::Scene => "scene",
Self::Character => "character",
Self::Creature => "creature",
Self::Animation => "animation",
Self::Expression => "expression",
Self::Location => "location",
Self::SetDressing => "set_dressing",
Self::Object => "object",
Self::Skybox => "skybox",
Self::ImagePlane => "image_plane",
Self::VideoPlane => "video_plane",
}
}
@@ -56,10 +83,15 @@ impl MediaFileEngineCategory {
match value {
"scene" => Ok(Self::Scene),
"character" => Ok(Self::Character),
"creature" => Ok(Self::Creature),
"animation" => Ok(Self::Animation),
"expression" => Ok(Self::Expression),
"location" => Ok(Self::Location),
"set_dressing" => Ok(Self::SetDressing),
"object" => Ok(Self::Object),
"skybox" => Ok(Self::Skybox),
"image_plane" => Ok(Self::ImagePlane),
"video_plane" => Ok(Self::VideoPlane),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -70,10 +102,15 @@ impl MediaFileEngineCategory {
BTreeSet::from([
Self::Scene,
Self::Character,
Self::Creature,
Self::Animation,
Self::Expression,
Self::Location,
Self::SetDressing,
Self::Object,
Self::Skybox,
Self::ImagePlane,
Self::VideoPlane,
])
}
}
@@ -90,43 +127,63 @@ mod tests {
fn test_serialization() {
assert_serialization(MediaFileEngineCategory::Scene, "scene");
assert_serialization(MediaFileEngineCategory::Character, "character");
assert_serialization(MediaFileEngineCategory::Creature, "creature");
assert_serialization(MediaFileEngineCategory::Animation, "animation");
assert_serialization(MediaFileEngineCategory::Expression, "expression");
assert_serialization(MediaFileEngineCategory::Location, "location");
assert_serialization(MediaFileEngineCategory::SetDressing, "set_dressing");
assert_serialization(MediaFileEngineCategory::Object, "object");
assert_serialization(MediaFileEngineCategory::Skybox, "skybox");
assert_serialization(MediaFileEngineCategory::ImagePlane, "image_plane");
assert_serialization(MediaFileEngineCategory::VideoPlane, "video_plane");
}
#[test]
fn test_to_str() {
assert_eq!(MediaFileEngineCategory::Scene.to_str(), "scene");
assert_eq!(MediaFileEngineCategory::Character.to_str(), "character");
assert_eq!(MediaFileEngineCategory::Creature.to_str(), "creature");
assert_eq!(MediaFileEngineCategory::Animation.to_str(), "animation");
assert_eq!(MediaFileEngineCategory::Expression.to_str(), "expression");
assert_eq!(MediaFileEngineCategory::Location.to_str(), "location");
assert_eq!(MediaFileEngineCategory::SetDressing.to_str(), "set_dressing");
assert_eq!(MediaFileEngineCategory::Object.to_str(), "object");
assert_eq!(MediaFileEngineCategory::Skybox.to_str(), "skybox");
assert_eq!(MediaFileEngineCategory::ImagePlane.to_str(), "image_plane");
assert_eq!(MediaFileEngineCategory::VideoPlane.to_str(), "video_plane");
}
#[test]
fn test_from_str() {
assert_eq!(MediaFileEngineCategory::from_str("scene").unwrap(), MediaFileEngineCategory::Scene);
assert_eq!(MediaFileEngineCategory::from_str("character").unwrap(), MediaFileEngineCategory::Character);
assert_eq!(MediaFileEngineCategory::from_str("creature").unwrap(), MediaFileEngineCategory::Creature);
assert_eq!(MediaFileEngineCategory::from_str("animation").unwrap(), MediaFileEngineCategory::Animation);
assert_eq!(MediaFileEngineCategory::from_str("expression").unwrap(), MediaFileEngineCategory::Expression);
assert_eq!(MediaFileEngineCategory::from_str("location").unwrap(), MediaFileEngineCategory::Location);
assert_eq!(MediaFileEngineCategory::from_str("set_dressing").unwrap(), MediaFileEngineCategory::SetDressing);
assert_eq!(MediaFileEngineCategory::from_str("object").unwrap(), MediaFileEngineCategory::Object);
assert_eq!(MediaFileEngineCategory::from_str("skybox").unwrap(), MediaFileEngineCategory::Skybox);
assert_eq!(MediaFileEngineCategory::from_str("image_plane").unwrap(), MediaFileEngineCategory::ImagePlane);
assert_eq!(MediaFileEngineCategory::from_str("video_plane").unwrap(), MediaFileEngineCategory::VideoPlane);
assert!(MediaFileEngineCategory::from_str("foo").is_err());
}
#[test]
fn all_variants() {
let mut variants = MediaFileEngineCategory::all_variants();
assert_eq!(variants.len(), 6);
assert_eq!(variants.len(), 11);
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::Scene));
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::Character));
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::Creature));
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::Animation));
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::Expression));
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::Location));
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::SetDressing));
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::Object));
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::Skybox));
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::ImagePlane));
assert_eq!(variants.pop_first(), Some(MediaFileEngineCategory::VideoPlane));
assert_eq!(variants.pop_first(), None);
}
}
@@ -47,6 +47,9 @@ pub enum MediaFileOriginModelType {
#[serde(rename = "stable_diffusion_1_5")]
StableDiffusion15,
#[serde(rename = "gpt_sovits")]
GptSovits,
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
@@ -67,7 +70,8 @@ impl MediaFileOriginModelType {
Self::MocapNet => "mocap_net",
Self::ComfyUi => "comfy_ui",
Self::StyleTTS2 => "styletts2",
Self::StableDiffusion15 => "stable_diffusion_1_5"
Self::StableDiffusion15 => "stable_diffusion_1_5",
Self::GptSovits => "gpt_sovits",
}
}
@@ -83,6 +87,7 @@ impl MediaFileOriginModelType {
"comfy_ui" => Ok(Self::ComfyUi),
"styletts2" => Ok(Self::StyleTTS2),
"stable_diffusion_1_5" => Ok(Self::StableDiffusion15),
"gpt_sovits" => Ok(Self::GptSovits),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -100,7 +105,8 @@ impl MediaFileOriginModelType {
Self::MocapNet,
Self::ComfyUi,
Self::StyleTTS2,
Self::StableDiffusion15
Self::StableDiffusion15,
Self::GptSovits,
])
}
}
@@ -130,6 +136,7 @@ mod tests {
assert_eq!(MediaFileOriginModelType::ComfyUi.to_str(), "comfy_ui");
assert_eq!(MediaFileOriginModelType::StyleTTS2.to_str(), "styletts2");
assert_eq!(MediaFileOriginModelType::StableDiffusion15.to_str(), "stable_diffusion_1_5");
assert_eq!(MediaFileOriginModelType::GptSovits.to_str(), "gpt_sovits");
}
#[test]
@@ -144,13 +151,14 @@ mod tests {
assert_eq!(MediaFileOriginModelType::from_str("comfy_ui").unwrap(), MediaFileOriginModelType::ComfyUi);
assert_eq!(MediaFileOriginModelType::from_str("styletts2").unwrap(), MediaFileOriginModelType::StyleTTS2);
assert_eq!(MediaFileOriginModelType::from_str("stable_diffusion_1_5").unwrap(), MediaFileOriginModelType::StableDiffusion15);
assert_eq!(MediaFileOriginModelType::from_str("gpt_sovits").unwrap(), MediaFileOriginModelType::GptSovits);
assert!(MediaFileOriginModelType::from_str("foo").is_err());
}
#[test]
fn all_variants() {
let mut variants = MediaFileOriginModelType::all_variants();
assert_eq!(variants.len(), 10);
assert_eq!(variants.len(), 11);
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::RvcV2));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::SadTalker));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::SoVitsSvc));
@@ -161,6 +169,7 @@ mod tests {
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::ComfyUi));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::StyleTTS2));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::StableDiffusion15));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::GptSovits));
assert_eq!(variants.pop_first(), None);
}
}
@@ -15,14 +15,17 @@ use utoipa::ToSchema;
pub enum MediaFileType {
// TODO(bt): Deprecate and split into audio mime types; use media_class to represent broadly
/// Audio files: wav, mp3, etc.
#[deprecated]
Audio,
// TODO(bt): Deprecate and split into image mime types; use media_class to represent broadly
/// Image files: png, jpeg, etc.
#[deprecated]
Image,
// TODO(bt): Deprecate and split into video mime types; use media_class to represent broadly
/// Video files: mp4, etc.
#[deprecated]
Video,
/// BVH files (for Bevy)
@@ -61,6 +64,18 @@ pub enum MediaFileType {
/// CSV format. (We use these for ArKit)
Csv,
/// Jpeg images
Jpg,
/// Png images
Png,
/// Gif images
Gif,
/// Mp4 videos
Mp4
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
@@ -85,6 +100,10 @@ impl MediaFileType {
Self::Vmd => "vmd",
Self::Pmx => "pmx",
Self::Csv => "csv",
Self::Jpg => "jpg",
Self::Png => "png",
Self::Gif => "gif",
Self::Mp4 => "mp4",
}
}
@@ -103,6 +122,10 @@ impl MediaFileType {
"vmd" => Ok(Self::Vmd),
"pmx" => Ok(Self::Pmx),
"csv" => Ok(Self::Csv),
"jpg" => Ok(Self::Jpg),
"png" => Ok(Self::Png),
"gif" => Ok(Self::Gif),
"mp4" => Ok(Self::Mp4),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -124,6 +147,10 @@ impl MediaFileType {
Self::Vmd,
Self::Pmx,
Self::Csv,
Self::Jpg,
Self::Png,
Self::Gif,
Self::Mp4,
])
}
}
@@ -151,6 +178,10 @@ mod tests {
assert_serialization(MediaFileType::Vmd, "vmd");
assert_serialization(MediaFileType::Pmx, "pmx");
assert_serialization(MediaFileType::Csv, "csv");
assert_serialization(MediaFileType::Jpg, "jpg");
assert_serialization(MediaFileType::Png, "png");
assert_serialization(MediaFileType::Gif, "gif");
assert_serialization(MediaFileType::Mp4, "mp4");
}
}
@@ -172,6 +203,10 @@ mod tests {
assert_eq!(MediaFileType::Vmd.to_str(), "vmd");
assert_eq!(MediaFileType::Pmx.to_str(), "pmx");
assert_eq!(MediaFileType::Csv.to_str(), "csv");
assert_eq!(MediaFileType::Jpg.to_str(), "jpg");
assert_eq!(MediaFileType::Png.to_str(), "png");
assert_eq!(MediaFileType::Gif.to_str(), "gif");
assert_eq!(MediaFileType::Mp4.to_str(), "mp4");
}
#[test]
@@ -189,6 +224,10 @@ mod tests {
assert_eq!(MediaFileType::from_str("vmd").unwrap(), MediaFileType::Vmd);
assert_eq!(MediaFileType::from_str("pmx").unwrap(), MediaFileType::Pmx);
assert_eq!(MediaFileType::from_str("csv").unwrap(), MediaFileType::Csv);
assert_eq!(MediaFileType::from_str("jpg").unwrap(), MediaFileType::Jpg);
assert_eq!(MediaFileType::from_str("png").unwrap(), MediaFileType::Png);
assert_eq!(MediaFileType::from_str("gif").unwrap(), MediaFileType::Gif);
assert_eq!(MediaFileType::from_str("mp4").unwrap(), MediaFileType::Mp4);
assert!(MediaFileType::from_str("foo").is_err());
}
}
@@ -199,7 +238,7 @@ mod tests {
#[test]
fn all_variants() {
let mut variants = MediaFileType::all_variants();
assert_eq!(variants.len(), 13);
assert_eq!(variants.len(), 17);
assert_eq!(variants.pop_first(), Some(MediaFileType::Audio));
assert_eq!(variants.pop_first(), Some(MediaFileType::Image));
assert_eq!(variants.pop_first(), Some(MediaFileType::Video));
@@ -213,6 +252,10 @@ mod tests {
assert_eq!(variants.pop_first(), Some(MediaFileType::Vmd));
assert_eq!(variants.pop_first(), Some(MediaFileType::Pmx));
assert_eq!(variants.pop_first(), Some(MediaFileType::Csv));
assert_eq!(variants.pop_first(), Some(MediaFileType::Jpg));
assert_eq!(variants.pop_first(), Some(MediaFileType::Png));
assert_eq!(variants.pop_first(), Some(MediaFileType::Gif));
assert_eq!(variants.pop_first(), Some(MediaFileType::Mp4));
assert_eq!(variants.pop_first(), None);
}
}
@@ -9,70 +9,77 @@ use utoipa::ToSchema;
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, ToSchema)]
pub enum WeightsType {
#[serde(rename = "hifigan_tt2")]
HifiganTacotron2,
#[serde(rename = "rvc_v2")]
RvcV2,
#[serde(rename = "sd_1.5")]
StableDiffusion15,
#[serde(rename = "sdxl")]
StableDiffusionXL,
#[serde(rename = "so_vits_svc")]
SoVitsSvc,
#[serde(rename = "tt2")]
Tacotron2,
#[serde(rename = "loRA")]
LoRA,
#[serde(rename = "vall_e")]
VallE,
#[serde(rename = "comfy_ui")]
ComfyUi,
#[serde(rename = "hifigan_tt2")]
HifiganTacotron2,
#[serde(rename = "rvc_v2")]
RvcV2,
#[serde(rename = "sd_1.5")]
StableDiffusion15,
#[serde(rename = "sdxl")]
StableDiffusionXL,
#[serde(rename = "so_vits_svc")]
SoVitsSvc,
#[serde(rename = "tt2")]
Tacotron2,
#[serde(rename = "loRA")]
LoRA,
#[serde(rename = "vall_e")]
VallE,
#[serde(rename = "comfy_ui")]
ComfyUi,
/// NB: IN production these are filtered to `PublicWeightsType::Tacotron25`.
#[serde(rename = "gpt_so_vits")]
GptSoVits,
}
impl WeightsType {
pub fn to_str(&self) -> &'static str {
match self {
Self::HifiganTacotron2 => "hifigan_tt2",
Self::RvcV2 => "rvc_v2",
Self::StableDiffusion15 => "sd_1.5",
Self::StableDiffusionXL => "sdxl",
Self::SoVitsSvc => "so_vits_svc",
Self::Tacotron2 => "tt2",
Self::LoRA => "loRA",
Self::VallE => "vall_e",
Self::ComfyUi => "comfy_ui",
}
pub fn to_str(&self) -> &'static str {
match self {
Self::HifiganTacotron2 => "hifigan_tt2",
Self::RvcV2 => "rvc_v2",
Self::StableDiffusion15 => "sd_1.5",
Self::StableDiffusionXL => "sdxl",
Self::SoVitsSvc => "so_vits_svc",
Self::Tacotron2 => "tt2",
Self::LoRA => "loRA",
Self::VallE => "vall_e",
Self::ComfyUi => "comfy_ui",
Self::GptSoVits => "gpt_so_vits",
}
}
pub fn from_str(value: &str) -> Result<Self, String> {
match value {
"hifigan_tt2" => Ok(Self::HifiganTacotron2),
"rvc_v2" => Ok(Self::RvcV2),
"sd_1.5" => Ok(Self::StableDiffusion15),
"sdxl" => Ok(Self::StableDiffusionXL),
"so_vits_svc" => Ok(Self::SoVitsSvc),
"tt2" => Ok(Self::Tacotron2),
"loRA" => Ok(Self::LoRA),
"vall_e" => Ok(Self::VallE),
"comfy_ui" => Ok(Self::ComfyUi),
_ => Err(format!("invalid value: {:?}", value)),
}
pub fn from_str(value: &str) -> Result<Self, String> {
match value {
"hifigan_tt2" => Ok(Self::HifiganTacotron2),
"rvc_v2" => Ok(Self::RvcV2),
"sd_1.5" => Ok(Self::StableDiffusion15),
"sdxl" => Ok(Self::StableDiffusionXL),
"so_vits_svc" => Ok(Self::SoVitsSvc),
"tt2" => Ok(Self::Tacotron2),
"loRA" => Ok(Self::LoRA),
"vall_e" => Ok(Self::VallE),
"comfy_ui" => Ok(Self::ComfyUi),
"gpt_so_vits" => Ok(Self::GptSoVits),
_ => Err(format!("invalid value: {:?}", value)),
}
}
pub fn all_variants() -> BTreeSet<Self> {
BTreeSet::from([
Self::HifiganTacotron2,
Self::RvcV2,
Self::StableDiffusion15,
Self::StableDiffusionXL,
Self::SoVitsSvc,
Self::Tacotron2,
Self::LoRA,
Self::VallE,
Self::ComfyUi,
])
}
pub fn all_variants() -> BTreeSet<Self> {
BTreeSet::from([
Self::HifiganTacotron2,
Self::RvcV2,
Self::StableDiffusion15,
Self::StableDiffusionXL,
Self::SoVitsSvc,
Self::Tacotron2,
Self::LoRA,
Self::VallE,
Self::ComfyUi,
Self::GptSoVits,
])
}
}
impl_enum_display_and_debug_using_to_str!(WeightsType);
@@ -84,44 +91,76 @@ mod tests {
use super::*;
#[test]
fn test_to_str() {
assert_eq!(WeightsType::HifiganTacotron2.to_str(), "hifigan_tt2");
assert_eq!(WeightsType::RvcV2.to_str(), "rvc_v2");
assert_eq!(WeightsType::StableDiffusion15.to_str(), "sd_1.5");
assert_eq!(WeightsType::StableDiffusionXL.to_str(), "sdxl");
assert_eq!(WeightsType::SoVitsSvc.to_str(), "so_vits_svc");
assert_eq!(WeightsType::Tacotron2.to_str(), "tt2");
assert_eq!(WeightsType::LoRA.to_str(), "loRA");
assert_eq!(WeightsType::VallE.to_str(), "vall_e");
assert_eq!(WeightsType::ComfyUi.to_str(), "comfy_ui");
fn test_to_str() {
assert_eq!(WeightsType::HifiganTacotron2.to_str(), "hifigan_tt2");
assert_eq!(WeightsType::RvcV2.to_str(), "rvc_v2");
assert_eq!(WeightsType::StableDiffusion15.to_str(), "sd_1.5");
assert_eq!(WeightsType::StableDiffusionXL.to_str(), "sdxl");
assert_eq!(WeightsType::SoVitsSvc.to_str(), "so_vits_svc");
assert_eq!(WeightsType::Tacotron2.to_str(), "tt2");
assert_eq!(WeightsType::LoRA.to_str(), "loRA");
assert_eq!(WeightsType::VallE.to_str(), "vall_e");
assert_eq!(WeightsType::ComfyUi.to_str(), "comfy_ui");
assert_eq!(WeightsType::GptSoVits.to_str(), "gpt_so_vits");
}
#[test]
fn test_from_str() {
assert_eq!(WeightsType::from_str("hifigan_tt2").unwrap(), WeightsType::HifiganTacotron2);
assert_eq!(WeightsType::from_str("rvc_v2").unwrap(), WeightsType::RvcV2);
assert_eq!(WeightsType::from_str("sd_1.5").unwrap(), WeightsType::StableDiffusion15);
assert_eq!(WeightsType::from_str("sdxl").unwrap(), WeightsType::StableDiffusionXL);
assert_eq!(WeightsType::from_str("so_vits_svc").unwrap(), WeightsType::SoVitsSvc);
assert_eq!(WeightsType::from_str("tt2").unwrap(), WeightsType::Tacotron2);
assert_eq!(WeightsType::from_str("loRA").unwrap(), WeightsType::LoRA);
assert_eq!(WeightsType::from_str("vall_e").unwrap(), WeightsType::VallE);
assert_eq!(WeightsType::from_str("comfy_ui").unwrap(), WeightsType::ComfyUi);
assert_eq!(WeightsType::from_str("gpt_so_vits").unwrap(), WeightsType::GptSoVits);
assert!(WeightsType::from_str("invalid").is_err());
}
#[test]
fn test_all_variants() {
let variants = WeightsType::all_variants();
assert_eq!(variants.len(), 10);
assert!(variants.contains(&WeightsType::HifiganTacotron2));
assert!(variants.contains(&WeightsType::RvcV2));
assert!(variants.contains(&WeightsType::StableDiffusion15));
assert!(variants.contains(&WeightsType::StableDiffusionXL));
assert!(variants.contains(&WeightsType::SoVitsSvc));
assert!(variants.contains(&WeightsType::Tacotron2));
assert!(variants.contains(&WeightsType::LoRA));
assert!(variants.contains(&WeightsType::VallE));
assert!(variants.contains(&WeightsType::ComfyUi));
assert!(variants.contains(&WeightsType::GptSoVits));
}
mod mechanical_checks {
use super::*;
#[test]
fn variant_length() {
use strum::IntoEnumIterator;
assert_eq!(WeightsType::all_variants().len(), WeightsType::iter().len());
}
#[test]
fn test_from_str() {
assert_eq!(WeightsType::from_str("hifigan_tt2").unwrap(), WeightsType::HifiganTacotron2);
assert_eq!(WeightsType::from_str("rvc_v2").unwrap(), WeightsType::RvcV2);
assert_eq!(WeightsType::from_str("sd_1.5").unwrap(), WeightsType::StableDiffusion15);
assert_eq!(WeightsType::from_str("sdxl").unwrap(), WeightsType::StableDiffusionXL);
assert_eq!(WeightsType::from_str("so_vits_svc").unwrap(), WeightsType::SoVitsSvc);
assert_eq!(WeightsType::from_str("tt2").unwrap(), WeightsType::Tacotron2);
assert_eq!(WeightsType::from_str("loRA").unwrap(), WeightsType::LoRA);
assert_eq!(WeightsType::from_str("vall_e").unwrap(), WeightsType::VallE);
assert_eq!(WeightsType::from_str("comfy_ui").unwrap(), WeightsType::ComfyUi);
assert!(WeightsType::from_str("invalid").is_err());
fn round_trip() {
for variant in WeightsType::all_variants() {
assert_eq!(variant, WeightsType::from_str(variant.to_str()).unwrap());
assert_eq!(variant, WeightsType::from_str(&format!("{}", variant)).unwrap());
assert_eq!(variant, WeightsType::from_str(&format!("{:?}", variant)).unwrap());
}
}
#[test]
fn test_all_variants() {
let variants = WeightsType::all_variants();
assert_eq!(variants.len(), 9);
assert!(variants.contains(&WeightsType::HifiganTacotron2));
assert!(variants.contains(&WeightsType::RvcV2));
assert!(variants.contains(&WeightsType::StableDiffusion15));
assert!(variants.contains(&WeightsType::StableDiffusionXL));
assert!(variants.contains(&WeightsType::SoVitsSvc));
assert!(variants.contains(&WeightsType::Tacotron2));
assert!(variants.contains(&WeightsType::LoRA));
assert!(variants.contains(&WeightsType::VallE));
assert!(variants.contains(&WeightsType::ComfyUi));
fn serialized_length_ok_for_database() {
const MAX_LENGTH : usize = 16;
for variant in WeightsType::all_variants() {
let serialized = variant.to_str();
assert!(serialized.len() > 0, "variant {:?} is too short", variant);
assert!(serialized.len() <= MAX_LENGTH, "variant {:?} is too long", variant);
}
}
}
}
@@ -124,10 +124,10 @@ mod tests {
fn serialize() {
let expected = "\"positive\"".to_string(); // NB: Quoted
assert_eq!(expected, toml::to_string(&UserRatingValue::Positive).unwrap());
assert_eq!(expected, serde_json::to_string(&UserRatingValue::Positive).unwrap());
// Just to show this serializes the same as a string
assert_eq!(expected, toml::to_string("positive").unwrap());
assert_eq!(expected, serde_json::to_string("positive").unwrap());
}
#[test]
+2 -2
View File
@@ -112,10 +112,10 @@ mod tests {
fn serialize() {
let expected = "\"author\"".to_string(); // NB: Quoted
assert_eq!(expected, toml::to_string(&ViewAs::Author).unwrap());
assert_eq!(expected, serde_json::to_string(&ViewAs::Author).unwrap());
// Just to show this serializes the same as a string
assert_eq!(expected, toml::to_string("author").unwrap());
assert_eq!(expected, serde_json::to_string("author").unwrap());
}
#[test]
+2 -2
View File
@@ -153,10 +153,10 @@ mod tests {
fn serialize() {
let expected = "\"public\"".to_string(); // NB: Quoted
assert_eq!(expected, toml::to_string(&Visibility::Public).unwrap());
assert_eq!(expected, serde_json::to_string(&Visibility::Public).unwrap());
// Just to show this serializes the same as a string
assert_eq!(expected, toml::to_string("public").unwrap());
assert_eq!(expected, serde_json::to_string("public").unwrap());
}
#[test]
+1
View File
@@ -1 +1,2 @@
pub mod premium_product;
pub mod style_transfer;
@@ -0,0 +1 @@
pub mod premium_product_name;
@@ -0,0 +1,134 @@
use std::collections::BTreeSet;
#[cfg(test)]
use strum::EnumCount;
#[cfg(test)]
use strum::EnumIter;
use utoipa::ToSchema;
/// This enum is not backed by a particular database table.
/// This is used to count premium product uses for free and paid users.
///
/// DO NOT CHANGE VALUES WITHOUT A MIGRATION STRATEGY.
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Deserialize, Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub enum PremiumProductName {
// NB: These keys are kept short to preserve space
#[serde(rename = "fa")]
FaceAnimator,
// NB: These keys are kept short to preserve space
#[serde(rename = "fm")]
FaceMirror,
// NB: These keys are kept short to preserve space
#[serde(rename = "lip")]
Lipsync,
// NB: These keys are kept short to preserve space
#[serde(rename = "vst")]
VideoStyleTransfer,
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
impl_enum_display_and_debug_using_to_str!(PremiumProductName);
//impl_mysql_enum_coders!(PremiumProductName);
//impl_mysql_from_row!(PremiumProductName);
/// NB: Legacy API for older code.
impl PremiumProductName {
pub fn to_str(&self) -> &'static str {
match self {
Self::FaceAnimator => "fa",
Self::FaceMirror => "fm",
Self::Lipsync => "lip",
Self::VideoStyleTransfer => "vst",
}
}
pub fn from_str(value: &str) -> Result<Self, String> {
match value {
"fa" => Ok(Self::FaceAnimator),
"fm" => Ok(Self::FaceMirror),
"lip" => Ok(Self::Lipsync),
"vst" => Ok(Self::VideoStyleTransfer),
_ => Err(format!("Unknown PremiumProductName: {}", value)),
}
}
pub fn all_variants() -> BTreeSet<Self> {
// NB: BTreeSet is sorted
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
BTreeSet::from([
Self::FaceAnimator,
Self::FaceMirror,
Self::Lipsync,
Self::VideoStyleTransfer,
])
}
}
#[cfg(test)]
mod tests {
use crate::no_table::premium_product::premium_product_name::PremiumProductName;
use crate::test_helpers::assert_serialization;
mod serde {
use super::*;
#[test]
fn test_serialization() {
assert_serialization(PremiumProductName::FaceAnimator, "fa");
assert_serialization(PremiumProductName::FaceMirror, "fm");
assert_serialization(PremiumProductName::Lipsync, "lip");
assert_serialization(PremiumProductName::VideoStyleTransfer, "vst");
}
mod impl_methods {
use super::*;
#[test]
fn to_str() {
assert_eq!(PremiumProductName::FaceAnimator.to_str(), "fa");
assert_eq!(PremiumProductName::FaceMirror.to_str(), "fm");
assert_eq!(PremiumProductName::Lipsync.to_str(), "lip");
assert_eq!(PremiumProductName::VideoStyleTransfer.to_str(), "vst");
}
#[test]
fn from_str() {
assert_eq!(PremiumProductName::from_str("fa").unwrap(), PremiumProductName::FaceAnimator);
assert_eq!(PremiumProductName::from_str("fm").unwrap(), PremiumProductName::FaceMirror);
assert_eq!(PremiumProductName::from_str("lip").unwrap(), PremiumProductName::Lipsync);
assert_eq!(PremiumProductName::from_str("vst").unwrap(), PremiumProductName::VideoStyleTransfer);
}
}
mod manual_variant_checks {
use super::*;
#[test]
fn all_variants() {
let variants = PremiumProductName::all_variants();
assert_eq!(variants.len(), 4);
}
}
mod mechanical_checks {
use super::*;
#[test]
fn variant_length() {
use strum::IntoEnumIterator;
assert_eq!(PremiumProductName::all_variants().len(), PremiumProductName::iter().len());
}
#[test]
fn round_trip() {
for variant in PremiumProductName::all_variants() {
assert_eq!(variant, PremiumProductName::from_str(variant.to_str()).unwrap());
assert_eq!(variant, PremiumProductName::from_str(&format!("{}", variant)).unwrap());
assert_eq!(variant, PremiumProductName::from_str(&format!("{:?}", variant)).unwrap());
}
}
}
}
}
@@ -84,6 +84,10 @@ pub enum StyleTransferName {
#[serde(rename = "realistic_cyberpunk")]
RealisticCyberpunk,
// New Styles (2024-06-27)
#[serde(rename = "dreamer")] // TODO: Land this in Gitub
Dreamer,
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
@@ -130,6 +134,9 @@ impl StyleTransferName {
Self::Dragonball => "dragonball",
Self::RealisticMatrix => "realistic_matrix",
Self::RealisticCyberpunk => "realistic_cyberpunk",
// New Styles (2024-06-27)
Self::Dreamer => "dreamer",
}
}
@@ -169,6 +176,7 @@ impl StyleTransferName {
"dragonball" => Ok(Self::Dragonball),
"realistic_matrix" => Ok(Self::RealisticMatrix),
"realistic_cyberpunk" => Ok(Self::RealisticCyberpunk),
"dreamer" => Ok(Self::Dreamer),
_ => Err(format!("Unknown StyleTransferName: {}", value)),
}
}
@@ -209,6 +217,7 @@ impl StyleTransferName {
Self::Dragonball => "31_dragonball.json",
Self::RealisticMatrix => "32_realistic_matrix.json",
Self::RealisticCyberpunk => "33_realistic_cyberpunk.json",
Self::Dreamer => "34_dreamer.json",
}
}
@@ -250,6 +259,8 @@ impl StyleTransferName {
Self::Dragonball,
Self::RealisticMatrix,
Self::RealisticCyberpunk,
Self::Dreamer,
])
}
}
@@ -298,6 +309,8 @@ mod tests {
assert_serialization(StyleTransferName::Dragonball, "dragonball");
assert_serialization(StyleTransferName::RealisticMatrix, "realistic_matrix");
assert_serialization(StyleTransferName::RealisticCyberpunk, "realistic_cyberpunk");
assert_serialization(StyleTransferName::Dreamer, "dreamer");
}
mod impl_methods {
@@ -339,6 +352,8 @@ mod tests {
assert_eq!(StyleTransferName::Dragonball.to_str(), "dragonball");
assert_eq!(StyleTransferName::RealisticMatrix.to_str(), "realistic_matrix");
assert_eq!(StyleTransferName::RealisticCyberpunk.to_str(), "realistic_cyberpunk");
assert_eq!(StyleTransferName::Dreamer.to_str(), "dreamer");
}
#[test]
@@ -378,6 +393,8 @@ mod tests {
assert_eq!(StyleTransferName::from_str("realistic_matrix").unwrap(), StyleTransferName::RealisticMatrix);
assert_eq!(StyleTransferName::from_str("realistic_cyberpunk").unwrap(), StyleTransferName::RealisticCyberpunk);
assert_eq!(StyleTransferName::from_str("dreamer").unwrap(), StyleTransferName::Dreamer);
assert!(StyleTransferName::from_str("foo").is_err());
}
}
@@ -388,7 +405,7 @@ mod tests {
#[test]
fn all_variants() {
let variants = StyleTransferName::all_variants();
assert_eq!(variants.len(), 33);
assert_eq!(variants.len(), 34);
}
}
+8 -4
View File
@@ -3,9 +3,12 @@
use serde::Serialize;
pub fn to_toml<T: Serialize>(t: &T) -> String {
toml::to_string(t)
.expect("serialization error")
.replace("\"", "") // JSON values are quoted, so we remove quotes
match toml::to_string(t) {
Ok(s) => s.replace("\"", ""), // JSON values are quoted, so we remove quotes
Err(err) => {
panic!("serialization error: {}", err);
}
}
}
pub fn to_json<T: Serialize>(t: &T) -> String {
@@ -18,6 +21,7 @@ pub fn to_json<T: Serialize>(t: &T) -> String {
/// This is useful for ensuring stability of serialization.
pub fn assert_serialization<T: Serialize>(t: T, expected: &str) {
// TODO: See if there's a way to check the sqlx serialization
assert_eq!(&to_toml(&t), expected);
// TODO(bt,2024-06-27): Something broke with serde toml serialization, so we're disabling it
// assert_eq!(&to_toml(&t), expected);
assert_eq!(&to_json(&t), expected);
}
+39
View File
@@ -0,0 +1,39 @@
[package]
name = "enums_public"
edition = "2018"
version = "0.0.1"
authors = [
"Brandon Thomas <bt@brand.io>",
"Brandon Thomas <echelon@gmail.com>",
]
publish = false
[lib]
name = "enums_public"
path = "src/lib.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["my-workspace-hack"]
[dependencies]
# Internal
enums = { path = "../enums" }
errors = { path = "../../lib/errors" }
# Workspace hack (faster compile times)
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
# Serialization
serde = "1.0.125"
serde_derive = "1.0.125"
utoipa = { version = "4", features = ["chrono","actix_extras"] }
[dev-dependencies]
# Enum utilities
strum = { version = "0.26", features = ["derive"] }
# Test serialization
serde_json = "1.0.108"
toml = "0.8.14"
@@ -0,0 +1 @@
pub mod public_inference_job_type;
@@ -0,0 +1,212 @@
#[cfg(test)]
use strum::EnumCount;
#[cfg(test)]
use strum::EnumIter;
use utoipa::ToSchema;
use enums::by_table::generic_inference_jobs::inference_job_type::InferenceJobType;
/// Report certain jobs publicly as different from what we actually run.
/// This is so we have an edge against the competition that might try to run
/// the same models or workflows. This won't always make sense, but in some cases it will.
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, Default, ToSchema, Debug)]
#[serde(rename_all = "snake_case")]
pub enum PublicInferenceJobType {
// Renamed enum variants
/// Instead of `InferenceJobType::LivePortrait` ("live_portrait")
ActingFace,
/// Storyteller Studio and Video Style Transfer Jobs (which we may want to split).
/// These run in Comfy.
/// TODO(bt,2024-07-15): We may segregate these two job types in the future
VideoRender,
GptSovits,
// Everything else is the same
/// Jobs that run ComfyUI workflows
/// This is actually just for Video Style Transfer and Storyteller Studio.
#[deprecated(note = "Use VideoRender instead.")]
ComfyUi,
/// A job that turns "FBX" game engine files into "GLTF" files (Bevy-compatible).
#[serde(rename = "convert_fbx_gltf")]
ConvertFbxToGltf,
/// Process a video into BVH mocap animation data for game engines
MocapNet,
/// RVC is a voice conversion model. RVCv2 is the most popular such model currently.
#[serde(rename = "rvc_v2")]
RvcV2,
/// SadTalker does image-to-video lip-syncing when given an audio file and image.
SadTalker,
/// so-vits-svc voice conversion. This predates RVCv2.
SoVitsSvc,
/// Stable diffusion image generation
StableDiffusion,
/// StyleTTS2 is a zero shot multi-speaker TTS model.
/// This job type should handle both speaker vector encoding and inference.
#[serde(rename = "styletts2")]
StyleTTS2,
/// TT2 Text to speech
Tacotron2,
/// A value we may use in the future for historical jobs
/// (i.e. when we backfill the database column and make it non-nullable)
#[default]
Unknown,
/// DEPRECATED. DO NOT USE.
/// Job that converts bevy to workflow files
#[deprecated(note = "This was for Bevy engine's server side rendering.")]
#[serde(rename = "bevy_to_workflow")]
BevyToWorkflow,
#[deprecated(note = "This was for ReRenderAVideo, which we never productionized.")]
/// DEPRECATED. DO NOT USE.
/// Re-render a video is a video style transfer algorithm. We developed code
/// around it, but chose to develop AnimateDiff / ComfyUI support instead.
RerenderAVideo,
}
/// NB: Legacy API for older code.
impl PublicInferenceJobType {
pub fn from_enum(inference_job_type: InferenceJobType) -> Self {
match inference_job_type {
// Renamed variants
InferenceJobType::LivePortrait => Self::ActingFace,
// Conserved variants
InferenceJobType::VideoRender => Self::VideoRender,
InferenceJobType::GptSovits => Self::GptSovits,
InferenceJobType::ComfyUi => Self::ComfyUi,
InferenceJobType::ConvertFbxToGltf => Self::ConvertFbxToGltf,
InferenceJobType::MocapNet => Self::MocapNet,
InferenceJobType::RvcV2 => Self::RvcV2,
InferenceJobType::SadTalker => Self::SadTalker,
InferenceJobType::SoVitsSvc => Self::SoVitsSvc,
InferenceJobType::StableDiffusion => Self::StableDiffusion,
InferenceJobType::StyleTTS2 => Self::StyleTTS2,
InferenceJobType::Tacotron2 => Self::Tacotron2,
InferenceJobType::Unknown => Self::Unknown,
InferenceJobType::BevyToWorkflow => Self::BevyToWorkflow,
InferenceJobType::RerenderAVideo => Self::RerenderAVideo,
}
}
pub fn to_enum(&self) -> InferenceJobType {
match self {
// Renamed variants
Self::ActingFace => InferenceJobType::LivePortrait,
// Conserved variants
Self::VideoRender => InferenceJobType::VideoRender,
Self::GptSovits => InferenceJobType::GptSovits,
Self::ComfyUi => InferenceJobType::ComfyUi,
Self::ConvertFbxToGltf => InferenceJobType::ConvertFbxToGltf,
Self::MocapNet => InferenceJobType::MocapNet,
Self::RvcV2 => InferenceJobType::RvcV2,
Self::SadTalker => InferenceJobType::SadTalker,
Self::SoVitsSvc => InferenceJobType::SoVitsSvc,
Self::StableDiffusion => InferenceJobType::StableDiffusion,
Self::StyleTTS2 => InferenceJobType::StyleTTS2,
Self::Tacotron2 => InferenceJobType::Tacotron2,
Self::Unknown => InferenceJobType::Unknown,
Self::BevyToWorkflow => InferenceJobType::BevyToWorkflow,
Self::RerenderAVideo => InferenceJobType::RerenderAVideo,
}
}
}
#[cfg(test)]
mod tests {
use strum::IntoEnumIterator;
use crate::test_helpers::to_json;
use super::*;
fn override_enums() -> &'static [PublicInferenceJobType; 1] {
&[
PublicInferenceJobType::ActingFace,
]
}
mod override_values {
use super::*;
#[test]
fn acting_face() {
// Public --> Internal
assert_eq!(PublicInferenceJobType::ActingFace.to_enum(), InferenceJobType::LivePortrait);
assert_eq!(to_json(&PublicInferenceJobType::ActingFace.to_enum()), "live_portrait");
// Internal --> Public
assert_eq!(PublicInferenceJobType::from_enum(InferenceJobType::LivePortrait), PublicInferenceJobType::ActingFace);
assert_eq!(to_json(&PublicInferenceJobType::from_enum(InferenceJobType::LivePortrait)), "acting_face");
}
}
mod mechanical_checks {
use super::*;
#[test]
fn public_to_internal() {
let mut tested_count = 0;
for public_variant in PublicInferenceJobType::iter() {
if public_variant == PublicInferenceJobType::ActingFace {
continue; // Can't compare.
}
// Round trip
assert_eq!(public_variant, PublicInferenceJobType::from_enum(public_variant.to_enum()));
let internal_enum_variant = public_variant.to_enum();
let internal_enum_string = to_json(&internal_enum_variant);
let public_enum_string = to_json(&public_variant);
assert_eq!(internal_enum_string, public_enum_string);
tested_count += 1;
}
assert!(tested_count > 1);
assert_eq!(tested_count, PublicInferenceJobType::iter().len() - override_enums().len());
}
#[test]
fn internal_to_public() {
let mut tested_count = 0;
for internal_variant in InferenceJobType::all_variants() {
if internal_variant == InferenceJobType::LivePortrait {
continue; // Can't compare.
}
// Round trip
assert_eq!(internal_variant, PublicInferenceJobType::from_enum(internal_variant).to_enum());
let public_enum_variant = PublicInferenceJobType::from_enum(internal_variant);
let public_enum_string = to_json(&public_enum_variant);
let internal_enum_string = to_json(&internal_variant);
// Same serialization
assert_eq!(internal_enum_string, public_enum_string);
tested_count += 1;
}
assert!(tested_count > 1);
assert_eq!(tested_count, InferenceJobType::all_variants().len() - override_enums().len());
}
}
}
@@ -0,0 +1,2 @@
pub mod generic_inference_jobs;
pub mod model_weights;
@@ -0,0 +1 @@
pub mod public_weights_types;
@@ -0,0 +1,162 @@
#[cfg(test)]
use strum::EnumCount;
#[cfg(test)]
use strum::EnumIter;
use utoipa::ToSchema;
use enums::by_table::model_weights::weights_types::WeightsType;
/// Report certain models publicly as different from what we actually use.
/// This is so we have an edge against the competition that might try to run
/// the same models. This won't always make sense, but in some cases it will.
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, ToSchema, Debug)]
pub enum PublicWeightsType {
// Renamed enum variants
/// Instead of `WeightsType::GptSoVits` ("gpt_so_vits")
#[serde(rename = "tacotron2.5")]
Tacotron2_5,
// Everything else is the same
#[serde(rename = "hifigan_tt2")]
HifiganTacotron2,
#[serde(rename = "rvc_v2")]
RvcV2,
#[serde(rename = "sd_1.5")]
StableDiffusion15,
#[serde(rename = "sdxl")]
StableDiffusionXL,
#[serde(rename = "so_vits_svc")]
SoVitsSvc,
#[serde(rename = "tt2")]
Tacotron2,
#[serde(rename = "loRA")]
LoRA,
#[serde(rename = "vall_e")]
VallE,
#[serde(rename = "comfy_ui")]
ComfyUi,
}
impl PublicWeightsType {
pub fn from_enum(weights_type: WeightsType) -> Self {
match weights_type {
// Renamed variants
WeightsType::GptSoVits => Self::Tacotron2_5,
// Conserved variants
WeightsType::HifiganTacotron2 => Self::HifiganTacotron2,
WeightsType::RvcV2 => Self::RvcV2,
WeightsType::StableDiffusion15 => Self::StableDiffusion15,
WeightsType::StableDiffusionXL => Self::StableDiffusionXL,
WeightsType::SoVitsSvc => Self::SoVitsSvc,
WeightsType::Tacotron2 => Self::Tacotron2,
WeightsType::LoRA => Self::LoRA,
WeightsType::VallE => Self::VallE,
WeightsType::ComfyUi => Self::ComfyUi,
}
}
pub fn to_enum(&self) -> WeightsType {
match self {
// Renamed variants
Self::Tacotron2_5 => WeightsType::GptSoVits,
// Conserved variants
Self::HifiganTacotron2 => WeightsType::HifiganTacotron2,
Self::RvcV2 => WeightsType::RvcV2,
Self::StableDiffusion15 => WeightsType::StableDiffusion15,
Self::StableDiffusionXL => WeightsType::StableDiffusionXL,
Self::SoVitsSvc => WeightsType::SoVitsSvc,
Self::Tacotron2 => WeightsType::Tacotron2,
Self::LoRA => WeightsType::LoRA,
Self::VallE => WeightsType::VallE,
Self::ComfyUi => WeightsType::ComfyUi,
}
}
}
#[cfg(test)]
mod tests {
use strum::IntoEnumIterator;
use crate::test_helpers::to_json;
use super::*;
fn override_enums() -> &'static [PublicWeightsType; 1] {
&[
PublicWeightsType::Tacotron2_5,
]
}
mod override_values {
use super::*;
#[test]
fn gpt_so_vits() {
// Public --> Internal
assert_eq!(PublicWeightsType::Tacotron2_5.to_enum(), WeightsType::GptSoVits);
assert_eq!(to_json(&PublicWeightsType::Tacotron2_5.to_enum()), "gpt_so_vits");
// Internal --> Public
assert_eq!(PublicWeightsType::from_enum(WeightsType::GptSoVits), PublicWeightsType::Tacotron2_5);
assert_eq!(to_json(&PublicWeightsType::from_enum(WeightsType::GptSoVits)), "tacotron2.5");
}
}
mod mechanical_checks {
use super::*;
#[test]
fn public_to_internal() {
let mut tested_count = 0;
for public_variant in PublicWeightsType::iter() {
if public_variant == PublicWeightsType::Tacotron2_5 {
continue; // Can't compare.
}
// Round trip
assert_eq!(public_variant, PublicWeightsType::from_enum(public_variant.to_enum()));
let internal_enum_variant = public_variant.to_enum();
let internal_enum_string = to_json(&internal_enum_variant);
let public_enum_string = to_json(&public_variant);
assert_eq!(internal_enum_string, public_enum_string);
tested_count += 1;
}
assert!(tested_count > 1);
assert_eq!(tested_count, PublicWeightsType::iter().len() - override_enums().len());
}
#[test]
fn internal_to_public() {
let mut tested_count = 0;
for internal_variant in WeightsType::all_variants() {
if internal_variant == WeightsType::GptSoVits {
continue; // Can't compare.
}
// Round trip
assert_eq!(internal_variant, PublicWeightsType::from_enum(internal_variant).to_enum());
let public_enum_variant = PublicWeightsType::from_enum(internal_variant);
let public_enum_string = to_json(&public_enum_variant);
let internal_enum_string = to_json(&internal_variant);
// Same serialization
assert_eq!(internal_enum_string, public_enum_string);
tested_count += 1;
}
assert!(tested_count > 1);
assert_eq!(tested_count, WeightsType::all_variants().len() - override_enums().len());
}
}
}
+26
View File
@@ -0,0 +1,26 @@
//! enums_public
//!
//! Sometimes we want to hide which enums we allow over the API
//! to keep competitors in the dark about what we're doing.
//!
// Never allow these
#![forbid(private_bounds)]
#![forbid(private_interfaces)]
#![forbid(unused_must_use)] // NB: It's unsafe to not close/check some things
// Okay to toggle
#![forbid(unreachable_patterns)]
#![forbid(unused_imports)]
#![forbid(unused_mut)]
#![forbid(unused_variables)]
// Always allow
#![allow(dead_code)]
#![allow(non_snake_case)]
#[macro_use] extern crate serde_derive;
#[cfg(test)] pub mod test_helpers;
pub mod by_table;
@@ -0,0 +1,27 @@
//! Only imported in tests
use serde::Serialize;
pub fn to_toml<T: Serialize>(t: &T) -> String {
match toml::to_string(t) {
Ok(s) => s.replace("\"", ""), // JSON values are quoted, so we remove quotes
Err(err) => {
panic!("serialization error: {}", err);
}
}
}
pub fn to_json<T: Serialize>(t: &T) -> String {
serde_json::to_string(t)
.expect("serialization error")
.replace("\"", "") // JSON values are quoted, so we remove quotes
}
/// Assert that the Serialize is represented by the expected string value.
/// This is useful for ensuring stability of serialization.
pub fn assert_serialization<T: Serialize>(t: T, expected: &str) {
// TODO: See if there's a way to check the sqlx serialization
// TODO(bt,2024-06-27): Something broke with serde toml serialization, so we're disabling it
// assert_eq!(&to_toml(&t), expected);
assert_eq!(&to_json(&t), expected);
}
+1 -1
View File
@@ -36,4 +36,4 @@ sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls",
[dev-dependencies]
# Test serialization
#serde_json = "1.0.64"
toml = "0.5.8"
toml = "0.8.14"
+2 -2
View File
@@ -41,8 +41,8 @@ utoipa = { version = "4", features = ["chrono","actix_extras"] }
[dev-dependencies]
# Enum utilities
strum = { version = "0.25", features = ["derive"] }
strum = { version = "0.26", features = ["derive"] }
# Test serialization
serde_json = "1.0.108"
toml = "0.5.8"
toml = "0.8.14"
@@ -12,4 +12,5 @@ use crate::prefixes::TokenPrefix;
pub struct MediaFileToken(pub String);
impl_string_token!(MediaFileToken);
impl_mysql_token_from_row!(MediaFileToken);
impl_crockford_generator!(MediaFileToken, 32usize, TokenPrefix::MediaFile, CrockfordLower);
@@ -40,7 +40,7 @@ clap = "4.4.8"
rand = "0.8.5"
# Runtime
# NB: We switched to Tokio from `async-std` for broader ecosystem support.
tokio = { version = "1.34.0", features = ["macros"] }
tokio = { version = "1.38.0", features = ["macros"] }
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
@@ -16,6 +16,7 @@ pub fn get_bucket_clients() -> AnyhowResult<BucketClients> {
let region_name = easyenv::get_env_string_required("REGION_NAME")?;
let public_bucket_name = easyenv::get_env_string_required("PUBLIC_BUCKET_NAME")?;
let private_bucket_name = easyenv::get_env_string_required("PRIVATE_BUCKET_NAME")?;
let s3_compatible_endpoint_url = easyenv::get_env_string_or_default("S3_COMPATIBLE_ENDPOINT_URL", "https://storage.googleapis.com");
// NB: Long timeout for dev rust builds to upload to cloud buckets.
// Unoptimized binaries sometimes take a lot of time to upload, presumably due to unoptimized code.
@@ -29,6 +30,7 @@ pub fn get_bucket_clients() -> AnyhowResult<BucketClients> {
&secret_key,
&region_name,
&public_bucket_name,
&s3_compatible_endpoint_url,
None,
Some(bucket_timeout),
)?;
@@ -40,6 +42,7 @@ pub fn get_bucket_clients() -> AnyhowResult<BucketClients> {
&secret_key,
&region_name,
&private_bucket_name,
&s3_compatible_endpoint_url,
None,
Some(bucket_timeout),
)?;
@@ -37,7 +37,7 @@ log = "0.4.14"
# Runtime
# NB: We switched to Tokio from `async-std` for broader ecosystem support.
tokio = { version = "1.34.0", features = ["macros"] }
tokio = { version = "1.38.0", features = ["macros"] }
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
@@ -43,6 +43,8 @@ pub async fn main() -> AnyhowResult<()> {
let region_name = easyenv::get_env_string_required("REGION_NAME")?;
let public_bucket_name = easyenv::get_env_string_required("PUBLIC_BUCKET_NAME")?;
let s3_compatible_endpoint_url = easyenv::get_env_string_or_default(
"S3_COMPATIBLE_ENDPOINT_URL", "");
let bucket_timeout = easyenv::get_env_duration_seconds_or_default(
"BUCKET_TIMEOUT_SECONDS", Duration::from_secs(60 * 5));
@@ -53,6 +55,7 @@ pub async fn main() -> AnyhowResult<()> {
&secret_key,
&region_name,
&public_bucket_name,
&s3_compatible_endpoint_url,
None,
Some(bucket_timeout),
)?;
+1 -1
View File
@@ -26,4 +26,4 @@ my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
# External
clap = "4.4.8"
tokio = { version = "1.34.0", features = ["macros"] }
tokio = { version = "1.38.0", features = ["macros"] }
+1 -2
View File
@@ -16,10 +16,9 @@ path = "src/main.rs"
normal = ["my-workspace-hack"]
[dependencies]
# Internal
container_common = { path = "../../../lib/deprecated/container_common" }
easyenv = { path = "../../../lib/easyenv" }
errors = { path = "../../../lib/errors" }
# Workspace hack (faster compile times)
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
+1 -1
View File
@@ -1,7 +1,7 @@
use log::info;
use container_common::anyhow_result::AnyhowResult;
use easyenv::init_all_with_default_logging;
use errors::AnyhowResult;
fn main() -> AnyhowResult<()> {
init_all_with_default_logging(None);
+2 -3
View File
@@ -18,7 +18,6 @@ normal = ["my-workspace-hack"]
[dependencies]
# Internal
buckets = { path = "../../../_types/buckets" }
container_common = { path = "../../../lib/deprecated/container_common" }
easyenv = { path = "../../../lib/easyenv" }
enums = { path = "../../../_types/enums" }
errors = { path = "../../../lib/errors" }
@@ -32,11 +31,11 @@ my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
# External
clap = "4.4.8"
dotenv = "0.15.0"
itertools = "0.11.0"
itertools = "0.13.0"
log = "0.4.14"
# Bigger pieces
tokio = { version = "1.34.0", features = ["macros"] }
tokio = { version = "1.38.0", features = ["macros"] }
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
# Serialization
+1 -1
View File
@@ -2,8 +2,8 @@ use log::info;
use sqlx::{MySql, Pool};
use sqlx::mysql::MySqlPoolOptions;
use container_common::anyhow_result::AnyhowResult;
use easyenv::init_all_with_default_logging;
use errors::AnyhowResult;
use crate::cli_args::Action;
use crate::operations::delete_all_anonymous_user_images::delete_all_anonymous_user_images::delete_all_anonymous_user_images;
@@ -8,7 +8,7 @@ use sqlx::{MySql, Pool};
use enums::by_table::media_files::media_file_type::MediaFileType;
use enums::common::view_as::ViewAs;
use errors::AnyhowResult;
use mysql_queries::queries::media_files::delete_media_file::delete_media_file_as_mod;
use mysql_queries::queries::media_files::delete::delete_media_file::delete_media_file_as_mod;
use mysql_queries::queries::media_files::list::list_media_files::{list_media_files, ListMediaFilesArgs};
use crate::cli_args::Args;
@@ -6,7 +6,7 @@ use sqlx::{MySql, Pool};
use enums::common::view_as::ViewAs;
use errors::{anyhow, AnyhowResult};
use mysql_queries::queries::media_files::delete_media_file::delete_media_file_as_mod;
use mysql_queries::queries::media_files::delete::delete_media_file::delete_media_file_as_mod;
use mysql_queries::queries::media_files::list::list_media_files_for_user::{list_media_files_for_user, ListMediaFileForUserArgs};
use mysql_queries::queries::users::user_profiles::get_user_profile_by_username::get_user_profile_by_username;
@@ -33,10 +33,10 @@ my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
# External
clap = "4.4.8"
log = "0.4.14"
strum = { version = "0.25", features = ["derive"] }
strum = { version = "0.26", features = ["derive"] }
# Bigger pieces
tokio = { version = "1.34.0", features = ["macros"] }
tokio = { version = "1.38.0", features = ["macros"] }
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
elasticsearch = "8.5.0-alpha.1"
@@ -23,10 +23,17 @@ pub enum Environment {
pub enum Action {
ReindexTts,
SearchTts,
/// Reindex model_weights into ElasticSearch
ReindexModelWeights,
/// Search the model weights
SearchModelWeights,
/// Reindex media_files into ElasticSearch
/// For now, this is just media files that are relevant to the engine.
ReindexMediaFiles,
SearchMediaFiles,
}
#[derive(Parser, Debug)]
@@ -20,6 +20,8 @@ use errors::AnyhowResult;
use crate::cli_args::{Action, Environment, parse_cli_args};
use crate::plans::create_all_model_weight_documents::create_all_model_weight_documents;
use crate::plans::create_all_tts_documents::create_all_tts_documents;
use crate::plans::media_files::create_dimensional_media_file_documents::create_dimensional_media_file_documents;
use crate::plans::media_files::test_search_media_files_documents::test_search_media_files;
pub mod cli_args;
pub mod plans;
@@ -62,6 +64,14 @@ pub async fn main() -> AnyhowResult<()> {
println!("Result: {:#?}", result);
}
}
Action::ReindexMediaFiles => {
info!("Reindexing media files...");
create_dimensional_media_file_documents(&mysql, &elasticsearch).await?;
}
Action::SearchMediaFiles => {
info!("Search media files...");
test_search_media_files(&elasticsearch).await?;
}
}
info!("Done!");
@@ -13,7 +13,11 @@ use errors::AnyhowResult;
use mysql_queries::queries::model_weights::list::list_model_weights_for_elastic_search_backfill_using_cursor::{list_model_weights_for_elastic_search_backfill_using_cursor, ModelWeightForElasticsearchRecord};
use storyteller_root::get_storyteller_rust_root;
pub async fn create_all_model_weight_documents(mysql: &Pool<MySql>, elasticsearch: &Elasticsearch) -> AnyhowResult<()> {
pub async fn create_all_model_weight_documents(
mysql: &Pool<MySql>,
elasticsearch: &Elasticsearch
) -> AnyhowResult<()> {
info!("Create all model weight documents.");
// TODO(bt, 2024-01-10): expose this as a CLI flag
@@ -63,7 +67,8 @@ async fn create_document_from_record(elasticsearch: &Elasticsearch, record: Mode
weights_type: record.weights_type,
weights_category: record.weights_category,
title: record.title,
title: record.title.clone(),
title_as_keyword: record.title,
maybe_cover_image_media_file_token: record.maybe_cover_image_media_file_token,
maybe_cover_image_public_bucket_hash: record.maybe_cover_image_public_bucket_hash,
@@ -0,0 +1,190 @@
use std::collections::HashSet;
use std::fs::read_to_string;
use std::iter::FromIterator;
use elasticsearch::{BulkOperation, BulkParts, Elasticsearch};
use log::{error, info, warn};
use serde_json::Value;
use sqlx::{MySql, Pool};
use elasticsearch_schema::documents::media_file_document::{MEDIA_FILE_INDEX, MediaFileDocument};
use elasticsearch_schema::traits::document::Document;
use elasticsearch_schema::utils::create_index_if_not_exists::{create_index_if_not_exists, CreateIndexArgs};
use enums::by_table::media_files::media_file_class::MediaFileClass;
use enums::by_table::media_files::media_file_engine_category::MediaFileEngineCategory;
use enums::by_table::media_files::media_file_type::MediaFileType;
use errors::AnyhowResult;
use mysql_queries::queries::media_files::list::list_media_files_for_elastic_search_backfill_using_cursor::{list_media_files_for_elastic_search_backfill_using_cursor, ListArgs, MediaFileForElasticsearchRecord};
use mysql_queries::queries::model_weights::list::list_model_weights_for_elastic_search_backfill_using_cursor::{list_model_weights_for_elastic_search_backfill_using_cursor, ModelWeightForElasticsearchRecord};
use storyteller_root::get_storyteller_rust_root;
pub async fn create_dimensional_media_file_documents(
mysql: &Pool<MySql>,
elasticsearch: &Elasticsearch
) -> AnyhowResult<()> {
info!("Create dimensional media file documents.");
// TODO(bt, 2024-01-10): expose this as a CLI flag
const DELETE_EXISTING_INDEX : bool = true;
const PAGE_SIZE : usize = 1000;
create_media_file_index(&elasticsearch, DELETE_EXISTING_INDEX).await?;
let mut cursor = 0;
loop {
info!("Cursor: {cursor}");
let results = list_media_files_for_elastic_search_backfill_using_cursor(ListArgs {
mysql_pool: mysql,
page_size: PAGE_SIZE,
cursor,
maybe_filter_engine_categories: Some(&HashSet::from_iter(vec![
MediaFileEngineCategory::Animation,
MediaFileEngineCategory::Character,
MediaFileEngineCategory::Creature,
MediaFileEngineCategory::Expression,
MediaFileEngineCategory::ImagePlane,
MediaFileEngineCategory::Location,
MediaFileEngineCategory::Object,
MediaFileEngineCategory::Scene,
MediaFileEngineCategory::SetDressing,
MediaFileEngineCategory::Skybox,
MediaFileEngineCategory::VideoPlane,
])),
maybe_filter_media_types: Some(&HashSet::from_iter(vec![
// Engine types
MediaFileType::Csv,
MediaFileType::Fbx,
MediaFileType::Glb,
MediaFileType::SceneJson,
// Image types
MediaFileType::Gif,
MediaFileType::Jpg,
MediaFileType::Png,
])),
maybe_filter_media_classes: Some(&HashSet::from_iter(vec![
MediaFileClass::Image,
MediaFileClass::Dimensional,
])),
}).await?;
info!("Results length: {}", results.len());
if results.is_empty() {
info!("No more results at cursor {cursor}");
break;
}
let maybe_last_id = results.last().map(|result| result.id);
match maybe_last_id {
Some(last_id) => cursor = last_id as usize,
None => {
warn!("No final ID at cursor {cursor}");
break;
}
}
for result in results {
create_document_from_record(elasticsearch, result).await?;
}
}
Ok(())
}
async fn create_document_from_record(elasticsearch: &Elasticsearch, record: MediaFileForElasticsearchRecord) -> AnyhowResult<()> {
info!("Create record for {:?}", record.token);
let is_deleted = record.user_deleted_at.is_some() || record.mod_deleted_at.is_some();
let document = MediaFileDocument {
token: record.token,
media_class: record.media_class,
media_type: record.media_type,
maybe_media_subtype: record.maybe_media_subtype,
maybe_engine_category: record.maybe_engine_category,
maybe_animation_type: record.maybe_animation_type,
maybe_mime_type: record.maybe_mime_type,
public_bucket_directory_hash: record.public_bucket_directory_hash,
maybe_public_bucket_prefix: record.maybe_public_bucket_prefix,
maybe_public_bucket_extension: record.maybe_public_bucket_extension,
creator_set_visibility: record.creator_set_visibility,
maybe_title: record.maybe_title.clone(),
maybe_title_as_keyword: record.maybe_title,
maybe_cover_image_media_file_token: record.maybe_cover_image_media_file_token,
maybe_cover_image_public_bucket_hash: record.maybe_cover_image_public_bucket_hash,
maybe_cover_image_public_bucket_prefix: record.maybe_cover_image_public_bucket_prefix,
maybe_cover_image_public_bucket_extension: record.maybe_cover_image_public_bucket_extension,
maybe_creator_user_token: record.maybe_creator_user_token,
maybe_creator_username: record.maybe_creator_username,
maybe_creator_display_name: record.maybe_creator_display_name,
maybe_creator_gravatar_hash: record.maybe_creator_gravatar_hash,
is_featured: record.is_featured,
created_at: record.created_at,
updated_at: record.updated_at,
user_deleted_at: record.user_deleted_at,
mod_deleted_at: record.mod_deleted_at,
is_deleted,
};
let op : BulkOperation<_> = BulkOperation::index(&document)
.id(document.get_document_id())
.into();
let response = elasticsearch
.bulk(BulkParts::Index(MEDIA_FILE_INDEX))
.body(vec![op])
.send()
.await?;
let json: Value = response.json().await?;
let had_errors = json["errors"].as_bool().unwrap_or(false);
if had_errors {
let failed: Vec<&Value> = json["items"]
.as_array()
.unwrap()
.iter()
.filter(|v| !v["error"].is_null())
.collect();
// TODO: retry failures
error!("Errors during indexing. Failures: {}", failed.len());
}
Ok(())
}
// NB: Adapted from elasticsearch crate examples source
async fn create_media_file_index(client: &Elasticsearch, delete_existing: bool) -> AnyhowResult<()> {
info!("Creating model media file index...");
let index_path = get_storyteller_rust_root()
.join("_elasticsearch/index_definitions/media_files_v1.json");
info!("Reading index file: {:?}", index_path);
let index_definition = read_to_string(index_path)?;
create_index_if_not_exists(CreateIndexArgs {
client,
index_name: MEDIA_FILE_INDEX,
index_definition: &index_definition,
delete_existing,
}).await?;
Ok(())
}
@@ -0,0 +1,2 @@
pub mod create_dimensional_media_file_documents;
pub mod test_search_media_files_documents;
@@ -0,0 +1,30 @@
use std::collections::HashSet;
use std::iter::FromIterator;
use elasticsearch::Elasticsearch;
use elasticsearch_schema::searches::search_media_files::{search_media_files, SearchArgs};
use enums::by_table::media_files::media_file_class::MediaFileClass;
use errors::AnyhowResult;
pub async fn test_search_media_files(client: &Elasticsearch) -> AnyhowResult<()> {
let results = search_media_files(SearchArgs {
search_term: "cac",
is_featured: None,
maybe_creator_user_token: None,
maybe_media_classes: Some(HashSet::from_iter(vec![
MediaFileClass::Dimensional,
MediaFileClass::Image,
])),
maybe_media_types: None,
maybe_engine_categories: None,
client,
}).await?;
for result in results {
println!("Result: {:#?}", result);
}
Ok(())
}
@@ -1,2 +1,3 @@
pub mod create_all_model_weight_documents;
pub mod create_all_tts_documents;
pub mod create_all_tts_documents;
pub mod media_files;
@@ -35,11 +35,11 @@ my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
# External
clap = "4.4.8"
log = "0.4.14"
strum = { version = "0.25", features = ["derive"] }
strum = { version = "0.26", features = ["derive"] }
tempdir = "0.3.7"
# Async + clients
tokio = { version = "1.34.0", features = ["macros"] }
tokio = { version = "1.38.0", features = ["macros"] }
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
# Serialization
@@ -75,6 +75,8 @@ pub fn get_bucket_client(env_var_suffix: &str) -> AnyhowResult<BucketClient> {
let region_name = easyenv::get_env_string_required(&format!("REGION_NAME_{env_var_suffix}"))?;
let bucket_name = easyenv::get_env_string_required(&format!("BUCKET_NAME_{env_var_suffix}"))?;
let s3_compatible_endpoint_url = easyenv::get_env_string_or_default(
&format!("S3_COMPATIBLE_ENDPOINT_URL_{env_var_suffix}"), "https://storage.googleapis.com");
// NB: Long timeout for dev rust builds to upload to cloud buckets.
// Unoptimized binaries sometimes take a lot of time to upload, presumably due to unoptimized code.
let bucket_timeout = easyenv::get_env_duration_seconds_or_default(
@@ -87,6 +89,7 @@ pub fn get_bucket_client(env_var_suffix: &str) -> AnyhowResult<BucketClient> {
&secret_key,
&region_name,
&bucket_name,
&s3_compatible_endpoint_url,
None,
Some(bucket_timeout),
)?)
+3 -3
View File
@@ -29,10 +29,10 @@ log = "0.4.14"
# Actix
actix-cors = "0.6.4"
actix-http = "3.4.0"
actix-web = "4.4.0"
actix-http = "3.7.0"
actix-web = "4.7.0"
url = { version = "2.5.0", features = [] }
[dev-dependencies]
actix-rt = "2.9.0"
actix-rt = "2.10.0"
speculoos = "0.11.0" # Fluent assertions
@@ -1,5 +1,5 @@
pub (crate) mod development_only;
pub (crate) mod fakeyou;
pub (crate) mod gottagofast;
pub (crate) mod storyteller_studio;
pub (crate) mod legacy;
pub (crate) mod storyteller;
@@ -2,14 +2,17 @@ use actix_cors::Cors;
use crate::util::netlify_branch_domain_matches::netlify_branch_domain_matches;
pub fn add_gotta_go_fast_test_branches(cors: Cors, _is_production: bool) -> Cors {
cors.allowed_origin("http://localhost:5173")
.allowed_origin_fn(|origin, _req_head| {
netlify_branch_domain_matches(origin, "pipeline-gottagofast.netlify.app")
})
pub fn add_storyteller_studio(cors: Cors, _is_production: bool) -> Cors {
cors.allowed_origin("https://studio.storyteller.ai")
.allowed_origin("https://studio-staging.studio.storyteller.ai")
.allowed_origin("https://studio-testing.studio.storyteller.ai")
.allowed_origin_fn(|origin, _req_head| {
netlify_branch_domain_matches(origin, "storytellerstudio.netlify.app")
})
.allowed_origin_fn(|origin, _req_head| {
netlify_branch_domain_matches(origin, "pipeline-gottagofast.netlify.app")
})
.allowed_origin("http://localhost:5173")
}
#[cfg(test)]
@@ -54,17 +57,39 @@ mod tests {
#[actix_rt::test]
async fn studio_main() {
let production_cors = build_cors_config(ServerEnvironment::Production);
assert_origin_ok(&production_cors, "https://storytellerstudio.netlify.app").await;
assert_origin_ok(&production_cors, "https://studio.storyteller.ai").await;
assert_origin_invalid(&production_cors, "https://studiofake.storyteller.ai").await;
}
#[actix_rt::test]
async fn studio_branch_deploy() {
async fn studio_staging() {
let production_cors = build_cors_config(ServerEnvironment::Production);
assert_origin_ok(&production_cors, "https://studio-staging.studio.storyteller.ai").await;
assert_origin_invalid(&production_cors, "https://studio-staging-fake.studio.storyteller.ai").await;
}
#[actix_rt::test]
async fn studio_testing() {
let production_cors = build_cors_config(ServerEnvironment::Production);
assert_origin_ok(&production_cors, "https://studio-testing.studio.storyteller.ai").await;
assert_origin_invalid(&production_cors, "https://studio-testing-fake.studio.storyteller.ai").await;
}
#[actix_rt::test]
async fn studio_netlify() {
let production_cors = build_cors_config(ServerEnvironment::Production);
assert_origin_ok(&production_cors, "https://storytellerstudio.netlify.app").await;
assert_origin_invalid(&production_cors, "https://storytellerstudiofake.netlify.app").await;
}
#[actix_rt::test]
async fn studio_netlify_branch_deploy() {
let production_cors = build_cors_config(ServerEnvironment::Production);
assert_origin_ok(&production_cors, "https://foo--storytellerstudio.netlify.app").await;
}
#[actix_rt::test]
async fn studio_deploy_preview() {
async fn studio_netlify_deploy_preview() {
let production_cors = build_cors_config(ServerEnvironment::Production);
assert_origin_ok(&production_cors, "https://deploy-preview-123--storytellerstudio.netlify.app").await;
}
+2 -2
View File
@@ -5,7 +5,7 @@ use reusable_types::server_environment::ServerEnvironment;
use crate::configs::development_only::add_development_only;
use crate::configs::fakeyou::{add_fakeyou, add_fakeyou_dev_proxy};
use crate::configs::gottagofast::add_gotta_go_fast_test_branches;
use crate::configs::storyteller_studio::add_storyteller_studio;
use crate::configs::legacy::{add_legacy_storyteller_stream, add_legacy_trumped, add_legacy_vocodes, add_power_stream};
use crate::configs::storyteller::{add_storyteller, add_storyteller_dev_proxy};
@@ -34,7 +34,7 @@ fn do_build_cors_config(is_production: bool) -> Cors {
cors = add_fakeyou_dev_proxy(cors, is_production);
cors = add_storyteller(cors, is_production);
cors = add_storyteller_dev_proxy(cors, is_production);
cors = add_gotta_go_fast_test_branches(cors, is_production);
cors = add_storyteller_studio(cors, is_production);
// Legacy
cors = add_legacy_trumped(cors, is_production);
+3 -3
View File
@@ -24,11 +24,11 @@ errors = { path = "../../lib/errors" }
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
# Actix
actix-http = "3.4.0"
actix-rt = "2.9.0"
actix-http = "3.7.0"
actix-rt = "2.10.0"
actix-service = "2.0.2"
actix-utils = "3.0.1"
actix-web = "4.4.0"
actix-web = "4.7.0"
# IPv4 and v6 CIDRs (crate has few dependencies)
cidr-utils = "0.5.11"
@@ -32,13 +32,13 @@ my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
# External
anyhow = "1.0.86"
log = "0.4.14"
env_logger = "0.10.1"
env_logger = "0.11.3"
async-trait = "0.1.75"
# The "never-encode-slash" feature seems to have been removed:
# https://github.com/durch/rust-s3/pull/254
rust-s3 = { version = "0.33.0" }
rust-s3 = { version = "0.34.0" }
# Runtime
# NB: We switched to Tokio from `async-std` for broader ecosystem support.
tokio = { version = "1.34.0", features = ["macros"] }
tokio = { version = "1.38.0", features = ["macros"] }
@@ -47,6 +47,7 @@ impl BucketClient {
secret_key: &str,
region_name: &str,
bucket_name: &str,
s3_endpoint: &str,
optional_bucket_root: Option<&str>,
// See underlying docs for timeout details.
bucket_request_timeout: Option<Duration>,
@@ -63,14 +64,14 @@ impl BucketClient {
// NB: The GCS buckets aren't supported by default.
let region = Region::Custom {
region: region_name.to_owned(),
endpoint: "https://storage.googleapis.com".to_owned(),
endpoint: s3_endpoint.to_owned(),
};
let mut bucket = Bucket::new(&bucket_name, region, credentials)?;
bucket.set_request_timeout(bucket_request_timeout);
bucket.set_path_style();
bucket.set_subdomain_style();
// bucket.set_subdomain_style();
let optional_bucket_root = optional_bucket_root.map(|s| s.to_string());

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