Skip to content

ONNX Celery worker ping flow #10

@raphy0316

Description

@raphy0316

Summary

Establish the initial Celery infrastructure for the ONNX Runner.
Ensure that the ONNX worker can successfully receive and execute tasks from the Redis queue using a simple onnx.test_ping task and a corresponding debug endpoint.

Why

All subsequent phases of the model execution pipeline (Phase 4–10) depend on a functioning Celery worker system.
Before implementing run logic, adapters, metrics, and storage integration, we must guarantee that:

  • Celery can start correctly
  • The worker can register tasks
  • Redis broker/backend communication works
  • API → Redis → Worker → Backend flow is stable

This is a foundational milestone for the entire Runner subsystem.

In Scope

  • Initialize ONNX Runner Celery application
  • Configure Celery queue name via QUEUE_ONNX
  • Implement onnx.test_ping task
  • Ensure worker correctly imports tasks (absolute imports)
  • Configure worker startup command (celery -A worker -Q ${QUEUE_ONNX})
  • Add debug endpoints:
    • /debug/onnx-ping
    • /debug/onnx-ping/{task_id}
  • Verify end-to-end flow using test task

Out of Scope

  • run_experiment() implementation (Phase 4)
  • DRY_RUN lifecycle logic (Phase 5)
  • ONNX adapter or runtime execution (Phase 8–10)
  • Metrics implementation (Phase 6)

Acceptance Criteria

  • ONNX worker container successfully loads Celery app without errors
  • Redis broker/backend connections succeed
  • Calling /debug/onnx-ping returns a valid task_id
  • Worker logs show receipt and execution of the test task:
    • [ONNX-RUNNER] test_ping called ...
  • /debug/onnx-ping/{task_id} returns:
    • state: SUCCESS
    • result containing the echoed payload

Tasks

  • Implement onnx.test_ping task (task.py)
  • Update worker.py to import task module using absolute import (import task)
  • Fix worker command to load Celery app properly (celery -A worker worker -l info -Q ${QUEUE_ONNX})
  • Add /debug/onnx-ping endpoint to dispatch test task
  • Add /debug/onnx-ping/{task_id} endpoint to inspect task result
  • Validate worker logs for task execution
  • Add developer documentation for Celery + Redis flow

Labels

  • backend
  • celery
  • runner
  • phase-1
  • feature

Assignees

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions