Add 'apps/arv-web/' from commit 'f9732ad8460d013c2f28363655d0d1b91894dca5'
[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 The pipeline template consists of "name" and "components".
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. Components
16
17 The components field of the pipeline template is a JSON object which describes the individual steps that make up the pipeline.  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  In addition, a component can have the following parameters:
18
19 table(table table-bordered table-condensed).
20 |_. Attribute    |_. Type          |_. Accepted values |_. Required|_. Description|
21 |output_name     |string or boolean|string or false    |no         |If a string is provided, use this name for the output collection of this component.  If the value is false, do not create a permanent output collection (an temporary intermediate collection will still be created).  If not provided, a default name will be assigned to the output.|
22
23 h3. Script parameters
24
25 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:
26
27 table(table table-bordered table-condensed).
28 |_. Attribute    |_. Type |_. Accepted values                               |_. Description|
29 |default         |any     |any                                              |The default value for this parameter.|
30 |required        |boolean |true or false                                    |Specifies whether the parameter is required to have a value or not.|
31 |dataclass       |string  |One of 'Collection', 'File' [1], 'number', or 'text' |Data type of this parameter.|
32 |search_for      |string  |any string                                       |Substring to use as a default search string when choosing inputs.|
33 |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.|
34 |title           |string  |any string                                       |User friendly title to display when choosing parameter values|
35 |description     |string  |any string                                       |Extended text description for describing expected/valid values for the script parameter|
36 |link_name       |string  |any string                                       |User friendly name to display for the parameter value instead of the actual parameter value|
37
38 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.
39
40 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'.
41
42 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 in Workbench. For example, if your input dataclass is a File and you are interested in a certain filename extention, you can preconfigure it in this attribute.
43
44 h3. Examples
45
46 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.
47
48 <notextile><pre>
49 {
50   "name": "Filter MD5 hash values",
51   "components": {
52     "do_hash": {
53       "script": "hash.py",
54       "repository": "<b>you</b>",
55       "script_version": "master",
56       "script_parameters": {
57         "input": {
58           "required": true,
59           "dataclass": "Collection",
60           "search_for": ".fastq.gz",
61           "title":"Please select a fastq file"
62         }
63       },
64     },
65     "filter": {
66       "script": "0-filter.py",
67       "repository": "<b>you</b>",
68       "script_version": "master",
69       "script_parameters": {
70         "input": {
71           "output_of": "do_hash"
72         }
73       },
74     }
75   }
76 }
77 </pre></notextile>
78
79 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.
80
81 <notextile><pre>
82 {
83   "name": "Wreck the house",
84   "components": {
85     "cat_in_the_hat": {
86       "script": "cat.py",
87       "repository": "<b>you</b>",
88       "script_version": "master",
89       "script_parameters": { }
90     },
91     "thing1": {
92       "script": "thing1.py",
93       "repository": "<b>you</b>",
94       "script_version": "master",
95       "script_parameters": {
96         "input": {
97           "output_of": "cat_in_the_hat"
98         }
99       },
100     },
101     "thing2": {
102       "script": "thing2.py",
103       "repository": "<b>you</b>",
104       "script_version": "master",
105       "script_parameters": {
106         "input": {
107           "output_of": "cat_in_the_hat"
108         }
109       },
110     },
111   }
112 }
113 </pre></notextile>
114
115 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.
116
117 <notextile><pre>
118 {
119   "name": "Clean the house",
120   "components": {
121     "thing1": {
122       "script": "thing1.py",
123       "repository": "<b>you</b>",
124       "script_version": "master",
125       "script_parameters": { }
126     },
127     "thing2": {
128       "script": "thing2.py",
129       "repository": "<b>you</b>",
130       "script_version": "master",
131       "script_parameters": { }
132     },
133     "cleanup": {
134       "script": "cleanup.py",
135       "repository": "<b>you</b>",
136       "script_version": "master",
137       "script_parameters": {
138         "mess1": {
139           "output_of": "thing1"
140         },
141         "mess2": {
142           "output_of": "thing2"
143         }
144       }
145     }
146   }
147 }
148 </pre></notextile>
149
150 h2. Methods
151
152 See "pipeline_templates":{{site.baseurl}}/api/methods/pipeline_templates.html
153
154 h2. Resource
155
156 Each PipelineTemplate has, in addition to the usual "attributes of Arvados resources":{{site.baseurl}}/api/resources.html:
157
158 table(table table-bordered table-condensed).
159 |_. Attribute|_. Type|_. Description|_. Example|
160 |name|string|||
161 |components|hash|||