Code Monkey home page Code Monkey logo

mentos's Introduction

Join the chat at https://gitter.im/lensacom/dask.mesos Coding Hours

Apache Mesos backend for 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, dask, toolz. All of them should be installed w/ the following commands:

pip install dask.mesos or use lensa/dask.mesos Docker image

Configuration:

  • MESOS_MASTER=zk://127.0.0.1:2181/mesos
  • ZOOKEEPER_HOST=127.0.0.1:2181

Example

from __future__ import absolute_import, division, print_function

from daskos import mesos, MesosExecutor


@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/daskos')
def mul(x, y):
    """Run mul on mesos in specified docker image"""
    return x * y


with MesosExecutor(name='dask') as executor:
    """This context handles Mesos scheduler's lifecycle"""
    a, b = 23, 89
    alot = add(a, b)
    gigalot = mul(alot, add(10, 2))

    gigalot.compute(get=executor.get)  # (a + b) * (10 + 2)
    executor.compute([alot, gigalot])  # list of futures

Configuring daskos 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.

mentos's People

Contributors

arttii avatar kszucs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mentos's Issues

Satyr integration

Satyr should be updated:

  • use mentos directly, without proxies
  • CI: drone -> compose + travis

Collaborator request

Can You add me as an outside collaborator?

I'd create a drone CI integration.

Another name

Malefico isn't easily memorizable. It's not intuitive and I don't know the meaning of it (is it italian https://translate.google.com/#auto/en/malefico or a character?)
Satyr's name also odd, difficult to find.

I think malefico should be renamed to suggest "it's a native mesos client". Satyr should be renamed to suggest "it's a high level mesos framework". Ideas?

Do You have other names or you insist on malefico?

Tests

I ended up moving to travis and coveralls, because it was just simpler to set up. I duplicated the drone config via docker-compose. It seems to work fine for now.

Not all tests are currently there. I will list them out here:

  • utils
  • states
  • interface
  • retry
  • exceptions
  • connection
  • subscription
  • executor
  • scheduler

Utils contains the zookeeper discovery, which I tested by killing one of the masters using docker-compose and waiting for some intervals in the middle. Seems like its working.

@kszucs Any thoughts?

Weird edgecase with redirect master Discovery

If zookeeper is turned off, but Mesos Master is running and we try to subscribe the redirect master detection get's an address, which when subscribed to, again redirects. The detector eventually reaches the actual Master, because currently there is no gate if there is already an active Master

Asyncio interface

If I recall correctly there were plans about dropping tornado and use python's native asyncio coroutines. @Arttii are You still interested?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.