miniwdl icon indicating copy to clipboard operation
miniwdl copied to clipboard

let task output files outside its working directory

Open mlin opened this issue 4 years ago • 2 comments

Right now the task runtime doesn't allow output files that reside outside of the initial working directory or a subdirectory thereof; for example, attempting to output a file under /tmp will fail.

The constraint has to do with our approach of mounting a host directory as the read/write container working directory, and collecting the output files from the host directory after the container is auto-removed. Any files outside of the working directory get destroyed along with the container. We could revise this by turning off container auto_remove, so that we can copy other output files out of the container file system before destroying the container ourselves. The downsides are (i) having to copy the files and deal with any potential basename collisions wherever we copy them to, and (ii) potentially neglecting to destroy the container under some code paths / circumstances.

mlin avatar Jul 20 '19 05:07 mlin

Example to noodle on -- a straightforward samtools index or tabix task. The input files are mounted a bit outside of the working directory. When we run the indexing program, it generates the index file next to it, which we can't output.

A different solution is to mount input files in or under the working directory, like Cromwell. This could also be more convenient for having the index files in the "right place" by default, although that depends on not having name collisions. Also mild concern about uncontrollable potential for collision with files/directories the task command is hard-coded to create.

mlin avatar Sep 27 '19 09:09 mlin

Possible heuristic for index files: following the current directory assortment pass, if (i) a file Idx has a basename which is equal to the basename of another file Dat plus one or more filename extensions; (ii) there exists no so-named Dat' file in the same directory as Idx; and (iii) there exists no file with the same basename as Idx in the directory of Dat; then, mount Idx in the same directory as Dat.

mlin avatar Sep 30 '19 03:09 mlin