Step
The otter.step package contains the step model and all the mechanics for the
parallel execution of tasks.
model module
Step model.
- class otter.step.model.Step(name: str, specs: list[Spec])[source]
Bases:
objectStep class.
This class represents a step in the pipeline.
- name
The name of the step.
- manifest: StepManifest
The manifest for the step.
- upsert_task_manifest(task: TaskReporter) None[source]
Update the step manifest with new task manifests.
coordinator module
Coordinator is the class that manages the execution of a step.
- otter.step.coordinator.COORDINATOR_POLLING_INTERVAL = 0.5
Default polling interval for the coordinator loop, in seconds.
- class otter.step.coordinator.Coordinator(step: Step, task_registry: TaskRegistry, config: Config)[source]
Bases:
objectCoordinates the execution of a step’s tasks.
- step
The
otter.step.model.Stepto run.
- task_registry
The task registry to build tasks from specs.
- config
The configuration object.
worker module
Worker process requests tasks from the coordinator and runs them.
- otter.step.worker.WORKER_POLLING_INTERVAL = 0.5
Default polling interval for the worker loop, in seconds.
- class otter.step.worker.Worker(worker_id: int)[source]
Bases:
objectWorker that executes tasks with a persistent event loop.
- run(task_queue: Queue, result_queue: Queue, shutdown_event: Event) None[source]
Run the worker loop.
Executes tasks from
task_queue, and puts the results inresult_queue. The worker will stop whenshutdown_eventis set.- Parameters:
task_queue (Queue) – Queue to get tasks from
result_queue (Queue) – Queue to put results in
shutdown_event (Event) – Event to signal shutdown
- otter.step.worker.worker_process(worker_id: int, task_queue: Queue, result_queue: Queue, shutdown_event: Event) None[source]
Worker process entry point.
Creates a Worker instance and runs it.
- Parameters:
worker_id (int) – Unique identifier for this worker
task_queue (Queue) – Queue to get tasks from
result_queue (Queue) – Queue to put results in
shutdown_event (Event) – Event to signal shutdown
Module contents
Step module.