Package Ganga :: Package Core :: Package InternalServices :: Module Coordinator
[hide private]
[frames] | no frames]

Module Coordinator

source code


Internal services coordinator :
 takes care of conditional enabling/disabling of internal services (job monitoring loop, job registry, job
 repository/workspace) when credentials become invalid preventing normal functioning of these services.
 E.g: invalid grid proxy triggers the monitor-loop stop

Functions [hide private]
 
isCredentialRequired(credObj)
The logic to decide if a given invalid credential should trigger the deactivation of Ganga internal services.
source code
 
notifyInvalidCredential(credObj)
The Core is notified when one of the monitored credentials is invalid @see ICredential.create()
source code
 
_diskSpaceChecker()
the callback function used internally by Monitoring Component Reads and calls the checking function provided in the configuration.
source code
 
disableInternalServices()
Deactivates all the internal services :...
source code
 
enableInternalServices()
activates the internal services previously disabled due to expired credentials
source code
 
checkInternalServices(errMsg='Internal services disabled. Job registry is read-only.')
Check the state of internal services and return a ReadOnlyObjectError exception in case the state is disabled.
source code
 
getMissingCredentials()
get a list of missing credentials i.e: invalid credentials that are needed by the internal services to run
source code
 
bootstrap() source code
Variables [hide private]
  log = getLogger()
  servicesEnabled = True
  __package__ = 'Ganga.Core.InternalServices'
Function Details [hide private]

_diskSpaceChecker()

source code 

the callback function used internally by Monitoring Component
Reads and calls the checking function provided in the configuration. 
If this checking function returns "False" the internal services are disabled making Ganga read-only:
e.g:
[PollThread]
DiskSpaceChecker =  
    import commands
    diskusage = commands.getoutput('df -l -P %s/workspace' % config['Configuration']['gangadir'])
    used  = diskusage.splitlines()[1].split()[4] # get disk usage (in %)
    return int(used[:-1])<70

disableInternalServices()

source code 

Deactivates all the internal services :
      * monitoring loop
      * registry/repository and workspace (or GPI entierly)
Currently this method is called whenever:
      * one of the managed credentials (AFS token or Grid Proxy) is detected as beeing *invalid* by the monitoring component
      * the user is running out of space