Skip to content

Custom scheduler - Celery? #3253

Closed
Closed

Description

@linar-jether

How easy would it be to implement a custom scheduler (compute(*values, get=custom_sched.get))?

I'm thinking about a more robust scheduler (timeouts/retries/lostworkers/durability),
even though it might be less flexible/performant...

For production workloads (can't lose tasks) this might very helpful, and also for users which already have a cluster of workers they could use for ad-hoc computations (not celery's strongest side).

Generally sending tasks to a Celery queue is very similar to sending tasks to a multiprocessing.Pool, so maybe dask.local.get_async would be a good place to start?

Activity

  1. mrocklin commented on Mar 8, 2018

    @mrocklin
    Member

    Generally sending tasks to a Celery queue is very similar to sending tasks to a multiprocessing.Pool, so maybe dask.local.get_async would be a good place to start?

    Yes, if you can recreate the Pool.get_async then you can use get_sync today. I believe that there is a Mesos solution out there that does this. I would love to see this. From my perspective it would be a good demonstration that Dask can indeed play nicely with other systems.

    I'm thinking about a more robust scheduler (timeouts/retries/lostworkers/durability),

    To be clear retries and lost workers are both supported in the distributed scheduler. Timeouts and durability less so. Timeouts would be easy-ish. High availability (which I am, perhaps erroneously, equating with durability) less so.

  2. linar-jether commented on Mar 8, 2018

    @linar-jether
    Author

    @mrocklin Thanks, I'll give it a shot!

    By durability, I mean that once a task is sent it is expected to arrive to a worker, even in the event of a scheduler restart/crash (in celery's case it is possible by configuring queue persistence in redis/rabbitmq).

    Also, this might allow greater scalability since it avoids a central python scheduler

  3. mrocklin commented on Mar 8, 2018

    @mrocklin
    Member

    By durability, I mean that once a task is sent it is expected to arrive to a worker, even in the event of a scheduler restart/crash (in celery's case it is possible by configuring queue persistence in redis/rabbitmq).

    Understood. Thanks for the clarification.

    Also, this might allow greater scalability since it avoids a central python scheduler

    Interestingly our efforts to move past Python for the central scheduler haven't been as effective as desired. Python is not terrible for highly dynamic workloads like this. There is enough complex data structure access and jumping around in memory that most system are equally terrible :)

  4. linar-jether commented on Mar 18, 2018

    @linar-jether
    Author

    @mrocklin Turns out celery plays well with dask, initial implementation works pretty fast and allows us to easily reuse our already running cluster.

    Published the initial implementation here:
    https://gist.github.com/linar-jether/0cc77e386c4a1b591bf3963062f0eaef

    Note that all scheduling is done client-side, so no single point of failure should exist (depending on broker/backend of choice for celery).

    Appreciate your feedback 😄

  5. jakirkham commented on Jun 29, 2018

    @jakirkham
    Member

    Might be worth rolling this into a small dask-celery library in the org if you are interested.

  6. linar-jether commented on Jul 1, 2018

    @linar-jether
    Author

    Sure, would need some tests to make sure this works with other parts of dask, we've only done some rather simple use cases

  7. mrocklin commented on Oct 24, 2018

    @mrocklin
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions