Package Ganga :: Package GPIDev :: Package Adapters :: Module IMonitoringService :: Class IMonitoringService
[hide private]
[frames] | no frames]

Class IMonitoringService

source code

Known Subclasses:

Interface of the monitoring service. Each method correponds to particular events which occur at ganga client or job wrapper (worker node). The event() method is retained for backwards compatibility and other methods by default use it. However it will be removed in the future.

Instance Methods [hide private]
 
__init__(self, job_info, config_info=None)
Initialize the monitoring service.
source code
 
complete(self, **opts)
Completion of a job.
source code
 
event(self, what='', values={})
Obsolete method.
source code
 
fail(self, **opts)
Failure of a job.
source code
 
getJobInfo(self)
Return a static info object which static information about the job at submission time.
source code
 
getSandboxModules(self)
Get the list of module dependencies of this monitoring module.
source code
 
getWrapperScriptConstructorText(self)
Return a line of python source code which creates the instance of the monitoring service object to be used in the job wrapper script.
source code
 
kill(self, **opts)
Killing of a job.
source code
 
prepare(self, **opts)
Preparation of a job.
source code
 
progress(self, **opts)
Application execution is in progress (called periodically, several times a second).
source code
 
rollback(self, **opts)
Rollback of a job to new state (caused by error during submission).
source code
 
start(self, **opts)
Application is about to start on the worker node.
source code
 
stop(self, exitcode, **opts)
Application execution finished.
source code
 
submit(self, **opts)
Submission of a job.
source code
 
submitting(self, **opts)
Just before the submission of a job.
source code
Static Methods [hide private]
 
getConfig()
Return the config object for this class.
source code
Method Details [hide private]

__init__(self, job_info, config_info=None)
(Constructor)

source code 

Initialize the monitoring service.

If the monitoring service is created in the Ganga client then job_info is the original job object, and config_info is the original config object returned by getConfig().

If the monitoring service is created on the worker node then job_info is the return value of getJobInfo(), and config_info is the return value of getConfig().getEffectiveOptions(), i.e. a dictionary.

In order to support existing monitoring classes, which do not use config_info, if getConfig() returns None, the constructor is called with only the job_info argument.

complete(self, **opts)

source code 

Completion of a job. Called by: ganga client.

fail(self, **opts)

source code 

Failure of a job. Called by: ganga client.

getConfig()
Static Method

source code 

Return the config object for this class.

By default this method returns None. If it is overridden to return a Config object then the configuration is made available consistently in the Ganga client and on the worker node via the instance variable config_info. See __init__().

For example, in your IMonitoringService implementation you could add:

   def getConfig():
       from Ganga.Utility import Config
       return Config.getConfig("MyMS")
   getConfig = staticmethod(getConfig)

N.B. this is a static method.

getJobInfo(self)

source code 

Return a static info object which static information about the job at submission time. Called by: ganga client.

The info object is passed to the contructor. Info object may only contain the standard python types (such as lists, dictionaries, int, strings).

getSandboxModules(self)

source code 
Get the list of module dependencies of this monitoring module.
Called by: ganga client.

Returns a list of modules which are imported by this module and
therefore must be shipped automatically to the worker node. The list
should include the module where this class is defined plus all modules
which represent the parent packages. The module containing the
IMonitoringService class is added automatically by the call to the
base class sandBoxModule() method. An example for a class defined in
the module Ganga/Lib/MonitoringServices/DummyMS/DummyMS.py which does
not have any further dependencies:

import Ganga.Lib.MonitoringServices.DummyMS
return IMonitoringService.getSandboxModules(self) + [
         Ganga,
         Ganga.Lib,
         Ganga.Lib.MonitoringServices,
         Ganga.Lib.MonitoringServices.DummyMS,
         Ganga.Lib.MonitoringServices.DummyMS.DummyMS
        ]
Note, that it should be possible to import all parent modules without side effects (so without importing automatically their other children).

getWrapperScriptConstructorText(self)

source code 

Return a line of python source code which creates the instance of the monitoring service object to be used in the job wrapper script. This method should not be overriden.

kill(self, **opts)

source code 

Killing of a job. Called by: ganga client.

prepare(self, **opts)

source code 

Preparation of a job. Called by: ganga client.

progress(self, **opts)

source code 

Application execution is in progress (called periodically, several times a second). Called by: job wrapper.

rollback(self, **opts)

source code 

Rollback of a job to new state (caused by error during submission). Called by: ganga client.

start(self, **opts)

source code 

Application is about to start on the worker node. Called by: job wrapper.

stop(self, exitcode, **opts)

source code 

Application execution finished. Called by: job wrapper.

submit(self, **opts)

source code 

Submission of a job. Called by: ganga client.

submitting(self, **opts)

source code 

Just before the submission of a job. Called by: ganga client.