Skip to content

Commit

Permalink
Merge pull request #12117 from amaltaro/235_cmsweb_bundle2
Browse files Browse the repository at this point in the history
Bundle of patches for WM central services - take 2
  • Loading branch information
amaltaro authored Sep 26, 2024
2 parents 1da2f62 + 4af7e2c commit f815ad8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CMSCouchapp~=1.3.4 # wmcore,wmagent
CMSMonitoring~=0.6.10 # wmcore,wmagent,reqmgr2,reqmon,global-workqueue,reqmgr2ms-unmerged,reqmgr2ms-output,reqmgr2ms-pileup,reqmgr2ms-monitor,reqmgr2ms-transferor,reqmgr2ms-rulecleaner
coverage~=5.4 # wmcore,wmagent,wmagent-devtools
cx-Oracle~=8.3.0 # wmcore,wmagent
dbs3-client~=4.0.12 # wmcore,wmagent,reqmgr2,reqmon,global-workqueue
dbs3-client==4.0.19 # wmcore,wmagent,wmagent-devtools,reqmgr2,reqmon,global-workqueue,reqmgr2ms-output,reqmgr2ms-transferor
future~=0.18.2 # wmcore,wmagent,wmagent-devtools,reqmgr2,reqmon,acdcserver,global-workqueue,reqmgr2ms-unmerged,reqmgr2ms-output,reqmgr2ms-pileup,reqmgr2ms-monitor,reqmgr2ms-transferor,reqmgr2ms-rulecleaner
gfal2-python~=1.11.0.post3 # wmcore,reqmgr2ms-unmerged
httplib2~=0.20.4 # wmcore,wmagent,reqmgr2,reqmon,acdcserver,global-workqueue,reqmgr2ms-unmerged,reqmgr2ms-output,reqmgr2ms-pileup,reqmgr2ms-monitor,reqmgr2ms-transferor,reqmgr2ms-rulecleaner
Expand Down
14 changes: 10 additions & 4 deletions src/python/WMCore/MicroService/Tools/Common.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
from WMCore.Services.pycurl_manager import RequestHandler
from WMCore.Services.pycurl_manager import getdata as multi_getdata

# DBS agregators
from dbs.apis.dbsClient import aggRuns, aggFileLumis


# static variables
STEP_PAT = re.compile(r'Step[0-9]')
TASK_PAT = re.compile(r'Task[0-9]')
Expand Down Expand Up @@ -279,6 +275,11 @@ def getFileLumisInBlock(blocks, dbsUrl, validFileOnly=1):
:param validFileOnly: integer flag for valid files only or not
:return: a dict of blocks with list of file/run/lumi info
"""
# importing dbs3-client only in the functions where it is used so that
# we do not need to add it to the docker images of microservices that do
# not use it.
from dbs.apis.dbsClient import aggFileLumis

runLumisByBlock = {}
urls = ['%s/filelumis?validFileOnly=%d&block_name=%s' % (dbsUrl, validFileOnly, quote(b)) for b in blocks]
# limit it to 10 concurrent calls not to overload DBS
Expand Down Expand Up @@ -343,6 +344,11 @@ def getRunsInBlock(blocks, dbsUrl):
:param dbsUrl: string with the DBS URL
:return: a dictionary of block names and a list of run numbers
"""
# importing dbs3-client only in the functions where it is used so that
# we do not need to add it to the docker images of microservices that do
# not use it.
from dbs.apis.dbsClient import aggRuns

runsByBlock = {}
urls = ['%s/runs?block_name=%s' % (dbsUrl, quote(b)) for b in blocks]
logging.info("Executing %d requests against DBS 'runs' API", len(urls))
Expand Down

0 comments on commit f815ad8

Please sign in to comment.