Merge branch 'master' into 3016-pipeline-template-search-string
[arvados.git] / doc / api / schema / PipelineTemplate.html.textile.liquid
1 ---
2 layout: default
3 navsection: api
4 navmenu: Schema
5 title: PipelineTemplate
6 ...
7
8 Pipelines consist of a set of "components".  Each component is an Arvados job submission.  "Parameters for job submissions are described on the job method page.":{{site.baseurl}}/api/methods/jobs.html#create
9
10 table(table table-bordered table-condensed).
11 |_. Attribute    |_. Type |_. Accepted values                           |_. Required|_. Description|
12 |name            |string  |any                                          |yes        |The human-readable name of the pipeline template.|
13 |components      |object  |JSON object containing job submission objects|yes        |The component jobs that make up the pipeline, with the component name as the key. |
14
15 h3. Script parameters
16
17 When used in a pipeline, each parameter in the 'script_parameters' attribute of a component job can specify that the input parameter must be supplied by the user, or the input parameter should be linked to the output of another component.  To do this, the value of the parameter should be JSON object containing one of the following attributes:
18
19 table(table table-bordered table-condensed).
20 |_. Attribute    |_. Type |_. Accepted values                               |_. Description|
21 |default         |any     |any                                              |The default value for this parameter.|
22 |required        |boolean |true or false                                    |Specifies whether the parameter is required to have a value or not.|
23 |dataclass       |string  |One of 'Collection', 'File' [1], 'number', or 'text' |Data type of this parameter.|
24 |search_for      |string  |any string                                       |Substring to look for in input collection or file name identifier.|
25 |output_of       |string  |the name of another component in the pipeline    |Specifies that the value of this parameter should be set to the 'output' attribute of the job that corresponds to the specified component.|
26
27 The 'output_of' parameter is especially important, as this is how components are actually linked together to form a pipeline.  Component jobs that depend on the output of other components do not run until the parent job completes and has produced output.  If the parent job fails, the entire pipeline fails.
28
29 fn1. The 'File' type refers to a specific file within a Keep collection in the form 'collection_hash/filename', for example '887cd41e9c613463eab2f0d885c6dd96+83/bob.txt'.
30
31 The 'search_for' parameter is meaningful only when input dataclass of type Collection or File is used. If a value is provided, this will be preloaded into the input data chooser dialog. For example, if your input dataclass is a File and you are interested in a certain filename exetention, you can preconfigure it in this attribute.
32
33 h3. Examples
34
35 This is a pipeline named "Filter MD5 hash values" with two components, "do_hash" and "filter".  The "input" script parameter of the "do_hash" component is required to be filled in by the user, and the expected data type is "Collection".  This also specifies that the "input" script parameter of the "filter" component is the output of "do_hash", so "filter" will not run until "do_hash" completes successfully.  When the pipeline runs, past jobs that meet the criteria described above may be substituted for either or both components to avoid redundant computation.
36
37 <notextile><pre>
38 {
39   "name": "Filter MD5 hash values",
40   "components": {
41     "do_hash": {
42       "script": "hash.py",
43       "repository": "<b>you</b>",
44       "script_version": "master",
45       "script_parameters": {
46         "input": {
47           "required": true,
48           "dataclass": "Collection",
49           "search_for": "FASTQ"
50         }
51       },
52     },
53     "filter": {
54       "script": "0-filter.py",
55       "repository": "<b>you</b>",
56       "script_version": "master",
57       "script_parameters": {
58         "input": {
59           "output_of": "do_hash"
60         }
61       },
62     }
63   }
64 }
65 </pre></notextile>
66
67 This pipeline consists of three components.  The components "thing1" and "thing2" both depend on "cat_in_the_hat".  Once the "cat_in_the_hat" job is complete, both "thing1" and "thing2" can run in parallel, because they do not depend on each other.
68
69 <notextile><pre>
70 {
71   "name": "Wreck the house",
72   "components": {
73     "cat_in_the_hat": {
74       "script": "cat.py",
75       "repository": "<b>you</b>",
76       "script_version": "master",
77       "script_parameters": { }
78     },
79     "thing1": {
80       "script": "thing1.py",
81       "repository": "<b>you</b>",
82       "script_version": "master",
83       "script_parameters": {
84         "input": {
85           "output_of": "cat_in_the_hat"
86         }
87       },
88     },
89     "thing2": {
90       "script": "thing2.py",
91       "repository": "<b>you</b>",
92       "script_version": "master",
93       "script_parameters": {
94         "input": {
95           "output_of": "cat_in_the_hat"
96         }
97       },
98     },
99   }
100 }
101 </pre></notextile>
102
103 This pipeline consists of three components.  The component "cleanup" depends on "thing1" and "thing2".  Both "thing1" and "thing2" are started immediately and can run in parallel, because they do not depend on each other, but "cleanup" cannot begin until both "thing1" and "thing2" have completed.
104
105 <notextile><pre>
106 {
107   "name": "Clean the house",
108   "components": {
109     "thing1": {
110       "script": "thing1.py",
111       "repository": "<b>you</b>",
112       "script_version": "master",
113       "script_parameters": { }
114     },
115     "thing2": {
116       "script": "thing2.py",
117       "repository": "<b>you</b>",
118       "script_version": "master",
119       "script_parameters": { }
120     },
121     "cleanup": {
122       "script": "cleanup.py",
123       "repository": "<b>you</b>",
124       "script_version": "master",
125       "script_parameters": {
126         "mess1": {
127           "output_of": "thing1"
128         },
129         "mess2": {
130           "output_of": "thing2"
131         }
132       }
133     }
134   }
135 }
136 </pre></notextile>
137
138 h2. Methods
139
140 See "pipeline_templates":{{site.baseurl}}/api/methods/pipeline_templates.html
141
142 h2. Resource
143
144 Each PipelineTemplate has, in addition to the usual "attributes of Arvados resources":{{site.baseurl}}/api/resources.html:
145
146 table(table table-bordered table-condensed).
147 |_. Attribute|_. Type|_. Description|_. Example|
148 |name|string|||
149 |components|hash|||