Commit 75cae60
committed
build(webui): build llama.cpp WebUI once in CI, share to all native builds
Implements the build-once-share-artifact approach for embedding the llama.cpp Svelte
WebUI into libjllama, so the in-process server (server-http.cpp) serves the real UI
instead of the empty-asset stub. The repo commits no build outputs, so the WebUI is
produced per-pipeline and never checked in (same policy as the native libs).
CI (.github/workflows/publish.yml):
- New build-webui job (ubuntu; the only job that runs npm): resolves the pinned
b<nnnn> tag from CMakeLists.txt GIT_TAG, sparse-checks-out ggml-org/llama.cpp@<tag>
tools/ui, runs the upstream Svelte build (npm ci && npm run build), gzips dist/
(LLAMA_UI_GZIP parity), builds the self-contained llama-ui-embed host tool (plain
C++17, no npm) and runs it to produce the platform-independent webui-generated/
ui.cpp + ui.h, uploaded as the webui-generated artifact.
- All 10 release-artifact build jobs now use needs:[startgate, build-webui] and
download the artifact into webui-generated/ before building. npm never runs in the
dockcross cross-compilers (no node) or per-platform — only once, in one job.
CMake (CMakeLists.txt "WebUI assets" block):
- When webui-generated/ui.cpp + ui.h are present, compile ui.cpp in and add its dir
to the include path; the generated ui.h #defines LLAMA_UI_HAS_ASSETS, activating
server-http.cpp's static-asset routes (compiled out under the stub). When absent,
fall back to the empty-asset stub webui_stub/ui.h so local builds and any job
without the artifact still build and run (no embedded UI).
The WebUI version auto-follows GIT_TAG, so a llama.cpp bump needs no extra step.
webui-generated/ is git-ignored; CLAUDE.md documents the pipeline + a local recipe.
Verified locally (Linux x86_64) with the real llama-ui-embed tool (no npm) on a
synthetic 9-asset dist: generated ui.cpp/ui.h carry LLAMA_UI_HAS_ASSETS + use_gzip
(9 assets); jllama rebuilds with server-http.cpp's asset routes compiled in, ui.cpp
compiled, libjllama.so linked (llama_ui_get_assets/find_asset defined, 0 undefined);
NativeLibraryLoadSmokeTest passes; removing webui-generated/ -> CMake reports the stub
fallback and jllama still builds. publish.yml parses (pyyaml); exactly the 10 native
build jobs gate on build-webui.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JdLpWD8nedY7LwNnHefZLF1 parent c10a6ec commit 75cae60
4 files changed
Lines changed: 218 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
83 | 164 | | |
84 | 165 | | |
85 | | - | |
| 166 | + | |
86 | 167 | | |
87 | 168 | | |
88 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
89 | 175 | | |
90 | 176 | | |
91 | 177 | | |
| |||
106 | 192 | | |
107 | 193 | | |
108 | 194 | | |
109 | | - | |
| 195 | + | |
110 | 196 | | |
111 | 197 | | |
112 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
113 | 204 | | |
114 | 205 | | |
115 | 206 | | |
| |||
130 | 221 | | |
131 | 222 | | |
132 | 223 | | |
133 | | - | |
| 224 | + | |
134 | 225 | | |
135 | 226 | | |
136 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
137 | 233 | | |
138 | 234 | | |
139 | 235 | | |
| |||
154 | 250 | | |
155 | 251 | | |
156 | 252 | | |
157 | | - | |
| 253 | + | |
158 | 254 | | |
159 | 255 | | |
160 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
161 | 262 | | |
162 | 263 | | |
163 | 264 | | |
| |||
178 | 279 | | |
179 | 280 | | |
180 | 281 | | |
181 | | - | |
| 282 | + | |
182 | 283 | | |
183 | 284 | | |
184 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
185 | 291 | | |
186 | 292 | | |
187 | 293 | | |
| |||
198 | 304 | | |
199 | 305 | | |
200 | 306 | | |
201 | | - | |
| 307 | + | |
202 | 308 | | |
203 | 309 | | |
204 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
205 | 316 | | |
206 | 317 | | |
207 | 318 | | |
| |||
229 | 340 | | |
230 | 341 | | |
231 | 342 | | |
232 | | - | |
| 343 | + | |
233 | 344 | | |
234 | 345 | | |
235 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
236 | 352 | | |
237 | 353 | | |
238 | 354 | | |
| |||
260 | 376 | | |
261 | 377 | | |
262 | 378 | | |
263 | | - | |
| 379 | + | |
264 | 380 | | |
265 | 381 | | |
266 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
267 | 388 | | |
268 | 389 | | |
269 | 390 | | |
| |||
289 | 410 | | |
290 | 411 | | |
291 | 412 | | |
292 | | - | |
| 413 | + | |
293 | 414 | | |
294 | 415 | | |
295 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
296 | 422 | | |
297 | 423 | | |
298 | 424 | | |
| |||
346 | 472 | | |
347 | 473 | | |
348 | 474 | | |
349 | | - | |
| 475 | + | |
350 | 476 | | |
351 | 477 | | |
352 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
353 | 484 | | |
354 | 485 | | |
355 | 486 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
124 | 168 | | |
125 | 169 | | |
126 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
294 | 296 | | |
295 | 297 | | |
296 | 298 | | |
| |||
315 | 317 | | |
316 | 318 | | |
317 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
318 | 339 | | |
319 | 340 | | |
320 | 341 | | |
321 | | - | |
322 | | - | |
323 | 342 | | |
324 | 343 | | |
325 | 344 | | |
| 345 | + | |
| 346 | + | |
326 | 347 | | |
327 | 348 | | |
328 | 349 | | |
| |||
0 commit comments