cyto.runners

Container execution backends — base interface plus Docker and Singularity implementations used by the distributed pipeline.

class cyto.runners.base.RunnerBase(execution_config: Dict[str, Any])[source]

Bases: ABC

Base class for container runners.

abstract run(task: Any, data: Any) Any[source]

Run a task in a container.

Parameters:
  • task – The task object to run.

  • data – The input data for the task.

Returns:

The result of the task execution.

class cyto.runners.docker.DockerRunner(execution_config: Dict[str, Any])[source]

Bases: RunnerBase

Runs tasks in a Docker container using the docker-py library.

run(task: Any, data: Any) Any[source]

Serializes task and data, runs them in a Docker container, and deserializes the result.

class cyto.runners.singularity.SingularityRunner(execution_config: Dict[str, Any])[source]

Bases: RunnerBase

Runs tasks in a Singularity container.

run(task: Any, data: Any) Any[source]

Run a task in a container.

Parameters:
  • task – The task object to run.

  • data – The input data for the task.

Returns:

The result of the task execution.

cyto.runners.container_worker.main()[source]

A generic worker for executing tasks inside a container.

This script is not meant to be called directly by the user. It is called by the runner system (e.g., DockerRunner) inside a container. It deserializes a task object and its input data, executes the task’s baremetal method, and serializes the result to a file.

Parameters:
  • task_path (str) – Path to the pickled task object.

  • data_path (str) – Path to the pickled input data.

  • result_path (str) – Path where the pickled result should be saved.