Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph Scheduler Task #232

Draft
wants to merge 6 commits into
base: task_state
Choose a base branch
from
Draft

Graph Scheduler Task #232

wants to merge 6 commits into from

Conversation

johanhenriksson
Copy link
Collaborator

@johanhenriksson johanhenriksson commented Jan 13, 2021

Implementation of a DAG scheduler as a Cowait task.

Example:

from cowait.tasks.graph import GraphTask
from sleep import Sleep

class GraphExample(GraphTask):
    async def define(self, graph, **inputs):
        a = graph.node(Sleep, {
            'duration': 3,
        })
        b = graph.node(Sleep, {
            'duration': 5,
        })
        graph.node(Sleep, {
            'a': a.output('duration'),
            'b': b.output('duration'),
        })

@johanhenriksson johanhenriksson marked this pull request as draft January 13, 2021 22:24
@johanhenriksson johanhenriksson changed the title DAG Task WIP Graph Scheduler Task Jan 14, 2021
@johanhenriksson johanhenriksson self-assigned this Jan 14, 2021
@johanhenriksson johanhenriksson added the feature New feature label Jan 14, 2021
@OskarHandmark
Copy link
Contributor

👍

Copy link
Contributor

@OskarHandmark OskarHandmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow export of the graph (to json?) in/after define()? Would play nicely in a UI, especially with live updates. Show the graph in terminal before running? :)

async def run(self, **inputs):
g = Graph()
await self.define(g, **inputs)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we run this we should make sure it has no loops

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a validation step sounds like a pretty good idea 😬

@johanhenriksson johanhenriksson force-pushed the dag_task branch 2 times, most recently from 257b69e to a3b093f Compare January 19, 2021 15:20
@johanhenriksson johanhenriksson changed the base branch from master to 0.4.7 January 19, 2021 15:21
Base automatically changed from 0.4.7 to master January 25, 2021 14:56
@johanhenriksson johanhenriksson changed the base branch from master to task_state March 1, 2021 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants