def main():
    # set up the LaunchPad and reset it
    swarmpad = SwarmPad()
    swarmpad.reset('', require_password=False)
    workflow_dax = "/home/kalana/fyp/fyp-new/SwarmForm/swarmform/util/workflows/dax/Montage_25.xml"
    dax_swarmflow = WorkflowGenerator.generate_workflow(workflow_dax)
    swarmpad.add_sf(dax_swarmflow)
def main():
    # set up the LaunchPad and reset it
    swarmpad = SwarmPad()
    swarmpad.reset('', require_password=False)
    workflow_yaml = "/home/kalana/fyp-new/SwarmForm/swarmform/util/workflows/yaml/custom-jobs-25.yaml"
    dax_swarmflow = WorkflowGenerator.generate_workflow(workflow_yaml)
    swarmpad.add_sf(dax_swarmflow)
Beispiel #3
0
def get_sp(args):
    try:
        if not args.launchpad_file:
            if os.path.exists(os.path.join(args.config_dir,
                                           DEFAULT_LPAD_YAML)):
                args.launchpad_file = os.path.join(args.config_dir,
                                                   DEFAULT_LPAD_YAML)
            else:
                args.launchpad_file = LAUNCHPAD_LOC

        if args.launchpad_file:
            return SwarmPad.from_file(args.launchpad_file)
        else:
            args.loglvl = 'CRITICAL' if args.silencer else args.loglvl
            return SwarmPad(logdir=args.logdir, strm_lvl=args.loglvl)
    except Exception:
        traceback.print_exc()
        err_message = 'SwarmForm was not able to connect to MongoDB. Is the server running? ' \
                      'The database file specified was {}.'.format(args.launchpad_file)
        if not args.launchpad_file:
            err_message += ' Type "sform init" if you would like to set up a file that specifies ' \
                           'location and credentials of your Mongo database (otherwise use default ' \
                           'localhost configuration).'
        raise ValueError(err_message)
Beispiel #4
0
def main():
    # set up the LaunchPad and reset it
    swarmpad = SwarmPad()
    swarmpad.reset('', require_password=False)

    firetask1 = ScriptTask.from_str('echo "starting"; sleep 30; echo "ending"')
    firetask2 = ScriptTask.from_str('echo "hello from BACKGROUND thread #1"')
    firetask3 = ScriptTask.from_str('echo "hello from BACKGROUND thread #2"')

    # Combine [firetasks] parallely to form a ParallelTask
    par_task = ParallelTask.from_firetasks([firetask1, firetask2])

    # Combine the par_task and firetask3 sequentially
    firework = Firework([par_task, firetask3])

    # store workflow and launch it locally
    swarmpad.add_wf(firework)
    rapidfire(swarmpad, FWorker())
    Args:
        task (Node)
        child_id (fw_id)

    Returns:
        int
    """
    children = task.get_children()
    for child in children:
        if child.get_fw_id() == child_id:
            return True
    return False


# For testing the clustering
swarmpad = SwarmPad()
swarmpad.reset('', require_password=False)

filename = '/Users/randika/Documents/FYP/SwarmForm/swarmform/examples/cluster_examples/test_workflow.yaml'
# create the Firework consisting of a custom "Addition" task
unclustered_sf = SwarmFlow.from_file(filename)

# store workflow
swarmpad.add_sf(unclustered_sf)
sf = swarmpad.get_sf_by_id(unclustered_sf.sf_id)
sf_dag = DAG(sf)

clusterd_wf = cluster_wf_in_hrab(sf_dag, 3)
print(clusterd_wf)
Beispiel #6
0
from swarmform import SwarmPad
from fireworks import Firework, ScriptTask, FWorker
from fireworks.core.rocket_launcher import launch_rocket

if __name__ == "__main__":
    # set up the SwarmPad and reset it
    swarmpad = SwarmPad()
    swarmpad.reset('', require_password=False)

    # create the Firework consisting of a custom "Addition" task
    firework = Firework(ScriptTask.from_str('echo "hello"'))

    # store workflow
    swarmpad.add_sf(firework)

    # Retrieve SwarmFlow from the SwarmPad
    sf = swarmpad.get_sf_by_id(1)

    sf = swarmpad.get_sf_by_name('Unnamed FW')

    # Run the swarmFlow
    launch_rocket(swarmpad, FWorker())