pilotCommands

Definitions of a standard set of pilot commands

Each commands is represented by a class inheriting CommandBase class. The command class constructor takes PilotParams object which is a data structure which keeps common parameters across all the pilot commands.

The constructor must call the superclass constructor with the PilotParams object and the command name as arguments, e.g.

class InstallDIRAC( CommandBase ):

  def __init__( self, pilotParams ):
    CommandBase.__init__(self, pilotParams, 'Install')
    ...

The command class must implement execute() method for the actual command execution.

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.CheckCECapabilities(pilotParams)

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

Used to get CE tags and other relevant parameters

__init__(pilotParams)

c’tor

execute()

Main execution method

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.CheckWNCapabilities(pilotParams)

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

Used to get capabilities specific to the Worker Node. This command must be called after the CheckCECapabilities command

__init__(pilotParams)

c’tor

execute()

Discover NumberOfProcessors and RAM

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.CheckWorkerNode(pilotParams)

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

Executes some basic checks

__init__(pilotParams)

c’tor

execute()

Get host and local user info, and other basic checks, e.g. space available

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.ConfigureArchitecture(pilotParams, dummy='')

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

This command simply calls dirac-platfom to determine the platform. Separated from the ConfigureDIRAC command for easier extensibility.

__init__(pilotParams, dummy='')

c’tor

Defines the logger and the pilot parameters

execute()

This is a simple command to call the dirac-platform utility to get the platform, and add it to the configuration

The architecture script, as well as its options can be replaced in a pilot extension

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.ConfigureBasics(pilotParams)

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

This command completes DIRAC installation, e.g. calls dirac-configure to:
  • download, by default, the CAs
  • creates a standard or custom (defined by self.pp.localConfigFile) cfg file to be used where all the pilot configuration is to be set, e.g.:
  • adds to it basic info like the version
  • adds to it the security configuration

If there is more than one command calling dirac-configure, this one should be always the first one called.

Note

Further commands should always call dirac-configure using the options -FDMH

Note

If custom cfg file is created further commands should call dirac-configure with “-O %s %s” % ( self.pp.localConfigFile, self.pp.localConfigFile )

From here on, we have to pay attention to the paths. Specifically, we need to know where to look for
  • executables (scripts)
  • DIRAC python code

If the pilot has installed DIRAC (and extensions) in the traditional way, so using the dirac-install.py script, simply the current directory is used, and:

  • scripts will be in $CWD/scripts.
  • DIRAC python code will be all sitting in $CWD
  • the local dirac.cfg file will be found in $CWD/etc

For a more general case of non-traditional installations, we should use the PATH and PYTHONPATH as set by the installation phase. Executables and code will be searched there.

__init__(pilotParams)

c’tor

execute()

What is called all the times.

VOs may want to replace/extend the _getBasicsCFG and _getSecurityCFG functions

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.ConfigureCPURequirements(pilotParams)

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

This command determines the CPU requirements. Needs to be executed after ConfigureSite

__init__(pilotParams)

c’tor

execute()

Get job CPU requirement and queue normalization

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.ConfigureSite(pilotParams)

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

Command to configure DIRAC sites using the pilot options

__init__(pilotParams)

c’tor

execute()

Setup configuration parameters

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.GetPilotVersion(pilotParams, dummy='')

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

Used to get the pilot version that needs to be installed. If passed as a parameter, uses that one. If not passed, it looks for alternatives.

This assures that a version is always got even on non-standard Grid resources.

__init__(pilotParams, dummy='')

c’tor

Defines the logger and the pilot parameters

execute()

Standard method for pilot commands

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.InstallDIRAC(pilotParams)

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

Basically, this is used to call dirac-install with the passed parameters.

It requires dirac-install script to be sitting in the same directory.

__init__(pilotParams)

c’tor

execute()

What is called all the time

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.LaunchAgent(pilotParams)

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

Prepare and launch the job agent

__init__(pilotParams)

c’tor

execute()

What is called all the time

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()

class DIRAC.WorkloadManagementSystem.PilotAgent.pilotCommands.ReplaceDIRACCode(pilotParams)

Bases: DIRAC.WorkloadManagementSystem.PilotAgent.pilotTools.CommandBase

This command will replace DIRAC code with the one taken from a different location. This command is mostly for testing purposes, and should NOT be added in default configurations. It uses generic -o option for specifying a zip location (like an archive file from github).

__init__(pilotParams)

c’tor

execute()

Download/unzip an archive file

executeAndGetOutput(cmd, environDict=None)

Execute a command on the worker node and get the output

exitWithError(errorCode)

Wrapper around sys.exit()