Ejemplo n.º 1
0
def test_limits_sequential(seq_plan):
    stack_to_execute = seq_plan.nodes()
    while stack_to_execute:
        left = stack_to_execute[0]
        assert list(limits.get_default_chain(seq_plan, [],
                                             stack_to_execute)) == [left]
        stack_to_execute.pop(0)
Ejemplo n.º 2
0
def test_limits_sequential(seq_plan):
    stack_to_execute = seq_plan.nodes()
    while stack_to_execute:
        left = stack_to_execute[0]
        assert list(limits.get_default_chain(
            seq_plan, [], stack_to_execute)) == [left]
        stack_to_execute.pop(0)
Ejemplo n.º 3
0
 def _next(self, plan):
     tasks = traverse(plan)
     filtered_tasks = list(
         limits.get_default_chain(plan, [
             t for t in plan
             if plan.node[t]['status'] == states.INPROGRESS.name
         ], tasks))
     return filtered_tasks
Ejemplo n.º 4
0
 def _next(self, plan):
     tasks = traverse(plan)
     filtered_tasks = list(limits.get_default_chain(
         plan,
         [t for t in plan
          if plan.node[t]['status'] == states.INPROGRESS.name],
         tasks))
     return filtered_tasks
Ejemplo n.º 5
0
def schedule(plan_uid, dg):
    tasks = traverse(dg)
    limit_chain = limits.get_default_chain(
        dg, [t for t in dg if dg.node[t]['status'] == 'INPROGRESS'], tasks)
    execution = executor.celery_executor(dg,
                                         limit_chain,
                                         control_tasks=('fault_tolerance', ))
    graph.save_graph(dg)
    execution()
Ejemplo n.º 6
0
def schedule(plan_uid, dg):
    tasks = traverse(dg)
    limit_chain = limits.get_default_chain(
        dg,
        [t for t in dg if dg.node[t]['status'] == 'INPROGRESS'],
        tasks)
    execution = executor.celery_executor(
        dg, limit_chain, control_tasks=('fault_tolerance',))
    graph.save_graph(dg)
    execution()
Ejemplo n.º 7
0
def test_filtering_chain(target_dg):

    chain = limits.get_default_chain(target_dg, [], ['t1', 't2'])
    assert list(chain) == ['t1']
Ejemplo n.º 8
0
 def _next(self, plan):
     return list(limits.get_default_chain(
         plan,
         [t for t in plan if t.status == states.INPROGRESS.name],
         sorted(find_visitable_tasks(plan),
                key=attrgetter('weight'), reverse=True)))
Ejemplo n.º 9
0
def test_filtering_chain(target_dg):

    chain = limits.get_default_chain(target_dg, [], ['t1', 't2'])
    assert list(chain) == ['t1']
Ejemplo n.º 10
0
def test_filtering_chain(dg, t1, t2):

    chain = limits.get_default_chain(dg, [], [t1, t2])
    assert list(chain) == [t1]