wmglobalqueue 2.4.5.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. Utils/CPMetrics.py +270 -0
  2. Utils/CertTools.py +100 -0
  3. Utils/EmailAlert.py +50 -0
  4. Utils/ExtendedUnitTestCase.py +62 -0
  5. Utils/FileTools.py +182 -0
  6. Utils/IteratorTools.py +80 -0
  7. Utils/MathUtils.py +31 -0
  8. Utils/MemoryCache.py +119 -0
  9. Utils/Patterns.py +24 -0
  10. Utils/Pipeline.py +137 -0
  11. Utils/PortForward.py +97 -0
  12. Utils/ProcFS.py +112 -0
  13. Utils/ProcessStats.py +194 -0
  14. Utils/PythonVersion.py +17 -0
  15. Utils/Signals.py +36 -0
  16. Utils/TemporaryEnvironment.py +27 -0
  17. Utils/Throttled.py +227 -0
  18. Utils/Timers.py +130 -0
  19. Utils/Timestamps.py +86 -0
  20. Utils/TokenManager.py +143 -0
  21. Utils/Tracing.py +60 -0
  22. Utils/TwPrint.py +98 -0
  23. Utils/Utilities.py +318 -0
  24. Utils/__init__.py +11 -0
  25. Utils/wmcoreDTools.py +707 -0
  26. WMCore/ACDC/Collection.py +57 -0
  27. WMCore/ACDC/CollectionTypes.py +12 -0
  28. WMCore/ACDC/CouchCollection.py +67 -0
  29. WMCore/ACDC/CouchFileset.py +238 -0
  30. WMCore/ACDC/CouchService.py +73 -0
  31. WMCore/ACDC/DataCollectionService.py +485 -0
  32. WMCore/ACDC/Fileset.py +94 -0
  33. WMCore/ACDC/__init__.py +11 -0
  34. WMCore/Algorithms/Alarm.py +39 -0
  35. WMCore/Algorithms/MathAlgos.py +274 -0
  36. WMCore/Algorithms/MiscAlgos.py +67 -0
  37. WMCore/Algorithms/ParseXMLFile.py +115 -0
  38. WMCore/Algorithms/Permissions.py +27 -0
  39. WMCore/Algorithms/Singleton.py +58 -0
  40. WMCore/Algorithms/SubprocessAlgos.py +129 -0
  41. WMCore/Algorithms/__init__.py +7 -0
  42. WMCore/Cache/GenericDataCache.py +98 -0
  43. WMCore/Cache/WMConfigCache.py +572 -0
  44. WMCore/Cache/__init__.py +0 -0
  45. WMCore/Configuration.py +659 -0
  46. WMCore/DAOFactory.py +47 -0
  47. WMCore/DataStructs/File.py +177 -0
  48. WMCore/DataStructs/Fileset.py +140 -0
  49. WMCore/DataStructs/Job.py +182 -0
  50. WMCore/DataStructs/JobGroup.py +142 -0
  51. WMCore/DataStructs/JobPackage.py +49 -0
  52. WMCore/DataStructs/LumiList.py +734 -0
  53. WMCore/DataStructs/Mask.py +219 -0
  54. WMCore/DataStructs/MathStructs/ContinuousSummaryHistogram.py +197 -0
  55. WMCore/DataStructs/MathStructs/DiscreteSummaryHistogram.py +92 -0
  56. WMCore/DataStructs/MathStructs/SummaryHistogram.py +117 -0
  57. WMCore/DataStructs/MathStructs/__init__.py +0 -0
  58. WMCore/DataStructs/Pickleable.py +24 -0
  59. WMCore/DataStructs/Run.py +256 -0
  60. WMCore/DataStructs/Subscription.py +175 -0
  61. WMCore/DataStructs/WMObject.py +47 -0
  62. WMCore/DataStructs/WorkUnit.py +112 -0
  63. WMCore/DataStructs/Workflow.py +60 -0
  64. WMCore/DataStructs/__init__.py +8 -0
  65. WMCore/Database/CMSCouch.py +1430 -0
  66. WMCore/Database/ConfigDBMap.py +29 -0
  67. WMCore/Database/CouchMonitoring.py +450 -0
  68. WMCore/Database/CouchUtils.py +118 -0
  69. WMCore/Database/DBCore.py +198 -0
  70. WMCore/Database/DBCreator.py +113 -0
  71. WMCore/Database/DBExceptionHandler.py +59 -0
  72. WMCore/Database/DBFactory.py +117 -0
  73. WMCore/Database/DBFormatter.py +177 -0
  74. WMCore/Database/Dialects.py +13 -0
  75. WMCore/Database/ExecuteDAO.py +327 -0
  76. WMCore/Database/MongoDB.py +241 -0
  77. WMCore/Database/MySQL/Destroy.py +42 -0
  78. WMCore/Database/MySQL/ListUserContent.py +20 -0
  79. WMCore/Database/MySQL/__init__.py +9 -0
  80. WMCore/Database/MySQLCore.py +132 -0
  81. WMCore/Database/Oracle/Destroy.py +56 -0
  82. WMCore/Database/Oracle/ListUserContent.py +19 -0
  83. WMCore/Database/Oracle/__init__.py +9 -0
  84. WMCore/Database/ResultSet.py +44 -0
  85. WMCore/Database/Transaction.py +91 -0
  86. WMCore/Database/__init__.py +9 -0
  87. WMCore/Database/ipy_profile_couch.py +438 -0
  88. WMCore/GlobalWorkQueue/CherryPyThreads/CleanUpTask.py +29 -0
  89. WMCore/GlobalWorkQueue/CherryPyThreads/HeartbeatMonitor.py +105 -0
  90. WMCore/GlobalWorkQueue/CherryPyThreads/LocationUpdateTask.py +28 -0
  91. WMCore/GlobalWorkQueue/CherryPyThreads/ReqMgrInteractionTask.py +35 -0
  92. WMCore/GlobalWorkQueue/CherryPyThreads/__init__.py +0 -0
  93. WMCore/GlobalWorkQueue/__init__.py +0 -0
  94. WMCore/GroupUser/CouchObject.py +127 -0
  95. WMCore/GroupUser/Decorators.py +51 -0
  96. WMCore/GroupUser/Group.py +33 -0
  97. WMCore/GroupUser/Interface.py +73 -0
  98. WMCore/GroupUser/User.py +96 -0
  99. WMCore/GroupUser/__init__.py +11 -0
  100. WMCore/Lexicon.py +836 -0
  101. WMCore/REST/Auth.py +202 -0
  102. WMCore/REST/CherryPyPeriodicTask.py +166 -0
  103. WMCore/REST/Error.py +333 -0
  104. WMCore/REST/Format.py +642 -0
  105. WMCore/REST/HeartbeatMonitorBase.py +90 -0
  106. WMCore/REST/Main.py +636 -0
  107. WMCore/REST/Server.py +2435 -0
  108. WMCore/REST/Services.py +24 -0
  109. WMCore/REST/Test.py +120 -0
  110. WMCore/REST/Tools.py +38 -0
  111. WMCore/REST/Validation.py +250 -0
  112. WMCore/REST/__init__.py +1 -0
  113. WMCore/ReqMgr/DataStructs/RequestStatus.py +209 -0
  114. WMCore/ReqMgr/DataStructs/RequestType.py +13 -0
  115. WMCore/ReqMgr/DataStructs/__init__.py +0 -0
  116. WMCore/ReqMgr/__init__.py +1 -0
  117. WMCore/Services/AlertManager/AlertManagerAPI.py +111 -0
  118. WMCore/Services/AlertManager/__init__.py +0 -0
  119. WMCore/Services/CRIC/CRIC.py +238 -0
  120. WMCore/Services/CRIC/__init__.py +0 -0
  121. WMCore/Services/DBS/DBS3Reader.py +1044 -0
  122. WMCore/Services/DBS/DBSConcurrency.py +44 -0
  123. WMCore/Services/DBS/DBSErrors.py +112 -0
  124. WMCore/Services/DBS/DBSReader.py +23 -0
  125. WMCore/Services/DBS/DBSUtils.py +166 -0
  126. WMCore/Services/DBS/DBSWriterObjects.py +381 -0
  127. WMCore/Services/DBS/ProdException.py +133 -0
  128. WMCore/Services/DBS/__init__.py +8 -0
  129. WMCore/Services/FWJRDB/FWJRDBAPI.py +118 -0
  130. WMCore/Services/FWJRDB/__init__.py +0 -0
  131. WMCore/Services/HTTPS/HTTPSAuthHandler.py +66 -0
  132. WMCore/Services/HTTPS/__init__.py +0 -0
  133. WMCore/Services/LogDB/LogDB.py +201 -0
  134. WMCore/Services/LogDB/LogDBBackend.py +191 -0
  135. WMCore/Services/LogDB/LogDBExceptions.py +11 -0
  136. WMCore/Services/LogDB/LogDBReport.py +85 -0
  137. WMCore/Services/LogDB/__init__.py +0 -0
  138. WMCore/Services/MSPileup/__init__.py +0 -0
  139. WMCore/Services/MSUtils/MSUtils.py +54 -0
  140. WMCore/Services/MSUtils/__init__.py +0 -0
  141. WMCore/Services/McM/McM.py +173 -0
  142. WMCore/Services/McM/__init__.py +8 -0
  143. WMCore/Services/MonIT/Grafana.py +133 -0
  144. WMCore/Services/MonIT/__init__.py +0 -0
  145. WMCore/Services/PyCondor/PyCondorAPI.py +154 -0
  146. WMCore/Services/PyCondor/__init__.py +0 -0
  147. WMCore/Services/ReqMgr/ReqMgr.py +261 -0
  148. WMCore/Services/ReqMgr/__init__.py +0 -0
  149. WMCore/Services/ReqMgrAux/ReqMgrAux.py +419 -0
  150. WMCore/Services/ReqMgrAux/__init__.py +0 -0
  151. WMCore/Services/RequestDB/RequestDBReader.py +267 -0
  152. WMCore/Services/RequestDB/RequestDBWriter.py +39 -0
  153. WMCore/Services/RequestDB/__init__.py +0 -0
  154. WMCore/Services/Requests.py +624 -0
  155. WMCore/Services/Rucio/Rucio.py +1290 -0
  156. WMCore/Services/Rucio/RucioUtils.py +74 -0
  157. WMCore/Services/Rucio/__init__.py +0 -0
  158. WMCore/Services/RucioConMon/RucioConMon.py +121 -0
  159. WMCore/Services/RucioConMon/__init__.py +0 -0
  160. WMCore/Services/Service.py +400 -0
  161. WMCore/Services/StompAMQ/__init__.py +0 -0
  162. WMCore/Services/TagCollector/TagCollector.py +155 -0
  163. WMCore/Services/TagCollector/XMLUtils.py +98 -0
  164. WMCore/Services/TagCollector/__init__.py +0 -0
  165. WMCore/Services/UUIDLib.py +13 -0
  166. WMCore/Services/UserFileCache/UserFileCache.py +160 -0
  167. WMCore/Services/UserFileCache/__init__.py +8 -0
  168. WMCore/Services/WMAgent/WMAgent.py +63 -0
  169. WMCore/Services/WMAgent/__init__.py +0 -0
  170. WMCore/Services/WMArchive/CMSSWMetrics.py +526 -0
  171. WMCore/Services/WMArchive/DataMap.py +463 -0
  172. WMCore/Services/WMArchive/WMArchive.py +33 -0
  173. WMCore/Services/WMArchive/__init__.py +0 -0
  174. WMCore/Services/WMBS/WMBS.py +97 -0
  175. WMCore/Services/WMBS/__init__.py +0 -0
  176. WMCore/Services/WMStats/DataStruct/RequestInfoCollection.py +300 -0
  177. WMCore/Services/WMStats/DataStruct/__init__.py +0 -0
  178. WMCore/Services/WMStats/WMStatsPycurl.py +145 -0
  179. WMCore/Services/WMStats/WMStatsReader.py +445 -0
  180. WMCore/Services/WMStats/WMStatsWriter.py +273 -0
  181. WMCore/Services/WMStats/__init__.py +0 -0
  182. WMCore/Services/WMStatsServer/WMStatsServer.py +134 -0
  183. WMCore/Services/WMStatsServer/__init__.py +0 -0
  184. WMCore/Services/WorkQueue/WorkQueue.py +492 -0
  185. WMCore/Services/WorkQueue/__init__.py +0 -0
  186. WMCore/Services/__init__.py +8 -0
  187. WMCore/Services/pycurl_manager.py +574 -0
  188. WMCore/WMBase.py +50 -0
  189. WMCore/WMConnectionBase.py +164 -0
  190. WMCore/WMException.py +183 -0
  191. WMCore/WMExceptions.py +269 -0
  192. WMCore/WMFactory.py +76 -0
  193. WMCore/WMInit.py +377 -0
  194. WMCore/WMLogging.py +104 -0
  195. WMCore/WMSpec/ConfigSectionTree.py +442 -0
  196. WMCore/WMSpec/Persistency.py +135 -0
  197. WMCore/WMSpec/Steps/BuildMaster.py +87 -0
  198. WMCore/WMSpec/Steps/BuildTools.py +201 -0
  199. WMCore/WMSpec/Steps/Builder.py +97 -0
  200. WMCore/WMSpec/Steps/Diagnostic.py +89 -0
  201. WMCore/WMSpec/Steps/Emulator.py +62 -0
  202. WMCore/WMSpec/Steps/ExecuteMaster.py +208 -0
  203. WMCore/WMSpec/Steps/Executor.py +210 -0
  204. WMCore/WMSpec/Steps/StepFactory.py +213 -0
  205. WMCore/WMSpec/Steps/TaskEmulator.py +75 -0
  206. WMCore/WMSpec/Steps/Template.py +204 -0
  207. WMCore/WMSpec/Steps/Templates/AlcaHarvest.py +76 -0
  208. WMCore/WMSpec/Steps/Templates/CMSSW.py +613 -0
  209. WMCore/WMSpec/Steps/Templates/DQMUpload.py +59 -0
  210. WMCore/WMSpec/Steps/Templates/DeleteFiles.py +70 -0
  211. WMCore/WMSpec/Steps/Templates/LogArchive.py +84 -0
  212. WMCore/WMSpec/Steps/Templates/LogCollect.py +105 -0
  213. WMCore/WMSpec/Steps/Templates/StageOut.py +105 -0
  214. WMCore/WMSpec/Steps/Templates/__init__.py +10 -0
  215. WMCore/WMSpec/Steps/WMExecutionFailure.py +21 -0
  216. WMCore/WMSpec/Steps/__init__.py +8 -0
  217. WMCore/WMSpec/Utilities.py +63 -0
  218. WMCore/WMSpec/WMSpecErrors.py +12 -0
  219. WMCore/WMSpec/WMStep.py +347 -0
  220. WMCore/WMSpec/WMTask.py +1997 -0
  221. WMCore/WMSpec/WMWorkload.py +2288 -0
  222. WMCore/WMSpec/WMWorkloadTools.py +382 -0
  223. WMCore/WMSpec/__init__.py +9 -0
  224. WMCore/WorkQueue/DataLocationMapper.py +273 -0
  225. WMCore/WorkQueue/DataStructs/ACDCBlock.py +47 -0
  226. WMCore/WorkQueue/DataStructs/Block.py +48 -0
  227. WMCore/WorkQueue/DataStructs/CouchWorkQueueElement.py +148 -0
  228. WMCore/WorkQueue/DataStructs/WorkQueueElement.py +274 -0
  229. WMCore/WorkQueue/DataStructs/WorkQueueElementResult.py +152 -0
  230. WMCore/WorkQueue/DataStructs/WorkQueueElementsSummary.py +185 -0
  231. WMCore/WorkQueue/DataStructs/__init__.py +0 -0
  232. WMCore/WorkQueue/Policy/End/EndPolicyInterface.py +44 -0
  233. WMCore/WorkQueue/Policy/End/SingleShot.py +22 -0
  234. WMCore/WorkQueue/Policy/End/__init__.py +32 -0
  235. WMCore/WorkQueue/Policy/PolicyInterface.py +17 -0
  236. WMCore/WorkQueue/Policy/Start/Block.py +258 -0
  237. WMCore/WorkQueue/Policy/Start/Dataset.py +180 -0
  238. WMCore/WorkQueue/Policy/Start/MonteCarlo.py +131 -0
  239. WMCore/WorkQueue/Policy/Start/ResubmitBlock.py +171 -0
  240. WMCore/WorkQueue/Policy/Start/StartPolicyInterface.py +316 -0
  241. WMCore/WorkQueue/Policy/Start/__init__.py +34 -0
  242. WMCore/WorkQueue/Policy/__init__.py +57 -0
  243. WMCore/WorkQueue/WMBSHelper.py +772 -0
  244. WMCore/WorkQueue/WorkQueue.py +1237 -0
  245. WMCore/WorkQueue/WorkQueueBackend.py +750 -0
  246. WMCore/WorkQueue/WorkQueueBase.py +39 -0
  247. WMCore/WorkQueue/WorkQueueExceptions.py +44 -0
  248. WMCore/WorkQueue/WorkQueueReqMgrInterface.py +278 -0
  249. WMCore/WorkQueue/WorkQueueUtils.py +130 -0
  250. WMCore/WorkQueue/__init__.py +13 -0
  251. WMCore/Wrappers/JsonWrapper/JSONThunker.py +342 -0
  252. WMCore/Wrappers/JsonWrapper/__init__.py +7 -0
  253. WMCore/Wrappers/__init__.py +6 -0
  254. WMCore/__init__.py +10 -0
  255. wmglobalqueue-2.4.5.1.data/data/bin/wmc-dist-patch +15 -0
  256. wmglobalqueue-2.4.5.1.data/data/bin/wmc-dist-unpatch +8 -0
  257. wmglobalqueue-2.4.5.1.data/data/bin/wmc-httpd +3 -0
  258. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/.couchapprc +1 -0
  259. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/README.md +40 -0
  260. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/index.html +264 -0
  261. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/ElementInfoByWorkflow.js +96 -0
  262. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/StuckElementInfo.js +57 -0
  263. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/WorkloadInfoTable.js +80 -0
  264. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/dataTable.js +70 -0
  265. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/namespace.js +23 -0
  266. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/style/main.css +75 -0
  267. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/couchapp.json +4 -0
  268. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/filters/childQueueFilter.js +13 -0
  269. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/filters/filterDeletedDocs.js +3 -0
  270. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/filters/queueFilter.js +11 -0
  271. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/language +1 -0
  272. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lib/mustache.js +333 -0
  273. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lib/validate.js +27 -0
  274. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lib/workqueue_utils.js +61 -0
  275. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/elementsDetail.js +28 -0
  276. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/filter.js +86 -0
  277. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/stuckElements.js +38 -0
  278. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/workRestrictions.js +153 -0
  279. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/workflowSummary.js +28 -0
  280. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/rewrites.json +73 -0
  281. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/shows/redirect.js +23 -0
  282. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/shows/status.js +40 -0
  283. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/ElementSummaryByWorkflow.html +27 -0
  284. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/StuckElementSummary.html +26 -0
  285. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/TaskStatus.html +23 -0
  286. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/WorkflowSummary.html +27 -0
  287. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/partials/workqueue-common-lib.html +2 -0
  288. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/partials/yui-lib-remote.html +16 -0
  289. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/partials/yui-lib.html +18 -0
  290. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/updates/in-place.js +50 -0
  291. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/validate_doc_update.js +8 -0
  292. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/vendor/couchapp/_attachments/jquery.couch.app.js +235 -0
  293. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/vendor/couchapp/_attachments/jquery.pathbinder.js +173 -0
  294. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeData/map.js +8 -0
  295. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeData/reduce.js +2 -0
  296. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeParentData/map.js +8 -0
  297. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeParentData/reduce.js +2 -0
  298. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activePileupData/map.js +8 -0
  299. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activePileupData/reduce.js +2 -0
  300. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/analyticsData/map.js +11 -0
  301. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/analyticsData/reduce.js +1 -0
  302. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/availableByPriority/map.js +6 -0
  303. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/conflicts/map.js +5 -0
  304. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elements/map.js +5 -0
  305. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByData/map.js +8 -0
  306. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByParent/map.js +8 -0
  307. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByParentData/map.js +8 -0
  308. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByPileupData/map.js +8 -0
  309. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByStatus/map.js +8 -0
  310. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsBySubscription/map.js +6 -0
  311. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByWorkflow/map.js +8 -0
  312. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByWorkflow/reduce.js +3 -0
  313. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsDetailByWorkflowAndStatus/map.js +26 -0
  314. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobInjectStatusByRequest/map.js +10 -0
  315. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobInjectStatusByRequest/reduce.js +1 -0
  316. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobStatusByRequest/map.js +6 -0
  317. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobStatusByRequest/reduce.js +1 -0
  318. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndPriority/map.js +6 -0
  319. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndPriority/reduce.js +1 -0
  320. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndStatus/map.js +6 -0
  321. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndStatus/reduce.js +1 -0
  322. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByRequest/map.js +6 -0
  323. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByRequest/reduce.js +1 -0
  324. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatus/map.js +6 -0
  325. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatus/reduce.js +1 -0
  326. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatusAndPriority/map.js +6 -0
  327. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatusAndPriority/reduce.js +1 -0
  328. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/openRequests/map.js +6 -0
  329. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/recent-items/map.js +5 -0
  330. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/siteWhitelistByRequest/map.js +6 -0
  331. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/siteWhitelistByRequest/reduce.js +1 -0
  332. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/specsByWorkflow/map.js +5 -0
  333. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/stuckElements/map.js +38 -0
  334. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsInjectStatusByRequest/map.js +12 -0
  335. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsInjectStatusByRequest/reduce.js +3 -0
  336. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrl/map.js +6 -0
  337. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrl/reduce.js +2 -0
  338. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrlByRequest/map.js +6 -0
  339. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrlByRequest/reduce.js +2 -0
  340. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/workflowSummary/map.js +9 -0
  341. wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/workflowSummary/reduce.js +10 -0
  342. wmglobalqueue-2.4.5.1.dist-info/METADATA +26 -0
  343. wmglobalqueue-2.4.5.1.dist-info/RECORD +347 -0
  344. wmglobalqueue-2.4.5.1.dist-info/WHEEL +5 -0
  345. wmglobalqueue-2.4.5.1.dist-info/licenses/LICENSE +202 -0
  346. wmglobalqueue-2.4.5.1.dist-info/licenses/NOTICE +16 -0
  347. wmglobalqueue-2.4.5.1.dist-info/top_level.txt +2 -0
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env python
2
+ """
3
+ _WMBSBase_
4
+
5
+ Generic methods used by all of the WMBS classes.
6
+ """
7
+
8
+ from builtins import object
9
+
10
+ import threading
11
+
12
+ class WorkQueueBase(object):
13
+ """
14
+ Generic methods used by all of the WMBS classes.
15
+ """
16
+ def __init__(self, logger=None, dbi=None):
17
+ """
18
+ ___init___
19
+
20
+ Initialize all the database connection attributes and the logging
21
+ attritbutes. Create a DAO factory for WMCore.WorkQueue as well. Finally,
22
+ check to see if a transaction object has been created. If none exists,
23
+ create one but leave the transaction closed.
24
+ """
25
+ # only load dbi connection if we need it
26
+ if dbi or 'dbi' in dir(threading.currentThread()):
27
+ from WMCore.WMConnectionBase import WMConnectionBase
28
+ self.conn = WMConnectionBase(daoPackage = "WMCore",
29
+ logger = logger, dbi = dbi)
30
+ self.logger = self.conn.logger
31
+ else:
32
+ self.conn = None
33
+ if logger:
34
+ self.logger = logger
35
+ elif 'logger' in dir(threading.currentThread()):
36
+ self.logger = threading.currentThread().logger
37
+ else:
38
+ import logging
39
+ self.logger = logging.getLogger()
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env python
2
+ """WorkQueue Exceptions"""
3
+
4
+ class WorkQueueError(Exception):
5
+ """Standard error baseclass"""
6
+ def __init__(self, error):
7
+ Exception.__init__(self, error)
8
+ self.msg = WorkQueueError.__class__.__name__
9
+ self.error = error
10
+
11
+ def __str__(self):
12
+ return "%s: %s" % (self.msg, self.error)
13
+
14
+ class WorkQueueWMSpecError(WorkQueueError):
15
+ """Problem with the spec file"""
16
+ def __init__(self, wmspec, error):
17
+ WorkQueueError.__init__(self, error)
18
+ self.wmspec = wmspec
19
+ if hasattr(self.wmspec, 'name'):
20
+ self.msg = "Invalid WMSpec: '%s'" % self.wmspec.name()
21
+ else:
22
+ self.msg = "Invalid WMSpec:"
23
+
24
+ class WorkQueueNoWorkError(WorkQueueError):
25
+ """No work for spec"""
26
+ def __init__(self, wmspec, error):
27
+ WorkQueueError.__init__(self, error)
28
+ self.wmspec = wmspec
29
+ if hasattr(self.wmspec, 'name'):
30
+ self.msg = "No work in spec: '%s' Check inputs" % self.wmspec.name()
31
+ else:
32
+ self.msg = "No work in spec: Check inputs"
33
+
34
+ class WorkQueueNoMatchingElements(WorkQueueError):
35
+ """Didn't find any element"""
36
+ def __init__(self, error):
37
+ WorkQueueError.__init__(self, error)
38
+ self.msg = WorkQueueNoMatchingElements.__class__.__name__
39
+ self.error = error
40
+
41
+ def __str__(self):
42
+ return "%s: %s" % (self.msg, self.error)
43
+
44
+ TERMINAL_EXCEPTIONS = (WorkQueueWMSpecError, WorkQueueNoWorkError)
@@ -0,0 +1,278 @@
1
+ #!/usr/bin/env python
2
+ """
3
+ Helper class for RequestManager interaction
4
+ """
5
+ from builtins import object
6
+ from future.utils import viewvalues
7
+
8
+ import logging
9
+ import os
10
+ import socket
11
+ import threading
12
+ import traceback
13
+ from operator import itemgetter
14
+
15
+ from WMCore import Lexicon
16
+ from WMCore.Database.CMSCouch import CouchError, CouchNotFoundError
17
+ from WMCore.Database.CouchUtils import CouchConnectionError
18
+ from WMCore.ReqMgr.DataStructs.RequestStatus import REQUEST_STATE_LIST
19
+ from WMCore.Services.LogDB.LogDB import LogDB
20
+ from WMCore.Services.ReqMgr.ReqMgr import ReqMgr
21
+ from WMCore.Services.Rucio.Rucio import Rucio
22
+ from WMCore.WorkQueue.WorkQueueExceptions import WorkQueueWMSpecError, WorkQueueNoWorkError, TERMINAL_EXCEPTIONS
23
+
24
+
25
+ class WorkQueueReqMgrInterface(object):
26
+ """Helper class for ReqMgr interaction"""
27
+
28
+ def __init__(self, **kwargs):
29
+ if not kwargs.get('logger'):
30
+ kwargs['logger'] = logging
31
+ self.logger = kwargs['logger']
32
+ self.rucio = Rucio(kwargs.get("rucioAccount", "wmcore_transferor"),
33
+ configDict=dict(logger=self.logger))
34
+ # this will break all in one test
35
+ self.reqMgr2 = ReqMgr(kwargs.get("reqmgr2_endpoint", None))
36
+
37
+ centralurl = kwargs.get("central_logdb_url", "")
38
+ identifier = kwargs.get("log_reporter", "")
39
+
40
+ # set the thread name before creat the log db.
41
+ # only sets that when it is not set already
42
+ myThread = threading.currentThread()
43
+ if myThread.getName() == "MainThread":
44
+ myThread.setName(self.__class__.__name__)
45
+
46
+ self.logdb = LogDB(centralurl, identifier, logger=self.logger)
47
+
48
+ def __call__(self, queue):
49
+ """Synchronize WorkQueue and RequestManager"""
50
+ # ensure log records go to the correct logger object
51
+ queue.logger = self.logger
52
+ msg = ''
53
+ try: # Fetch data from ReqMgr and propagate work cancellation to workqueue
54
+ self.logger.info("Canceling aborted and force-completed requests")
55
+ count = self.cancelWork(queue)
56
+ msg += "Work canceled: %s, " % count
57
+ except Exception as ex:
58
+ self.logger.exception("Generic error while canceling work. Details: %s", str(ex))
59
+
60
+ try: # Close requests that no longer need to be open for new data
61
+ self.logger.info("Closing open requests")
62
+ workClosed = queue.closeWork()
63
+ msg += "Work closed: %d, " % len(workClosed)
64
+ except Exception as ex:
65
+ errorMsg = "Generic error while closing open requests. Details: %s"
66
+ self.logger.exception(errorMsg, str(ex))
67
+
68
+ try: # Try to create new work elements for open requests
69
+ self.logger.info("Adding new elements to open requests")
70
+ extraWork = self.addNewElementsToOpenRequests(queue)
71
+ msg += "Work added: %d, " % extraWork
72
+ except Exception as ex:
73
+ errorMsg = "Generic error while adding work to open requests. Details: %s"
74
+ self.logger.exception(errorMsg, str(ex))
75
+
76
+ try: # Pull in work for new requests
77
+ self.logger.info("Queuing work for new requests")
78
+ work = self.queueNewRequests(queue)
79
+ msg += "New Work: %d" % work
80
+ except Exception as ex:
81
+ errorMsg = "Generic error while queuing work for new requests. Details: %s"
82
+ self.logger.exception(errorMsg, str(ex))
83
+
84
+ self.logger.info("Summary of %s: %s", self.__class__.__name__, msg)
85
+ queue.backend.recordTaskActivity('reqmgr_sync', msg)
86
+
87
+ def queueNewRequests(self, queue):
88
+ """Get requests from regMgr and queue to workqueue"""
89
+ try:
90
+ workLoads = self.getAvailableRequests()
91
+ except Exception as exc:
92
+ msg = "Error contacting RequestManager. Details: %s" % str(exc)
93
+ self.logger.exception(msg)
94
+ return 0
95
+
96
+ work = 0
97
+ for team, reqName, workLoadUrl in workLoads:
98
+ try:
99
+ try:
100
+ Lexicon.couchurl(workLoadUrl)
101
+ except Exception as ex: # can throw many errors e.g. AttributeError, AssertionError etc.
102
+ # check its not a local file
103
+ if not os.path.exists(workLoadUrl):
104
+ error = WorkQueueWMSpecError(None, "Workflow url validation error: %s" % str(ex))
105
+ raise error
106
+
107
+ self.logger.info("Processing request %s at %s" % (reqName, workLoadUrl))
108
+ units = queue.queueWork(workLoadUrl, request=reqName, team=team)
109
+ self.logdb.delete(reqName, "error", this_thread=True, agent=False)
110
+ except TERMINAL_EXCEPTIONS as ex:
111
+ # fatal error - report back to ReqMgr
112
+ self.logger.critical('Permanent failure processing request "%s": %s' % (reqName, str(ex)))
113
+ self.logger.info("Marking request %s as failed in ReqMgr" % reqName)
114
+ self.reportRequestStatus(reqName, 'Failed', message=str(ex))
115
+ continue
116
+ except (IOError, socket.error, CouchError, CouchConnectionError) as ex:
117
+ # temporary problem - try again later
118
+ msg = 'Error processing request "%s": will try again later.' % reqName
119
+ msg += '\nError: "%s"' % str(ex)
120
+ self.logger.error(msg)
121
+ self.logdb.post(reqName, msg, 'error')
122
+ continue
123
+ except Exception as ex:
124
+ # Log exception as it isnt a communication problem
125
+ msg = 'Error processing request "%s": will try again later.' % reqName
126
+ msg += '\nSee log for details.\nError: "%s"' % str(ex)
127
+ self.logger.exception('Unknown error processing %s' % reqName)
128
+ self.logdb.post(reqName, msg, 'error')
129
+ continue
130
+
131
+ self.logger.info('%s units(s) queued for "%s"' % (units, reqName))
132
+ work += units
133
+
134
+ self.logger.info("Total of %s element(s) queued for new requests", work)
135
+ return work
136
+
137
+ def cancelWork(self, queue):
138
+ requests = self.reqMgr2.getRequestByStatus(['aborted', 'force-complete'], detail=False)
139
+ count = 0
140
+ for req in requests:
141
+ try:
142
+ queue.cancelWork(req)
143
+ count += 1
144
+ except CouchNotFoundError as exc:
145
+ msg = 'Failed to cancel workflow: {} because elements are no '.format(req)
146
+ msg += 'longer exist in CouchDB. Details: {}'.format(str(exc))
147
+ except Exception as ex:
148
+ msg = 'Error to cancel the request "%s": %s' % (req, str(ex))
149
+ self.logger.exception(msg)
150
+ return count
151
+
152
+ def deleteFinishedWork(self, queue, elements):
153
+ """Delete work from queue that is finished in ReqMgr"""
154
+ finished = []
155
+ for element in elements:
156
+ if element.inEndState():
157
+ finished.append(element['RequestName'])
158
+ return queue.deleteWorkflows(*finished)
159
+
160
+ def getAvailableRequests(self):
161
+ """
162
+ Get available requests and sort by team and priority
163
+ returns [(team, request_name, request_spec_url)]
164
+ """
165
+ thisStatus = "staged"
166
+ self.logger.info("Contacting ReqMgr for workflows in status: %s", thisStatus)
167
+ tempResults = self.reqMgr2.getRequestByStatus(thisStatus)
168
+ filteredResults = []
169
+ for requests in tempResults:
170
+ for request in viewvalues(requests):
171
+ filteredResults.append(request)
172
+ filteredResults.sort(key=itemgetter('RequestPriority'), reverse=True)
173
+ filteredResults.sort(key=lambda r: r["Team"])
174
+
175
+ results = [(x["Team"], x["RequestName"], x["RequestWorkflow"]) for x in filteredResults]
176
+
177
+ return results
178
+
179
+ def reportRequestStatus(self, request, status, message=None):
180
+ """Change state in RequestManager
181
+ Optionally, take a message to append to the request
182
+ """
183
+ if message:
184
+ logType = "error" if status == "Failed" else "info"
185
+ self.logdb.post(request, str(message), logType)
186
+ reqmgrStatus = self._workQueueToReqMgrStatus(status)
187
+
188
+ if reqmgrStatus: # only send known states
189
+ try:
190
+ self.reqMgr2.updateRequestStatus(request, reqmgrStatus)
191
+ except Exception as ex:
192
+ msg = "%s : fail to update status will try later: %s" % (request, str(ex))
193
+ msg += traceback.format_exc()
194
+ self.logdb.post(request, msg, 'warning')
195
+ raise ex
196
+ return
197
+
198
+ def _workQueueToReqMgrStatus(self, status):
199
+ """Map WorkQueue Status to that reported to ReqMgr"""
200
+ statusMapping = {'Acquired': 'acquired',
201
+ 'Running': 'running-open',
202
+ 'Failed': 'failed',
203
+ 'Canceled': 'aborted',
204
+ 'CancelRequested': 'aborted',
205
+ 'Done': 'completed'
206
+ }
207
+ if status in statusMapping:
208
+ # if wq status passed convert to reqmgr status
209
+ return statusMapping[status]
210
+ elif status in REQUEST_STATE_LIST:
211
+ # if reqmgr status passed return reqmgr status
212
+ return status
213
+ else:
214
+ # unknown status
215
+ return None
216
+
217
+ def _reqMgrToWorkQueueStatus(self, status):
218
+ """Map ReqMgr status to that in a WorkQueue element, it is not a 1-1 relation"""
219
+ statusMapping = {'acquired': ['Acquired'],
220
+ 'running': ['Running'],
221
+ 'running-open': ['Running'],
222
+ 'running-closed': ['Running'],
223
+ 'failed': ['Failed'],
224
+ 'aborted': ['Canceled', 'CancelRequested'],
225
+ 'force-complete': ['Canceled', 'CancelRequested'],
226
+ 'completed': ['Done']}
227
+ if status in statusMapping:
228
+ return statusMapping[status]
229
+ else:
230
+ return []
231
+
232
+ def reportElement(self, element):
233
+ """Report element to ReqMgr"""
234
+ self.reportRequestStatus(element['RequestName'], element['Status'])
235
+
236
+ def addNewElementsToOpenRequests(self, queue):
237
+ """
238
+ Add new elements to open requests according to their
239
+ workqueue_inbox element.
240
+ """
241
+ self.logger.info("Fetching open requests from WorkQueue")
242
+
243
+ try:
244
+ workInbox = queue.backend.getInboxElements(OpenForNewData=True, loadSpec=True)
245
+ except Exception as exc:
246
+ self.logger.exception("Error retrieving open inbox elements. Details: %s", str(exc))
247
+ return 0
248
+
249
+ self.logger.info("Retrieved %d inbox elements open for new data", len(workInbox))
250
+ work = 0
251
+ for elem in workInbox:
252
+ try:
253
+ units = queue.addWork(elem, rucioObj=self.rucio)
254
+ self.logdb.delete(elem['RequestName'], 'error', True, agent=False)
255
+ except (WorkQueueWMSpecError, WorkQueueNoWorkError) as ex:
256
+ # fatal error - but at least it was split the first time. Log and skip.
257
+ msg = 'Error adding further work to request "%s". ' % elem['RequestName']
258
+ msg += 'Will try again later.\nError: "%s"' % str(ex)
259
+ self.logger.error(msg)
260
+ self.logdb.post(elem['RequestName'], msg, 'error')
261
+ except (IOError, socket.error, CouchError, CouchConnectionError) as ex:
262
+ # temporary problem - try again later
263
+ msg = 'Error processing request "%s": will try again later.' % elem['RequestName']
264
+ msg += '\nError: "%s"' % str(ex)
265
+ self.logger.error(msg)
266
+ self.logdb.post(elem['RequestName'], msg, 'error')
267
+ except Exception as ex:
268
+ # Log exception as it isnt a communication problem
269
+ msg = 'Error processing request "%s". Will try again later. ' % elem['RequestName']
270
+ msg += 'See log for details.\nError: "%s"' % str(ex)
271
+ msg += '\nTraceback: %s' % traceback.format_exc()
272
+ self.logger.exception('Unknown error processing %s' % elem['RequestName'])
273
+ self.logdb.post(elem['RequestName'], msg, 'error')
274
+ else:
275
+ work += units
276
+
277
+ self.logger.info("%s element(s) added to open requests" % work)
278
+ return work
@@ -0,0 +1,130 @@
1
+ #!/usr/bin/env python
2
+ """Various helper functions for workqueue"""
3
+
4
+ import logging
5
+ import os
6
+ from WMCore.Services.CRIC.CRIC import CRIC
7
+
8
+
9
+ __dbses = {}
10
+
11
+
12
+ def get_dbs(url):
13
+ """Return DBS object for url"""
14
+ try:
15
+ return __dbses[url]
16
+ except KeyError:
17
+ from WMCore.Services.DBS.DBSReader import DBSReader
18
+ __dbses[url] = DBSReader(url)
19
+ return __dbses[url]
20
+
21
+ __cric = None
22
+ __cmsSiteNames = []
23
+
24
+
25
+ def cmsSiteNames():
26
+ """Get all cms sites"""
27
+ global __cmsSiteNames
28
+ if __cmsSiteNames:
29
+ return __cmsSiteNames
30
+ global __cric
31
+ if not __cric:
32
+ __cric = CRIC()
33
+
34
+ try:
35
+ __cmsSiteNames = __cric.getAllPSNs()
36
+ except Exception:
37
+ pass
38
+ return __cmsSiteNames
39
+
40
+
41
+ def makeLocationsList(siteWhitelist, siteBlacklist):
42
+ """
43
+ _makeLocationsList_
44
+
45
+ Make a location list based on the intersection between a site white list
46
+ and blacklist, if none specified then all sites are listed.
47
+ """
48
+ sites = cmsSiteNames()
49
+ if siteWhitelist:
50
+ # Just get the CMS sites matching the whitelists
51
+ sites = list(set(sites) & set(siteWhitelist))
52
+ if siteBlacklist:
53
+ # Get all CMS sites less the blacklist
54
+ sites = list(set(sites) - set(siteBlacklist))
55
+ return sites
56
+
57
+
58
+ def queueFromConfig(config):
59
+ """Create a queue from the config object"""
60
+ config = queueConfigFromConfigObject(config)
61
+ if config.WorkQueueManager.level == 'GlobalQueue':
62
+ from WMCore.WorkQueue.WorkQueue import globalQueue
63
+ return globalQueue(**config.WorkQueueManager.queueParams)
64
+ elif config.WorkQueueManager.level == 'LocalQueue':
65
+ from WMCore.WorkQueue.WorkQueue import localQueue
66
+ return localQueue(**config.WorkQueueManager.queueParams)
67
+ else:
68
+ from WMCore.WorkQueue.WorkQueue import WorkQueue
69
+ return WorkQueue(**config.WorkQueueManager.queueParams)
70
+
71
+
72
+ def queueConfigFromConfigObject(config):
73
+ """From a config object create a config dict suitable for a queue object"""
74
+ from os import path
75
+ wqManager = config.section_('WorkQueueManager')
76
+
77
+ if not hasattr(wqManager, 'componentDir'):
78
+ wqManager.componentDir = path.join(config.General.WorkDir,
79
+ 'WorkQueueManager')
80
+ if not hasattr(wqManager, 'namespace'):
81
+ wqManager.namespace = 'WMComponent.WorkQueueManager.WorkQueueManager'
82
+ if not hasattr(wqManager, 'logLevel'):
83
+ wqManager.logLevel = 'INFO'
84
+ if not hasattr(wqManager, 'pollInterval'):
85
+ wqManager.pollInterval = 600
86
+
87
+ # WorkQueue config
88
+ if not hasattr(wqManager, 'queueParams'):
89
+ wqManager.queueParams = {}
90
+ qConfig = wqManager.queueParams
91
+
92
+ # Rucio-related config
93
+ if hasattr(wqManager, 'rucioUrl'):
94
+ qConfig['rucioUrl'] = wqManager.rucioUrl
95
+ if hasattr(wqManager, 'rucioAuthUrl'):
96
+ qConfig['rucioAuthUrl'] = wqManager.rucioAuthUrl
97
+
98
+ if hasattr(wqManager, 'couchurl'):
99
+ qConfig['CouchUrl'] = wqManager.couchurl
100
+ if hasattr(wqManager, 'dbname'):
101
+ qConfig['DbName'] = wqManager.dbname
102
+ if hasattr(wqManager, 'inboxDatabase'):
103
+ qConfig['InboxDbName'] = wqManager.inboxDatabase
104
+
105
+ # pull some info we need from other areas of the config
106
+ if "BossAirConfig" not in qConfig and hasattr(config, 'BossAir'):
107
+ qConfig["BossAirConfig"] = config
108
+ qConfig['BossAirConfig'].section_("Agent").agentName = config.Agent.agentName
109
+ if "JobDumpConfig" not in qConfig and hasattr(config, 'JobStateMachine'):
110
+ qConfig["JobDumpConfig"] = config
111
+ if "CacheDir" not in qConfig and getattr(config.WorkQueueManager, 'componentDir', None):
112
+ qConfig['CacheDir'] = os.path.join(config.WorkQueueManager.componentDir, 'cache')
113
+
114
+ if 'Team' not in qConfig and hasattr(config.Agent, 'teamName'):
115
+ qConfig['Team'] = config.Agent.teamName
116
+ if 'logger' not in qConfig:
117
+ import threading
118
+ myThread = threading.currentThread()
119
+ if not hasattr(myThread, 'logger'):
120
+ loggingLevelName = getattr(wqManager, 'logLevel', 'INFO')
121
+ logging.basicConfig(format='%(asctime)-15s %(levelname)-8s %(module)s: %(message)s',
122
+ level=getattr(logging, loggingLevelName))
123
+ myThread.logger = logging.getLogger('workqueue')
124
+ qConfig['logger'] = myThread.logger
125
+
126
+ # ReqMgr params
127
+ if not hasattr(wqManager, 'reqMgrConfig'):
128
+ wqManager.reqMgrConfig = {}
129
+
130
+ return config
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env python
2
+ """
3
+ _WorkQueue_
4
+
5
+ WorkQueue provides functionality to queue large chunks of work,
6
+ thus acting as a buffer for the next steps in job processing
7
+
8
+ WMSpec objects are fed into the queue, split into coarse grained work units
9
+ and released when a suitable resource is found to execute them.
10
+
11
+ https://twiki.cern.ch/twiki/bin/view/CMS/WMCoreJobPool
12
+ """
13
+ __all__ = []