Commit History
2 days ago
-
fix(entrypoint): start the celery worker only when CELERY_BULK_ENABLED=true — a misconfigured rediss:// broker caused a pointless 5s crash-restart loop while bulk actually runs sync Running
Z User4c14cbd
30 days ago
-
fix(entrypoint): always bind uvicorn to 7860 (HF Spaces proxy port)
The PORT secret is 8000, so uvicorn bound 8000 and the platform never saw the app come up -> stuck APP_STARTING. Spaces always route to 7860. Co-Authored-By: Claude Code <noreply@anthropic.com>fdadce4 -
fix(entrypoint): PING-verify Space secret Redis URLs before trusting them
A stale secret (expired Upstash DB, NXDOMAIN) shadowed the local sidecar and crash-looped the Celery worker -> RUNTIME_ERROR. Dead secrets are now ignored and the sidecar takes over. Co-Authored-By: Claude Code <noreply@anthropic.com>d4811ce -
fix: run local redis-server sidecar instead of fragile Upstash provisioning
Diagnosed via Space run logs: Celery worker crash-looped every ~9s ("broker_connection_retry_on_startup=False ... Shutting down") because the Upstash start-redis provisioning did not succeed from the Space network, so the broker fell back to localhost with nothing listening and the container never became READY. - Dockerfile(s): install redis-server; entrypoint starts a volatile local sidecar (port 6379, 120mb LRU) and wires cache/broker/result to redis://127.0.0.1:6379/{0,1,2} after a PING gate - Space secrets still win (REDIS_URL/CELERY_BROKER_URL/CELERY_RESULT_BACKEND) - Upstash free-tier provisioning kept only as last-resort fallback - Celery: retry broker connect on startup (survive sidecar cold start) - Entrypoint supervisor: restart sidecar/worker if they die; skip worker entirely when no broker exists Co-Authored-By: Claude Code <noreply@anthropic.com>dcabaa0 -
feat: container entrypoint provisions Redis + supervises Celery worker
- entrypoint.py: resolves REDIS_URL/CELERY_BROKER_URL/CELERY_RESULT_BACKEND from env (Space secrets win), else provisions Upstash free-tier DBs with deterministic v4-form idempotency keys (restart-stable, re-fetchable); runs Celery worker + uvicorn, restarts worker on death. - celery_tasks.py: explicit broker_use_ssl/redis_backend_use_ssl with CERT_REQUIRED for rediss:// brokers (TLS verification stays ON). - Dockerfile / Dockerfile.hf: CMD -> python entrypoint.py. Co-Authored-By: Claude Code <noreply@anthropic.com>45dd526