DIRACGrid/DIRACWeb — Issue #43: Future crashes on SiteGateway view
Author: ubeda
Created: 2011-11-24 15:08:02+00:00
State: open

Hi,

this is now a feature request, but after DIRAC v6r1 will be a bug report.
I mean, changes introduced on v6r1 will make the controller crash.

As we have time, we can do this slowly, but we cannot forget that this task
has a deadline :(

So, first of all, not anymore usage of RPCClient to connect to RSS, it decides
where to connect, so:

< from dirac.lib.diset import getRPCClient
< RPC = getRPCClient("ResourceStatus/ResourceStatus"
> from DIRAC.ResourceStatusSystem.Client.ResourceStatusClient import ResourceStatusClient
> client = ResourceStatusClient()

And secondly, ALL methods have been refactored, so here are, more or less, all the evident changes needed:

< result = RPC.getSitesStatusWeb(result,globalSort,pageNumber,numberOfJobs)
> result = client.getMonitoredsStatusWeb('Site',result,globalSort,pageNumber,numberOfJobs)

< result = RPC.getServicesStatusWeb(result,globalSort,pageNumber,numberOfJobs)
> result = client.getMonitoredsStatusWeb('Service',result,globalSort,pageNumber,numberOfJobs)

< result = RPC.getResourcesStatusWeb(result,globalSort,pageNumber,numberOfJobs)
> result = client.getMonitoredsStatusWeb('Resource',result,globalSort,pageNumber,numberOfJobs)

< result = RPC.getSitesStorageElementsWeb(result,globalSort,pageNumber,numberOfJobs)
> result = client.getMonitoredsStatusWeb('StorageElement',result,globalSort,pageNumber,numberOfJobs)

< result = RPC.getSitesList()
> result = client.getSitePresent( )
or
> result = client.getSitePresent( meta = { 'columns' : 'SiteName' } )

This method has been deleted, so you will need to write on your utils something like this:
< result = RPC.getSESitesList()
> result = client.getStorageElementPresent( meta = { 'columns' : 'GridSiteName' }, statusType = 'Read' )
> from DIRAC.Core.Utilities.SitesDIRACGOCDBmapping import getDIRACSiteName
> res = set([])
> for gSite in result:
> dSite = getDIRACSiteName( gSite ).setdefault( 'Value', [] )
> for ds in dSite:
> res.add( ds )
> res = list( res )

< result = RPC.getSiteTypeList()
> result = client.getValidSiteTypes()

< result = RPC.getStatusList()
> result = client.getValidStatuses()

< result = RPC.getResourceTypeList()
> result = client.getValidResourceTypes()

< result = RPC.getResourcesList()
> result = client.getResourcePresent()
or
> result = client.getResourcePresent( meta = { 'columns' : 'ResourceName' } )

< result = RPC.getServiceTypeList()
> result = client.getValidServiceTypes()

< result = RPC.getServicesList()
> result = client.getServicePreent()
or
> result = client.getServicePresent( meta = { 'columns' : 'ServiceName' } )

< result = RPC.getStorageElementsList()
> result = client.getStorageElementPresent( statusType = 'Read' )
or
> result = client.getStorageelementPresent( meta = { 'columns' : 'StorageElementName' }, statusType = 'Read' )

And here is a small recipe to the code that will go on v6r1
1.- fetch my code on DIRAC :: ubeda :: rssPermissions
2.- install the DB's, ResourceStatusDB and ResourceManagementDB
3.- Synchronize them.
from DIRAC.Core.Base.Script import parseCommandLine
parseCommandLine()
from DIRAC.ResourceStatusSystem.Utilities.Synchronizer import Synchronizer
s = Synchronizer()
s._syncSites()
s._syncServices()
s._syncResources()
s._syncStorageElements()

Note that I've forced the StorageElements to report their statusType ( := accessType ) to Read. Further development will be required, but at least, the purposed changes will keep us on the non-crashes side. Please, let me know it something goes bananas.

Thanks,
Mario.