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.
- Utils/CPMetrics.py +270 -0
- Utils/CertTools.py +100 -0
- Utils/EmailAlert.py +50 -0
- Utils/ExtendedUnitTestCase.py +62 -0
- Utils/FileTools.py +182 -0
- Utils/IteratorTools.py +80 -0
- Utils/MathUtils.py +31 -0
- Utils/MemoryCache.py +119 -0
- Utils/Patterns.py +24 -0
- Utils/Pipeline.py +137 -0
- Utils/PortForward.py +97 -0
- Utils/ProcFS.py +112 -0
- Utils/ProcessStats.py +194 -0
- Utils/PythonVersion.py +17 -0
- Utils/Signals.py +36 -0
- Utils/TemporaryEnvironment.py +27 -0
- Utils/Throttled.py +227 -0
- Utils/Timers.py +130 -0
- Utils/Timestamps.py +86 -0
- Utils/TokenManager.py +143 -0
- Utils/Tracing.py +60 -0
- Utils/TwPrint.py +98 -0
- Utils/Utilities.py +318 -0
- Utils/__init__.py +11 -0
- Utils/wmcoreDTools.py +707 -0
- WMCore/ACDC/Collection.py +57 -0
- WMCore/ACDC/CollectionTypes.py +12 -0
- WMCore/ACDC/CouchCollection.py +67 -0
- WMCore/ACDC/CouchFileset.py +238 -0
- WMCore/ACDC/CouchService.py +73 -0
- WMCore/ACDC/DataCollectionService.py +485 -0
- WMCore/ACDC/Fileset.py +94 -0
- WMCore/ACDC/__init__.py +11 -0
- WMCore/Algorithms/Alarm.py +39 -0
- WMCore/Algorithms/MathAlgos.py +274 -0
- WMCore/Algorithms/MiscAlgos.py +67 -0
- WMCore/Algorithms/ParseXMLFile.py +115 -0
- WMCore/Algorithms/Permissions.py +27 -0
- WMCore/Algorithms/Singleton.py +58 -0
- WMCore/Algorithms/SubprocessAlgos.py +129 -0
- WMCore/Algorithms/__init__.py +7 -0
- WMCore/Cache/GenericDataCache.py +98 -0
- WMCore/Cache/WMConfigCache.py +572 -0
- WMCore/Cache/__init__.py +0 -0
- WMCore/Configuration.py +659 -0
- WMCore/DAOFactory.py +47 -0
- WMCore/DataStructs/File.py +177 -0
- WMCore/DataStructs/Fileset.py +140 -0
- WMCore/DataStructs/Job.py +182 -0
- WMCore/DataStructs/JobGroup.py +142 -0
- WMCore/DataStructs/JobPackage.py +49 -0
- WMCore/DataStructs/LumiList.py +734 -0
- WMCore/DataStructs/Mask.py +219 -0
- WMCore/DataStructs/MathStructs/ContinuousSummaryHistogram.py +197 -0
- WMCore/DataStructs/MathStructs/DiscreteSummaryHistogram.py +92 -0
- WMCore/DataStructs/MathStructs/SummaryHistogram.py +117 -0
- WMCore/DataStructs/MathStructs/__init__.py +0 -0
- WMCore/DataStructs/Pickleable.py +24 -0
- WMCore/DataStructs/Run.py +256 -0
- WMCore/DataStructs/Subscription.py +175 -0
- WMCore/DataStructs/WMObject.py +47 -0
- WMCore/DataStructs/WorkUnit.py +112 -0
- WMCore/DataStructs/Workflow.py +60 -0
- WMCore/DataStructs/__init__.py +8 -0
- WMCore/Database/CMSCouch.py +1430 -0
- WMCore/Database/ConfigDBMap.py +29 -0
- WMCore/Database/CouchMonitoring.py +450 -0
- WMCore/Database/CouchUtils.py +118 -0
- WMCore/Database/DBCore.py +198 -0
- WMCore/Database/DBCreator.py +113 -0
- WMCore/Database/DBExceptionHandler.py +59 -0
- WMCore/Database/DBFactory.py +117 -0
- WMCore/Database/DBFormatter.py +177 -0
- WMCore/Database/Dialects.py +13 -0
- WMCore/Database/ExecuteDAO.py +327 -0
- WMCore/Database/MongoDB.py +241 -0
- WMCore/Database/MySQL/Destroy.py +42 -0
- WMCore/Database/MySQL/ListUserContent.py +20 -0
- WMCore/Database/MySQL/__init__.py +9 -0
- WMCore/Database/MySQLCore.py +132 -0
- WMCore/Database/Oracle/Destroy.py +56 -0
- WMCore/Database/Oracle/ListUserContent.py +19 -0
- WMCore/Database/Oracle/__init__.py +9 -0
- WMCore/Database/ResultSet.py +44 -0
- WMCore/Database/Transaction.py +91 -0
- WMCore/Database/__init__.py +9 -0
- WMCore/Database/ipy_profile_couch.py +438 -0
- WMCore/GlobalWorkQueue/CherryPyThreads/CleanUpTask.py +29 -0
- WMCore/GlobalWorkQueue/CherryPyThreads/HeartbeatMonitor.py +105 -0
- WMCore/GlobalWorkQueue/CherryPyThreads/LocationUpdateTask.py +28 -0
- WMCore/GlobalWorkQueue/CherryPyThreads/ReqMgrInteractionTask.py +35 -0
- WMCore/GlobalWorkQueue/CherryPyThreads/__init__.py +0 -0
- WMCore/GlobalWorkQueue/__init__.py +0 -0
- WMCore/GroupUser/CouchObject.py +127 -0
- WMCore/GroupUser/Decorators.py +51 -0
- WMCore/GroupUser/Group.py +33 -0
- WMCore/GroupUser/Interface.py +73 -0
- WMCore/GroupUser/User.py +96 -0
- WMCore/GroupUser/__init__.py +11 -0
- WMCore/Lexicon.py +836 -0
- WMCore/REST/Auth.py +202 -0
- WMCore/REST/CherryPyPeriodicTask.py +166 -0
- WMCore/REST/Error.py +333 -0
- WMCore/REST/Format.py +642 -0
- WMCore/REST/HeartbeatMonitorBase.py +90 -0
- WMCore/REST/Main.py +636 -0
- WMCore/REST/Server.py +2435 -0
- WMCore/REST/Services.py +24 -0
- WMCore/REST/Test.py +120 -0
- WMCore/REST/Tools.py +38 -0
- WMCore/REST/Validation.py +250 -0
- WMCore/REST/__init__.py +1 -0
- WMCore/ReqMgr/DataStructs/RequestStatus.py +209 -0
- WMCore/ReqMgr/DataStructs/RequestType.py +13 -0
- WMCore/ReqMgr/DataStructs/__init__.py +0 -0
- WMCore/ReqMgr/__init__.py +1 -0
- WMCore/Services/AlertManager/AlertManagerAPI.py +111 -0
- WMCore/Services/AlertManager/__init__.py +0 -0
- WMCore/Services/CRIC/CRIC.py +238 -0
- WMCore/Services/CRIC/__init__.py +0 -0
- WMCore/Services/DBS/DBS3Reader.py +1044 -0
- WMCore/Services/DBS/DBSConcurrency.py +44 -0
- WMCore/Services/DBS/DBSErrors.py +112 -0
- WMCore/Services/DBS/DBSReader.py +23 -0
- WMCore/Services/DBS/DBSUtils.py +166 -0
- WMCore/Services/DBS/DBSWriterObjects.py +381 -0
- WMCore/Services/DBS/ProdException.py +133 -0
- WMCore/Services/DBS/__init__.py +8 -0
- WMCore/Services/FWJRDB/FWJRDBAPI.py +118 -0
- WMCore/Services/FWJRDB/__init__.py +0 -0
- WMCore/Services/HTTPS/HTTPSAuthHandler.py +66 -0
- WMCore/Services/HTTPS/__init__.py +0 -0
- WMCore/Services/LogDB/LogDB.py +201 -0
- WMCore/Services/LogDB/LogDBBackend.py +191 -0
- WMCore/Services/LogDB/LogDBExceptions.py +11 -0
- WMCore/Services/LogDB/LogDBReport.py +85 -0
- WMCore/Services/LogDB/__init__.py +0 -0
- WMCore/Services/MSPileup/__init__.py +0 -0
- WMCore/Services/MSUtils/MSUtils.py +54 -0
- WMCore/Services/MSUtils/__init__.py +0 -0
- WMCore/Services/McM/McM.py +173 -0
- WMCore/Services/McM/__init__.py +8 -0
- WMCore/Services/MonIT/Grafana.py +133 -0
- WMCore/Services/MonIT/__init__.py +0 -0
- WMCore/Services/PyCondor/PyCondorAPI.py +154 -0
- WMCore/Services/PyCondor/__init__.py +0 -0
- WMCore/Services/ReqMgr/ReqMgr.py +261 -0
- WMCore/Services/ReqMgr/__init__.py +0 -0
- WMCore/Services/ReqMgrAux/ReqMgrAux.py +419 -0
- WMCore/Services/ReqMgrAux/__init__.py +0 -0
- WMCore/Services/RequestDB/RequestDBReader.py +267 -0
- WMCore/Services/RequestDB/RequestDBWriter.py +39 -0
- WMCore/Services/RequestDB/__init__.py +0 -0
- WMCore/Services/Requests.py +624 -0
- WMCore/Services/Rucio/Rucio.py +1290 -0
- WMCore/Services/Rucio/RucioUtils.py +74 -0
- WMCore/Services/Rucio/__init__.py +0 -0
- WMCore/Services/RucioConMon/RucioConMon.py +121 -0
- WMCore/Services/RucioConMon/__init__.py +0 -0
- WMCore/Services/Service.py +400 -0
- WMCore/Services/StompAMQ/__init__.py +0 -0
- WMCore/Services/TagCollector/TagCollector.py +155 -0
- WMCore/Services/TagCollector/XMLUtils.py +98 -0
- WMCore/Services/TagCollector/__init__.py +0 -0
- WMCore/Services/UUIDLib.py +13 -0
- WMCore/Services/UserFileCache/UserFileCache.py +160 -0
- WMCore/Services/UserFileCache/__init__.py +8 -0
- WMCore/Services/WMAgent/WMAgent.py +63 -0
- WMCore/Services/WMAgent/__init__.py +0 -0
- WMCore/Services/WMArchive/CMSSWMetrics.py +526 -0
- WMCore/Services/WMArchive/DataMap.py +463 -0
- WMCore/Services/WMArchive/WMArchive.py +33 -0
- WMCore/Services/WMArchive/__init__.py +0 -0
- WMCore/Services/WMBS/WMBS.py +97 -0
- WMCore/Services/WMBS/__init__.py +0 -0
- WMCore/Services/WMStats/DataStruct/RequestInfoCollection.py +300 -0
- WMCore/Services/WMStats/DataStruct/__init__.py +0 -0
- WMCore/Services/WMStats/WMStatsPycurl.py +145 -0
- WMCore/Services/WMStats/WMStatsReader.py +445 -0
- WMCore/Services/WMStats/WMStatsWriter.py +273 -0
- WMCore/Services/WMStats/__init__.py +0 -0
- WMCore/Services/WMStatsServer/WMStatsServer.py +134 -0
- WMCore/Services/WMStatsServer/__init__.py +0 -0
- WMCore/Services/WorkQueue/WorkQueue.py +492 -0
- WMCore/Services/WorkQueue/__init__.py +0 -0
- WMCore/Services/__init__.py +8 -0
- WMCore/Services/pycurl_manager.py +574 -0
- WMCore/WMBase.py +50 -0
- WMCore/WMConnectionBase.py +164 -0
- WMCore/WMException.py +183 -0
- WMCore/WMExceptions.py +269 -0
- WMCore/WMFactory.py +76 -0
- WMCore/WMInit.py +377 -0
- WMCore/WMLogging.py +104 -0
- WMCore/WMSpec/ConfigSectionTree.py +442 -0
- WMCore/WMSpec/Persistency.py +135 -0
- WMCore/WMSpec/Steps/BuildMaster.py +87 -0
- WMCore/WMSpec/Steps/BuildTools.py +201 -0
- WMCore/WMSpec/Steps/Builder.py +97 -0
- WMCore/WMSpec/Steps/Diagnostic.py +89 -0
- WMCore/WMSpec/Steps/Emulator.py +62 -0
- WMCore/WMSpec/Steps/ExecuteMaster.py +208 -0
- WMCore/WMSpec/Steps/Executor.py +210 -0
- WMCore/WMSpec/Steps/StepFactory.py +213 -0
- WMCore/WMSpec/Steps/TaskEmulator.py +75 -0
- WMCore/WMSpec/Steps/Template.py +204 -0
- WMCore/WMSpec/Steps/Templates/AlcaHarvest.py +76 -0
- WMCore/WMSpec/Steps/Templates/CMSSW.py +613 -0
- WMCore/WMSpec/Steps/Templates/DQMUpload.py +59 -0
- WMCore/WMSpec/Steps/Templates/DeleteFiles.py +70 -0
- WMCore/WMSpec/Steps/Templates/LogArchive.py +84 -0
- WMCore/WMSpec/Steps/Templates/LogCollect.py +105 -0
- WMCore/WMSpec/Steps/Templates/StageOut.py +105 -0
- WMCore/WMSpec/Steps/Templates/__init__.py +10 -0
- WMCore/WMSpec/Steps/WMExecutionFailure.py +21 -0
- WMCore/WMSpec/Steps/__init__.py +8 -0
- WMCore/WMSpec/Utilities.py +63 -0
- WMCore/WMSpec/WMSpecErrors.py +12 -0
- WMCore/WMSpec/WMStep.py +347 -0
- WMCore/WMSpec/WMTask.py +1997 -0
- WMCore/WMSpec/WMWorkload.py +2288 -0
- WMCore/WMSpec/WMWorkloadTools.py +382 -0
- WMCore/WMSpec/__init__.py +9 -0
- WMCore/WorkQueue/DataLocationMapper.py +273 -0
- WMCore/WorkQueue/DataStructs/ACDCBlock.py +47 -0
- WMCore/WorkQueue/DataStructs/Block.py +48 -0
- WMCore/WorkQueue/DataStructs/CouchWorkQueueElement.py +148 -0
- WMCore/WorkQueue/DataStructs/WorkQueueElement.py +274 -0
- WMCore/WorkQueue/DataStructs/WorkQueueElementResult.py +152 -0
- WMCore/WorkQueue/DataStructs/WorkQueueElementsSummary.py +185 -0
- WMCore/WorkQueue/DataStructs/__init__.py +0 -0
- WMCore/WorkQueue/Policy/End/EndPolicyInterface.py +44 -0
- WMCore/WorkQueue/Policy/End/SingleShot.py +22 -0
- WMCore/WorkQueue/Policy/End/__init__.py +32 -0
- WMCore/WorkQueue/Policy/PolicyInterface.py +17 -0
- WMCore/WorkQueue/Policy/Start/Block.py +258 -0
- WMCore/WorkQueue/Policy/Start/Dataset.py +180 -0
- WMCore/WorkQueue/Policy/Start/MonteCarlo.py +131 -0
- WMCore/WorkQueue/Policy/Start/ResubmitBlock.py +171 -0
- WMCore/WorkQueue/Policy/Start/StartPolicyInterface.py +316 -0
- WMCore/WorkQueue/Policy/Start/__init__.py +34 -0
- WMCore/WorkQueue/Policy/__init__.py +57 -0
- WMCore/WorkQueue/WMBSHelper.py +772 -0
- WMCore/WorkQueue/WorkQueue.py +1237 -0
- WMCore/WorkQueue/WorkQueueBackend.py +750 -0
- WMCore/WorkQueue/WorkQueueBase.py +39 -0
- WMCore/WorkQueue/WorkQueueExceptions.py +44 -0
- WMCore/WorkQueue/WorkQueueReqMgrInterface.py +278 -0
- WMCore/WorkQueue/WorkQueueUtils.py +130 -0
- WMCore/WorkQueue/__init__.py +13 -0
- WMCore/Wrappers/JsonWrapper/JSONThunker.py +342 -0
- WMCore/Wrappers/JsonWrapper/__init__.py +7 -0
- WMCore/Wrappers/__init__.py +6 -0
- WMCore/__init__.py +10 -0
- wmglobalqueue-2.4.5.1.data/data/bin/wmc-dist-patch +15 -0
- wmglobalqueue-2.4.5.1.data/data/bin/wmc-dist-unpatch +8 -0
- wmglobalqueue-2.4.5.1.data/data/bin/wmc-httpd +3 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/.couchapprc +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/README.md +40 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/index.html +264 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/ElementInfoByWorkflow.js +96 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/StuckElementInfo.js +57 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/WorkloadInfoTable.js +80 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/dataTable.js +70 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/namespace.js +23 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/style/main.css +75 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/couchapp.json +4 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/filters/childQueueFilter.js +13 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/filters/filterDeletedDocs.js +3 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/filters/queueFilter.js +11 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/language +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lib/mustache.js +333 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lib/validate.js +27 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lib/workqueue_utils.js +61 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/elementsDetail.js +28 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/filter.js +86 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/stuckElements.js +38 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/workRestrictions.js +153 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/workflowSummary.js +28 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/rewrites.json +73 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/shows/redirect.js +23 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/shows/status.js +40 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/ElementSummaryByWorkflow.html +27 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/StuckElementSummary.html +26 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/TaskStatus.html +23 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/WorkflowSummary.html +27 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/partials/workqueue-common-lib.html +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/partials/yui-lib-remote.html +16 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/partials/yui-lib.html +18 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/updates/in-place.js +50 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/validate_doc_update.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/vendor/couchapp/_attachments/jquery.couch.app.js +235 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/vendor/couchapp/_attachments/jquery.pathbinder.js +173 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeData/reduce.js +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeParentData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeParentData/reduce.js +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activePileupData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activePileupData/reduce.js +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/analyticsData/map.js +11 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/analyticsData/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/availableByPriority/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/conflicts/map.js +5 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elements/map.js +5 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByParent/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByParentData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByPileupData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByStatus/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsBySubscription/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByWorkflow/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByWorkflow/reduce.js +3 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsDetailByWorkflowAndStatus/map.js +26 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobInjectStatusByRequest/map.js +10 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobInjectStatusByRequest/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobStatusByRequest/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobStatusByRequest/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndPriority/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndPriority/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndStatus/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndStatus/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByRequest/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByRequest/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatus/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatus/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatusAndPriority/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatusAndPriority/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/openRequests/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/recent-items/map.js +5 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/siteWhitelistByRequest/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/siteWhitelistByRequest/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/specsByWorkflow/map.js +5 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/stuckElements/map.js +38 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsInjectStatusByRequest/map.js +12 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsInjectStatusByRequest/reduce.js +3 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrl/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrl/reduce.js +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrlByRequest/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrlByRequest/reduce.js +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/workflowSummary/map.js +9 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/workflowSummary/reduce.js +10 -0
- wmglobalqueue-2.4.5.1.dist-info/METADATA +26 -0
- wmglobalqueue-2.4.5.1.dist-info/RECORD +347 -0
- wmglobalqueue-2.4.5.1.dist-info/WHEEL +5 -0
- wmglobalqueue-2.4.5.1.dist-info/licenses/LICENSE +202 -0
- wmglobalqueue-2.4.5.1.dist-info/licenses/NOTICE +16 -0
- wmglobalqueue-2.4.5.1.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
from builtins import str, bytes, object
|
|
2
|
+
import time
|
|
3
|
+
|
|
4
|
+
from WMCore.Database.CMSCouch import CouchServer, Database
|
|
5
|
+
from WMCore.Lexicon import splitCouchServiceURL, sanitizeURL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RequestDBReader(object):
|
|
9
|
+
def __init__(self, couchURL, couchapp="ReqMgr"):
|
|
10
|
+
# set the connection for local couchDB call
|
|
11
|
+
self._commonInit(couchURL, couchapp)
|
|
12
|
+
|
|
13
|
+
def _commonInit(self, couchURL, couchapp):
|
|
14
|
+
"""
|
|
15
|
+
setting up comon variables for inherited class.
|
|
16
|
+
inherited class should call this in their init function
|
|
17
|
+
"""
|
|
18
|
+
if isinstance(couchURL, Database):
|
|
19
|
+
self.couchDB = couchURL
|
|
20
|
+
self.couchURL = self.couchDB['host']
|
|
21
|
+
self.dbName = self.couchDB.name
|
|
22
|
+
self.couchServer = CouchServer(self.couchURL)
|
|
23
|
+
else:
|
|
24
|
+
# NOTE: starting in CouchDB 3.x, we need to provide the couch credentials in
|
|
25
|
+
# order to be able to write to the database, thus a RequestDBWriter object
|
|
26
|
+
if isinstance(self.__class__, RequestDBReader):
|
|
27
|
+
couchURL = sanitizeURL(couchURL)['url']
|
|
28
|
+
self.couchURL, self.dbName = splitCouchServiceURL(couchURL)
|
|
29
|
+
self.couchServer = CouchServer(self.couchURL)
|
|
30
|
+
self.couchDB = self.couchServer.connectDatabase(self.dbName, False)
|
|
31
|
+
self.couchapp = couchapp
|
|
32
|
+
self.defaultStale = {"stale": "update_after"}
|
|
33
|
+
|
|
34
|
+
def setDefaultStaleOptions(self, options):
|
|
35
|
+
if not options:
|
|
36
|
+
options = {}
|
|
37
|
+
if 'stale' not in options:
|
|
38
|
+
options.update(self.defaultStale)
|
|
39
|
+
return options
|
|
40
|
+
|
|
41
|
+
def _setNoStale(self):
|
|
42
|
+
"""
|
|
43
|
+
Use this only for the unittest
|
|
44
|
+
"""
|
|
45
|
+
self.defaultStale = {}
|
|
46
|
+
|
|
47
|
+
def _getCouchView(self, view, options, keys=None):
|
|
48
|
+
keys = keys or []
|
|
49
|
+
options = self.setDefaultStaleOptions(options)
|
|
50
|
+
|
|
51
|
+
if keys and isinstance(keys, (str, bytes)):
|
|
52
|
+
keys = [keys]
|
|
53
|
+
return self.couchDB.loadView(self.couchapp, view, options, keys)
|
|
54
|
+
|
|
55
|
+
def _filterCouchInfo(self, couchInfo):
|
|
56
|
+
# remove the couch specific information
|
|
57
|
+
for key in ['_rev', '_attachments']:
|
|
58
|
+
if key in couchInfo:
|
|
59
|
+
del couchInfo[key]
|
|
60
|
+
return
|
|
61
|
+
|
|
62
|
+
def _formatCouchData(self, data, key="id", detail=True, filterCouch=True, returnDict=False):
|
|
63
|
+
result = {}
|
|
64
|
+
for row in data['rows']:
|
|
65
|
+
if 'error' in row:
|
|
66
|
+
continue
|
|
67
|
+
if "doc" in row:
|
|
68
|
+
if filterCouch:
|
|
69
|
+
self._filterCouchInfo(row["doc"])
|
|
70
|
+
result[row[key]] = row["doc"]
|
|
71
|
+
else:
|
|
72
|
+
result[row[key]] = row["value"]
|
|
73
|
+
if detail or returnDict:
|
|
74
|
+
return result
|
|
75
|
+
else:
|
|
76
|
+
return list(result)
|
|
77
|
+
|
|
78
|
+
def _getRequestByName(self, requestName, detail):
|
|
79
|
+
"""
|
|
80
|
+
Retrieves a request dictionary from CouchDB
|
|
81
|
+
:param requestName: string with the request name
|
|
82
|
+
:param detail: boolean with False value for retrieving only the
|
|
83
|
+
workflow name, or True for retrieving all its description
|
|
84
|
+
:return: a list with the request name. Or a dictionary with the
|
|
85
|
+
request description if detail=true
|
|
86
|
+
"""
|
|
87
|
+
# this returns a dictionary with the workflow description, or
|
|
88
|
+
# an empty dictionary if nothing is found in CouchDB
|
|
89
|
+
result = self.couchDB.getDoc(requestName)
|
|
90
|
+
if not result:
|
|
91
|
+
return dict()
|
|
92
|
+
if detail:
|
|
93
|
+
result.pop('_attachments', None)
|
|
94
|
+
result.pop('_rev', None)
|
|
95
|
+
return {result['RequestName']: result}
|
|
96
|
+
return [result['RequestName']]
|
|
97
|
+
|
|
98
|
+
def _getRequestByNames(self, requestNames, detail):
|
|
99
|
+
"""
|
|
100
|
+
'status': list of the status
|
|
101
|
+
"""
|
|
102
|
+
options = {}
|
|
103
|
+
options["include_docs"] = detail
|
|
104
|
+
result = self.couchDB.allDocs(options, requestNames)
|
|
105
|
+
return result
|
|
106
|
+
|
|
107
|
+
def _getRequestByStatus(self, statusList, detail, limit, skip):
|
|
108
|
+
"""
|
|
109
|
+
'status': list of the status
|
|
110
|
+
"""
|
|
111
|
+
options = {}
|
|
112
|
+
options["include_docs"] = detail
|
|
113
|
+
|
|
114
|
+
if limit != None:
|
|
115
|
+
options["limit"] = limit
|
|
116
|
+
if skip != None:
|
|
117
|
+
options["skip"] = skip
|
|
118
|
+
keys = statusList
|
|
119
|
+
return self._getCouchView("bystatus", options, keys)
|
|
120
|
+
|
|
121
|
+
def _getRequestByStatusAndStartTime(self, status, detail, startTime):
|
|
122
|
+
timeNow = int(time.time())
|
|
123
|
+
options = {}
|
|
124
|
+
options["include_docs"] = detail
|
|
125
|
+
options["startkey"] = [status, startTime]
|
|
126
|
+
options["endkey"] = [status, timeNow]
|
|
127
|
+
options["descending"] = False
|
|
128
|
+
|
|
129
|
+
return self._getCouchView("bystatusandtime", options)
|
|
130
|
+
|
|
131
|
+
def _getRequestByStatusAndEndTime(self, status, detail, endTime):
|
|
132
|
+
"""
|
|
133
|
+
'status': is the status of the workflow
|
|
134
|
+
'endTime': unix timestamp for end time
|
|
135
|
+
"""
|
|
136
|
+
options = {}
|
|
137
|
+
options["include_docs"] = detail
|
|
138
|
+
options["startkey"] = [status, 0]
|
|
139
|
+
options["endkey"] = [status, endTime]
|
|
140
|
+
options["descending"] = False
|
|
141
|
+
|
|
142
|
+
return self._getCouchView("bystatusandtime", options)
|
|
143
|
+
|
|
144
|
+
def _getRequestByTeamAndStatus(self, team, status, limit):
|
|
145
|
+
"""
|
|
146
|
+
'status': is the status of the workflow
|
|
147
|
+
'startTime': unix timestamp for start time
|
|
148
|
+
"""
|
|
149
|
+
options = {}
|
|
150
|
+
if limit:
|
|
151
|
+
options["limit"] = limit
|
|
152
|
+
if team and status:
|
|
153
|
+
options["key"] = [team, status]
|
|
154
|
+
elif team and not status:
|
|
155
|
+
options["startkey"] = [team]
|
|
156
|
+
options["endkey"] = [team, status] # status = {}
|
|
157
|
+
|
|
158
|
+
return self._getCouchView("byteamandstatus", options)
|
|
159
|
+
|
|
160
|
+
def _getAllDocsByIDs(self, ids, include_docs=True):
|
|
161
|
+
"""
|
|
162
|
+
keys is [id, ....]
|
|
163
|
+
returns document
|
|
164
|
+
"""
|
|
165
|
+
if len(ids) == 0:
|
|
166
|
+
return []
|
|
167
|
+
options = {}
|
|
168
|
+
options["include_docs"] = include_docs
|
|
169
|
+
result = self.couchDB.allDocs(options, ids)
|
|
170
|
+
|
|
171
|
+
return result
|
|
172
|
+
|
|
173
|
+
def getDBInstance(self):
|
|
174
|
+
return self.couchDB
|
|
175
|
+
|
|
176
|
+
def getRequestByNames(self, requestNames, detail=True):
|
|
177
|
+
if len(requestNames) == 0:
|
|
178
|
+
return {}
|
|
179
|
+
if isinstance(requestNames, list) and len(requestNames) == 1:
|
|
180
|
+
requestNames = requestNames[0]
|
|
181
|
+
|
|
182
|
+
if isinstance(requestNames, (str, bytes)):
|
|
183
|
+
requestInfo = self._getRequestByName(requestNames, detail=detail)
|
|
184
|
+
else:
|
|
185
|
+
requestInfo = self._getRequestByNames(requestNames, detail=detail)
|
|
186
|
+
requestInfo = self._formatCouchData(requestInfo, detail=detail)
|
|
187
|
+
return requestInfo
|
|
188
|
+
|
|
189
|
+
def getRequestByStatus(self, statusList, detail=False, limit=None, skip=None):
|
|
190
|
+
|
|
191
|
+
data = self._getRequestByStatus(statusList, detail, limit, skip)
|
|
192
|
+
requestInfo = self._formatCouchData(data, detail=detail)
|
|
193
|
+
|
|
194
|
+
return requestInfo
|
|
195
|
+
|
|
196
|
+
def getRequestByStatusAndStartTime(self, status, detail=False, startTime=0):
|
|
197
|
+
"""
|
|
198
|
+
Query for requests that are in a specific status since startTime.
|
|
199
|
+
:param status: string with the workflow status
|
|
200
|
+
:param detail: boolean flag used to return doc content or not
|
|
201
|
+
:param startTime: unix start timestamp for your query
|
|
202
|
+
:return: a list of request names
|
|
203
|
+
"""
|
|
204
|
+
if startTime == 0:
|
|
205
|
+
data = self._getRequestByStatus([status], detail, limit=None, skip=None)
|
|
206
|
+
else:
|
|
207
|
+
data = self._getRequestByStatusAndStartTime(status, detail, startTime)
|
|
208
|
+
|
|
209
|
+
requestInfo = self._formatCouchData(data, detail=detail)
|
|
210
|
+
return requestInfo
|
|
211
|
+
|
|
212
|
+
def getRequestByStatusAndEndTime(self, status, detail=False, endTime=0):
|
|
213
|
+
"""
|
|
214
|
+
Query for requests that are in a specific status until endTime.
|
|
215
|
+
:param status: string with the workflow status
|
|
216
|
+
:param detail: boolean flag used to return doc content or not
|
|
217
|
+
:param endTime: unix end timestamp for your query
|
|
218
|
+
:return: a list of request names
|
|
219
|
+
"""
|
|
220
|
+
if endTime == 0:
|
|
221
|
+
data = self._getRequestByStatus([status], detail, limit=None, skip=None)
|
|
222
|
+
else:
|
|
223
|
+
data = self._getRequestByStatusAndEndTime(status, detail, endTime)
|
|
224
|
+
|
|
225
|
+
requestInfo = self._formatCouchData(data, detail=detail)
|
|
226
|
+
return requestInfo
|
|
227
|
+
|
|
228
|
+
def getRequestByTeamAndStatus(self, team, status, detail=False, limit=None):
|
|
229
|
+
"""
|
|
230
|
+
'team': team name in which the workflow was assigned to.
|
|
231
|
+
'status': a single status string.
|
|
232
|
+
"""
|
|
233
|
+
if team and status:
|
|
234
|
+
data = self._getRequestByTeamAndStatus(team, status, limit)
|
|
235
|
+
elif team and not status:
|
|
236
|
+
data = self._getRequestByTeamAndStatus(team, status={}, limit=limit)
|
|
237
|
+
elif not team and not status:
|
|
238
|
+
data = self._getRequestByTeamAndStatus(team={}, status={}, limit=limit)
|
|
239
|
+
else:
|
|
240
|
+
# nothing we can do with status only
|
|
241
|
+
return
|
|
242
|
+
|
|
243
|
+
requestInfo = self._formatCouchData(data, detail=detail)
|
|
244
|
+
return requestInfo
|
|
245
|
+
|
|
246
|
+
def getRequestByCouchView(self, view, options, keys=None, returnDict=True):
|
|
247
|
+
keys = keys or []
|
|
248
|
+
options.setdefault("include_docs", True)
|
|
249
|
+
data = self._getCouchView(view, options, keys)
|
|
250
|
+
requestInfo = self._formatCouchData(data, returnDict=returnDict)
|
|
251
|
+
return requestInfo
|
|
252
|
+
|
|
253
|
+
def getStatusAndTypeByRequest(self, requestNames):
|
|
254
|
+
if isinstance(requestNames, (str, bytes)):
|
|
255
|
+
requestNames = [requestNames]
|
|
256
|
+
if len(requestNames) == 0:
|
|
257
|
+
return {}
|
|
258
|
+
data = self._getCouchView("byrequest", {}, requestNames)
|
|
259
|
+
requestInfo = self._formatCouchData(data, returnDict=True)
|
|
260
|
+
return requestInfo
|
|
261
|
+
|
|
262
|
+
def getStepChainDatasetParentageByStatus(self, status):
|
|
263
|
+
options = {}
|
|
264
|
+
options["key"] = [False, status]
|
|
265
|
+
data = self._getCouchView("byparentageflag", options)
|
|
266
|
+
datasetParentageInfo = self._formatCouchData(data, returnDict=True)
|
|
267
|
+
return datasetParentageInfo
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from WMCore.Database.CMSCouch import Document
|
|
2
|
+
from WMCore.Services.RequestDB.RequestDBReader import RequestDBReader
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class RequestDBWriter(RequestDBReader):
|
|
6
|
+
def __init__(self, couchURL, couchapp="ReqMgr"):
|
|
7
|
+
# set the connection for local couchDB call
|
|
8
|
+
# inherited from WMStatsReader
|
|
9
|
+
self._commonInit(couchURL, couchapp)
|
|
10
|
+
|
|
11
|
+
def insertGenericRequest(self, doc):
|
|
12
|
+
|
|
13
|
+
doc = Document(doc["RequestName"], doc)
|
|
14
|
+
result = self.couchDB.commitOne(doc)
|
|
15
|
+
self.updateRequestStatus(doc["RequestName"], "new")
|
|
16
|
+
return result
|
|
17
|
+
|
|
18
|
+
def updateRequestStatus(self, request, status, dn=None):
|
|
19
|
+
status = {"RequestStatus": status}
|
|
20
|
+
if dn:
|
|
21
|
+
status["DN"] = dn
|
|
22
|
+
return self.couchDB.updateDocument(request, self.couchapp, "updaterequest",
|
|
23
|
+
status)
|
|
24
|
+
|
|
25
|
+
def updateRequestStats(self, request, stats):
|
|
26
|
+
"""
|
|
27
|
+
This function is only available ReqMgr couch app currently (not T0)
|
|
28
|
+
WQ specific function
|
|
29
|
+
param: stats: dict of {'total_jobs': 0, 'input_lumis': 0,
|
|
30
|
+
'input_events': 0, 'input_num_files': 0}
|
|
31
|
+
"""
|
|
32
|
+
return self.couchDB.updateDocument(request, self.couchapp, "totalstats",
|
|
33
|
+
fields=stats)
|
|
34
|
+
|
|
35
|
+
def updateRequestProperty(self, request, propDict, dn=None):
|
|
36
|
+
if dn:
|
|
37
|
+
propDict["DN"] = dn
|
|
38
|
+
return self.couchDB.updateDocument(request, self.couchapp, "updaterequest",
|
|
39
|
+
propDict, useBody=True)
|
|
File without changes
|