Skip to main content

Simple task manager and job queue for distributed rendering. Built on celery and redis.

Project description

Distributask

A simple way to distribute rendering tasks across multiple machines.

Lint and Test PyPI version License

Description

Distributask is a package that automatically queues, executes, and uploads the result of any task you want using Vast.ai, a decentralized network of GPUs. It works by first creating a Celery queue of the tasks, which contain the code that you want to be ran on a GPU. The tasks are then passed to the Vast.ai GPU workers using Redis as a message broker. Once a worker has completed a task, the result is uploaded to Hugging Face.

Installation

pip install distributask

Development

Setup

Clone the repository and navigate to the project directory:

git clone https://github.com/DeepAI-Research/Distributask.git
cd Distributask

Install the required packages:

pip install -r requirements.txt

Or install Distributask as a package:

pip install distributask

Configuration

Create a .env file in the root directory of your project or set environment variables to create your desired setup:

REDIS_HOST="name of your redis server"
REDIS_PORT="port of your redis server
REDIS_USER="username to login to redis server"
REDIS_PASSWORD="password to login to redis server"
VAST_API_KEY="your Vast.ai API key"
HF_TOKEN="your Hugging Face token"
HF_REPO_ID="name of your Hugging Face repository"
BROKER_POOL_LIMIT="your broker pool limit setting"

Getting Started

Running an Example Task

To run an example task and see Distributask in action, you can execute the example script provided in the project:

# Run the example task locally using either a Docker container or a Celery worker:
python -m distributask.example.local

# Run the example task on Vast.ai ("kitchen sink" example):
python -m distributask.example.distributed

This script configures the environment, registers a sample function, creates a queue of tasks, and monitors its execution on some workers.

Command Options

  • --max_price is the max price (in $/hour) a node can be be rented for.
  • --max_nodes is the max number of vast.ai nodes that can be rented.
  • --docker_image is the name of the docker image to load to the vast.ai node.
  • --module_name is the name of the Celery worker.
  • --number_of_tasks is the number of example tasks that will be added to the queue and done by the workers.

Documentation

For more info checkout our in-depth documentation!

Contributing

Contributions are welcome! For any changes you would like to see, please open an issue to discuss what you would like to see changed or to change yourself.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

@misc{Distributask,
  author = {DeepAIResearch},
  title = {Distributask: a simple way to distribute rendering tasks across mulitiple machines},
  year = {2024},
  publisher = {GitHub},
  howpublished = {\url{https://github.com/DeepAI-Research/Distributask}}
}

Contributors

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

distributask-0.1.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

distributask-0.1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file distributask-0.1.0.tar.gz.

File metadata

  • Download URL: distributask-0.1.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for distributask-0.1.0.tar.gz
Algorithm Hash digest
SHA256 398e45482b77f420d8f563f88e0a559179ed888f856f7fb308bb5f2dca797074
MD5 04335f4b2c23dd1e535a44a20dd96311
BLAKE2b-256 e476ff0aa479f668f71017d6095ae6c6a575a8449e8556663fb7014df4d73838

See more details on using hashes here.

File details

Details for the file distributask-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: distributask-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for distributask-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb0b64228d7134ed842efe04b7511ffae609343bcd643f13b1753b96cb78e3a0
MD5 e7ae3bf40cb250952f9c72d2ae5d5a4c
BLAKE2b-256 52bda91604570a469fa494425cacfbf1c83519d231f39dd2afca59a951cc799e

See more details on using hashes here.

Supported by

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