Skip to content

Commit c454528

Browse files
authored
Merge branch 'master' into fix-671
2 parents 129cb28 + 92abb4e commit c454528

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

cwltool/argparser.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
_logger = logging.getLogger("cwltool")
1717

18+
DEFAULT_TMP_PREFIX = "tmp"
19+
20+
1821
def arg_parser(): # type: () -> argparse.ArgumentParser
1922
parser = argparse.ArgumentParser(description='Reference executor for Common Workflow Language')
2023
parser.add_argument("--basedir", type=Text)
@@ -71,12 +74,12 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
7174

7275
parser.add_argument("--tmpdir-prefix", type=Text,
7376
help="Path prefix for temporary directories",
74-
default="tmp")
77+
default=DEFAULT_TMP_PREFIX)
7578

7679
exgroup = parser.add_mutually_exclusive_group()
7780
exgroup.add_argument("--tmp-outdir-prefix", type=Text,
7881
help="Path prefix for intermediate output directories",
79-
default="tmp")
82+
default=DEFAULT_TMP_PREFIX)
8083

8184
exgroup.add_argument("--cachedir", type=Text, default="",
8285
help="Directory to cache intermediate workflow outputs to avoid recomputing steps.")

cwltool/main.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
import ruamel.yaml as yaml
1818
import schema_salad.validate as validate
1919
import six
20+
2021
from schema_salad.ref_resolver import Loader, file_uri, uri_file_path
2122
from schema_salad.sourceline import strip_dup_lineno
2223

2324
from . import draft2tool, workflow
24-
from .argparser import arg_parser, generate_parser
25+
from .argparser import arg_parser, generate_parser, DEFAULT_TMP_PREFIX
2526
from .cwlrdf import printdot, printrdf
2627
from .errors import UnsupportedRequirement, WorkflowException
2728
from .executors import SingleJobExecutor, MultithreadedJobExecutor
@@ -529,8 +530,16 @@ def main(argsl=None, # type: List[str]
529530
if isinstance(tool, int):
530531
return tool
531532

533+
# If on MacOS platform, TMPDIR must be set to be under one of the shared volumes in Docker for Mac
534+
# More info: https://dockstore.org/docs/faq
535+
if sys.platform == "darwin":
536+
tmp_prefix = "tmp_outdir_prefix"
537+
default_mac_path = "/private/tmp/docker_tmp"
538+
if getattr(args, tmp_prefix) and getattr(args, tmp_prefix) == DEFAULT_TMP_PREFIX:
539+
setattr(args, tmp_prefix, default_mac_path)
540+
532541
for dirprefix in ("tmpdir_prefix", "tmp_outdir_prefix", "cachedir"):
533-
if getattr(args, dirprefix) and getattr(args, dirprefix) != 'tmp':
542+
if getattr(args, dirprefix) and getattr(args, dirprefix) != DEFAULT_TMP_PREFIX:
534543
sl = "/" if getattr(args, dirprefix).endswith("/") or dirprefix == "cachedir" else ""
535544
setattr(args, dirprefix,
536545
os.path.abspath(getattr(args, dirprefix)) + sl)

0 commit comments

Comments
 (0)