common
Common utilities and routines for runner backends (public API)
This module includes utilities and routines that are of use to implement
runner backends but that should also be exposed to the other components of
Fractal Server
.
TaskParameterEncoder
¶
Bases: JSONEncoder
Convenience JSONEncoder that serialises Path
s as strings
Source code in fractal_server/app/runner/v1/common.py
20 21 22 23 24 25 26 27 28 |
|
TaskParameters
¶
Bases: BaseModel
Wrapper for task input parameters
Instances of this class are used to pass parameters from the output of a task to the input of the next one.
Attributes:
Name | Type | Description |
---|---|---|
input_paths |
list[Path]
|
Input paths as derived by the input dataset. |
output_paths |
list[Path]
|
Output path as derived from the output dataset. |
metadata |
dict[str, Any]
|
Dataset metadata, as found in the input dataset or as updated by the previous task. |
history |
list[dict[str, Any]]
|
Dataset history, as found in the input dataset or as updated by the previous task. |
Source code in fractal_server/app/runner/v1/common.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
validate_workflow_compatibility(*, input_dataset, workflow, output_dataset, first_task_index, last_task_index)
¶
Check compatibility of workflow and input / ouptut dataset
Source code in fractal_server/app/runner/v1/common.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
write_args_file(*args, path)
¶
Merge arbitrary dictionaries and write to file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args |
dict[str, Any]
|
One or more dictionaries that will be merged into one respecting the order with which they are passed in, i.e., last in overrides previous ones. |
()
|
path |
Path
|
Destination for serialised file. |
required |
Source code in fractal_server/app/runner/v1/common.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|