Skip to content

Commit 1fa72ca

Browse files
committed
BF: orchestrators: Fetch with --recurse-submodules=no
By default 'git fetch' will try to fetch submodules if the recorded commit isn't available locally. Avoid this because 1) with the upcoming 0.13 release of Datalad, update() try to fetch an commit even if it isn't in a ref that's brought down by the initial fetch [*] and 2) submodule.c hard codes 'origin' as a fallback to fetch from, so the fetch is likely to fail, as 'run' names remotes by the resource name. [*] See DataLad's dbd84e5662 (ENH: update: Try to fetch submodule commit explicitly if needed, 2020-02-07). Fixes gh-499.
1 parent a141f39 commit 1fa72ca

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

reproman/support/jobs/orchestrators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,8 @@ def fetch(self, on_remote_finish=None):
921921
ref = self.job_refname
922922
lgr.info("Updating local dataset with changes from '%s'",
923923
resource_name)
924-
self.ds.repo.fetch(resource_name, "{0}:{0}".format(ref))
924+
self.ds.repo.fetch(resource_name, "{0}:{0}".format(ref),
925+
recurse_submodules="no")
925926
self.ds.update(sibling=resource_name,
926927
merge=True, recursive=True)
927928
lgr.info("Getting outputs from '%s'", resource_name)

reproman/support/jobs/tests/test_orchestrators.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,3 +647,21 @@ def test_orc_datalad_concurrent_slurm(check_orc_datalad_concurrent, ssh_slurm):
647647
check_orc_datalad_concurrent(ssh_slurm,
648648
orcs.DataladLocalRunOrchestrator,
649649
"slurm")
650+
651+
652+
def test_orc_datalad_pair_submodule(job_spec, dataset, shell):
653+
# Smoke test that triggers the failure from gh-499
654+
with chpwd(dataset.path):
655+
dataset.create("sub")
656+
dataset.save()
657+
658+
job_spec["_resolved_command_str"] = "sh -c 'echo foo >sub/foo'"
659+
job_spec["inputs"] = []
660+
job_spec["outputs"] = []
661+
662+
orc = orcs.DataladPairOrchestrator(
663+
shell, submission_type="local", job_spec=job_spec)
664+
orc.prepare_remote()
665+
orc.submit()
666+
orc.follow()
667+
orc.fetch()

0 commit comments

Comments
 (0)