#134 Implement Worker Registration and Capacity Management System
Description
EditImplement enterprise-grade worker registration where workers:
1. Ping DB every 30 seconds announcing availability
2. Check allowed batch_size from DB (0 = paused, don't pick up work)
3. Enable admins to control capacity per worker/machine
4. Track worker presence (know which workers are online)
5. Support future brain component for automated capacity allocation
IMPLEMENTATION:
- Phase 1 (Now): Core registration with worker_registry table, heartbeat, capacity control
- Phases 2-4 (Future): Worker groups, affinity rules, brain component
FILES TO CREATE/MODIFY:
- engine/migrations/sql/highway_0.0.47_worker_registration.sql (NEW)
- engine/services/worker_registration_service.py (NEW)
- engine/cli/worker.py (modify)
- api/blueprints/v1/workers.py (NEW)
- api/blueprints/v1/__init__.py (modify)
KEY DESIGN:
- 30s heartbeat interval, 90s timeout (3 missed = offline)
- UPSERT-based idempotent registration
- Graceful degradation: if DB unavailable, use CLI default batch_size
- Status states: online, offline, paused, draining
- Backward compatible: workers without registration still work
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...