cmake/ui : improve UI build to better handle many assets#24551
Conversation
IMO this is mostly to circumvent the fact that some asset files now have hash in the file name. I think the original PR add quite a lot of code to handle it which is quite overkill. I'm trying to simply the whole thing in #24550 , simply rename the file back to static Would you mind having a look on my version instead? It's still missing the |
Well, yes but also there's over 60 files to embed now. I think enumerating them seems error-prone. I would rather just serve up whatever the Vite build spits out. That said, we'll do whatever you think is best. |
ah yes that's a good point, I didn't notice that. It's fine to keep the ARCHIVE_EXTRACT then I think I've done my work on the other PR, would you mind adapting your change accordingly? you can also push directly to my PR if you want, I'm going AFK now |
Overview
The #23871 PR added a slew of new assets. This PR updates the asset embedding to better handle this. Additionally, there are a few bug fixes in here.
Additional information
ui-build.yml
LLAMA_BUILD_VERSIONfromLLAMA_UI_VERSIONdist.tar.gzwith an accompanyingdist.tar.gz.sha256checksum file.scripts/ui-assets.cmake
file(ARCHIVE_EXTRACT)ASSETSwithREQUIRED_ASSETSused only for validationdist.tar.gzfrom HF bucket and extract instead of individually downloading every asset file.tools/ui/CMakeLists.txt
LLAMA_UI_HF_BUCKETto include the namespace (ggml-org/llama-ui). Did this so I can test against my own bucket.tools/ui/embed.cpp
tools/server/server-http.cpp
tools/ui/scripts/vite-plugin-build-info.ts
b0000, so abuild.jsonfile is always created. The lack of the file fails the asset validation checks in cmake.On top of this, I am further refactoring the build to better align with @ngxson's vision where
npm buildis an opt-in fallback.Requirements