Skip to content

Commit

Permalink
Update language around files and direcotories being read only. Closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
vsmalladi committed May 10, 2024
1 parent 73c6062 commit 1730dc3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ version 1.2.0

+ Added `Directory` type.

+ Added clarification that input files and directories should be treated as read-only.

version 1.1.1
---------------------------

Expand Down
22 changes: 22 additions & 0 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -3543,6 +3543,28 @@ task call_variants_safe {
}
```

Runtime engines **should** treat input `File`s and `Directory`s as read-only, e.g., by setting their permissions appropriately on the local file system, or by localizing them to a directory marked as read-only.

Note starting in WDL 2.0 engines **must** treat input `File`s and `Directory`s as read-only.

A common pattern for tasks that require multiple input files to be in the same directory is to create a new directory in the execution environment and soft-link the files into that directory.

```wdl
task two_files_one_directory {
input {
File bam
File bai
}
String prefix = basename(bam, ".bam")
command <<<
mkdir inputs
ln -s ~{bam} inputs/~{prefix}.bam
ln -s ~{bai} inputs/~{prefix}.bam.bai
varcall inputs/~{prefix}.bam
>>>
}
```

##### Special Case: Versioning Filesystem

Two or more versions of a file in a versioning filesystem might have the same name and come from the same directory. In that case, the following special procedure must be used to avoid collision:
Expand Down

0 comments on commit 1730dc3

Please sign in to comment.