Milestone (c): worker and downloads with live progress

- Worker queue with per-model exclusivity and MAX_CONCURRENT_DOWNLOADS,
  spawns `hf download --revision <sha> --local-dir ... --include <exact paths>`
  with HF_TOKEN via env only
- Progress from bytes on disk (final + .incomplete files matched by etag),
  per job and per file, with speed and ETA; post-download size/etag check
- Job logs (sanitized), cancel, graceful interrupt on shutdown,
  partial-file cleanup (hf 2.1.1 does not resume partials)
- Single-worker DB lease, free-space check
- SSE live updates for library, model and job pages
- Dockerfile + compose.yaml (web, worker, data/models volumes)
- HF_HUB_DISABLE_XET default on for measurable progress

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pascal LinxweilerandClaude Opus 5.5 committed 2026-10-05 16:57:12 +02:00
1 parent 8f7ac60ccf
commit 49440154a2
42 files changed
+2974 -110

No files matched your search

+2
View File
@@ -239,6 +239,8 @@ export const jobLogs = sqliteTable(
export const workerState = sqliteTable("worker_state", {
id: text("id").primaryKey(), // "worker"
/** Random per process; the row acts as a lease so only one worker runs at a time. */
instanceId: text("instance_id"),
pid: integer("pid"),
hfVersion: text("hf_version"),
/** Free/total bytes on the filesystem holding MODELS_DIR (the web app has no access to it). */