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,155 @@
1
+ from __future__ import (division, print_function)
2
+ from future import standard_library
3
+
4
+ from Utils.Utilities import decodeBytesToUnicode
5
+
6
+ standard_library.install_aliases()
7
+
8
+ import logging
9
+ from urllib.parse import urlparse
10
+
11
+ from collections import defaultdict
12
+ from WMCore.Services.Service import Service
13
+ from WMCore.Services.TagCollector.XMLUtils import xml_parser
14
+
15
+ class TagCollector(Service):
16
+ """
17
+ Class which provides interface to CMS TagCollector web-service.
18
+ Provides non-deprecated CMSSW releases in all their ScramArchs (not only prod)
19
+ """
20
+
21
+ def __init__(self, url=None, logger=None, configDict=None, **kwargs):
22
+ """
23
+ responseType will be either xml or json
24
+ """
25
+ defaultURL = "https://cmssdt.cern.ch/SDT/cgi-bin/ReleasesXML"
26
+ url = url or defaultURL
27
+ parsedUrl = urlparse(url)
28
+ self.cFileUrlPath = parsedUrl.path.replace("/", "_")
29
+ # all releases types and all their archs
30
+ self.tcArgs = kwargs
31
+ self.tcArgs.setdefault("anytype", 1)
32
+ self.tcArgs.setdefault("anyarch", 1)
33
+
34
+ configDict = configDict or {}
35
+ configDict.setdefault('endpoint', url)
36
+ configDict.setdefault("timeout", 300)
37
+ configDict.setdefault('cacheduration', 1)
38
+ configDict['logger'] = logger if logger else logging.getLogger()
39
+ super(TagCollector, self).__init__(configDict)
40
+ self['logger'].debug("Initializing TagCollector with url: %s", self['endpoint'])
41
+
42
+ def _getResult(self, callname="", clearCache=False,
43
+ args=None, verb="GET", encoder=None, decoder=None,
44
+ contentType=None):
45
+ """
46
+ _getResult_
47
+
48
+ retrieve JSON/XML formatted information given the service name and the
49
+ argument dictionaries
50
+
51
+ TODO: Probably want to move this up into Service
52
+ """
53
+ if not args:
54
+ args = self.tcArgs
55
+
56
+ cFile = '%s_%s'% (self.cFileUrlPath, callname.replace("/", "_"))
57
+ # If no callname or url path, the base host is getting queried
58
+ if cFile == '_':
59
+ cFile = 'baseRequest'
60
+
61
+ if clearCache:
62
+ self.clearCache(cFile, args, verb)
63
+
64
+ # Note cFile is just the base name pattern, args
65
+ # are also considered for the end filename in the method below
66
+ f = self.refreshCache(cFile, callname, args, encoder=encoder, decoder=decodeBytesToUnicode,
67
+ verb=verb, contentType=contentType)
68
+ result = f.read()
69
+ f.close()
70
+
71
+ # overhead from REST model which returns results as strings or None
72
+ # therefore they can be encoded by JSON to None, etc.
73
+ if result == 'None':
74
+ return
75
+ if result and decoder:
76
+ result = decoder(result)
77
+ return result
78
+
79
+ def data(self):
80
+ "Fetch data from tag collector or local cache"
81
+ data = self._getResult()
82
+ pkey = 'architecture'
83
+ for row in xml_parser(data, pkey):
84
+ yield row[pkey]
85
+
86
+ def releases(self, arch=None):
87
+ "Yield CMS releases known in tag collector"
88
+ arr = []
89
+ for row in self.data():
90
+ if arch:
91
+ if arch == row['name']:
92
+ for item in row['project']:
93
+ arr.append(item['label'])
94
+ else:
95
+ for item in row['project']:
96
+ arr.append(item['label'])
97
+ return list(set(arr))
98
+
99
+ def architectures(self):
100
+ "Yield CMS architectures known in tag collector"
101
+ arr = []
102
+ for row in self.data():
103
+ arr.append(row['name'])
104
+ return list(set(arr))
105
+
106
+ def releases_by_architecture(self):
107
+ "returns CMS architectures and realease in dictionary format"
108
+ arch_dict = defaultdict(list)
109
+ for row in self.data():
110
+ releases = set()
111
+ for item in row['project']:
112
+ releases.add(item['label'])
113
+ arch_dict[row['name']].extend(list(releases))
114
+ return dict(arch_dict)
115
+
116
+
117
+ def defaultMicroArchVersionNumberByRelease(self, default_microarch=0):
118
+ """
119
+ Yield default microarchitecture by CMS release known in tag collector.
120
+
121
+ :param default_microarch: int, default microar when not found in TagCollector XML file.
122
+ :return: dictionary ("release": default_microarch (or default_microarch if not found)).
123
+ """
124
+ rel_microarchs = {}
125
+ for row in self.data():
126
+ for item in row['project']:
127
+ microarch = item.get('default_micro_arch', default_microarch)
128
+ if isinstance(microarch, str):
129
+ # format of this value is "arch-vN"
130
+ microarch = int((microarch.split("-")[-1]).lstrip("v"))
131
+ rel_microarchs[item['label']] = microarch
132
+ return rel_microarchs
133
+
134
+ def getGreaterMicroarchVersionNumber(self, releases=None, default_microarch=0, rel_microarchs=None):
135
+ """
136
+ Return the greated default microarchitecture, given a list of releases.
137
+
138
+ :param releases: str, comma-separated list of releases.
139
+ :param default_microarch: int, default microar when not found in TagCollector XML file.
140
+ :return: int, greater default microarchitecture version number.
141
+ """
142
+ if releases is None:
143
+ return default_microarch
144
+
145
+ if rel_microarchs is None:
146
+ rel_microarchs = self.defaultMicroArchVersionNumberByRelease()
147
+
148
+ releases = releases.split(",")
149
+ microarch = default_microarch
150
+ for r in releases:
151
+ m = rel_microarchs.get(r, default_microarch)
152
+ if m > microarch:
153
+ microarch = m
154
+
155
+ return microarch
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env python
2
+ # encoding: utf-8
3
+
4
+ """
5
+ File : XMLUtils.py
6
+ Author : Valentin Kuznetsov <vkuznet AT gmail dot com>
7
+ Description: Set of utilities for RequestManager code
8
+ """
9
+
10
+ from __future__ import (division, print_function)
11
+ from builtins import str, bytes
12
+ from Utils.Utilities import encodeUnicodeToBytes
13
+
14
+ from io import BytesIO
15
+ import re
16
+ import xml.etree.cElementTree as ET
17
+
18
+ int_number_pattern = re.compile(r'(^[0-9-]$|^[0-9-][0-9]*$)')
19
+ float_number_pattern = re.compile(r'(^[-]?\d+\.\d*$|^\d*\.{1,1}\d+$)')
20
+
21
+
22
+ def adjust_value(value):
23
+ """
24
+ Change null value to None.
25
+ """
26
+ pat_float = float_number_pattern
27
+ pat_integer = int_number_pattern
28
+ if isinstance(value, str):
29
+ if value == 'null' or value == '(null)':
30
+ return None
31
+ elif pat_float.match(value):
32
+ return float(value)
33
+ elif pat_integer.match(value):
34
+ return int(value)
35
+ else:
36
+ return value
37
+ else:
38
+ return value
39
+
40
+
41
+ def xml_parser(data, prim_key):
42
+ """
43
+ Generic XML parser
44
+
45
+ :param data: can be of type "file object", unicode string or bytes string
46
+ """
47
+ if isinstance(data, (str, bytes)):
48
+ stream = BytesIO()
49
+ data = encodeUnicodeToBytes(data, "ignore")
50
+ stream.write(data)
51
+ stream.seek(0)
52
+ else:
53
+ stream = data
54
+
55
+ context = ET.iterparse(stream)
56
+ for event, elem in context:
57
+ row = {}
58
+ key = elem.tag
59
+ if key != prim_key:
60
+ continue
61
+ row[key] = elem.attrib
62
+ get_children(elem, event, row, key)
63
+ elem.clear()
64
+ yield row
65
+
66
+
67
+ def get_children(elem, event, row, key):
68
+ """
69
+ xml_parser helper function. It gets recursively information about
70
+ children for given element tag. Information is stored into provided
71
+ row for given key. The change of notations can be applied during
72
+ parsing step by using provided notations dictionary.
73
+ """
74
+ for child in list(elem):
75
+ child_key = child.tag
76
+ child_data = child.attrib
77
+ if not child_data:
78
+ child_dict = adjust_value(child.text)
79
+ else:
80
+ child_dict = child_data
81
+
82
+ if list(child): # we got grand-children
83
+ if child_dict:
84
+ row[key][child_key] = child_dict
85
+ else:
86
+ row[key][child_key] = {}
87
+ if isinstance(child_dict, dict):
88
+ newdict = {child_key: child_dict}
89
+ else:
90
+ newdict = {child_key: {}}
91
+ get_children(child, event, newdict, child_key)
92
+ row[key][child_key] = newdict[child_key]
93
+ else:
94
+ if not isinstance(row[key], dict):
95
+ row[key] = {}
96
+ row[key].setdefault(child_key, [])
97
+ row[key][child_key].append(child_dict)
98
+ child.clear()
File without changes
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env python
2
+
3
+ from builtins import str
4
+ import uuid
5
+
6
+
7
+ def makeUUID():
8
+ """
9
+ _makeUUID_
10
+
11
+ Makes a UUID from the uuid class, returns it
12
+ """
13
+ return str(uuid.uuid4())
@@ -0,0 +1,160 @@
1
+ #!/usr/bin/env python
2
+ """
3
+ _UserFileCache_
4
+
5
+ API for UserFileCache service
6
+ """
7
+
8
+ from builtins import str, bytes
9
+
10
+ import os
11
+ import json
12
+ import shutil
13
+ import hashlib
14
+ import tarfile
15
+ import tempfile
16
+
17
+ from Utils.Utilities import encodeUnicodeToBytesConditional
18
+ from Utils.PythonVersion import PY3
19
+
20
+ from WMCore.Services.Service import Service
21
+
22
+
23
+ def calculateChecksum(tarfile_, exclude=None):
24
+ """
25
+ Calculate the checksum of the tar file in input.
26
+
27
+ The tarfile_ input parameter could be a string or a file object (anything compatible
28
+ with the fileobj parameter of tarfile.open).
29
+
30
+ The exclude parameter could be a list of strings, or a callable that takes as input
31
+ the output of the list of tarfile.getmembers() and return a list of strings.
32
+ The exclude param is interpreted as a list of files that will not be taken into consideration
33
+ when calculating the checksum.
34
+
35
+ The output is the checksum of the tar input file.
36
+
37
+ The checksum is calculated taking into consideration the names of the objects
38
+ in the tarfile (files, directories etc) and the content of each file.
39
+
40
+ Each file is exctracted, read, and then deleted right after the input is passed
41
+ to the hasher object. The file is read in chuncks of 4096 bytes to avoid memory
42
+ issues.
43
+ """
44
+ if exclude==None: #[] is a dangerous value for a param
45
+ exclude = []
46
+
47
+ hasher = hashlib.sha256()
48
+
49
+ ## "massage" out the input parameters
50
+ if isinstance(tarfile_, (str, bytes)):
51
+ tar = tarfile.open(tarfile_, mode='r')
52
+ else:
53
+ tar = tarfile.open(fileobj=tarfile_, mode='r')
54
+
55
+ if exclude and hasattr(exclude, '__call__'):
56
+ excludeList = exclude(tar.getmembers())
57
+ else:
58
+ excludeList = exclude
59
+
60
+
61
+ tmpDir = tempfile.mkdtemp()
62
+ try:
63
+ for tarmember in tar:
64
+ if tarmember.name in excludeList:
65
+ continue
66
+ hasher.update(encodeUnicodeToBytesConditional(tarmember.name, condition=PY3))
67
+ if tarmember.isfile() and tarmember.name.split('.')[-1]!='pkl':
68
+ tar.extractall(path=tmpDir, members=[tarmember])
69
+ fn = os.path.join(tmpDir, tarmember.name)
70
+ with open(fn, 'rb') as fd:
71
+ while True:
72
+ buf = fd.read(4096)
73
+ if not buf:
74
+ break
75
+ hasher.update(buf)
76
+ os.remove(fn)
77
+ finally:
78
+ #never leave tmddir around
79
+ shutil.rmtree(tmpDir)
80
+ checksum = hasher.hexdigest()
81
+
82
+ return checksum
83
+
84
+
85
+ class UserFileCache(Service):
86
+ """
87
+ API for UserFileCache service
88
+ """
89
+ # Should be filled out with other methods: download, exists
90
+
91
+ def __init__(self, mydict=None):
92
+ if mydict==None: #dangerous {} default value
93
+ mydict = {}
94
+ mydict['endpoint'] = mydict.get('endpoint', 'https://cmsweb.cern.ch/crabcache/')
95
+ Service.__init__(self, mydict)
96
+ self['requests']['accept_type'] = 'application/json'
97
+
98
+ if 'proxyfilename' in mydict:
99
+ #in case there is some code I have not updated in ticket #3780. Should not be required... but...
100
+ self['logger'].warning('The UserFileCache proxyfilename parameter has been replace with the more'
101
+ ' general (ckey/cert) pair.')
102
+
103
+ def downloadLog(self, fileName, output):
104
+ """
105
+ """
106
+ url = self['endpoint'] + 'logfile?name=%s' % os.path.split(fileName)[1]
107
+
108
+ self['logger'].info('Fetching URL %s' % url)
109
+ fileName, dummyHeader = self['requests'].downloadFile(output, str(url)) #unicode broke pycurl.setopt
110
+ self['logger'].debug('Wrote %s' % output)
111
+ return fileName
112
+
113
+ def uploadLog(self, fileName, uploadName=None):
114
+ """
115
+ """
116
+ if not uploadName:
117
+ uploadName = os.path.split(fileName)[1]
118
+ params = [('name', uploadName)]
119
+
120
+ resString = self["requests"].uploadFile(fileName=fileName, fieldName='inputfile',
121
+ url=self['endpoint'] + 'logfile',
122
+ params=params, verb='PUT')
123
+
124
+ return json.loads(resString)['result'][0]
125
+
126
+ def removeFile(self, haskey):
127
+ result=self['requests'].makeRequest(uri = 'info', data = {'subresource':'fileremove', 'hashkey': haskey})
128
+ return json.loads(result[0])['result'][0]
129
+
130
+ def download(self, hashkey, output, username=None):
131
+ """
132
+ Download tarfile with the provided hashkey.
133
+ """
134
+ url = self['endpoint'] + 'file?hashkey=%s' % hashkey
135
+ if username:
136
+ url = url + '&username=%s' % username
137
+
138
+ self['logger'].info('Fetching URL %s' % url)
139
+ fileName, dummyHeader = self['requests'].downloadFile(output, str(url)) # unicode broke pycurl.setopt
140
+ self['logger'].debug('Wrote %s' % fileName)
141
+ return fileName
142
+
143
+ def upload(self, fileName, excludeList = None):
144
+ """
145
+ Upload the tarfile fileName to the user file cache. Returns the hash of the content of the file
146
+ which can be used to retrieve the file later on.
147
+ """
148
+ if excludeList==None: #pylint says [] is a dangerous default value
149
+ excludeList = []
150
+
151
+ #The parameter newchecksum tells the crabcache to use the new algorithm. It's there
152
+ #to guarantee backward compatibility.
153
+ params = [('hashkey', calculateChecksum(fileName, excludeList)), ('newchecksum', '2')]
154
+
155
+ resString = self["requests"].uploadFile(fileName=fileName, fieldName='inputfile',
156
+ url=self['endpoint'] + 'file',
157
+ params=params, verb='PUT')
158
+
159
+ return json.loads(resString)['result'][0]
160
+
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env python
2
+ """
3
+ _UserFileCache_
4
+
5
+ UserFileCache interface package
6
+
7
+ """
8
+ __all__ = []
@@ -0,0 +1,63 @@
1
+ import json
2
+
3
+ from WMCore.Services.Service import Service
4
+
5
+
6
+ class WMAgent(Service):
7
+
8
+ """
9
+ API for dealing with retrieving information from WMAgent RESTModel Service
10
+ """
11
+
12
+ def __init__(self, dict={}):
13
+ """
14
+ responseType will be JSON
15
+ """
16
+
17
+ dict.setdefault("accept_type", "application/json")
18
+ dict.setdefault("content_type", "application/json")
19
+ self.encoder = json.dumps
20
+ self.decoder = json.loads
21
+
22
+ Service.__init__(self, dict)
23
+
24
+ def _getResult(self, callname, clearCache = True,
25
+ args = None, verb="GET", contentType = None):
26
+ """
27
+ _getResult_
28
+
29
+ retrieve JSON/XML formatted information given the service name and the
30
+ argument dictionaries
31
+
32
+ TODO: Probably want to move this up into Service
33
+ """
34
+ result = ''
35
+ # make base file name from call name.
36
+ file = callname.replace("/", "_")
37
+ if clearCache:
38
+ self.clearCache(file, args, verb)
39
+
40
+ # can't pass the decoder here since refreshCache wright to file
41
+ f = self.refreshCache(file, callname, args, encoder = self.encoder,
42
+ verb = verb, contentType = contentType)
43
+ result = f.read()
44
+ f.close()
45
+ result = self.decoder(result)
46
+
47
+ return result
48
+
49
+ def getAgentStatus(self, detail = False):
50
+ """
51
+ """
52
+ callname = 'agentstatus'
53
+ # TODO support detail flag if it is needed
54
+ # need to convert to boolean on serverside
55
+ #args = {'detail': detail}
56
+ args = {}
57
+ return self._getResult(callname, args = args)
58
+
59
+ def getACDCInfo(self):
60
+ """
61
+ """
62
+ callname = 'acdclink'
63
+ return self._getResult(callname)
File without changes