Commit f83ad8c
Redis queue system for online mode (#305)
* Add Redis queue implementation plan for online mode
This document outlines the architecture and implementation steps for
introducing a Redis-based job queueing system to online deployments:
- Uses RQ (Redis Queue) for task management
- Docker Compose additions for Redis, worker, and dashboard services
- New QueueManager class for queue interactions
- Worker tasks module for background execution
- Health monitoring utilities
- Backward compatible with local mode (multiprocessing fallback)
* Simplify to single-container architecture for Redis queue
Update implementation plan to run Redis server and RQ worker within the
same Docker container as the Streamlit app:
- Redis server runs as background process via entrypoint script
- RQ worker runs in same container with identical environment
- No docker-compose orchestration complexity
- All communication via localhost
- Optional supervisord config for robust process management
- Simplified deployment and debugging
* Expand implementation plan with offline mode, worker config, and UX details
- Add "Design Principles" section explaining plug & play architecture
- Document offline mode (Windows installer) compatibility - zero changes needed
- Add comprehensive "Configuring Worker Count" section with multiple methods
- Add "User Experience: Queue Status Display" section showing what users see
- Add "Sidebar Metrics" section for queue monitoring alongside CPU/RAM
- Include code examples for all UI components
* Implement Redis queue system for online mode workflows
New files:
- src/workflow/QueueManager.py: Redis queue interaction layer
- src/workflow/tasks.py: Worker task definitions for RQ
- src/workflow/health.py: Queue health check utilities
Modified files:
- Dockerfile: Install Redis server, add entrypoint for Redis/RQ workers
- requirements.txt: Add redis and rq packages
- settings.json: Add queue_settings configuration
- src/workflow/WorkflowManager.py: Add queue support with local fallback
- src/workflow/StreamlitUI.py: Add queue status display in execution section
- src/common/common.py: Add sidebar queue metrics for online mode
Features:
- Automatic queue mode in online deployment, local mode unchanged
- Queue position and progress display when workflows are queued
- Sidebar metrics showing worker utilization and queue depth
- Configurable worker count via RQ_WORKER_COUNT env variable
- Graceful fallback to multiprocessing if Redis unavailable
* Update settings.json
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix redis queue handling
* minor fixes
* minor fixes
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 2ee6466 commit f83ad8c
File tree
11 files changed
+2563
-38
lines changed- docs
- src
- common
- python-tools
- workflow
11 files changed
+2563
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
| |||
141 | 149 | | |
142 | 150 | | |
143 | 151 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
149 | 186 | | |
150 | 187 | | |
151 | 188 | | |
| |||
0 commit comments