Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 7c9237b

Browse files
authored
Merge pull request #284 from CMSCompOps/actor_multi_sites
allow to assign to all sites reading from a SE
2 parents e86eca4 + 68903b0 commit 7c9237b

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

Unified/actor.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,15 +555,21 @@ def actor(url,options=None):
555555
for action in actions:
556556
if action.startswith('sites'):
557557
if type(actions[action]) != list:
558-
assign_to_sites=[SI.SE_to_CE(actions[action])]
558+
assign_to_sites=SI.SE_to_CEs(actions[action])
559559
else:
560-
assign_to_sites=list(set([SI.SE_to_CE(site) for site in actions[action]]))
560+
assign_to_sites=[]
561+
for site in actions[action]:
562+
assign_to_sites.extend( SI.SE_to_CEs(site))
563+
assign_to_sites=sorted(set(assign_to_sites))
561564
# if action.startswith('mem') and actions[action] != "" and actions[action] != 'Same' and wfi.request['RequestType'] in ['TaskChain']:
562565
# recover = False;
563566
# print "Skipping %s for now until Allie fixes memory parameter for TaskChain ACDCs."%wfname
564567
# wfi.sendLog('actor',"Skipping %s for now until Allie fixes memory parameter for TaskChain ACDCs."%wfname)
565568
if not 'sites' in actions:
566-
assign_to_sites = list(set([SI.SE_to_CE(site) for site in where_to_run[fulltaskname]]))
569+
assign_to_sites=[]
570+
for site in where_to_run[task]:
571+
assign_to_sites.extend( SI.SE_to_CEs(site))
572+
assign_to_sites=sorted(set(assign_to_sites))
567573
print "Found",sorted(assign_to_sites),"as sites where to run the ACDC at, from the acdc doc of ",wfname
568574
print "Going to run at",sorted(assign_to_sites)
569575
if recover:

utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,7 +1943,7 @@ def default_expiration():
19431943
'data' : None,
19441944
'timestamp' : time.mktime( time.gmtime()),
19451945
'expiration' : default_expiration(),
1946-
'getter' : lambda : getSiteStorage('cmsweb.cern.ch'),
1946+
'getter' : lambda : getSiteStorage('cms-cric.cern.ch'),
19471947
'cachefile' : None,
19481948
'default' : ""
19491949
}
@@ -2069,8 +2069,7 @@ def getNodeQueue(url, node):
20692069

20702070
def getSiteStorage(url):
20712071
conn = make_x509_conn(url)
2072-
#conn = httplib.HTTPSConnection(url, cert_file = os.getenv('X509_USER_PROXY'), key_file = os.getenv('X509_USER_PROXY'))
2073-
r1=conn.request("GET",'/sitedb/data/prod/data-processing', headers={"Accept":"*/*"})
2072+
r1=conn.request("GET",'/api/cms/site/query/?json&preset=data-processing', headers={"Accept":"application/json"})
20742073
r2=conn.getresponse()
20752074
r = json.loads(r2.read())['result']
20762075
return r

0 commit comments

Comments
 (0)