Skip to content

Commit 538c0d1

Browse files
Merge pull request #10 from InformaticsMatters/prototype-work-alan
Stricter schema
2 parents c968555 + 9c5e183 commit 538c0d1

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

tests/workflow-definitions/simple-python-molprops.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ variables:
1010
outputs:
1111
- name: clusteredMolecules
1212
from:
13-
- step: step2
13+
step: step2
1414
output: outputFile
1515
as: clustered-molecules.smi
1616

@@ -36,7 +36,7 @@ steps:
3636
as: __step1__out.smi
3737

3838
- name: step2
39-
Description: Add column 2
39+
description: Add column 2
4040
specification: >-
4141
{
4242
"collection": "workflow-engine-unit-test-jobs",

workflow/workflow-schema.yaml

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ properties:
3434
type: array
3535
items:
3636
$ref: "#/definitions/workflow-input-parameter"
37+
outputs:
38+
type: array
39+
items:
40+
$ref: "#/definitions/workflow-output-parameter"
3741
required:
3842
- kind
3943
- kind-version
@@ -53,23 +57,56 @@ definitions:
5357
A value compatible with Kubernetes variables
5458
to allow it to be used ins Pod Label
5559
56-
parameter-name:
60+
# What does a Job specification template variable look like?
61+
# The values found in Jinja variables like '{{ x }}'.
62+
# Stuff like 'candidateMolecules' or 'clustered_molecules'
63+
template-variable-name:
5764
type: string
58-
pattern: ^[a-zA-Z_][a-zA-Z0-9_-]*$
65+
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
5966

67+
# What does a filename look like?
68+
# We do not (at the moment) permit spaces!
69+
file-name:
70+
type: string
71+
pattern: ^[a-zA-Z0-9._-]+$
72+
73+
# An input parameter has a name and a (MIME) type.
6074
workflow-input-parameter:
6175
type: object
76+
additionalProperties: false
77+
properties:
78+
name:
79+
$ref: '#/definitions/template-variable-name'
80+
type:
81+
type: string
82+
description: The MIME type of the parameter
83+
required:
84+
- name
85+
- type
86+
87+
# An workflow output parameter is essentially a file
88+
# taken from the output of a step with a default (as) value.
89+
workflow-output-parameter:
90+
type: object
91+
additionalProperties: false
6292
properties:
6393
name:
64-
$ref: '#/definitions/parameter-name'
94+
$ref: '#/definitions/template-variable-name'
95+
from:
96+
$ref: '#/definitions/from-step-output'
97+
as:
98+
$ref: '#/definitions/file-name'
99+
required:
100+
- name
101+
- as
65102

66103
# Declaration of a value from a workflow input (variable)
67104
from-workflow-input:
68105
type: object
69106
additionalProperties: false
70107
properties:
71108
workflow-input:
72-
$ref: '#/definitions/parameter-name'
109+
$ref: '#/definitions/template-variable-name'
73110
required:
74111
- workflow-input
75112

@@ -81,7 +118,7 @@ definitions:
81118
step:
82119
$ref: '#/definitions/rfc1035-label-name'
83120
output:
84-
$ref: '#/definitions/parameter-name'
121+
$ref: '#/definitions/template-variable-name'
85122
required:
86123
- step
87124
- output
@@ -92,39 +129,42 @@ definitions:
92129
additionalProperties: false
93130
properties:
94131
input:
95-
$ref: '#/definitions/parameter-name'
132+
$ref: '#/definitions/template-variable-name'
96133
from:
97134
$ref: '#/definitions/from-step-output'
98135
required:
99136
- input
100137

138+
# A Step input (from a workflow input)
101139
step-input-from-workflow:
102140
type: object
103141
additionalProperties: false
104142
properties:
105143
input:
106-
$ref: '#/definitions/parameter-name'
144+
$ref: '#/definitions/template-variable-name'
107145
from:
108146
$ref: '#/definitions/from-workflow-input'
109147
required:
110148
- input
149+
- from
111150

112151
# A Step output (with an 'as' - a declared value)
113152
step-output-as:
114153
type: object
115154
additionalProperties: false
116155
properties:
117156
output:
118-
$ref: '#/definitions/parameter-name'
157+
$ref: '#/definitions/template-variable-name'
119158
as:
120-
type: string
121-
description: The value to set the parameter to
159+
$ref: '#/definitions/file-name'
122160
required:
123161
- output
124162
- as
125163

164+
# Steps (in a workflow)
126165
step:
127166
type: object
167+
additionalProperties: false
128168
properties:
129169
name:
130170
$ref: '#/definitions/rfc1035-label-name'

0 commit comments

Comments
 (0)