Saltar al contenido principal

alphaswarm-worker

Celery orchestration worker pod that drains the light / coordination queues produced by alphaswarm-core.

As of the Phase 4c worker/executor split it has its own slim image (target worker) carrying only the task-dispatch + lineage surface — not the API stage's visualization / dev / Dash deps it used to inherit. Heavy compute (backtest / training / ML / agents / factors / RAG) is offloaded to the sibling alphaswarm-executor. See worker vs executor images for the full rationale and dependency matrix.

Identity

FieldValue
Service idalphaswarm-worker
Roleworker
Packagealphaswarm/ (tasks under alphaswarm/tasks/*.py)
Image (key)worker
Built fromalphaswarm_platform/Dockerfile (target worker, multi-arch) or the standalone build/docker/alphaswarm_worker/Dockerfile

Wire

FieldValue
Protocolnone (no HTTP listener)
HealthCelery broker connection probe + Prometheus metrics on :9100 (when enabled)
Public URL
Brokerredis://redis:6379/0
Result backendredis://redis:6379/1

Deployment surfaces

SurfaceWhere
Composeservice worker in alphaswarm_platform/compose/docker-compose.yml; alphaswarm-worker in deployments/compose/docker-compose.local.yml
Kustomizedeployments/kubernetes/base/alphaswarm-worker/ — Deployment + HPA + PDB
AQP CRfolded into AQPMonolith (spec.workers.queues)
Terraform modulealphaswarm_platform/terraform/modules/faas/ — Celery + KEDA per-queue ScaledObjects

Queue families

The orchestration worker drains the light / coordination queues only. The heavy compute queues (backtest, training, ml, agents, factors, rag) are drained by alphaswarm-executor. KEDA scales each queue family independently. Default queue map:

QueueDrivesScale-to-zeroNotes
defaultmisc tasks, callbacks, lookupsyesalways-on min=1 in prod
paperpaper trading session ticksnosub-second latency required
terraformTerraformRuntime celery wrappersyes
ingestionAirbyte / Dagster / connector pullsnouses long-lived workers
workflowsWorkflowRuntime orchestrationyes
hftHFT hot-path event handlersnopinned to hft-nodes (compose/legacy)
nota

The faas KEDA module keys per-queue Deployments off local.heavy_queues — heavy queues run the alphaswarm-executor image, everything else runs this alphaswarm-worker image. The two image sets never share a queue.

Dependencies

Upstream:

  • redis — broker + result backend.
  • postgres — task lookups, ledger writes.
  • alphaswarm-core — progress emit callbacks, lookup APIs.
  • All data-plane services the alphaswarm-core pod depends on (the same code paths run inside Celery).

Downstream:

  • Beat schedules tasks; the worker is the consumer.
  • HFT-tagged tasks land on the hft-nodes/ workload (PTP-tuned).

Operations

  • Scaling: KEDA ScaledObject per queue; idle queues scale to zero. The per-queue min/max lives in the faas Terraform module.
  • Concurrency: the orchestration worker runs concurrency 4 (light, IO-bound dispatch work); 1 for HFT (single-threaded pinning).
  • Drain on shutdown: terminationGracePeriodSeconds: 600 so in-flight tasks complete; preStop sends SIGTERM to Celery.
  • Audit: WorkloadRuntime actions land workload_runs rows; the worker pod respects the kill-switch Redis key the same way the API does.

See also