diff --git a/WDL/runtime/config_templates/default.cfg b/WDL/runtime/config_templates/default.cfg index 0a9b23d0..dfef4676 100644 --- a/WDL/runtime/config_templates/default.cfg +++ b/WDL/runtime/config_templates/default.cfg @@ -93,11 +93,14 @@ output_hardlinks = false # output files would be deleted too. Input/output JSON, logs, and stdout/stderr are always retained # in the task run directory (above the container working directory). delete_work = false -# In each task container, set TMPDIR environment variable to a subdirectory of the mounted task -# working directory, automatically deleted afterwards. This may be useful if tasks use a lot of -# scratch disk space and the run directory is on larger, separate storage from the container root -# file system holding /tmp. Note the software inside the container must actually use the TMPDIR -# environment variable in order for this to have an effect. (New in v1.5.4) +# Suggest that each task's temporary directory should reside within the mounted task working +# directory, instead of the storage backing the container's root filesystem. The latter (default) +# is usually preferred because the working directory is more likely to reside on slower network- +# attached storage. But mount_tmpdir may be helpful if tasks use large amounts of scratch space and +# the working directory storage has more capacity. +# The exact effect of this setting depends on the container backend implementation: some may change +# where they mount /tmp, some may merely override TMPDIR inside the container, and others may not +# yet implement it at all. (New in v1.5.4) mount_tmpdir = false # Selectively mount_tmpdir for those tasks whose names appear in this list. (New in v1.5.4) mount_tmpdir_for = [] diff --git a/WDL/runtime/task.py b/WDL/runtime/task.py index 765c52b0..c157b594 100644 --- a/WDL/runtime/task.py +++ b/WDL/runtime/task.py @@ -494,7 +494,9 @@ def _eval_task_runtime( if cfg.get_bool("file_io", "mount_tmpdir") or task.name in cfg.get_list( "file_io", "mount_tmpdir_for" ): - env_vars_override["TMPDIR"] = os.path.join(container.container_dir, "work", "_tmpdir") + env_vars_override["TMPDIR"] = os.path.join( + container.container_dir, "work", "_miniwdl_tmpdir" + ) if env_vars_override: # usually don't dump values into log, as they may often be auth tokens logger.notice( # pyre-ignore @@ -545,7 +547,7 @@ def _try_task( ): container.copy_input_files(logger) host_tmpdir = ( - os.path.join(container.host_work_dir(), "_tmpdir") + os.path.join(container.host_work_dir(), "_miniwdl_tmpdir") if cfg.get_bool("file_io", "mount_tmpdir") or task.name in cfg.get_list("file_io", "mount_tmpdir_for") else None @@ -554,13 +556,13 @@ def _try_task( try: # start container & run command if host_tmpdir: - logger.debug(_("creating temp directory to mount", TMPDIR=host_tmpdir)) + logger.debug(_("creating task temp directory", TMPDIR=host_tmpdir)) os.mkdir(host_tmpdir, mode=0o770) try: return container.run(logger, command) finally: if host_tmpdir: - logger.info(_("deleting mounted temp directory", TMPDIR=host_tmpdir)) + logger.info(_("deleting task temp directory", TMPDIR=host_tmpdir)) rmtree_atomic(host_tmpdir) if ( "preemptible" in container.runtime_values