comparison env/lib/python3.7/site-packages/cwltool/schemas/v1.0/CommandLineTool.yml @ 0:26e78fe6e8c4 draft

"planemo upload commit c699937486c35866861690329de38ec1a5d9f783"
author shellac
date Sat, 02 May 2020 07:14:21 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:26e78fe6e8c4
1 $base: "https://w3id.org/cwl/cwl#"
2
3 $namespaces:
4 cwl: "https://w3id.org/cwl/cwl#"
5
6 $graph:
7
8 - name: CommandLineToolDoc
9 type: documentation
10 doc:
11 - |
12 # Common Workflow Language (CWL) Command Line Tool Description, v1.0.2
13
14 This version:
15 * https://w3id.org/cwl/v1.0/
16
17 Current version:
18 * https://w3id.org/cwl/
19 - "\n\n"
20 - {$include: contrib.md}
21 - "\n\n"
22 - |
23 # Abstract
24
25 A Command Line Tool is a non-interactive executable program that reads
26 some input, performs a computation, and terminates after producing some
27 output. Command line programs are a flexible unit of code sharing and
28 reuse, unfortunately the syntax and input/output semantics among command
29 line programs is extremely heterogeneous. A common layer for describing
30 the syntax and semantics of programs can reduce this incidental
31 complexity by providing a consistent way to connect programs together.
32 This specification defines the Common Workflow Language (CWL) Command
33 Line Tool Description, a vendor-neutral standard for describing the
34 syntax and input/output semantics of command line programs.
35
36 - {$include: intro.md}
37
38 - |
39 ## Introduction to CWL Command Line Tool standard v1.0.2
40
41 This specification represents the third stable release from the CWL
42 group. Since the initial v1.0 release, v1.0.2 introduces the following
43 updates to the CWL Command Line Tool standard. Documents should continue
44 to use `cwlVersion: v1.0` and existing v1.0 documents remain valid,
45 however CWL documents that relied on previously undefined or
46 underspecified behavior may have slightly different behavior in v1.0.2.
47
48 * 13 July 2016: Mark `baseCommand` as optional and update descriptive text.
49 * 14 November 2016: Clarify [SoftwareRequirement](#SoftwareRequirement)
50 `spec` fields.
51 * 12 March 2017:
52 * Mark `default` as not required for link checking.
53 * Add note that files in InitialWorkDir must have path in output directory.
54 * Add note that writable: true applies recursively.
55 * 23 July 2017: (v1.0.1)
56 * Add clarification about scattering over empty arrays.
57 * Clarify interpretation of `secondaryFiles` on inputs.
58 * Expanded discussion of semantics of `File` and `Directory` types
59 * Fixed typo "EMACScript" to "ECMAScript"
60 * Clarified application of input parameter default values when the input is `null` or undefined.
61 * Clarified valid types and meaning of the format field on inputs versus outputs
62 * Clarify that command line arguments must not interpreted as shell except when shellQuote: false
63 * Clarify behavior of `entryname`
64 * 10 August 2017: (v1.0.2)
65 * Clarify behavior resolving expressions in `secondaryFile`
66
67 Since draft-3, v1.0 introduces the following changes and additions
68 to the CWL Command Line Tool standard:
69
70 * The [Directory](#Directory) type.
71 * Syntax simplifcations: denoted by the `map<>` syntax. Example: inputs
72 contains a list of items, each with an id. Now one can specify
73 a mapping of that identifier to the corresponding
74 `CommandInputParamater`.
75 ```
76 inputs:
77 - id: one
78 type: string
79 doc: First input parameter
80 - id: two
81 type: int
82 doc: Second input parameter
83 ```
84 can be
85 ```
86 inputs:
87 one:
88 type: string
89 doc: First input parameter
90 two:
91 type: int
92 doc: Second input parameter
93 ```
94 * [InitialWorkDirRequirement](#InitialWorkDirRequirement): list of
95 files and subdirectories to be present in the output directory prior
96 to execution.
97 * Shortcuts for specifying the standard [output](#stdout) and/or
98 [error](#stderr) streams as a (streamable) File output.
99 * [SoftwareRequirement](#SoftwareRequirement) for describing software
100 dependencies of a tool.
101 * The common `description` field has been renamed to `doc`.
102
103
104 ## Purpose
105
106 Standalone programs are a flexible and interoperable form of code reuse.
107 Unlike monolithic applications, applications and analysis workflows which
108 are composed of multiple separate programs can be written in multiple
109 languages and execute concurrently on multiple hosts. However, POSIX
110 does not dictate computer-readable grammar or semantics for program input
111 and output, resulting in extremely heterogeneous command line grammar and
112 input/output semantics among program. This is a particular problem in
113 distributed computing (multi-node compute clusters) and virtualized
114 environments (such as Docker containers) where it is often necessary to
115 provision resources such as input files before executing the program.
116
117 Often this gap is filled by hard coding program invocation and
118 implicitly assuming requirements will be met, or abstracting program
119 invocation with wrapper scripts or descriptor documents. Unfortunately,
120 where these approaches are application or platform specific it creates a
121 significant barrier to reproducibility and portability, as methods
122 developed for one platform must be manually ported to be used on new
123 platforms. Similarly it creates redundant work, as wrappers for popular
124 tools must be rewritten for each application or platform in use.
125
126 The Common Workflow Language Command Line Tool Description is designed to
127 provide a common standard description of grammar and semantics for
128 invoking programs used in data-intensive fields such as Bioinformatics,
129 Chemistry, Physics, Astronomy, and Statistics. This specification
130 defines a precise data and execution model for Command Line Tools that
131 can be implemented on a variety of computing platforms, ranging from a
132 single workstation to cluster, grid, cloud, and high performance
133 computing platforms.
134
135 - {$include: concepts.md}
136 - {$include: invocation.md}
137
138
139 - type: record
140 name: EnvironmentDef
141 doc: |
142 Define an environment variable that will be set in the runtime environment
143 by the workflow platform when executing the command line tool. May be the
144 result of executing an expression, such as getting a parameter from input.
145 fields:
146 - name: envName
147 type: string
148 doc: The environment variable name
149 - name: envValue
150 type: [string, Expression]
151 doc: The environment variable value
152
153 - type: record
154 name: CommandLineBinding
155 extends: InputBinding
156 doc: |
157
158 When listed under `inputBinding` in the input schema, the term
159 "value" refers to the the corresponding value in the input object. For
160 binding objects listed in `CommandLineTool.arguments`, the term "value"
161 refers to the effective value after evaluating `valueFrom`.
162
163 The binding behavior when building the command line depends on the data
164 type of the value. If there is a mismatch between the type described by
165 the input schema and the effective value, such as resulting from an
166 expression evaluation, an implementation must use the data type of the
167 effective value.
168
169 - **string**: Add `prefix` and the string to the command line.
170
171 - **number**: Add `prefix` and decimal representation to command line.
172
173 - **boolean**: If true, add `prefix` to the command line. If false, add
174 nothing.
175
176 - **File**: Add `prefix` and the value of
177 [`File.path`](#File) to the command line.
178
179 - **array**: If `itemSeparator` is specified, add `prefix` and the join
180 the array into a single string with `itemSeparator` separating the
181 items. Otherwise first add `prefix`, then recursively process
182 individual elements.
183
184 - **object**: Add `prefix` only, and recursively add object fields for
185 which `inputBinding` is specified.
186
187 - **null**: Add nothing.
188
189 fields:
190 - name: position
191 type: int?
192 doc: "The sorting key. Default position is 0."
193 - name: prefix
194 type: string?
195 doc: "Command line prefix to add before the value."
196 - name: separate
197 type: boolean?
198 doc: |
199 If true (default), then the prefix and value must be added as separate
200 command line arguments; if false, prefix and value must be concatenated
201 into a single command line argument.
202 - name: itemSeparator
203 type: string?
204 doc: |
205 Join the array elements into a single string with the elements
206 separated by by `itemSeparator`.
207 - name: valueFrom
208 type:
209 - "null"
210 - string
211 - Expression
212 jsonldPredicate: "cwl:valueFrom"
213 doc: |
214 If `valueFrom` is a constant string value, use this as the value and
215 apply the binding rules above.
216
217 If `valueFrom` is an expression, evaluate the expression to yield the
218 actual value to use to build the command line and apply the binding
219 rules above. If the inputBinding is associated with an input
220 parameter, the value of `self` in the expression will be the value of
221 the input parameter. Input parameter defaults (as specified by the
222 `InputParameter.default` field) must be applied before evaluating the
223 expression.
224
225 When a binding is part of the `CommandLineTool.arguments` field,
226 the `valueFrom` field is required.
227
228 - name: shellQuote
229 type: boolean?
230 doc: |
231 If `ShellCommandRequirement` is in the requirements for the current command,
232 this controls whether the value is quoted on the command line (default is true).
233 Use `shellQuote: false` to inject metacharacters for operations such as pipes.
234
235 If `shellQuote` is true or not provided, the implementation must not
236 permit interpretation of any shell metacharacters or directives.
237
238 - type: record
239 name: CommandOutputBinding
240 extends: OutputBinding
241 doc: |
242 Describes how to generate an output parameter based on the files produced
243 by a CommandLineTool.
244
245 The output parameter value is generated by applying these operations in the
246 following order:
247
248 - glob
249 - loadContents
250 - outputEval
251 - secondaryFiles
252 fields:
253 - name: glob
254 type:
255 - "null"
256 - string
257 - Expression
258 - type: array
259 items: string
260 doc: |
261 Find files relative to the output directory, using POSIX glob(3)
262 pathname matching. If an array is provided, find files that match any
263 pattern in the array. If an expression is provided, the expression must
264 return a string or an array of strings, which will then be evaluated as
265 one or more glob patterns. Must only match and return files which
266 actually exist.
267 - name: loadContents
268 type:
269 - "null"
270 - boolean
271 jsonldPredicate: "cwl:loadContents"
272 doc: |
273 For each file matched in `glob`, read up to
274 the first 64 KiB of text from the file and place it in the `contents`
275 field of the file object for manipulation by `outputEval`.
276 - name: outputEval
277 type:
278 - "null"
279 - string
280 - Expression
281 doc: |
282 Evaluate an expression to generate the output value. If `glob` was
283 specified, the value of `self` must be an array containing file objects
284 that were matched. If no files were matched, `self` must be a zero
285 length array; if a single file was matched, the value of `self` is an
286 array of a single element. Additionally, if `loadContents` is `true`,
287 the File objects must include up to the first 64 KiB of file contents
288 in the `contents` field.
289
290
291 - name: CommandInputRecordField
292 type: record
293 extends: InputRecordField
294 specialize:
295 - specializeFrom: InputRecordSchema
296 specializeTo: CommandInputRecordSchema
297 - specializeFrom: InputEnumSchema
298 specializeTo: CommandInputEnumSchema
299 - specializeFrom: InputArraySchema
300 specializeTo: CommandInputArraySchema
301 - specializeFrom: InputBinding
302 specializeTo: CommandLineBinding
303
304
305 - name: CommandInputRecordSchema
306 type: record
307 extends: InputRecordSchema
308 specialize:
309 - specializeFrom: InputRecordField
310 specializeTo: CommandInputRecordField
311
312
313 - name: CommandInputEnumSchema
314 type: record
315 extends: InputEnumSchema
316 specialize:
317 - specializeFrom: InputBinding
318 specializeTo: CommandLineBinding
319
320
321 - name: CommandInputArraySchema
322 type: record
323 extends: InputArraySchema
324 specialize:
325 - specializeFrom: InputRecordSchema
326 specializeTo: CommandInputRecordSchema
327 - specializeFrom: InputEnumSchema
328 specializeTo: CommandInputEnumSchema
329 - specializeFrom: InputArraySchema
330 specializeTo: CommandInputArraySchema
331 - specializeFrom: InputBinding
332 specializeTo: CommandLineBinding
333
334
335 - name: CommandOutputRecordField
336 type: record
337 extends: OutputRecordField
338 specialize:
339 - specializeFrom: OutputRecordSchema
340 specializeTo: CommandOutputRecordSchema
341 - specializeFrom: OutputEnumSchema
342 specializeTo: CommandOutputEnumSchema
343 - specializeFrom: OutputArraySchema
344 specializeTo: CommandOutputArraySchema
345 - specializeFrom: OutputBinding
346 specializeTo: CommandOutputBinding
347
348
349 - name: CommandOutputRecordSchema
350 type: record
351 extends: OutputRecordSchema
352 specialize:
353 - specializeFrom: OutputRecordField
354 specializeTo: CommandOutputRecordField
355
356
357 - name: CommandOutputEnumSchema
358 type: record
359 extends: OutputEnumSchema
360 specialize:
361 - specializeFrom: OutputRecordSchema
362 specializeTo: CommandOutputRecordSchema
363 - specializeFrom: OutputEnumSchema
364 specializeTo: CommandOutputEnumSchema
365 - specializeFrom: OutputArraySchema
366 specializeTo: CommandOutputArraySchema
367 - specializeFrom: OutputBinding
368 specializeTo: CommandOutputBinding
369
370
371 - name: CommandOutputArraySchema
372 type: record
373 extends: OutputArraySchema
374 specialize:
375 - specializeFrom: OutputRecordSchema
376 specializeTo: CommandOutputRecordSchema
377 - specializeFrom: OutputEnumSchema
378 specializeTo: CommandOutputEnumSchema
379 - specializeFrom: OutputArraySchema
380 specializeTo: CommandOutputArraySchema
381 - specializeFrom: OutputBinding
382 specializeTo: CommandOutputBinding
383
384
385 - type: record
386 name: CommandInputParameter
387 extends: InputParameter
388 doc: An input parameter for a CommandLineTool.
389 specialize:
390 - specializeFrom: InputRecordSchema
391 specializeTo: CommandInputRecordSchema
392 - specializeFrom: InputEnumSchema
393 specializeTo: CommandInputEnumSchema
394 - specializeFrom: InputArraySchema
395 specializeTo: CommandInputArraySchema
396 - specializeFrom: InputBinding
397 specializeTo: CommandLineBinding
398
399 - type: record
400 name: CommandOutputParameter
401 extends: OutputParameter
402 doc: An output parameter for a CommandLineTool.
403 specialize:
404 - specializeFrom: OutputBinding
405 specializeTo: CommandOutputBinding
406 fields:
407 - name: type
408 type:
409 - "null"
410 - CWLType
411 - stdout
412 - stderr
413 - CommandOutputRecordSchema
414 - CommandOutputEnumSchema
415 - CommandOutputArraySchema
416 - string
417 - type: array
418 items:
419 - CWLType
420 - CommandOutputRecordSchema
421 - CommandOutputEnumSchema
422 - CommandOutputArraySchema
423 - string
424 jsonldPredicate:
425 "_id": "sld:type"
426 "_type": "@vocab"
427 refScope: 2
428 typeDSL: True
429 doc: |
430 Specify valid types of data that may be assigned to this parameter.
431
432 - name: stdout
433 type: enum
434 symbols: [ "cwl:stdout" ]
435 docParent: "#CommandOutputParameter"
436 doc: |
437 Only valid as a `type` for a `CommandLineTool` output with no
438 `outputBinding` set.
439
440 The following
441 ```
442 outputs:
443 an_output_name:
444 type: stdout
445
446 stdout: a_stdout_file
447 ```
448 is equivalent to
449 ```
450 outputs:
451 an_output_name:
452 type: File
453 streamable: true
454 outputBinding:
455 glob: a_stdout_file
456
457 stdout: a_stdout_file
458 ```
459
460 If there is no `stdout` name provided, a random filename will be created.
461 For example, the following
462 ```
463 outputs:
464 an_output_name:
465 type: stdout
466 ```
467 is equivalent to
468 ```
469 outputs:
470 an_output_name:
471 type: File
472 streamable: true
473 outputBinding:
474 glob: random_stdout_filenameABCDEFG
475
476 stdout: random_stdout_filenameABCDEFG
477 ```
478
479
480 - name: stderr
481 type: enum
482 symbols: [ "cwl:stderr" ]
483 docParent: "#CommandOutputParameter"
484 doc: |
485 Only valid as a `type` for a `CommandLineTool` output with no
486 `outputBinding` set.
487
488 The following
489 ```
490 outputs:
491 an_output_name:
492 type: stderr
493
494 stderr: a_stderr_file
495 ```
496 is equivalent to
497 ```
498 outputs:
499 an_output_name:
500 type: File
501 streamable: true
502 outputBinding:
503 glob: a_stderr_file
504
505 stderr: a_stderr_file
506 ```
507
508 If there is no `stderr` name provided, a random filename will be created.
509 For example, the following
510 ```
511 outputs:
512 an_output_name:
513 type: stderr
514 ```
515 is equivalent to
516 ```
517 outputs:
518 an_output_name:
519 type: File
520 streamable: true
521 outputBinding:
522 glob: random_stderr_filenameABCDEFG
523
524 stderr: random_stderr_filenameABCDEFG
525 ```
526
527
528 - type: record
529 name: CommandLineTool
530 extends: Process
531 documentRoot: true
532 specialize:
533 - specializeFrom: InputParameter
534 specializeTo: CommandInputParameter
535 - specializeFrom: OutputParameter
536 specializeTo: CommandOutputParameter
537 doc: |
538 This defines the schema of the CWL Command Line Tool Description document.
539
540 fields:
541 - name: class
542 jsonldPredicate:
543 "_id": "@type"
544 "_type": "@vocab"
545 type: string
546 - name: baseCommand
547 doc: |
548 Specifies the program to execute. If an array, the first element of
549 the array is the command to execute, and subsequent elements are
550 mandatory command line arguments. The elements in `baseCommand` must
551 appear before any command line bindings from `inputBinding` or
552 `arguments`.
553
554 If `baseCommand` is not provided or is an empty array, the first
555 element of the command line produced after processing `inputBinding` or
556 `arguments` must be used as the program to execute.
557
558 If the program includes a path separator character it must
559 be an absolute path, otherwise it is an error. If the program does not
560 include a path separator, search the `$PATH` variable in the runtime
561 environment of the workflow runner find the absolute path of the
562 executable.
563 type:
564 - string?
565 - string[]?
566 jsonldPredicate:
567 "_id": "cwl:baseCommand"
568 "_container": "@list"
569 - name: arguments
570 doc: |
571 Command line bindings which are not directly associated with input parameters.
572 type:
573 - "null"
574 - type: array
575 items: [string, Expression, CommandLineBinding]
576 jsonldPredicate:
577 "_id": "cwl:arguments"
578 "_container": "@list"
579 - name: stdin
580 type: ["null", string, Expression]
581 doc: |
582 A path to a file whose contents must be piped into the command's
583 standard input stream.
584 - name: stderr
585 type: ["null", string, Expression]
586 jsonldPredicate: "https://w3id.org/cwl/cwl#stderr"
587 doc: |
588 Capture the command's standard error stream to a file written to
589 the designated output directory.
590
591 If `stderr` is a string, it specifies the file name to use.
592
593 If `stderr` is an expression, the expression is evaluated and must
594 return a string with the file name to use to capture stderr. If the
595 return value is not a string, or the resulting path contains illegal
596 characters (such as the path separator `/`) it is an error.
597 - name: stdout
598 type: ["null", string, Expression]
599 jsonldPredicate: "https://w3id.org/cwl/cwl#stdout"
600 doc: |
601 Capture the command's standard output stream to a file written to
602 the designated output directory.
603
604 If `stdout` is a string, it specifies the file name to use.
605
606 If `stdout` is an expression, the expression is evaluated and must
607 return a string with the file name to use to capture stdout. If the
608 return value is not a string, or the resulting path contains illegal
609 characters (such as the path separator `/`) it is an error.
610 - name: successCodes
611 type: int[]?
612 doc: |
613 Exit codes that indicate the process completed successfully.
614
615 - name: temporaryFailCodes
616 type: int[]?
617 doc: |
618 Exit codes that indicate the process failed due to a possibly
619 temporary condition, where executing the process with the same
620 runtime environment and inputs may produce different results.
621
622 - name: permanentFailCodes
623 type: int[]?
624 doc:
625 Exit codes that indicate the process failed due to a permanent logic
626 error, where executing the process with the same runtime environment and
627 same inputs is expected to always fail.
628
629
630 - type: record
631 name: DockerRequirement
632 extends: ProcessRequirement
633 doc: |
634 Indicates that a workflow component should be run in a
635 [Docker](http://docker.com) container, and specifies how to fetch or build
636 the image.
637
638 If a CommandLineTool lists `DockerRequirement` under
639 `hints` (or `requirements`), it may (or must) be run in the specified Docker
640 container.
641
642 The platform must first acquire or install the correct Docker image as
643 specified by `dockerPull`, `dockerImport`, `dockerLoad` or `dockerFile`.
644
645 The platform must execute the tool in the container using `docker run` with
646 the appropriate Docker image and tool command line.
647
648 The workflow platform may provide input files and the designated output
649 directory through the use of volume bind mounts. The platform may rewrite
650 file paths in the input object to correspond to the Docker bind mounted
651 locations.
652
653 When running a tool contained in Docker, the workflow platform must not
654 assume anything about the contents of the Docker container, such as the
655 presence or absence of specific software, except to assume that the
656 generated command line represents a valid command within the runtime
657 environment of the container.
658
659 ## Interaction with other requirements
660
661 If [EnvVarRequirement](#EnvVarRequirement) is specified alongside a
662 DockerRequirement, the environment variables must be provided to Docker
663 using `--env` or `--env-file` and interact with the container's preexisting
664 environment as defined by Docker.
665
666 fields:
667 - name: class
668 type: string
669 doc: "Always 'DockerRequirement'"
670 jsonldPredicate:
671 "_id": "@type"
672 "_type": "@vocab"
673 - name: dockerPull
674 type: string?
675 doc: "Specify a Docker image to retrieve using `docker pull`."
676 - name: dockerLoad
677 type: string?
678 doc: "Specify a HTTP URL from which to download a Docker image using `docker load`."
679 - name: dockerFile
680 type: string?
681 doc: "Supply the contents of a Dockerfile which will be built using `docker build`."
682 - name: dockerImport
683 type: string?
684 doc: "Provide HTTP URL to download and gunzip a Docker images using `docker import."
685 - name: dockerImageId
686 type: string?
687 doc: |
688 The image id that will be used for `docker run`. May be a
689 human-readable image name or the image identifier hash. May be skipped
690 if `dockerPull` is specified, in which case the `dockerPull` image id
691 must be used.
692 - name: dockerOutputDirectory
693 type: string?
694 doc: |
695 Set the designated output directory to a specific location inside the
696 Docker container.
697
698
699 - type: record
700 name: SoftwareRequirement
701 extends: ProcessRequirement
702 doc: |
703 A list of software packages that should be configured in the environment of
704 the defined process.
705 fields:
706 - name: class
707 type: string
708 doc: "Always 'SoftwareRequirement'"
709 jsonldPredicate:
710 "_id": "@type"
711 "_type": "@vocab"
712 - name: packages
713 type: SoftwarePackage[]
714 doc: "The list of software to be configured."
715 jsonldPredicate:
716 mapSubject: package
717 mapPredicate: specs
718
719 - name: SoftwarePackage
720 type: record
721 fields:
722 - name: package
723 type: string
724 doc: |
725 The name of the software to be made available. If the name is
726 common, inconsistent, or otherwise ambiguous it should be combined with
727 one or more identifiers in the `specs` field.
728 - name: version
729 type: string[]?
730 doc: |
731 The (optional) versions of the software that are known to be
732 compatible.
733 - name: specs
734 type: string[]?
735 doc: |
736 One or more [IRI](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier)s
737 identifying resources for installing or enabling the software named in
738 the `package` field. Implementations may provide resolvers which map
739 these software identifer IRIs to some configuration action; or they can
740 use only the name from the `package` field on a best effort basis.
741
742 For example, the IRI https://packages.debian.org/bowtie could
743 be resolved with `apt-get install bowtie`. The IRI
744 https://anaconda.org/bioconda/bowtie could be resolved with `conda
745 install -c bioconda bowtie`.
746
747 IRIs can also be system independent and used to map to a specific
748 software installation or selection mechanism.
749 Using [RRID](https://www.identifiers.org/rrid/) as an example:
750 https://identifiers.org/rrid/RRID:SCR_005476
751 could be fulfilled using the above mentioned Debian or bioconda
752 package, a local installation managed by [Environement Modules](http://modules.sourceforge.net/),
753 or any other mechanism the platform chooses. IRIs can also be from
754 identifer sources that are discipline specific yet still system
755 independent. As an example, the equivalent [ELIXIR Tools and Data
756 Service Registry](https://bio.tools) IRI to the previous RRID example is
757 https://bio.tools/tool/bowtie2/version/2.2.8.
758 If supported by a given registry, implementations are encouraged to
759 query these system independent sofware identifier IRIs directly for
760 links to packaging systems.
761
762 A site specific IRI can be listed as well. For example, an academic
763 computing cluster using Environement Modules could list the IRI
764 `https://hpc.example.edu/modules/bowtie-tbb/1.22` to indicate that
765 `module load bowtie-tbb/1.1.2` should be executed to make available
766 `bowtie` version 1.1.2 compiled with the TBB library prior to running
767 the accompanying Workflow or CommandLineTool. Note that the example IRI
768 is specific to a particular institution and computing environment as
769 the Environment Modules system does not have a common namespace or
770 standardized naming convention.
771
772 This last example is the least portable and should only be used if
773 mechanisms based off of the `package` field or more generic IRIs are
774 unavailable or unsuitable. While harmless to other sites, site specific
775 software IRIs should be left out of shared CWL descriptions to avoid
776 clutter.
777
778 - name: Dirent
779 type: record
780 doc: |
781 Define a file or subdirectory that must be placed in the designated output
782 directory prior to executing the command line tool. May be the result of
783 executing an expression, such as building a configuration file from a
784 template.
785 fields:
786 - name: entryname
787 type: ["null", string, Expression]
788 jsonldPredicate:
789 _id: cwl:entryname
790 doc: |
791 The name of the file or subdirectory to create in the output directory.
792 If `entry` is a File or Directory, the `entryname` field overrides the value
793 of `basename` of the File or Directory object. Optional.
794 - name: entry
795 type: [string, Expression]
796 jsonldPredicate:
797 _id: cwl:entry
798 doc: |
799 If the value is a string literal or an expression which evaluates to a
800 string, a new file must be created with the string as the file contents.
801
802 If the value is an expression that evaluates to a `File` object, this
803 indicates the referenced file should be added to the designated output
804 directory prior to executing the tool.
805
806 If the value is an expression that evaluates to a `Dirent` object, this
807 indicates that the File or Directory in `entry` should be added to the
808 designated output directory with the name in `entryname`.
809
810 If `writable` is false, the file may be made available using a bind
811 mount or file system link to avoid unnecessary copying of the input
812 file.
813 - name: writable
814 type: boolean?
815 doc: |
816 If true, the file or directory must be writable by the tool. Changes
817 to the file or directory must be isolated and not visible by any other
818 CommandLineTool process. This may be implemented by making a copy of
819 the original file or directory. Default false (files and directories
820 read-only by default).
821
822 A directory marked as `writable: true` implies that all files and
823 subdirectories are recursively writable as well.
824
825
826 - name: InitialWorkDirRequirement
827 type: record
828 extends: ProcessRequirement
829 doc:
830 Define a list of files and subdirectories that must be created by the
831 workflow platform in the designated output directory prior to executing the
832 command line tool.
833 fields:
834 - name: class
835 type: string
836 doc: InitialWorkDirRequirement
837 jsonldPredicate:
838 "_id": "@type"
839 "_type": "@vocab"
840 - name: listing
841 type:
842 - type: array
843 items: [File, Directory, Dirent, string, Expression]
844 - string
845 - Expression
846 jsonldPredicate:
847 _id: "cwl:listing"
848 doc: |
849 The list of files or subdirectories that must be placed in the
850 designated output directory prior to executing the command line tool.
851
852 May be an expression. If so, the expression return value must validate
853 as `{type: array, items: [File, Directory]}`.
854
855 Files or Directories which are listed in the input parameters and
856 appear in the `InitialWorkDirRequirement` listing must have their
857 `path` set to their staged location in the designated output directory.
858 If the same File or Directory appears more than once in the
859 `InitialWorkDirRequirement` listing, the implementation must choose
860 exactly one value for `path`; how this value is chosen is undefined.
861
862
863 - name: EnvVarRequirement
864 type: record
865 extends: ProcessRequirement
866 doc: |
867 Define a list of environment variables which will be set in the
868 execution environment of the tool. See `EnvironmentDef` for details.
869 fields:
870 - name: class
871 type: string
872 doc: "Always 'EnvVarRequirement'"
873 jsonldPredicate:
874 "_id": "@type"
875 "_type": "@vocab"
876 - name: envDef
877 type: EnvironmentDef[]
878 doc: The list of environment variables.
879 jsonldPredicate:
880 mapSubject: envName
881 mapPredicate: envValue
882
883
884 - type: record
885 name: ShellCommandRequirement
886 extends: ProcessRequirement
887 doc: |
888 Modify the behavior of CommandLineTool to generate a single string
889 containing a shell command line. Each item in the argument list must be
890 joined into a string separated by single spaces and quoted to prevent
891 intepretation by the shell, unless `CommandLineBinding` for that argument
892 contains `shellQuote: false`. If `shellQuote: false` is specified, the
893 argument is joined into the command string without quoting, which allows
894 the use of shell metacharacters such as `|` for pipes.
895 fields:
896 - name: class
897 type: string
898 doc: "Always 'ShellCommandRequirement'"
899 jsonldPredicate:
900 "_id": "@type"
901 "_type": "@vocab"
902
903
904 - type: record
905 name: ResourceRequirement
906 extends: ProcessRequirement
907 doc: |
908 Specify basic hardware resource requirements.
909
910 "min" is the minimum amount of a resource that must be reserved to schedule
911 a job. If "min" cannot be satisfied, the job should not be run.
912
913 "max" is the maximum amount of a resource that the job shall be permitted
914 to use. If a node has sufficient resources, multiple jobs may be scheduled
915 on a single node provided each job's "max" resource requirements are
916 met. If a job attempts to exceed its "max" resource allocation, an
917 implementation may deny additional resources, which may result in job
918 failure.
919
920 If "min" is specified but "max" is not, then "max" == "min"
921 If "max" is specified by "min" is not, then "min" == "max".
922
923 It is an error if max < min.
924
925 It is an error if the value of any of these fields is negative.
926
927 If neither "min" nor "max" is specified for a resource, an implementation may provide a default.
928
929 fields:
930 - name: class
931 type: string
932 doc: "Always 'ResourceRequirement'"
933 jsonldPredicate:
934 "_id": "@type"
935 "_type": "@vocab"
936 - name: coresMin
937 type: ["null", long, string, Expression]
938 doc: Minimum reserved number of CPU cores
939
940 - name: coresMax
941 type: ["null", int, string, Expression]
942 doc: Maximum reserved number of CPU cores
943
944 - name: ramMin
945 type: ["null", long, string, Expression]
946 doc: Minimum reserved RAM in mebibytes (2**20)
947
948 - name: ramMax
949 type: ["null", long, string, Expression]
950 doc: Maximum reserved RAM in mebibytes (2**20)
951
952 - name: tmpdirMin
953 type: ["null", long, string, Expression]
954 doc: Minimum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20)
955
956 - name: tmpdirMax
957 type: ["null", long, string, Expression]
958 doc: Maximum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20)
959
960 - name: outdirMin
961 type: ["null", long, string, Expression]
962 doc: Minimum reserved filesystem based storage for the designated output directory, in mebibytes (2**20)
963
964 - name: outdirMax
965 type: ["null", long, string, Expression]
966 doc: Maximum reserved filesystem based storage for the designated output directory, in mebibytes (2**20)