Module: configuration
This module contains the implementation of the base components which are parsed from the workflows configuration file.
Configuration
dataclass
¶
Class that represents the configuration of the workflows.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workflows
|
Workflows
|
List of workflows. |
required |
parameters
|
Parameters
|
List of configuration level parameters. |
Parameters()
|
from_dict(data)
classmethod
¶
A method that creates a new instance of the class from the dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict
|
Dictionary with configuration data. |
required |
Returns:
Type | Description |
---|---|
Configuration
|
New instance of the class. |
from_json(file_path)
classmethod
¶
A method that creates a new instance of the class from the JSON file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
Union[str, Path]
|
Path to the JSON file. |
required |
Returns:
Type | Description |
---|---|
Configuration
|
New instance of the class. |
from_yaml(file_path)
classmethod
¶
A method that creates a new instance of the class from the YAML file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
Union[str, Path]
|
Path to the YAML file. |
required |
Returns:
Type | Description |
---|---|
Configuration
|
New instance of the class. |
validate_all()
¶
A method that validates the configuration. It validates all workflows and parameters.
NormalStep
dataclass
¶
Bases: Step
Class that represents a normal step in the workflow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the step. |
required |
parameters
|
Parameters
|
List of step parameters. |
Parameters()
|
stop_on_error
|
bool
|
Flag that indicates whether the workflow should stop on error. |
True
|
id
|
Optional[str]
|
ID of the step (name of the step used when registering the step). |
None
|
capture_stdout
|
bool
|
Flag that indicates whether the stdout should be captured. |
False
|
capture_stderr
|
bool
|
Flag that indicates whether the stderr should be captured. |
False
|
from_dict(data)
classmethod
¶
Create a new instance of the class from the dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict
|
Dictionary with step data. |
required |
Returns:
Type | Description |
---|---|
Step
|
New instance of the class. |
validate_all()
¶
Validate the step. Check if the type is valid and if the step has all required attributes.
ParallelStep
dataclass
¶
Bases: Step
Class that represents a parallel step in the workflow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the step. |
required |
parameters
|
Parameters
|
List of step parameters. |
Parameters()
|
stop_on_error
|
bool
|
Flag that indicates whether the workflow should stop on error. |
True
|
parallels
|
Steps
|
List of parallel steps. |
Steps()
|
from_dict(data)
classmethod
¶
Create a new instance of the class from the dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict
|
Dictionary with step data. |
required |
Returns:
Type | Description |
---|---|
Step
|
New instance of the class. |
validate_all()
¶
Validate the step. Check if the type is valid and if the step has all required attributes.
Parameter
dataclass
¶
Class that represents a parameter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the parameter. |
required |
value
|
Optional[Any]
|
Value of the parameter. |
None
|
from_context
|
Optional[str]
|
Name of the context from which the parameter should be taken. |
None
|
from_dict(data)
classmethod
¶
Create a new instance of the class from the dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict
|
Dictionary with parameter data. |
required |
Returns:
Type | Description |
---|---|
Parameter
|
New instance of the class. |
validate_all()
¶
Validate the parameter. Check if the name is not empty, if it is not reserved, and if it matches the regex.
Raises:
Type | Description |
---|---|
InvalidConfigurationException
|
If the parameter is not valid. |
Parameters
dataclass
¶
Class that represents a list of parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
elements
|
List[Parameter]
|
List of parameters. |
list()
|
from_dict(data)
classmethod
¶
Create a new instance of the class from the dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
List[Dict]
|
Dictionary with parameters data. |
required |
Returns:
Type | Description |
---|---|
Parameters
|
New instance of the class. |
validate_all()
¶
Validate all parameters in the list.
Step
dataclass
¶
Class that represents a step in the workflow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the step. |
required |
parameters
|
Parameters
|
List of step parameters. |
Parameters()
|
stop_on_error
|
bool
|
Flag that indicates whether the workflow should stop on error. |
True
|
from_dict(data)
classmethod
¶
Create a new instance of the class from the dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict
|
Dictionary with step data. |
required |
Returns:
Type | Description |
---|---|
Step
|
New instance of the class. |
validate_all()
¶
Validate the step. Check if the type is valid and if the step has all required attributes.
StepType
¶
Bases: Enum
Enum class that represents the type of the step.
from_str(value)
staticmethod
¶
Convert string to StepType enum.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
String representation of the step type. |
required |
Returns:
Type | Description |
---|---|
StepType
|
StepType enum. |
Raises:
Type | Description |
---|---|
InvalidConfigurationException
|
If the step type is not valid enum value. |
Steps
dataclass
¶
Class that represents a list of steps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
elements
|
List[Union[NormalStep, WorkflowStep, ParallelStep]]
|
List of steps. |
list()
|
Workflow
dataclass
¶
Class that represents a workflow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the workflow. |
required |
steps
|
Steps
|
List of steps in the workflow. |
required |
parameters
|
Parameters
|
List of workflow parameters. |
Parameters()
|
from_dict(data)
classmethod
¶
Create a new instance of the class from the dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict
|
Dictionary with workflow data. |
required |
Returns:
Type | Description |
---|---|
Workflow
|
New instance of the class. |
validate_all()
¶
Validate the workflow. Check if the name is valid and if all steps and parameters are valid.
WorkflowStep
dataclass
¶
Bases: Step
Class that represents a workflow step in the workflow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the step. |
required |
parameters
|
Parameters
|
List of step parameters. |
Parameters()
|
stop_on_error
|
bool
|
Flag that indicates whether the workflow should stop on error. |
True
|
workflow
|
Optional[str]
|
Name of the workflow that should be executed. |
None
|
from_dict(data)
classmethod
¶
Create a new instance of the class from the dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict
|
Dictionary with step data. |
required |
Returns:
Type | Description |
---|---|
Step
|
New instance of the class. |
validate_all()
¶
Validate the step. Check if the type is valid and if the step has all required attributes.