コード例 #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']))
コード例 #2
0
ファイル: orch.py プロジェクト: torgartor21/solar
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']))
コード例 #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()
コード例 #4
0
ファイル: tasks.py プロジェクト: rustyrobot/solar
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()
コード例 #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
    }
コード例 #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
    }
コード例 #7
0
ファイル: tasks.py プロジェクト: rustyrobot/solar
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)
コード例 #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)
コード例 #9
0
ファイル: tasks.py プロジェクト: CGenie/solar
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)