Skip to main content

A pipeline system for efficient execution.

Project description

Pyturbo Package

PyPI version Publish to PyPI

Author: Lijun Yu

Email: lijun@lj-y.com

A pipeline system for efficient execution.

Installation

pip install py-turbo

Introduction

Pyturbo utilizes multiple level of abstract to efficiently execute parallel tasks.

  • Worker: a process.
  • Stage: a group of peer workers processing the same type of tasks.
  • Task: a data unit transferred between stages. At each stage, a task is processed by one worker and will result in one or multiple downstream tasks.
  • Pipeline: a set of sequential stages.
  • Job: a data unit for a pipeline, typically a wrapped task for the first stage.
  • Result: output of a job processed by one pipeline, typically a set of output tasks from the last stage.
  • System: a set of peer pipelines processing the same type of jobs.

abstract.png

Get Started

from pyturbo import ReorderStage, Stage, System

class Stage1(Stage): # Define a stage

    def __init__(self, resources):
        ... # Optional: set resources and number of workers

    def process(self, task):
        ... # Process function for each worker process. Returns one or a series of downstream tasks.

... # Repeat for Stage2, Stage3

class Stage4(ReorderStage): # Define a reorder stage, typically for the final stage

    def get_sequence_id(self, task):
        ... # Return the order of each task. Start from 0.

    def process(self, task):
        ...

class MySystem(System):

    def get_stages(self, resources):
        ... # Define the stages in a pipeline with given resources.

    def get_results(self, results_gen):
        ... # Define how to extract final results from output tasks.

def main():
    system = MySystem(num_pipeline) # Set debug=True to run in a single process
    system.start() # Build and start system
    system.add_job(...) # Submit one job
    finished_job = system.result_queue.get() # Wait for result
    system.end() # End system

Demo

abstract.png

See demo.py for an example implementation.

Development Modes

See develop.md

Version History

See version.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-turbo-0.2.2.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

py_turbo-0.2.2-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file py-turbo-0.2.2.tar.gz.

File metadata

  • Download URL: py-turbo-0.2.2.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for py-turbo-0.2.2.tar.gz
Algorithm Hash digest
SHA256 19be43b6008cecf5b9a8add1ca551400f2b562d2694f22b2655c7dc604017416
MD5 103745bf726327f7d20659ad6ab64264
BLAKE2b-256 a973a99a4e5b626776f31f8ae06f3a32ada0829b810d1ca1906387c1a4f12dbf

See more details on using hashes here.

File details

Details for the file py_turbo-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: py_turbo-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for py_turbo-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 989362854f6601996cd425db96cfc994ad684ba92eb2ee3a7ce74d5de8cafb1d
MD5 fa4ac8e582603554c245c404da3d108f
BLAKE2b-256 0877bb3e5deb9cc3a1c30e15402954f6650053bba59ed5e617c37ec7324b11ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page