Skip to content

Commit dfb9d1f

Browse files
authored
Merge branch 'master' into Remove_conda
2 parents de6704f + 7d0cb16 commit dfb9d1f

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

cwltool/job.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,11 @@ def docker_monitor(self, cidfile, tmpdir_prefix, cleanup_cidfile, process):
705705
time.sleep(1)
706706
if process.returncode is not None:
707707
if cleanup_cidfile:
708-
os.remove(cidfile)
709-
return
708+
try:
709+
os.remove(cidfile)
710+
except OSError as exc:
711+
_logger.warn("Ignored error cleaning up Docker cidfile: %s", exc)
712+
return
710713
try:
711714
with open(cidfile) as cidhandle:
712715
cid = cidhandle.readline().strip()
@@ -715,12 +718,16 @@ def docker_monitor(self, cidfile, tmpdir_prefix, cleanup_cidfile, process):
715718
max_mem = psutil.virtual_memory().total
716719
tmp_dir, tmp_prefix = os.path.split(tmpdir_prefix)
717720
stats_file = tempfile.NamedTemporaryFile(prefix=tmp_prefix, dir=tmp_dir)
718-
with open(stats_file.name, mode="w") as stats_file_handle:
719-
stats_proc = subprocess.Popen(
720-
['docker', 'stats', '--no-trunc', '--format', '{{.MemPerc}}',
721-
cid], stdout=stats_file_handle, stderr=subprocess.DEVNULL)
722-
process.wait()
723-
stats_proc.kill()
721+
try:
722+
with open(stats_file.name, mode="w") as stats_file_handle:
723+
stats_proc = subprocess.Popen(
724+
['docker', 'stats', '--no-trunc', '--format', '{{.MemPerc}}',
725+
cid], stdout=stats_file_handle, stderr=subprocess.DEVNULL)
726+
process.wait()
727+
stats_proc.kill()
728+
except OSError as exc:
729+
_logger.warn("Ignored error with docker stats: %s", exc)
730+
return
724731
max_mem_percent = 0
725732
with open(stats_file.name, mode="r") as stats:
726733
for line in stats:

tests/test_udocker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
LINUX = sys.platform in ('linux', 'linux2')
1111

1212

13-
@pytest.mark.skipif(not LINUX, reason="LINUX only")
13+
#@pytest.mark.skipif(not LINUX, reason="LINUX only")
14+
@pytest.mark.skip("Udocker install is broken, see https://github.com/indigo-dc/udocker/issues/221")
1415
class TestUdocker:
1516
udocker_path = None
1617

0 commit comments

Comments
 (0)