Skip to content

Commit 2256a30

Browse files
authored
Bump to 1.2.0-dev2 (#1262)
* Bump to 1.2.0-dev2 * Round up fractional cores. Remove package_data from setup.py which is confusingly redundant with MANIFEST.in * Add v1.1+ extensions.yml file
1 parent 5ae5798 commit 2256a30

File tree

137 files changed

+183
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+183
-57
lines changed

MANIFEST.in

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ include cwltool/schemas/v1.1.0-dev1/*.yml
2424
include cwltool/schemas/v1.1.0-dev1/*.md
2525
include cwltool/schemas/v1.1.0-dev1/salad/schema_salad/metaschema/*.yml
2626
include cwltool/schemas/v1.1.0-dev1/salad/schema_salad/metaschema/*.md
27-
include cwltool/schemas/v1.2.0-dev1/*.yml
28-
include cwltool/schemas/v1.2.0-dev1/*.md
29-
include cwltool/schemas/v1.2.0-dev1/salad/schema_salad/metaschema/*.yml
30-
include cwltool/schemas/v1.2.0-dev1/salad/schema_salad/metaschema/*.md
27+
include cwltool/schemas/v1.2.0-dev2/*.yml
28+
include cwltool/schemas/v1.2.0-dev2/*.md
29+
include cwltool/schemas/v1.2.0-dev2/salad/schema_salad/metaschema/*.yml
30+
include cwltool/schemas/v1.2.0-dev2/salad/schema_salad/metaschema/*.md
3131
include cwltool/cwlNodeEngine.js
3232
include cwltool/cwlNodeEngineJSConsole.js
3333
include cwltool/cwlNodeEngineWithContext.js
3434
include cwltool/extensions.yml
35+
include cwltool/extensions-v1.1.yml
3536
include cwltool/jshint/jshint_wrapper.js
3637
include cwltool/jshint/jshint.js
38+
include cwltool/hello.simg
3739
prune cwltool/schemas/v1.0/salad/typeshed
3840
prune cwltool/schemas/v1.0/salad/schema_salad/tests
3941
prune cwltool/schemas/v1.1.0-dev1/salad/typeshed

cwltool/builder.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import copy
22
import logging
33
import os
4+
import math
45
from typing import (
56
IO,
67
Any,
@@ -544,13 +545,18 @@ def do_eval(self, ex, context=None, recursive=False, strip_whitespace=True):
544545
if isinstance(ex, MutableSequence):
545546
return [self.do_eval(v, context, recursive) for v in ex]
546547

548+
resources = self.resources
549+
if self.resources and "cores" in self.resources:
550+
resources = copy.copy(resources)
551+
resources["cores"] = int(math.ceil(resources["cores"]))
552+
547553
return expression.do_eval(
548554
ex,
549555
self.job,
550556
self.requirements,
551557
self.outdir,
552558
self.tmpdir,
553-
self.resources,
559+
resources,
554560
context=context,
555561
timeout=self.timeout,
556562
debug=self.debug,

cwltool/extensions-v1.1.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
$base: http://commonwl.org/cwltool#
2+
$namespaces:
3+
cwl: "https://w3id.org/cwl/cwl#"
4+
$graph:
5+
- $import: https://w3id.org/cwl/CommonWorkflowLanguage.yml
6+
7+
- name: Secrets
8+
type: record
9+
inVocab: false
10+
extends: cwl:ProcessRequirement
11+
fields:
12+
class:
13+
type: string
14+
doc: "Always 'Secrets'"
15+
jsonldPredicate:
16+
"_id": "@type"
17+
"_type": "@vocab"
18+
secrets:
19+
type: string[]
20+
doc: |
21+
List one or more input parameters that are sensitive (such as passwords)
22+
which will be deliberately obscured from logging.
23+
jsonldPredicate:
24+
"_type": "@id"
25+
refScope: 0
26+
27+
28+
- name: ProcessGenerator
29+
type: record
30+
inVocab: true
31+
extends: cwl:Process
32+
documentRoot: true
33+
fields:
34+
- name: class
35+
jsonldPredicate:
36+
"_id": "@type"
37+
"_type": "@vocab"
38+
type: string
39+
- name: run
40+
type: [string, cwl:Process]
41+
jsonldPredicate:
42+
_id: "cwl:run"
43+
_type: "@id"
44+
subscope: run
45+
doc: |
46+
Specifies the process to run.

cwltool/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,17 @@ def setup_schema(
609609
custom_schema_callback()
610610
elif args.enable_ext:
611611
res = pkg_resources.resource_stream(__name__, "extensions.yml")
612-
use_custom_schema("v1.0", "http://commonwl.org/cwltool", res.read())
612+
ext10 = res.read()
613+
res = pkg_resources.resource_stream(__name__, "extensions-v1.1.yml")
614+
ext11 = res.read()
615+
use_custom_schema("v1.0", "http://commonwl.org/cwltool", ext10)
616+
use_custom_schema("v1.1", "http://commonwl.org/cwltool", ext11)
617+
use_custom_schema("v1.2.0-dev2", "http://commonwl.org/cwltool", ext11)
613618
res.close()
614619
else:
615620
use_standard_schema("v1.0")
621+
use_standard_schema("v1.1")
622+
use_standard_schema("v1.2.0-dev2")
616623

617624

618625
def setup_provenance(

cwltool/schemas/v1.2.0-dev1/CommandLineTool.yml renamed to cwltool/schemas/v1.2.0-dev2/CommandLineTool.yml

Lines changed: 57 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ $graph:
1010
type: documentation
1111
doc:
1212
- |
13-
# Common Workflow Language (CWL) Command Line Tool Description, v1.2.0-dev1
13+
# Common Workflow Language (CWL) Command Line Tool Description, v1.2.0-dev2
1414
1515
This version:
16-
* https://w3id.org/cwl/v1.2.0-dev1/
16+
* https://w3id.org/cwl/v1.2.0-dev2/
1717
1818
Current version:
1919
* https://w3id.org/cwl/
@@ -37,21 +37,26 @@ $graph:
3737
- {$include: intro.md}
3838

3939
- |
40-
## Introduction to the CWL Command Line Tool standard v1.2.0-dev1
40+
## Introduction to the CWL Command Line Tool standard v1.2.0-dev2
4141
4242
This specification represents the latest development release from the
43-
CWL group. Since the v1.1 release, v1.2.0-dev1 introduces the
43+
CWL group. Since the v1.1 release, v1.2.0-dev2 introduces the
4444
following updates to the CWL Command Line Tool standard.
45-
Documents should use `cwlVersion: v1.2.0-dev1` to make use of new
46-
syntax and features introduced in v1.2.0-dev1. Existing v1.1 documents
45+
Documents should use `cwlVersion: v1.2.0-dev2` to make use of new
46+
syntax and features introduced in v1.2.0-dev2. Existing v1.1 documents
4747
should be trivially updatable by changing `cwlVersion`, however
4848
CWL documents that relied on previously undefined or
4949
underspecified behavior may have slightly different behavior in
50-
v1.2.0-dev1.
50+
v1.2.0-dev2.
5151
5252
## Changelog
5353
54-
See also the [CWL Workflow Description, v1.2.0-dev1 changelog](Workflow.html#Changelog).
54+
* `coresMin` and `coresMax` of
55+
[ResourceRequirement](#ResourceRequirement) may now request fractional CPUs.
56+
* (CommandLineTool)[#CommandLineTool] can now express `intent`
57+
with an identifier for the type of computational operation.
58+
59+
See also the [CWL Workflow Description, v1.2.0-dev2 changelog](Workflow.html#Changelog).
5560
5661
## Purpose
5762
@@ -874,14 +879,22 @@ $graph:
874879
If the value is a string literal or an expression which evaluates to a
875880
string, a new file must be created with the string as the file contents.
876881
877-
If the value is an expression that evaluates to a `File` object, this
878-
indicates the referenced file should be added to the designated output
879-
directory prior to executing the tool.
882+
If the value is an expression that evaluates to a `File` or `Directory`
883+
object, this indicates the referenced file or directory should be added
884+
to the designated output directory prior to executing the tool.
885+
886+
If the value is an expression that evaluates to an array of `File` or
887+
`Directory` objects, this indicates the referenced files or directories
888+
should be added to the designated output directory prior to executing
889+
the tool, with ignoring the value in `entryname`.
880890
881891
If the value is an expression that evaluates to a `Dirent` object, this
882892
indicates that the File or Directory in `entry` should be added to the
883893
designated output directory with the name in `entryname`.
884894
895+
If the value is an expression that evaluates to `null`, nothing is added
896+
to the designated output directory from this entry.
897+
885898
If `writable` is false, the file may be made available using a bind
886899
mount or file system link to avoid unnecessary copying of the input
887900
file.
@@ -934,7 +947,7 @@ $graph:
934947
designated output directory prior to executing the command line tool.
935948
936949
May be an expression. If so, the expression return value must validate as
937-
`{type: array, items: ["null", File, File[], Directory, Directory[], Dirent]}`.
950+
`{type: array, items: ["null", File, Directory, Dirent, {type: array, items: [File, Directory]}]}`.
938951
939952
Files or Directories which are listed in the input parameters and
940953
appear in the `InitialWorkDirRequirement` listing must have their
@@ -1018,12 +1031,40 @@ $graph:
10181031
"_id": "@type"
10191032
"_type": "@vocab"
10201033
- name: coresMin
1021-
type: ["null", long, Expression]
1022-
doc: Minimum reserved number of CPU cores (default is 1)
1034+
type: ["null", long, float, Expression]
1035+
doc: |
1036+
Minimum reserved number of CPU cores (default is 1).
1037+
1038+
May be a fractional value to indicate to a scheduling
1039+
algorithm that one core can be allocated to multiple
1040+
jobs. For example, a value of 0.25 indicates that up to 4
1041+
jobs may run in parallel on 1 core. A value of 1.25 means
1042+
that up to 3 jobs can run on a 4 core system (4/1.25 ≈ 3).
1043+
1044+
Processes can only share a core allocation if the sum of each
1045+
of their `ramMax`, `tmpdirMax`, and `outdirMax` requests also
1046+
do not exceed the capacity of the node.
1047+
1048+
Processes sharing a core must have the same level of isolation
1049+
(typically a container or VM) that they would normally.
1050+
1051+
The reported number of CPU cores reserved for the process,
1052+
which is available to expressions on the CommandLineTool as
1053+
`runtime.cores`, must be a non-zero integer, and may be
1054+
calculated by rounding up the cores request to the next whole
1055+
number.
1056+
1057+
Scheduling systems may allocate fractional CPU resources by
1058+
setting quotas or scheduling weights. Scheduling systems that
1059+
do not support fractional CPUs may round up the request to the
1060+
next whole number.
10231061
10241062
- name: coresMax
1025-
type: ["null", int, Expression]
1026-
doc: Maximum reserved number of CPU cores
1063+
type: ["null", long, float, Expression]
1064+
doc: |
1065+
Maximum reserved number of CPU cores.
1066+
1067+
See `coresMin` for discussion about fractional CPU requests.
10271068
10281069
- name: ramMin
10291070
type: ["null", long, Expression]

cwltool/schemas/v1.2.0-dev1/Process.yml renamed to cwltool/schemas/v1.2.0-dev2/Process.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $namespaces:
88

99
$graph:
1010

11-
- name: "Common Workflow Language, v1.2.0-dev1"
11+
- name: "Common Workflow Language, v1.2.0-dev2"
1212
type: documentation
1313
doc: {$include: concepts.md}
1414

@@ -41,6 +41,7 @@ $graph:
4141
- cwl:v1.1.0-dev1 # a dash is required by the semver 2.0 rules
4242
- cwl:v1.1
4343
- cwl:v1.2.0-dev1
44+
- cwl:v1.2.0-dev2
4445

4546
- name: CWLType
4647
type: enum
@@ -843,6 +844,25 @@ $graph:
843844
jsonldPredicate:
844845
"_id": "cwl:cwlVersion"
845846
"_type": "@vocab"
847+
- name: intent
848+
type: string[]?
849+
jsonldPredicate:
850+
_type: "@id"
851+
identity: true
852+
doc: |
853+
An identifier for the type of computational operation, of this Process.
854+
Especially useful for "class: Operation", but can also be used for
855+
CommandLineTool, Workflow, or ExpressionTool.
856+
857+
If provided, then this must be an IRI of a concept node that
858+
represents the type of operation, preferrably defined within an ontology.
859+
860+
For example, in the domain of bioinformatics, one can use an IRI from
861+
the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004),
862+
like [Alignment](http://edamontology.org/operation_2928),
863+
or [Clustering](http://edamontology.org/operation_3432); or a more
864+
specific Operation concept like
865+
[Split read mapping](http://edamontology.org/operation_3199).
846866
847867
- name: InlineJavascriptRequirement
848868
type: record
@@ -940,6 +960,20 @@ $graph:
940960
set to `false` and the expected secondary file does not exist.
941961
Default value for `required` field is `true` for secondary files on
942962
input and `false` for secondary files on output.
963+
doc: |
964+
Secondary files are specified using the following micro-DSL for secondary files:
965+
966+
* If the value is a string, it is transformed to an object with two fields
967+
`pattern` and `required`
968+
* By default, the value of `required` is `null`
969+
(this indicates default behavior, which may be based on the context)
970+
* If the value ends with a question mark `?` the question mark is
971+
stripped off and the value of the field `required` is set to `False`
972+
* The remaining value is assigned to the field `pattern`
973+
974+
For implementation details and examples, please see
975+
[this section](SchemaSalad.html#Domain_Specific_Language_for_secondary_files)
976+
in the Schema Salad specification.
943977
944978
- name: LoadListingRequirement
945979
type: record

0 commit comments

Comments
 (0)