Skip to main content

Apache Mesos backend for Dask scheduling library

Project description

[![Build Status](http://52.0.47.203:8000/api/badges/lensacom/dask.mesos/status.svg)](http://52.0.47.203:8000/lensacom/dask.mesos)

[Apache Mesos](http://mesos.apache.org/) backend for [Dask](https://github.com/dask/dask) scheduling library.
Run distributed python dask workflows on your Mesos cluster.

## Notable Features

- distributively run tasks in docker container
- specify resource requirements per task
- bin packing for optimized resource utilization

## Installation

**Prerequisits:** [satyr](https://github.com/lensacom/satyr), [dask](https://github.com/dask/dask.git), [toolz](https://pypi-hypernode.com/pypi/toolz). All of them should be installed w/ the following commands:

`pip install dask.mesos` or use [lensa/dask.mesos](https://hub.docker.com/r/lensa/dask.mesos/) Docker image

Configuration:
- `MESOS_MASTER=zk://127.0.0.1:2181/mesos`
- `ZOOKEEPER_HOST=127.0.0.1:2181`


## Example

```python
from __future__ import absolute_import, division, print_function

from dask import set_options
from dask_mesos.imperative import mesos
from dask_mesos.mesos import get


@mesos(cpus=0.1, mem=64)
def add(x, y):
"""Run add on mesos with specified resources"""
return x + y


@mesos(cpus=0.3, mem=128, image='lensa/dask.mesos')
def mul(x, y):
"""Run mul on mesos in specified docker image"""
return x * y


with set_options(get=get):
"""This context ensures that decorated functions will run on mesos."""
a, b = 23, 89
alot = add(a, b)
gigalot = mul(alot, add(10, 2))

result = gigalot.compute() # or gigalot.compute(get=get)
```

Or check [example.py](example.py) for a docker only example.

## Configuring dask.mesos Tasks

You can configure your mesos tasks in your decorator, currently the following options are available:

* **cpus**: The amount of cpus to use for the task.
* **mem**: Memory in MB to reserver for the task.
* **disk**: The amount of disk to use for the task.
* **image**: A docker image name. If not set, mesos containerizer will be used.

Both mem and cpus are defaults to some low values set in _satyr_ so you're encouraged to override them here. More options like constraints, other resources are on the way.

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

dask.mesos-0.1.3.tar.gz (7.7 kB view details)

Uploaded Source

File details

Details for the file dask.mesos-0.1.3.tar.gz.

File metadata

  • Download URL: dask.mesos-0.1.3.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dask.mesos-0.1.3.tar.gz
Algorithm Hash digest
SHA256 21cbc104afbb58ec3f1450977056eaf5fc91653875f79f62cde276137360c4e8
MD5 edc7054148357b50cb7e815546fb443d
BLAKE2b-256 3769a63b1dbdd300e800b21b45f411507bcb87279b8be7b88f979262948af67d

See more details on using hashes here.

Provenance

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