Esempio n. 1
0
def filter(uid, start, end):
    graph.reset_filtered(uid)
    plan = graph.get_graph(uid)
    errors = filters.filter(plan, start=start, end=end)
    if errors:
        raise click.ClickException('\n'.join(errors))
    graph.save_graph(uid, plan)
    utils.write_graph(plan)
    click.echo('Created {name}.png'.format(name=plan.graph['name']))
Esempio n. 2
0
def filter(uid, start, end):
    graph.reset_filtered(uid)
    plan = graph.get_graph(uid)
    errors = filters.filter(plan, start=start, end=end)
    if errors:
        raise click.ClickException('\n'.join(errors))
    graph.save_graph(uid, plan)
    utils.write_graph(plan)
    click.echo('Created {name}.png'.format(name=plan.graph['name']))
Esempio n. 3
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()
Esempio n. 4
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()
Esempio n. 5
0
def test_wait_finish(simple):
    for n in simple:
        simple.node[n]['status'] = states.SUCCESS.name
    graph.save_graph(simple)

    assert next(graph.wait_finish(simple.graph['uid'], 10)) == {
        'SKIPPED': 0,
        'SUCCESS': 2,
        'NOOP': 0,
        'ERROR': 0,
        'INPROGRESS': 0,
        'PENDING': 0
    }
Esempio n. 6
0
def test_several_updates(simple):
    simple.node['just_fail']['status'] = states.ERROR.name
    graph.save_graph(simple)

    assert next(graph.wait_finish(simple.graph['uid'], 10)) == {
        'SKIPPED': 0,
        'SUCCESS': 0,
        'NOOP': 0,
        'ERROR': 1,
        'INPROGRESS': 0,
        'PENDING': 1
    }

    simple.node['echo_stuff']['status'] = states.ERROR.name
    graph.save_graph(simple)

    assert next(graph.wait_finish(simple.graph['uid'], 10)) == {
        'SKIPPED': 0,
        'SUCCESS': 0,
        'NOOP': 0,
        'ERROR': 2,
        'INPROGRESS': 0,
        'PENDING': 0
    }
Esempio n. 7
0
def soft_stop(plan_uid):
    dg = graph.get_graph(plan_uid)
    for n in dg:
        if dg.node[n]['status'] == 'PENDING':
            dg.node[n]['status'] = 'SKIPPED'
    graph.save_graph(dg)
Esempio n. 8
0
def soft_stop(plan_uid):
    dg = graph.get_graph(plan_uid)
    for n in dg:
        if dg.node[n]['status'] == 'PENDING':
            dg.node[n]['status'] = 'SKIPPED'
    graph.save_graph(dg)
Esempio n. 9
0
def soft_stop(plan_uid):
    dg = graph.get_graph(plan_uid)
    for n in dg:
        if dg.node[n]["status"] == "PENDING":
            dg.node[n]["status"] = "SKIPPED"
    graph.save_graph(plan_uid, dg)