TaskManagerAgentBase

NOTA BENE: This agent should NOT be run alone. Instead, it serves as a base class for extensions.

The TaskManagerAgentBase is the base class to submit tasks to external systems, monitor and update the tasks and file status in the transformation DB.

This agent is extended in WorkflowTaskAgent and RequestTaskAgent. In case you want to further extend it you are required to follow the note on the initialize method and on the _getClients method.

class DIRAC.TransformationSystem.Agent.TaskManagerAgentBase.TaskManagerAgentBase(*args, **kwargs)

Bases: DIRAC.Core.Base.AgentModule.AgentModule, DIRAC.TransformationSystem.Agent.TransformationAgentsUtilities.TransformationAgentsUtilities

To be extended. Please look at WorkflowTaskAgent and RequestTaskAgent.

__init__(*args, **kwargs)

c’tor

Always call this in the extension agent

am_Enabled()
am_checkStopAgentFile()
am_createStopAgentFile()
am_disableMonitoring()
am_getBasePath()
am_getControlDirectory()
am_getCyclesDone()
am_getMaxCycles()
am_getModuleParam(optionName)
am_getOption(optionName, defaultValue=None)
am_getPollingTime()
am_getShifterProxyLocation()
am_getStopAgentFile()
am_getWatchdogTime()
am_getWorkDirectory()
am_go()
am_initialize(*initArgs)
am_monitoringEnabled()
am_removeStopAgentFile()
am_secureCall(functor, args=(), name=False)
am_setModuleParam(optionName, value)
am_setOption(optionName, value)
am_stopExecution()
beginExecution()
checkReservedTasks(transIDOPBody, clients)

Checking Reserved tasks

endExecution()
execute()

The TaskManagerBase execution method is just filling the Queues of transformations that need to be processed

finalize()

graceful finalization

initialize()

Agent initialization.

The extensions MUST provide in the initialize method the following data members: - TransformationClient objects (self.transClient), - set the shifterProxy if different from the default one set here (‘ProductionManager’) - list of transformation types to be looked (self.transType)

submitTasks(transIDOPBody, clients)

Submit the tasks to an external system, using the taskManager provided

Parameters:
  • transIDOPBody (dict) – transformation body
  • clients (dict) – dictionary of client objects
Returns:

S_OK/S_ERROR

updateFileStatus(transIDOPBody, clients)

Update the files status

updateTaskStatus(transIDOPBody, clients)

Updates the task status