-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Overview
The task manager is the subcomponent responsible for executing workflow tasks. It's responsible for triggering the task plug-ins, mapping input and output, providing meta data and updating meta data, updating task status, and notifying the workflow manager after a task has been completed.
This task is concerned with the initial basic functionality of dispatching a task that has been added to the queue. Please see the following tickets for additional functionality:
Dispatching tasks
Tasks are picked up from a queue in a RabbitMQ.
Queue name: md.tasks.dispatch
Event schema:
{
"ExecutionId": $execution_id,
"WorkflowInstanceId": $workflow_instance_id,
"StorageInformation": Object
}
Additional task information is then retrieved from MongoDB based on the workflow instance ID and the execution ID.
Handling a task
- Retrieve task information from MongoDB
- Check the task type and instantiate the relevant plug-in
- Provide the following information to the specific plug-in:
- Artifact dictionary
- The
task_plugin_argumentsproperty in the task's object in MongoDB - Storage engine credentials
- Output directory path
- Call the plug-in's "run" method
- Update task status in MongoDB to submitted
- Acknowledge the task dispatch event so that it is removed from RabbitMQ
Plug-in errors
A plug-in can fail either because the event doesn't contain the information it needs, or because of an external reason such as an app server not being available. To facilitate error handling plug-in should be able to raise one of the following exceptions:
- InvalidTask: to be used when the task does not contain the necessary information, for example when the task plug-in arguments don't contain the required fields for that plug-in
- UpstreamError: to be used when a plug-in can communicate with an external system.
Acceptance criteria
- Given a valid event in RabbitMQ, when it is picked up by the event broker adapter it should trigger the task executer
- Given an event doesn't include all of the required information, when it is picked up by the event broker adapter it should be rejected with requeue=false
- Given an event references a non-existent task, when it is picked up it should be rejected with requeue=false
- When the plug-in throws an upstream error exception, the message should be rejected with requeue=true
- When the plug-in throws an invalid event exception, the message should be rejected with requeue=false
Metadata
Metadata
Assignees
Labels
Type
Projects
Status