Flow-Spec Reference¶
Conventions¶
The reference documentation uses a few conventions when specifying the capabilities of various aspects of the specification:
refstring - A string where parameter and expression references (ie ${{ … }}) are expanded.
string - A literal string
Packages¶
A package file defines content under a package root element. The name element is required. Other elements are optional.
package:
name: my_package
An outline of the package schema is shown below. Please see the following sections for more information about key items:
Datasets
Tasks
Schema: |
#/defs/PackageDef |
|
|---|---|---|
Item |
Type |
Description |
name |
string |
Name of the package |
desc |
string |
Short description of the package |
doc |
string |
Documentation of the package content |
uses |
string |
Name of the base package |
with |
list[refstring | ParamDef] |
Package parameters |
imports |
list[refstring] |
External packages to load |
tasks |
list[TaskDef] |
Task definitions |
datasets |
list[DatasetDef] |
Dataset definitions |
fragments |
list[refstring] |
Package fragment files |
A package file defines content under a package root element. The name element is required. Other elements are optional.
package:
name: my_package
Uses¶
A package inherits from a base package via the uses element. All elements from the base package become elements of the inheriting package.
# my_base_pkg.yaml
package:
name: my_base_pkg
tasks:
- name: my_t1
# my_ext_pkg.yaml
package:
name: my_ext_pkg
uses: my_base_pkg
imports:
- my_base_pkg.yml
tasks:
- name: my_t2
In the example above, my_ext_pkg contains two tasks: my_t1 and my_t2.
With¶
A package declares and configures package-local parameters using the with section.
package:
name: my_package
with:
- name: p1
type: str
value: abc
For more information about declaring and using parameters, see the Parameters section.
Imports¶
Packages are explicitly loaded from a file using the imports section. Each entry in this section is a path to a package file. The path may be absolute or relative. Relative paths are resolved:
Relative to the directory containing the current file
Relative to the directory containing the root package file
Variable references are supported.
package:
name: my_package
imports:
- ${{ env.ANCHOR_my_uvc }}/flow.yaml
package:
name: my_package
imports:
- import/my_ip/flow.yaml
Package Fragments¶
Package fragment files specify additional content. Most package elements can be declared in a fragment, with the exception of the package name, uses (base package), and with (package parameters).
fragment:
imports:
- ../my_file.yaml
tasks:
- name: T1
# ...
Schema: |
#/defs/FragmentDef |
|
|---|---|---|
Item |
Type |
Description |
imports |
list[refstring] |
External packages to load |
tasks |
list[TaskDef] |
Task definitions |
datasets |
list[DatasetDef] |
Dataset definitions |
fragments |
list[string] |
Package fragment files |
Task Definition¶
RundirE¶
type |
string |
enum |
unique, inherit |
TaskDef¶
Holds definition information (ie the YAML view) for a task |
||||
type |
object |
|||
properties |
||||
|
Task Name |
|||
The name of the task |
||||
default |
null |
|||
anyOf |
type |
string |
||
type |
null |
|||
|
Root Task Name |
|||
The name of the task (marked as root scope) |
||||
default |
null |
|||
anyOf |
type |
string |
||
type |
null |
|||
|
Export Task Name |
|||
The name of the task (marked as export scope) |
||||
default |
null |
|||
anyOf |
type |
string |
||
type |
null |
|||
|
Local Task Name |
|||
The name of the task (marked as local scope) |
||||
default |
null |
|||
anyOf |
type |
string |
||
type |
null |
|||
|
Overide Name |
|||
The name of the task to override |
||||
default |
null |
|||
anyOf |
type |
string |
||
type |
null |
|||
|
Base type |
|||
Task from which this task is derived |
||||
type |
string |
|||
default |
null |
|||
|
Task visibility scope |
|||
Visibility scope: ‘root’ (executable), ‘export’ (visible outside package), ‘local’ (fragment-only) |
||||
default |
null |
|||
anyOf |
type |
string |
||
type |
array |
|||
items |
type |
string |
||
type |
null |
|||
|
Body |
|||
Sub-tasks |
||||
type |
array |
|||
items |
||||
|
Task enable condition |
|||
Condition that must be true for this task to run |
||||
default |
null |
|||
anyOf |
type |
string |
||
type |
boolean |
|||
|
Pytask |
|||
Python-based implementation (deprecated) |
||||
type |
string |
|||
default |
null |
|||
|
Run |
|||
Shell-based implementation |
||||
type |
string |
|||
default |
null |
|||
|
Shell |
|||
Shell to use for shell-based implementation |
||||
type |
string |
|||
default |
bash |
|||
|
default |
null |
||
|
Task description |
|||
Short description of the task’s purpose |
||||
type |
string |
|||
default |
||||
|
Task documentation |
|||
Full documentation of the task |
||||
type |
string |
|||
default |
||||
|
Needs |
|||
List of tasks that this task depends on |
||||
type |
array |
|||
items |
type |
string |
||
|
Feeds |
|||
List of tasks that depend on this task (inverse of needs) |
||||
type |
array |
|||
items |
type |
string |
||
|
With |
|||
Parameters for the task |
||||
type |
object |
|||
additionalProperties |
anyOf |
type |
string |
|
type |
array |
|||
items |
||||
type |
integer |
|||
type |
boolean |
|||
type |
object |
|||
additionalProperties |
True |
|||
|
Specifies handling of this tasks’s run directory |
|||
default |
unique |
|||
|
Passthrough |
|||
Specifies whether this task should pass its inputs to its output |
||||
default |
null |
|||
anyOf |
#/defs/PassthroughE |
|||
type |
array |
|||
items |
||||
type |
null |
|||
|
Consumes |
|||
Specifies matching patterns for parameter sets that this task consumes |
||||
default |
null |
|||
anyOf |
#/defs/ConsumesE |
|||
type |
array |
|||
items |
||||
type |
null |
|||
|
Uptodate |
|||
Up-to-date check: false=always run, string=Python method, None=use default check |
||||
default |
null |
|||
anyOf |
type |
boolean |
||
type |
string |
|||
type |
null |
|||
|
Cache |
|||
Cache configuration. True=enabled with defaults, False=disabled, CacheDef=custom config |
||||
default |
null |
|||
anyOf |
#/defs/CacheDef |
|||
type |
boolean |
|||
type |
null |
|||
|
Tags |
|||
Tags as type references with optional parameter overrides |
||||
type |
array |
|||
items |
anyOf |
type |
string |
|
type |
object |
|||
additionalProperties |
True |
|||
additionalProperties |
False |
|||
PackageImportSpec¶
type |
object |
|
properties |
||
|
From |
|
Package identifier or file path to import |
||
type |
string |
|
default |
null |
|
|
As |
|
Alias name for the imported package |
||
type |
string |
|
default |
null |
|
|
Config |
|
Configuration name to apply when importing |
||
type |
string |
|
default |
null |
|
|
With |
|
Parameter overrides to apply to the imported package |
||
type |
object |
|
additionalProperties |
True |
|
TypeDef¶
type |
object |
|||
properties |
||||
|
Name |
|||
Name of the data type |
||||
type |
string |
|||
|
Uses |
|||
Base type to inherit from. Supports type extension/specialization |
||||
type |
string |
|||
default |
null |
|||
|
Doc |
|||
Documentation for this type definition |
||||
type |
string |
|||
default |
null |
|||
|
With |
|||
Parameters for this type. Can be simple values or full parameter definitions |
||||
type |
object |
|||
additionalProperties |
anyOf |
type |
string |
|
|
Tags |
|||
Tags as type references with optional parameter overrides |
||||
type |
array |
|||
items |
anyOf |
type |
string |
|
type |
object |
|||
additionalProperties |
True |
|||
StrategyDef¶
type |
object |
|||
properties |
||||
|
Chain |
|||
Enable chain strategy: run body tasks sequentially with each consuming output of previous task |
||||
default |
null |
|||
anyOf |
type |
boolean |
||
type |
null |
|||
|
Enable generate strategy: dynamically create tasks by running a shell command that outputs task definitions |
|||
default |
null |
|||
anyOf |
#/defs/GenerateSpec |
|||
type |
null |
|||
|
Matrix |
|||
Matrix of parameter values to explore. Creates one task instance per combination of values |
||||
default |
null |
|||
anyOf |
type |
object |
||
additionalProperties |
type |
array |
||
items |
||||
type |
null |
|||
|
Body |
|||
Body tasks for strategy execution. Used with chain and matrix strategies |
||||
type |
array |
|||
items |
||||
ListType¶
type |
object |
||
properties |
|||
|
Item |
||
anyOf |
type |
string |
|
MapType¶
type |
object |
||
properties |
|||
|
Key |
||
anyOf |
type |
string |
|
|
Val |
||
anyOf |
type |
string |
|
ComplexType¶
type |
object |
||
properties |
|||
|
default |
null |
|
anyOf |
|||
type |
null |
||
|
default |
null |
|
anyOf |
|||
type |
null |
||
ParamDef¶
type |
object |
||
properties |
|||
|
Doc |
||
Full documentation for this parameter |
|||
type |
string |
||
default |
null |
||
|
Desc |
||
Short description of this parameter |
|||
type |
string |
||
default |
null |
||
|
Type |
||
Parameter type (e.g., ‘str’, ‘int’, ‘bool’, ‘list’, ‘map’, or a complex type definition) |
|||
default |
null |
||
anyOf |
type |
string |
|
|
Value |
||
Default value for this parameter |
|||
default |
null |
||
anyOf |
type |
null |
|
|
Append |
||
Value to append to list-type parameters |
|||
default |
null |
||
anyOf |
type |
null |
|
|
Prepend |
||
Value to prepend to list-type parameters |
|||
default |
null |
||
anyOf |
type |
null |
|
|
Path-Append |
||
Path to append to path-type parameters (OS-specific separator) |
|||
default |
null |
||
anyOf |
type |
null |
|
|
Path-Prepend |
||
Path to prepend to path-type parameters (OS-specific separator) |
|||
default |
null |
||
anyOf |
type |
null |
|