Пример #1
0
 def do(js):
     orc = orcs.DataladPairRunOrchestrator(
         shell, submission_type="local", job_spec=js)
     orc.prepare_remote()
     orc.submit()
     orc.follow()
     orc.fetch()
     return orc
Пример #2
0
def test_orc_datalad_run_failed(job_spec, dataset, ssh):
    job_spec["_resolved_command_str"] = "iwillfail"
    job_spec["inputs"] = []

    with chpwd(dataset.path):
        orc = orcs.DataladPairRunOrchestrator(
            ssh, submission_type="local", job_spec=job_spec)
        orc.prepare_remote()
        orc.submit()
        orc.follow()
        with swallow_logs(new_level=logging.INFO) as log:
            orc.fetch()
            assert "1 subjob failed" in log.out
            assert "stderr:" in log.out
Пример #3
0
def test_orc_datalad_pair_run_multiple_same_point(job_spec, dataset, ssh):
    # Start two orchestrators from the same point:
    #
    #   orc 0, <branch tip>
    #   |
    #   | orc 1
    #   |/
    #   o
    ds = dataset
    repo = ds.repo
    branch_orig = repo.get_active_branch()

    js0 = job_spec
    js1 = dict(job_spec, _resolved_command_str='bash -c "echo other >other"')
    with chpwd(ds.path):
        orc0, orc1 = [
            orcs.DataladPairRunOrchestrator(ssh,
                                            submission_type="local",
                                            job_spec=js) for js in [js0, js1]
        ]

        for orc in [orc0, orc1]:
            orc.prepare_remote()
            orc.submit()
            orc.follow()

        # The status for the first one is now out-of-tree ...
        assert not op.exists(op.join(orc0.meta_directory, "status.0"))
        # but we can still get it.
        assert orc0.status == "succeeded"

        orc0.fetch()
        orc1.fetch()

        ref0 = "refs/reproman/{}".format(orc0.jobid)
        ref1 = "refs/reproman/{}".format(orc1.jobid)
        assert not repo.is_ancestor(ref0, ref1)
        assert not repo.is_ancestor(ref1, ref0)

        # Both runs branched off of the original branch. The first one fetched
        # advanced it. The other one is a side-branch.
        assert not repo.is_ancestor(ref1, "HEAD")
        assert repo.get_hexsha(ref0) == repo.get_hexsha(branch_orig)
        assert repo.get_active_branch() == branch_orig
Пример #4
0
 def get_orc(jspec=None):
     return orcs.DataladPairRunOrchestrator(ssh,
                                            submission_type="local",
                                            job_spec=jspec or job_spec)