This library allows for the easy construction and management of Dask clusters from a Git repository via a simple context manager.
Project description
Distributed Runner
This library allows for the easy construction and management of Dask clusters from a Git repository via a simple context manager.
Installation
pip install distrunner
Usage
In your scheduler (Airfow etc.) use this:
from distrunner import DistRunner
with DistRunner(
workers=5,
python_version="3.10",
repo="https://gitlab.com/crossref/labs/task-test.git",
entry_module="task",
entry_point="entry_point",
requirements_file="requirements.txt",
local=False,
retries=3,
worker_memory=16384,
worker_cpus=4096,
) as dr:
logging.basicConfig(level=logging.INFO)
dr.run()
The "local" flag will determine whether a remote cluster is created.
The code in the git repository at the module and entry point that you specify will be called, passing the DaskRunner object. You can use this, then, to obtain a Dask client by calling cldr.client.
You will need to set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables to use the Fargate clusters.
Features
- Context manager handling of Dask Fargate clusters with scale-to-zero on complete
- Easy ability to switch between local and distributed/remote development
- Simple deployment from a git repository including all requirements
- Bugfixes to Dask AWS 2022.10.0 to suppress errors in weakref finalizers
What it Does
This library allows you to bootstrap a git repository into a distributed computation environment. It will install all the needed dependencies into the current virtual environment and sync these with workers. Your code's entrypoint will be called with access to a Dask Client object.
Credits
Copyright © Crossref 2023
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for distrunner-0.0.40-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 605d0a4dc2a96344f933bca177dab632655d2da90836c2e617ad2e2dd228d2e7 |
|
MD5 | b891623430f3078ef81d0b657eebe44c |
|
BLAKE2b-256 | be75da0f8d02b4dd1553fe6f4ff7a5507b1c55b21fbdd8befddf8cab51f862e5 |