Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cwltool/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def add_file_or_directory_volume(
"""Append volume a file/dir mapping to the runtime option list."""
if not volume.resolved.startswith("_:"):
_check_docker_machine_path(volume.resolved)
self.append_volume(runtime, volume.resolved, volume.target)
self.append_volume(runtime, volume.resolved, volume.target, writable=volume.staged)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the goal here? This results in many files that should be mounted read-only to not be..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal overall was to fix a bug I was encountering with a specific CommandLineTool (Yank) which we are no longer using. I still believe there is a bug in cwltool, but I can't seem to simultaneously fix the bug and get the test suite to pass. This is very low priority work for me, so feel free to close if you like.


def add_writable_file_volume(
self,
Expand Down
13 changes: 12 additions & 1 deletion cwltool/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,23 @@ def relink_initialworkdir(
continue
host_outdir_tgt = os.path.join(host_outdir, vol.target[len(container_outdir) + 1 :])
if os.path.islink(host_outdir_tgt) or os.path.isfile(host_outdir_tgt):
try:
ensure_writable(host_outdir_tgt, include_root=True)
except PermissionError:
pass
try:
os.remove(host_outdir_tgt)
except PermissionError:
pass
elif os.path.isdir(host_outdir_tgt) and not vol.resolved.startswith("_:"):
shutil.rmtree(host_outdir_tgt)
try:
ensure_writable(host_outdir_tgt, include_root=True)
except PermissionError:
pass
try:
shutil.rmtree(host_outdir_tgt)
except PermissionError:
pass
if not vol.resolved.startswith("_:"):
try:
os.symlink(vol.resolved, host_outdir_tgt)
Expand Down