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:
1 parent
8f7ac60ccf
commit
49440154a2
42 files changed
+2974
-110
No files matched your search
@@ -0,0 +1,44 @@
|
||||
name: kaname
|
||||
|
||||
x-app: &app
|
||||
image: kaname:local
|
||||
build: .
|
||||
env_file: .env
|
||||
# Container paths override whatever local-dev paths are in .env.
|
||||
environment:
|
||||
DATABASE_URL: file:/data/app.db
|
||||
MODELS_DIR: /models
|
||||
HF_HOME: /data/hf-home
|
||||
restart: unless-stopped
|
||||
init: true # reaps child processes (hf) and forwards signals
|
||||
|
||||
services:
|
||||
worker:
|
||||
<<: *app
|
||||
command: ["node", "dist/worker.mjs"]
|
||||
volumes:
|
||||
- data:/data
|
||||
- models:/models
|
||||
# Give running downloads time to stop cleanly (they are marked "interrupted").
|
||||
stop_grace_period: 20s
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "find /tmp/kaname-worker-alive -mmin -1 | grep -q ."]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
start_period: 30s
|
||||
retries: 3
|
||||
|
||||
web:
|
||||
<<: *app
|
||||
command: ["node_modules/.bin/next", "start"]
|
||||
ports:
|
||||
- "${WEB_PORT:-3000}:3000"
|
||||
volumes:
|
||||
- data:/data
|
||||
depends_on:
|
||||
worker:
|
||||
condition: service_healthy # worker applies DB migrations on startup
|
||||
|
||||
volumes:
|
||||
data: # SQLite + hf home; keep on local disk (SQLite and NFS don't mix)
|
||||
models: # downloaded models; will become an NFS mount from TrueNAS
|
||||
Reference in new issue
Block a user