TaskManager

TaskManager contains WorkflowTasks and RequestTasks modules, for managing jobs and requests tasks

class DIRAC.TransformationSystem.Client.TaskManager.RequestTasks(transClient=None, logger=None, requestClient=None, requestClass=None, requestValidator=None, ownerDN=None, ownerGroup=None)

Bases: DIRAC.TransformationSystem.Client.TaskManager.TaskBase

Class for handling tasks for the RMS

__init__(transClient=None, logger=None, requestClient=None, requestClass=None, requestValidator=None, ownerDN=None, ownerGroup=None)

c’tor

the requestClass is by default Request. If extensions want to use an extended type, they can pass it as a parameter. This is the same behavior as WorfkloTasks and jobClass

getSubmittedFileStatus(fileDicts)

Check if transformation files changed status, and return a list of taskIDs per new status

getSubmittedTaskStatus(taskDicts)

Check if tasks changed status, and return a list of tasks per new status

prepareTransformationTasks(transBody, taskDict, owner='', ownerGroup='', ownerDN='', bulkSubmissionFlag=False)

Prepare tasks, given a taskDict, that is created (with some manipulation) by the DB

submitTaskToExternal(oRequest)

Submits a request to RMS

submitTasksToExternal(_task)

To make sure the method is implemented in the derived class

submitTransformationTasks(taskDict)

Submit requests one by one

updateDBAfterTaskSubmission(taskDict)

Sets tasks status after the submission to “Submitted”, in case of success

updateTransformationReservedTasks(taskDicts)

To make sure the method is implemented in the derived class

class DIRAC.TransformationSystem.Client.TaskManager.TaskBase(transClient=None, logger=None)

Bases: DIRAC.TransformationSystem.Agent.TransformationAgentsUtilities.TransformationAgentsUtilities

The other classes inside here inherits from this one.

__init__(transClient=None, logger=None)

c’tor

getSubmittedFileStatus(_fileDicts)

To make sure the method is implemented in the derived class

getSubmittedTaskStatus(_taskDicts)

To make sure the method is implemented in the derived class

prepareTransformationTasks(_transBody, _taskDict, owner='', ownerGroup='', ownerDN='', bulkSubmissionFlag=False)

To make sure the method is implemented in the derived class

submitTasksToExternal(_task)

To make sure the method is implemented in the derived class

submitTransformationTasks(_taskDict)

To make sure the method is implemented in the derived class

updateDBAfterTaskSubmission(taskDict)

Sets tasks status after the submission to “Submitted”, in case of success

updateTransformationReservedTasks(_taskDicts)

To make sure the method is implemented in the derived class

class DIRAC.TransformationSystem.Client.TaskManager.WorkflowTasks(transClient=None, logger=None, submissionClient=None, jobMonitoringClient=None, outputDataModule=None, jobClass=None, opsH=None, destinationPlugin=None, ownerDN=None, ownerGroup=None)

Bases: DIRAC.TransformationSystem.Client.TaskManager.TaskBase

Handles jobs

__init__(transClient=None, logger=None, submissionClient=None, jobMonitoringClient=None, outputDataModule=None, jobClass=None, opsH=None, destinationPlugin=None, ownerDN=None, ownerGroup=None)

Generates some default objects. jobClass is by default “DIRAC.Interfaces.API.Job.Job”. An extension of it also works: VOs can pass in their job class extension, if present

getOutputData(paramDict)

Get the list of job output LFNs from the provided plugin

getSubmittedFileStatus(fileDicts)

Check the status of a list of files and return the new status of each LFN

getSubmittedTaskStatus(taskDicts)

Check the status of a list of tasks and return lists of taskIDs for each new status

prepareTransformationTasks(transBody, taskDict, owner='', ownerGroup='', ownerDN='', bulkSubmissionFlag=False)
Prepare tasks, given a taskDict, that is created (with some manipulation) by the DB
jobClass is by default “DIRAC.Interfaces.API.Job.Job”. An extension of it also works.
Parameters:
  • transBody (str) – transformation job template
  • taskDict (dict) – dictionary of per task parameters
  • owner (str) – owner of the transformation
  • ownerGroup (str) – group of the owner of the transformation
  • ownerDN (str) – DN of the owner of the transformation
  • bulkSubmissionFlag (bool) – flag for using bulk submission or not
Returns:

S_OK/S_ERROR with updated taskDict

submitTaskToExternal(job)

Submits a single job (which can be a bulk one) to the WMS.

submitTasksToExternal(_task)

To make sure the method is implemented in the derived class

submitTransformationTasks(taskDict)

Submit the tasks

updateDBAfterTaskSubmission(taskDict)

Sets tasks status after the submission to “Submitted”, in case of success

updateTransformationReservedTasks(taskDicts)

To make sure the method is implemented in the derived class