Skip to content

Redis rq - #13

Merged
BehRoooz merged 26 commits into
mainfrom
redis-rq
Jul 23, 2026
Merged

Redis rq#13
BehRoooz merged 26 commits into
mainfrom
redis-rq

Conversation

@BehRoooz

Copy link
Copy Markdown
Owner

Summary

  • Migrate embedding and training async jobs from SQLite + in-process poll loops to durable Postgres (proseqgo_jobs) and Redis/RQ.
  • APIs enqueue jobs and return immediately; dedicated embedding-worker / trainer-worker containers run GPU work, update Postgres progress/status, and recover orphaned jobs after worker crash.
  • Compose adds AOF Redis, a Postgres init hook, and job/env wiring.
  • Monitoring scrapes workers and redis_exporter, with Grafana panels and alerts for Redis down and worker backlog.
  • Smoke/acceptance checks (including crash recovery) live under tests/smoke/.

BehRoooz added 26 commits July 23, 2026 00:03
… failures from retryable runtime errors so RQ Retry only requeues blips.
Keep the JobStore API but store lifecycle and artifact metadata in proseqgo_jobs instead of SQLite.
Centralize Queue.enqueue(process_job), job_timeout, Retry, and the failure callback for durable job ids.
Create the Postgres row, enqueue to Redis, and expose queue metrics; remove startup/shutdown of the polling daemon.
Run embedding/training work under RQ, update Postgres progress/status, and raise transient errors for retry instead of polling SQLite.
Starts a Prometheus metrics HTTP server, requeues orphaned started jobs
(from a previous SIGKILL), then runs an RQ worker with graceful SIGTERM.
Describe the API→Postgres→Redis→worker flow, crash recovery, and env vars after the queue migration.
Expose JOBS_DATABASE_URL, REDIS_URL, queue name, timeouts, and artifact-root overrides for the async worker stack.
Separate non-retryable failures from retryable runtime errors so RQ Retry only requeues blips.
Keep the JobStore API but store lifecycle and artifact metadata in proseqgo_jobs instead of SQLite.
Write queued rows to Postgres, enqueue process_job, refresh queue metrics, and drop the in-process daemon loop.
Centralize Queue.enqueue with job_timeout, Retry, and the failure callback for durable job ids.
Serve worker metrics, requeue started jobs after SIGKILL, and run the embedding-jobs RQ worker.
Drive embedding work from RQ, update Postgres progress/status, and raise transient errors for retry.
Describe API→Postgres→Redis→worker flow, crash recovery, and storage layout after the queue migration.
Create the durable job-history DB on first Postgres volume init, separate from MLflow's mlflow database.
Mount the jobs DB init script, run Redis with AOF, split embedding/training APIs from GPU workers, and wire JOBS_DATABASE_URL plus Redis for async dispatch.
Add Prometheus targets for embedding-worker, trainer-worker, and Redis so queue and broker health are visible beside the APIs.
Extend target-down coverage to workers/redis_exporter and add critical rules for embedding-worker down with a non-empty RQ queue.
Show cafa5_rq_queue_length and redis_memory_used_bytes on the domain pipelines dashboard after the Redis/RQ migration.
Relocate embedding/MLflow smoke scripts out of scripts/ so pipeline CLIs stay separate from acceptance checks.
Add the smoke/acceptance directory to the repo tree so verification scripts are easy to find.
@BehRoooz
BehRoooz merged commit c7d2f4f into main Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant