Skip to content

Commit c6538ab

Browse files
author
Peter Amstutz
committed
Remove CreateFileRequirement. Add documentation to InitialWorkDirRequirement.
Add "writable" flag to DirentExt.
1 parent 8b48da6 commit c6538ab

File tree

2 files changed

+61
-49
lines changed

2 files changed

+61
-49
lines changed

draft-4/CommandLineTool.yml

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -79,30 +79,6 @@ $graph:
7979
- {$include: concepts.md}
8080
- {$include: invocation.md}
8181

82-
- type: record
83-
name: FileDef
84-
doc: |
85-
Define a file that must be placed in the designated output directory
86-
prior to executing the command line tool. May be the result of executing
87-
an expression, such as building a configuration file from a template.
88-
fields:
89-
- name: "filename"
90-
type: ["string", "#Expression"]
91-
doc: "The name of the file to create in the output directory."
92-
- name: "fileContent"
93-
type: ["string", "#Expression"]
94-
doc: |
95-
If the value is a string literal or an expression which evaluates to a
96-
string, a new file must be created with the string as the file contents.
97-
98-
If the value is an expression that evaluates to a File object, this
99-
indicates the referenced file should be added to the designated output
100-
directory prior to executing the tool.
101-
102-
Files added in this way may be read-only, and may be provided
103-
by bind mounts or file system links to avoid
104-
unnecessary copying of the input file.
105-
10682

10783
- type: record
10884
name: EnvironmentDef
@@ -628,20 +604,53 @@ $graph:
628604
629605
- name: DirentExt
630606
type: record
607+
doc: |
608+
Define a file or subdirectory that must be placed in the designated output
609+
directory prior to executing the command line tool. May be the result of
610+
executing an expression, such as building a configuration file from a
611+
template.
631612
fields:
632613
- name: entryname
633614
type: [string, Expression]
634615
jsonldPredicate:
635616
_id: cwl:entryname
617+
doc: |
618+
The name of the file or subdirectory to create in the output directory.
636619
- name: entry
637620
type: [string, Expression]
638621
jsonldPredicate:
639622
_id: cwl:entry
623+
doc: |
624+
If the value is a string literal or an expression which evaluates to a
625+
string, a new file must be created with the string as the file contents.
640626
627+
If the value is an expression that evaluates to a `File` object, this
628+
indicates the referenced file should be added to the designated output
629+
directory prior to executing the tool.
630+
631+
If the value is an expression that evaluates to a `Dirent` object, this
632+
indicates that the File or Directory in `entry` should be added to the
633+
designated output directory with the name in `entryname`.
634+
635+
If `writable` is false, the file may be made available using a bind
636+
mount or file system link to avoid unnecessary copying of the input
637+
file.
638+
- name: writable
639+
type: boolean?
640+
doc: |
641+
If true, the file or directory must be writable by the tool. Changes
642+
to the file or directory must be isolated and not visible by any other
643+
CommandLineTool process. This may be implemented by making a copy of
644+
the original file or directory. Default false (files and directories
645+
read-only by default).
641646
642647
- name: InitialWorkDirRequirement
643648
type: record
644649
extends: ProcessRequirement
650+
doc:
651+
Define a list of files and subdirectories that must be created by the
652+
workflow platform in the designated output directory prior to executing the
653+
command line tool.
645654
fields:
646655
- name: listing
647656
type:
@@ -653,24 +662,12 @@ $graph:
653662
_id: "cwl:listing"
654663
mapSubject: entryname
655664
mapPredicate: entry
665+
doc: |
666+
The list of files or subdirectories that must be placed in the
667+
designated output directory prior to executing the command line tool.
656668
657-
658-
- name: CreateFileRequirement
659-
type: record
660-
extends: "#ProcessRequirement"
661-
doc: |
662-
*Deprecated*, superceded by InitialWorkDirRequirement.
663-
664-
Define a list of files that must be created by the workflow
665-
platform in the designated output directory prior to executing the command
666-
line tool. See `FileDef` for details.
667-
fields:
668-
- name: fileDef
669-
type:
670-
type: "array"
671-
items: "#FileDef"
672-
doc: The list of files.
673-
669+
May be an expression. If so, the expression return value must validate
670+
as `{type: array, items: [File, Dirent]}`.
674671
675672
- name: EnvVarRequirement
676673
type: record

draft-4/Process.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,21 @@ $graph:
7474
implementation is unable to retrieve the file content stored at a
7575
remote resource (due to unsupported protocol, access denied, or other
7676
issue) it must signal an error.
77+
78+
If the `path` field is provided but the `location` field is not, an
79+
implementation may assign the value of the `path` field to `location`,
80+
then follow the rules above.
7781
jsonldPredicate:
7882
_id: "@id"
7983
_type: "@id"
8084
- name: path
8185
type: string?
8286
doc: |
8387
The local path where the File is made available prior to executing a
84-
CommandLineTool. This field must not be used in any other context. The
85-
command line tool being executed must be able to to access the file at
86-
`path` using the POSIX `open(2)` syscall.
88+
CommandLineTool. This must be set by the implementation. This field
89+
must not be used in any other context. The command line tool being
90+
executed must be able to to access the file at `path` using the POSIX
91+
`open(2)` syscall.
8792
jsonldPredicate:
8893
"_id": "cwl:path"
8994
"_type": "@id"
@@ -211,16 +216,26 @@ $graph:
211216
A URI that identifies the directory resource. This may be a relative
212217
reference, in which case it must be resolved using the base URI of the
213218
document. The location may refer to a local or remote resource. If
214-
the `listing` field is not set, the implementation must use the URI to
215-
retrieve directory listing. If an implementation is unable to retrieve
216-
the file content stored at a remote resource (due to unsupported
217-
protocol, access denied, or other issue) it must signal an error.
219+
the `listing` field is not set, the implementation must use the
220+
location URI to retrieve directory listing. If an implementation is
221+
unable to retrieve the directory listing stored at a remote resource (due to
222+
unsupported protocol, access denied, or other issue) it must signal an
223+
error.
224+
225+
If the `path` field is provided but the `location` field is not, an
226+
implementation may assign the value of the `path` field to `location`,
227+
then follow the rules above.
218228
jsonldPredicate:
219229
_id: "@id"
220230
_type: "@id"
221231
- name: path
222232
type: string?
223-
doc: The path to the directory.
233+
doc: |
234+
The local path where the Directory is made available prior to executing a
235+
CommandLineTool. This must be set by the implementation. This field
236+
must not be used in any other context. The command line tool being
237+
executed must be able to to access the directory at `path` using the POSIX
238+
`opendir(2)` syscall.
224239
jsonldPredicate:
225240
_id: "cwl:path"
226241
_type: "@id"

0 commit comments

Comments
 (0)