CloudDirector

The Cloud Director is a simple agent performing VM instantiations

class DIRAC.WorkloadManagementSystem.Agent.CloudDirector.CloudDirector(*args, **kwargs)

Bases: AgentModule

The CloudDirector works like a SiteDirector for cloud sites: It looks at the queued jobs in the task queues and attempts to start VM instances to meet the current demand.

__init__(*args, **kwargs)

Common __init__ method for all Agents. All Agent modules must define: __doc__

They are used to populate __codeProperties

The following Options are used from the Configuration: - /DIRAC/Setup - Status - Enabled - PollingTime default = 120 - MaxCycles default = 500 - WatchdogTime default = 0 (disabled) - ControlDirectory control/SystemName/AgentName - WorkDirectory work/SystemName/AgentName - shifterProxy ‘’ - shifterProxyLocation WorkDirectory/SystemName/AgentName/.shifterCred

It defines the following default Options that can be set via Configuration (above): - MonitoringEnabled True - Enabled True if Status == Active - PollingTime 120 - MaxCycles 500 - ControlDirectory control/SystemName/AgentName - WorkDirectory work/SystemName/AgentName - shifterProxy False - shifterProxyLocation work/SystemName/AgentName/.shifterCred

different defaults can be set in the initialize() method of the Agent using am_setOption()

In order to get a shifter proxy in the environment during the execute() the configuration Option ‘shifterProxy’ must be set, a default may be given in the initialize() method.

am_Enabled()
am_checkStopAgentFile()
am_createStopAgentFile()
am_getControlDirectory()
am_getCyclesDone()
am_getMaxCycles()
am_getModuleParam(optionName)
am_getOption(optionName, defaultValue=None)

Gets an option from the agent’s configuration section. The section will be a subsection of the /Systems section in the CS.

am_getPollingTime()
am_getShifterProxyLocation()
am_getStopAgentFile()
am_getWatchdogTime()
am_getWorkDirectory()
am_go()
am_initialize(*initArgs)

Common initialization for all the agents.

This is executed every time an agent (re)starts. This is called by the AgentReactor, should not be overridden.

am_removeStopAgentFile()
am_secureCall(functor, args=(), name=False)
am_setModuleParam(optionName, value)
am_setOption(optionName, value)
am_stopExecution()
beginExecution()
createVMs()

Go through defined computing elements and submit jobs if necessary

endExecution()
execute()

Main execution method

finalize()
getEndpoints(resourceDict)

Get the list of relevant CEs and their descriptions

getVMInstances(endpoint, maxInstances)
initialize()

Agents should override this method for specific initialization. Executed at every agent (re)start.