wmglobalqueue 2.3.10rc10__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.
Potentially problematic release.
This version of wmglobalqueue might be problematic. Click here for more details.
- Utils/CPMetrics.py +270 -0
- Utils/CertTools.py +62 -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/ProcessStats.py +103 -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 +308 -0
- Utils/__init__.py +11 -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 +651 -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 +1349 -0
- WMCore/Database/ConfigDBMap.py +29 -0
- WMCore/Database/CouchUtils.py +118 -0
- WMCore/Database/DBCore.py +198 -0
- WMCore/Database/DBCreator.py +113 -0
- WMCore/Database/DBExceptionHandler.py +57 -0
- WMCore/Database/DBFactory.py +110 -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 +623 -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 +113 -0
- WMCore/Services/DBS/DBSReader.py +23 -0
- WMCore/Services/DBS/DBSUtils.py +139 -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/PyCondorUtils.py +105 -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 +1287 -0
- WMCore/Services/Rucio/RucioUtils.py +74 -0
- WMCore/Services/Rucio/__init__.py +0 -0
- WMCore/Services/RucioConMon/RucioConMon.py +128 -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 +228 -0
- WMCore/WMLogging.py +108 -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 +1980 -0
- WMCore/WMSpec/WMWorkload.py +2288 -0
- WMCore/WMSpec/WMWorkloadTools.py +370 -0
- WMCore/WMSpec/__init__.py +9 -0
- WMCore/WorkQueue/DataLocationMapper.py +269 -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 +741 -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.3.10rc10.data/data/bin/wmc-dist-patch +15 -0
- wmglobalqueue-2.3.10rc10.data/data/bin/wmc-dist-unpatch +8 -0
- wmglobalqueue-2.3.10rc10.data/data/bin/wmc-httpd +3 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/.couchapprc +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/README.md +40 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/_attachments/index.html +264 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/_attachments/js/ElementInfoByWorkflow.js +96 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/_attachments/js/StuckElementInfo.js +57 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/_attachments/js/WorkloadInfoTable.js +80 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/_attachments/js/dataTable.js +70 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/_attachments/js/namespace.js +23 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/_attachments/style/main.css +75 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/couchapp.json +4 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/filters/childQueueFilter.js +13 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/filters/filterDeletedDocs.js +3 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/filters/queueFilter.js +11 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/language +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/lib/mustache.js +333 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/lib/validate.js +27 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/lib/workqueue_utils.js +61 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/lists/elementsDetail.js +28 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/lists/filter.js +86 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/lists/stuckElements.js +38 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/lists/workRestrictions.js +153 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/lists/workflowSummary.js +28 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/rewrites.json +73 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/shows/redirect.js +23 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/shows/status.js +40 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/templates/ElementSummaryByWorkflow.html +27 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/templates/StuckElementSummary.html +26 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/templates/TaskStatus.html +23 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/templates/WorkflowSummary.html +27 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/templates/partials/workqueue-common-lib.html +2 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/templates/partials/yui-lib-remote.html +16 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/templates/partials/yui-lib.html +18 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/updates/in-place.js +50 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/validate_doc_update.js +8 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/vendor/couchapp/_attachments/jquery.couch.app.js +235 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/vendor/couchapp/_attachments/jquery.pathbinder.js +173 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/activeData/map.js +8 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/activeData/reduce.js +2 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/activeParentData/map.js +8 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/activeParentData/reduce.js +2 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/activePileupData/map.js +8 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/activePileupData/reduce.js +2 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/analyticsData/map.js +11 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/analyticsData/reduce.js +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/availableByPriority/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/conflicts/map.js +5 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/elements/map.js +5 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/elementsByData/map.js +8 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/elementsByParent/map.js +8 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/elementsByParentData/map.js +8 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/elementsByPileupData/map.js +8 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/elementsByStatus/map.js +8 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/elementsBySubscription/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/elementsByWorkflow/map.js +8 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/elementsByWorkflow/reduce.js +3 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/elementsDetailByWorkflowAndStatus/map.js +26 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobInjectStatusByRequest/map.js +10 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobInjectStatusByRequest/reduce.js +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobStatusByRequest/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobStatusByRequest/reduce.js +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndPriority/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndPriority/reduce.js +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndStatus/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndStatus/reduce.js +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobsByRequest/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobsByRequest/reduce.js +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobsByStatus/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobsByStatus/reduce.js +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobsByStatusAndPriority/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/jobsByStatusAndPriority/reduce.js +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/openRequests/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/recent-items/map.js +5 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/siteWhitelistByRequest/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/siteWhitelistByRequest/reduce.js +1 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/specsByWorkflow/map.js +5 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/stuckElements/map.js +38 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/wmbsInjectStatusByRequest/map.js +12 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/wmbsInjectStatusByRequest/reduce.js +3 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/wmbsUrl/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/wmbsUrl/reduce.js +2 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/wmbsUrlByRequest/map.js +6 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/wmbsUrlByRequest/reduce.js +2 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/workflowSummary/map.js +9 -0
- wmglobalqueue-2.3.10rc10.data/data/data/couchapps/WorkQueue/views/workflowSummary/reduce.js +10 -0
- wmglobalqueue-2.3.10rc10.dist-info/METADATA +26 -0
- wmglobalqueue-2.3.10rc10.dist-info/RECORD +345 -0
- wmglobalqueue-2.3.10rc10.dist-info/WHEEL +5 -0
- wmglobalqueue-2.3.10rc10.dist-info/licenses/LICENSE +202 -0
- wmglobalqueue-2.3.10rc10.dist-info/licenses/NOTICE +16 -0
- wmglobalqueue-2.3.10rc10.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"""
|
|
2
|
+
_PyCondorAPI_
|
|
3
|
+
|
|
4
|
+
Class used to interact with Condor daemons on the agent
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import print_function, division
|
|
8
|
+
|
|
9
|
+
from builtins import str, object
|
|
10
|
+
from past.builtins import basestring
|
|
11
|
+
import logging
|
|
12
|
+
try:
|
|
13
|
+
# This module has dependency with python binding for condor package (condor)
|
|
14
|
+
import htcondor
|
|
15
|
+
except ImportError:
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class PyCondorAPI(object):
|
|
20
|
+
"""
|
|
21
|
+
Some APIs to interact with HTCondor via the HTCondor python bindings.
|
|
22
|
+
"""
|
|
23
|
+
def __init__(self):
|
|
24
|
+
self.schedd = htcondor.Schedd()
|
|
25
|
+
self.coll = htcondor.Collector()
|
|
26
|
+
|
|
27
|
+
def recreateSchedd(self):
|
|
28
|
+
"""
|
|
29
|
+
In case our current schedd object is in a "strange" state, we
|
|
30
|
+
better recreate it.
|
|
31
|
+
"""
|
|
32
|
+
logging.warning("Recreating Schedd instance due to query error...")
|
|
33
|
+
self.schedd = htcondor.Schedd()
|
|
34
|
+
|
|
35
|
+
def getCondorJobsSummary(self):
|
|
36
|
+
"""
|
|
37
|
+
Retrieves a job summary from the HTCondor Schedd object
|
|
38
|
+
:return: a list of classads representing the matching jobs, or None if failed
|
|
39
|
+
"""
|
|
40
|
+
jobs = None # return None to signalize the query failed
|
|
41
|
+
queryOpts = htcondor.htcondor.QueryOpts.SummaryOnly
|
|
42
|
+
try:
|
|
43
|
+
return self.schedd.query(opts=queryOpts)
|
|
44
|
+
except Exception:
|
|
45
|
+
self.recreateSchedd()
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
jobs = self.schedd.query(opts=queryOpts)
|
|
49
|
+
except Exception as ex:
|
|
50
|
+
logging.exception("Failed to fetch summary of jobs from Condor Schedd. Error: %s", str(ex))
|
|
51
|
+
return jobs
|
|
52
|
+
|
|
53
|
+
def getCondorJobs(self, constraint='true', attrList=None, limit=-1, opts="Default"):
|
|
54
|
+
"""
|
|
55
|
+
Given a job/schedd constraint, return a list of job classad.
|
|
56
|
+
:param constraint: the query constraint (str or ExprTree). Defaults to 'true'
|
|
57
|
+
:param attrList: a list of attribute strings to be returned in the call.
|
|
58
|
+
It defaults to all attributes.
|
|
59
|
+
:param limit: a limit on the number of matches to return. Defaults to -1 (all)
|
|
60
|
+
:param opts: string with additional flags for the query. Defaults to Default.
|
|
61
|
+
https://htcondor.readthedocs.io/en/v8_9_7/apis/python-bindings/api/htcondor.html#htcondor.QueryOpts
|
|
62
|
+
:return: returns an iterator to the job classads
|
|
63
|
+
"""
|
|
64
|
+
attrList = attrList or []
|
|
65
|
+
# if option parameter is invalid, default it to the standard behavior
|
|
66
|
+
opts = getattr(htcondor.htcondor.QueryOpts, opts, "Default")
|
|
67
|
+
msg = "Querying condor schedd with params: constraint=%s, attrList=%s, limit=%s, opts=%s"
|
|
68
|
+
logging.info(msg, constraint, attrList, limit, opts)
|
|
69
|
+
try:
|
|
70
|
+
return self.schedd.query(constraint, attrList, limit, opts=opts)
|
|
71
|
+
except Exception:
|
|
72
|
+
self.recreateSchedd()
|
|
73
|
+
|
|
74
|
+
# if we hit another exception, let it be raised up in the chain
|
|
75
|
+
return self.schedd.query(constraint, attrList, limit, opts=opts)
|
|
76
|
+
|
|
77
|
+
def editCondorJobs(self, job_spec, attr, value):
|
|
78
|
+
"""
|
|
79
|
+
_editCondorJobs_
|
|
80
|
+
|
|
81
|
+
Edit a set of condor jobs given an attribute and value
|
|
82
|
+
job_spec can be a list of job IDs or a string specifying a constraint
|
|
83
|
+
"""
|
|
84
|
+
success = False
|
|
85
|
+
try:
|
|
86
|
+
self.schedd.edit(job_spec, attr, value)
|
|
87
|
+
success = True
|
|
88
|
+
except Exception as ex:
|
|
89
|
+
# edit doesn't distinguish between an error and not matching any jobs
|
|
90
|
+
# check for this message and assume it just didn't match any jobs
|
|
91
|
+
if isinstance(ex, RuntimeError) and str(ex) == "Unable to edit jobs matching constraint":
|
|
92
|
+
success = True
|
|
93
|
+
msg = "Condor constraint did not match any jobs. "
|
|
94
|
+
msg += "Message from schedd: %s" % str(ex)
|
|
95
|
+
logging.info(msg)
|
|
96
|
+
else:
|
|
97
|
+
msg = "Condor failed to edit the jobs. "
|
|
98
|
+
msg += "Error message: %s" % str(ex)
|
|
99
|
+
logging.exception(msg)
|
|
100
|
+
|
|
101
|
+
return success
|
|
102
|
+
|
|
103
|
+
def isScheddOverloaded(self):
|
|
104
|
+
"""
|
|
105
|
+
check whether job limit is reached in local schedd.
|
|
106
|
+
Condition is check by following logic.
|
|
107
|
+
( ShadowsRunning > 9.700000000000000E-01 * MAX_RUNNING_JOBS) )
|
|
108
|
+
|| ( RecentDaemonCoreDutyCycle > 9.800000000000000E-01 )
|
|
109
|
+
"""
|
|
110
|
+
try:
|
|
111
|
+
scheddAd = self.coll.locate(htcondor.DaemonTypes.Schedd)
|
|
112
|
+
q = self.coll.query(htcondor.AdTypes.Schedd, 'Name == "%s"' % scheddAd['Name'],
|
|
113
|
+
projection=['CurbMatchmaking'])[0]
|
|
114
|
+
isOverloaded = q['CurbMatchmaking'].eval()
|
|
115
|
+
return isOverloaded
|
|
116
|
+
except Exception:
|
|
117
|
+
# if there is an error, try to recreate the collector instance
|
|
118
|
+
logging.info("Recreating Collector instance due to query error...")
|
|
119
|
+
self.coll = htcondor.Collector()
|
|
120
|
+
try:
|
|
121
|
+
scheddAd = self.coll.locate(htcondor.DaemonTypes.Schedd)
|
|
122
|
+
q = self.coll.query(htcondor.AdTypes.Schedd, 'Name == "%s"' % scheddAd['Name'],
|
|
123
|
+
projection=['CurbMatchmaking'])[0]
|
|
124
|
+
isOverloaded = q['CurbMatchmaking'].eval()
|
|
125
|
+
except Exception as ex:
|
|
126
|
+
msg = "Condor failed to fetch schedd attributes."
|
|
127
|
+
msg += "Error message: %s" % str(ex)
|
|
128
|
+
logging.exception(msg)
|
|
129
|
+
# since it failed, assume it's overloaded
|
|
130
|
+
isOverloaded = True
|
|
131
|
+
|
|
132
|
+
return isOverloaded
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def getScheddParamValue(param):
|
|
136
|
+
"""
|
|
137
|
+
_getScheddParamValue_
|
|
138
|
+
|
|
139
|
+
Given a schedd parameter, retrieve it's value with htcondor, e.g.:
|
|
140
|
+
MAX_JOBS_RUNNING, MAX_JOBS_PER_OWNER, etc
|
|
141
|
+
"""
|
|
142
|
+
paramResult = None
|
|
143
|
+
if not isinstance(param, basestring):
|
|
144
|
+
logging.error("Parameter %s must be string type", param)
|
|
145
|
+
return paramResult
|
|
146
|
+
|
|
147
|
+
try:
|
|
148
|
+
paramResult = htcondor.param[param]
|
|
149
|
+
except Exception as ex:
|
|
150
|
+
msg = "Condor failed to fetch schedd parameter: %s" % param
|
|
151
|
+
msg += "Error message: %s" % str(ex)
|
|
152
|
+
logging.exception(msg)
|
|
153
|
+
|
|
154
|
+
return paramResult
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
from __future__ import print_function, division
|
|
2
|
+
|
|
3
|
+
from builtins import str, object
|
|
4
|
+
|
|
5
|
+
from future.utils import viewitems
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
import os
|
|
9
|
+
import pickle
|
|
10
|
+
import signal
|
|
11
|
+
import time
|
|
12
|
+
import traceback
|
|
13
|
+
|
|
14
|
+
import htcondor
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class OutputObj(object):
|
|
18
|
+
"""
|
|
19
|
+
Class used when AuthenticatedSubprocess is created with pickleOut
|
|
20
|
+
It stores the output message of the subprocess, any output object provided
|
|
21
|
+
and extra information for debugging purposes, such as the environment
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
def __init__(self, outputMessage, outputObj):
|
|
25
|
+
self.outputMessage = outputMessage
|
|
26
|
+
self.outputObj = outputObj
|
|
27
|
+
self.environmentStr = ""
|
|
28
|
+
for key, val in viewitems(os.environ):
|
|
29
|
+
self.environmentStr += "%s=%s\n" % (key, val)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class AuthenticatedSubprocess(object):
|
|
33
|
+
"""
|
|
34
|
+
Context manager for execution of condor commands in a forked, especially useful for
|
|
35
|
+
those commands where a different proxy credential is needed.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
def __init__(self, proxy=None, pickleOut=False, outputObj=None, logger=logging):
|
|
39
|
+
"""
|
|
40
|
+
Basic setup of the context manager
|
|
41
|
+
:param proxy: optional path to the proxy file
|
|
42
|
+
:param pickleOut: boolean flag which enables pickled output data
|
|
43
|
+
:param outputObj: structure storing the actual output of the htcondor call
|
|
44
|
+
:param logger: logger object
|
|
45
|
+
"""
|
|
46
|
+
self.proxy = proxy
|
|
47
|
+
self.pickleOut = pickleOut
|
|
48
|
+
self.outputObj = outputObj
|
|
49
|
+
self.timedout = False
|
|
50
|
+
self.logger = logger
|
|
51
|
+
|
|
52
|
+
def __enter__(self):
|
|
53
|
+
self.r, self.w = os.pipe()
|
|
54
|
+
self.rpipe = os.fdopen(self.r, 'r')
|
|
55
|
+
self.wpipe = os.fdopen(self.w, 'w')
|
|
56
|
+
self.pid = os.fork()
|
|
57
|
+
if self.pid == 0 and self.proxy:
|
|
58
|
+
# CRAB case
|
|
59
|
+
htcondor.SecMan().invalidateAllSessions()
|
|
60
|
+
htcondor.param['SEC_CLIENT_AUTHENTICATION_METHODS'] = 'FS,GSI'
|
|
61
|
+
htcondor.param['DELEGATE_FULL_JOB_GSI_CREDENTIALS'] = 'true'
|
|
62
|
+
htcondor.param['DELEGATE_JOB_GSI_CREDENTIALS_LIFETIME'] = '0'
|
|
63
|
+
os.environ['X509_USER_PROXY'] = self.proxy
|
|
64
|
+
self.rpipe.close()
|
|
65
|
+
elif self.pid == 0:
|
|
66
|
+
self.rpipe.close()
|
|
67
|
+
else:
|
|
68
|
+
self.wpipe.close()
|
|
69
|
+
return self.pid, self.rpipe
|
|
70
|
+
|
|
71
|
+
def __exit__(self, a, b, c):
|
|
72
|
+
if self.pid == 0:
|
|
73
|
+
if a is None and b is None and c is None:
|
|
74
|
+
if self.pickleOut:
|
|
75
|
+
oo = OutputObj("OK", self.outputObj)
|
|
76
|
+
self.wpipe.write(pickle.dumps(oo))
|
|
77
|
+
else:
|
|
78
|
+
self.wpipe.write("OK")
|
|
79
|
+
self.wpipe.close()
|
|
80
|
+
os._exit(0)
|
|
81
|
+
else:
|
|
82
|
+
tracebackString = str('\n'.join(traceback.format_tb(c)))
|
|
83
|
+
msg = "Trapped exception in AuthenticatedSubprocess.Fork: %s %s %s \n%s" % \
|
|
84
|
+
(a, b, c, tracebackString)
|
|
85
|
+
if self.pickleOut:
|
|
86
|
+
oo = OutputObj(msg, self.outputObj)
|
|
87
|
+
self.wpipe.write(pickle.dumps(oo))
|
|
88
|
+
else:
|
|
89
|
+
self.wpipe.write(msg)
|
|
90
|
+
self.wpipe.close()
|
|
91
|
+
os._exit(1)
|
|
92
|
+
else:
|
|
93
|
+
timestart = time.time()
|
|
94
|
+
self.timedout = True
|
|
95
|
+
while (time.time() - timestart) < 3600:
|
|
96
|
+
res = os.waitpid(self.pid, os.WNOHANG)
|
|
97
|
+
if res != (0, 0):
|
|
98
|
+
self.timedout = False
|
|
99
|
+
break
|
|
100
|
+
time.sleep(0.100)
|
|
101
|
+
if self.timedout:
|
|
102
|
+
self.logger.warning(
|
|
103
|
+
"Subprocess with PID %s (executed in AuthenticatedSubprocess) timed out. Killing it." % self.pid)
|
|
104
|
+
os.kill(self.pid, signal.SIGTERM)
|
|
105
|
+
# we should probably wait again and send SIGKILL if the kill does not work
|
|
File without changes
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
from builtins import str, bytes
|
|
2
|
+
from future.utils import viewitems
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
import logging
|
|
6
|
+
|
|
7
|
+
from WMCore.Services.Service import Service
|
|
8
|
+
from WMCore.Cache.GenericDataCache import MemoryCacheStruct
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ReqMgr(Service):
|
|
12
|
+
"""
|
|
13
|
+
API for dealing with retrieving information from RequestManager dataservice
|
|
14
|
+
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, url, header=None, logger=None):
|
|
18
|
+
"""
|
|
19
|
+
responseType will be either xml or json
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
httpDict = {}
|
|
23
|
+
header = header or {}
|
|
24
|
+
# url is end point
|
|
25
|
+
httpDict['endpoint'] = "%s/data" % url
|
|
26
|
+
httpDict['logger'] = logger if logger else logging.getLogger()
|
|
27
|
+
|
|
28
|
+
# cherrypy converts request.body to params when content type is set
|
|
29
|
+
# application/x-www-form-urlencodeds
|
|
30
|
+
httpDict.setdefault("content_type", 'application/json')
|
|
31
|
+
httpDict.setdefault('cacheduration', 0)
|
|
32
|
+
httpDict.setdefault("accept_type", "application/json")
|
|
33
|
+
httpDict.update(header)
|
|
34
|
+
self.encoder = json.dumps
|
|
35
|
+
Service.__init__(self, httpDict)
|
|
36
|
+
# This is only for the unittest: never set it true unless it is unittest
|
|
37
|
+
self._noStale = False
|
|
38
|
+
|
|
39
|
+
def _getResult(self, callname, clearCache=True, args=None, verb="GET",
|
|
40
|
+
encoder=json.loads, decoder=json.loads, contentType=None):
|
|
41
|
+
"""
|
|
42
|
+
_getResult_
|
|
43
|
+
"""
|
|
44
|
+
result = ''
|
|
45
|
+
cfile = callname.replace("/", "_")
|
|
46
|
+
if clearCache:
|
|
47
|
+
self.clearCache(cfile, args, verb)
|
|
48
|
+
|
|
49
|
+
f = self.refreshCache(cfile, callname, args, encoder=encoder,
|
|
50
|
+
verb=verb, contentType=contentType)
|
|
51
|
+
result = f.read()
|
|
52
|
+
f.close()
|
|
53
|
+
|
|
54
|
+
if result and decoder:
|
|
55
|
+
result = decoder(result)
|
|
56
|
+
|
|
57
|
+
return result['result']
|
|
58
|
+
|
|
59
|
+
def _createQuery(self, queryDict):
|
|
60
|
+
"""
|
|
61
|
+
_createQuery
|
|
62
|
+
:param queryDict: is the format of {name: values} fair. value can be sting, int or list
|
|
63
|
+
:type queryDict: dict
|
|
64
|
+
:returns: url query string
|
|
65
|
+
"""
|
|
66
|
+
if self._noStale:
|
|
67
|
+
args = "_nostale=true&"
|
|
68
|
+
else:
|
|
69
|
+
args = ""
|
|
70
|
+
for name, values in viewitems(queryDict):
|
|
71
|
+
if isinstance(values, (str, bytes, int)):
|
|
72
|
+
values = [values]
|
|
73
|
+
for val in values:
|
|
74
|
+
args += '%s=%s&' % (name, val)
|
|
75
|
+
|
|
76
|
+
return args.rstrip('&')
|
|
77
|
+
|
|
78
|
+
def getParentLocks(self):
|
|
79
|
+
"""
|
|
80
|
+
_getParentLocks_
|
|
81
|
+
|
|
82
|
+
A public method to return the parent locks from ReqMgr.
|
|
83
|
+
:returns: A list of datasets
|
|
84
|
+
|
|
85
|
+
"""
|
|
86
|
+
callname = 'parentlocks'
|
|
87
|
+
result = self._getResult(callname, clearCache=True, verb="GET")
|
|
88
|
+
return result[0][callname]
|
|
89
|
+
|
|
90
|
+
def getRequestByNames(self, names):
|
|
91
|
+
|
|
92
|
+
"""
|
|
93
|
+
_getRequestByNames_
|
|
94
|
+
|
|
95
|
+
:param names: list or sting of request name(s)
|
|
96
|
+
:type statusList: list, str
|
|
97
|
+
:returns: list of dict or list of request names depending on the detail value
|
|
98
|
+
-- [{'test_RequestString-OVERRIDE-ME_141125_142331_4966': {'BlockBlacklist': [],
|
|
99
|
+
'BlockWhitelist': [],
|
|
100
|
+
'CMSSWVersion': 'CMSSW_4_4_2_patch2',
|
|
101
|
+
....
|
|
102
|
+
'_id': 'test_RequestString-OVERRIDE-ME_141125_142331_4966',
|
|
103
|
+
'inputMode': 'couchDB'}}]
|
|
104
|
+
TODO: need proper error handling if status is not 200 from orignal reporting.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
query = self._createQuery({'name': names})
|
|
108
|
+
callname = 'request?%s' % query
|
|
109
|
+
return self._getResult(callname, verb="GET")
|
|
110
|
+
|
|
111
|
+
def getRequestByStatus(self, statusList, detail=True):
|
|
112
|
+
"""
|
|
113
|
+
_getRequestByStatus_
|
|
114
|
+
|
|
115
|
+
:param statusList: list of status
|
|
116
|
+
:type statusList: list
|
|
117
|
+
:param detail: boolean of request list.
|
|
118
|
+
:type detail: boolean
|
|
119
|
+
:returns: list of dict or list of request names depending on the detail value
|
|
120
|
+
-- [{'test_RequestString-OVERRIDE-ME_141125_142331_4966': {'BlockBlacklist': [],
|
|
121
|
+
'BlockWhitelist': [],
|
|
122
|
+
'CMSSWVersion': 'CMSSW_4_4_2_patch2',
|
|
123
|
+
....
|
|
124
|
+
'_id': 'test_RequestString-OVERRIDE-ME_141125_142331_4966',
|
|
125
|
+
'inputMode': 'couchDB'}}]
|
|
126
|
+
TODO: need proper error handling if status is not 200 from orignal reporting.
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
query = self._createQuery({'status': statusList, 'detail': detail})
|
|
130
|
+
callname = 'request?%s' % query
|
|
131
|
+
return self._getResult(callname, verb="GET")
|
|
132
|
+
|
|
133
|
+
def getRequestTasks(self, name):
|
|
134
|
+
|
|
135
|
+
"""
|
|
136
|
+
_getRequestTasks_
|
|
137
|
+
|
|
138
|
+
:param name: request name
|
|
139
|
+
:type string: str
|
|
140
|
+
:returns: list of dict or list of request names depending on the detail value
|
|
141
|
+
-- {result:[{requestTask}, {requestTask}]}
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
callname = 'splitting/%s' % name
|
|
145
|
+
return self._getResult(callname, verb="GET")
|
|
146
|
+
|
|
147
|
+
def getConfig(self, name):
|
|
148
|
+
|
|
149
|
+
"""
|
|
150
|
+
_getConfig_
|
|
151
|
+
|
|
152
|
+
:param name: request name
|
|
153
|
+
:type string: str
|
|
154
|
+
:returns: list of dict or list of request names depending on the detail value
|
|
155
|
+
-- {result:[config_string]}
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
callname = 'workload_config/%s' % name
|
|
159
|
+
return self._getResult(callname, verb="GET")
|
|
160
|
+
|
|
161
|
+
def insertRequests(self, requestDict):
|
|
162
|
+
"""
|
|
163
|
+
_insertRequests_
|
|
164
|
+
|
|
165
|
+
:param requestDict: request argument dictionary
|
|
166
|
+
:type requestDict: dict
|
|
167
|
+
:returns: list of dictionary -- [{'test_RequestString-OVERRIDE-ME_141125_142331_4966': {'BlockBlacklist': [],
|
|
168
|
+
'BlockWhitelist': [],
|
|
169
|
+
'CMSSWVersion': 'CMSSW_4_4_2_patch2',
|
|
170
|
+
....
|
|
171
|
+
'_id': 'test_RequestString-OVERRIDE-ME_141125_142331_4966',
|
|
172
|
+
'inputMode': 'couchDB'}}]
|
|
173
|
+
TODO: need proper error handling if status is not 200 from orignal reporting.
|
|
174
|
+
"""
|
|
175
|
+
return self["requests"].post('request', requestDict)[0]['result']
|
|
176
|
+
|
|
177
|
+
def updateRequestStatus(self, request, status):
|
|
178
|
+
"""
|
|
179
|
+
_updateRequestStatus_
|
|
180
|
+
|
|
181
|
+
:param request: request(workflow name)
|
|
182
|
+
:type reqeust: str
|
|
183
|
+
:param status: status of workflow to update (i.e. 'assigned')
|
|
184
|
+
:type status: str
|
|
185
|
+
:returns: list of dictionary -- [{'test_RequestString-OVERRIDE-ME_141125_142331_4966': {'BlockBlacklist': [],
|
|
186
|
+
'BlockWhitelist': [],
|
|
187
|
+
'CMSSWVersion': 'CMSSW_4_4_2_patch2',
|
|
188
|
+
....
|
|
189
|
+
'_id': 'test_RequestString-OVERRIDE-ME_141125_142331_4966',
|
|
190
|
+
'inputMode': 'couchDB'}}]
|
|
191
|
+
TODO: need proper error handling if status is not 200 from orignal reporting.
|
|
192
|
+
"""
|
|
193
|
+
|
|
194
|
+
status = {"RequestStatus": status}
|
|
195
|
+
status["RequestName"] = request
|
|
196
|
+
return self["requests"].put('request', status)[0]['result']
|
|
197
|
+
|
|
198
|
+
def updateRequestStats(self, request, stats):
|
|
199
|
+
"""
|
|
200
|
+
put initial stats for request
|
|
201
|
+
param: stats: dict of {'total_jobs': 100, 'input_lumis': 100,
|
|
202
|
+
'input_events': 100, 'input_num_files': 100}
|
|
203
|
+
specific to ReqMgr app. not implemented for T0
|
|
204
|
+
"""
|
|
205
|
+
# this stats dict will be validated on the server side
|
|
206
|
+
self.updateRequestProperty(request, stats)
|
|
207
|
+
|
|
208
|
+
def updateRequestProperty(self, request, propDict):
|
|
209
|
+
"""
|
|
210
|
+
_updateRequestProperty_
|
|
211
|
+
:param request: request(workflow name)
|
|
212
|
+
:type reqeust: str
|
|
213
|
+
:param propDict: request property with key value -- {"SiteWhitelist": ["ABC"], "SiteBlacklist": ["A"], "RequestStatus": "assigned"}
|
|
214
|
+
:type propDict: dict
|
|
215
|
+
:returns: list of dictionary -- [{'test_RequestString-OVERRIDE-ME_141125_142331_4966': {'BlockBlacklist': [],
|
|
216
|
+
'BlockWhitelist': [],
|
|
217
|
+
'CMSSWVersion': 'CMSSW_4_4_2_patch2',
|
|
218
|
+
....
|
|
219
|
+
'_id': 'test_RequestString-OVERRIDE-ME_141125_142331_4966',
|
|
220
|
+
'inputMode': 'couchDB'}}]
|
|
221
|
+
"""
|
|
222
|
+
propDict["RequestName"] = request
|
|
223
|
+
return self["requests"].put('request/%s' % request, propDict)[0]['result']
|
|
224
|
+
|
|
225
|
+
def getAbortedAndForceCompleteRequestsFromMemoryCache(self, expire=0):
|
|
226
|
+
"""
|
|
227
|
+
_getAbortedAndForceCompleteRequestsFromMemoryCache_
|
|
228
|
+
"""
|
|
229
|
+
|
|
230
|
+
maskStates = ["aborted", "aborted-completed", "force-complete"]
|
|
231
|
+
return self.getRequestByStatusFromMemoryCache(maskStates, expire)
|
|
232
|
+
|
|
233
|
+
def getRequestByStatusFromMemoryCache(self, statusList, expire=0):
|
|
234
|
+
|
|
235
|
+
return MemoryCacheStruct(expire=expire, func=self.getRequestByStatus, initCacheValue=[],
|
|
236
|
+
logger=self['logger'], kwargs={'statusList': statusList, "detail": False})
|
|
237
|
+
|
|
238
|
+
def cloneRequest(self, requestName, overwrittenParams=None):
|
|
239
|
+
"""
|
|
240
|
+
_cloneRequest_
|
|
241
|
+
|
|
242
|
+
:param requestName: request name which need to be cloned
|
|
243
|
+
:type reqeust: str
|
|
244
|
+
:param overwrittenParams: status of workflow to update (i.e. 'assigned')
|
|
245
|
+
:type overwrittenParams: dict (dictionary format of parameters need to be overwritten)
|
|
246
|
+
:returns list of dict [{'request': cloned_request_name}]
|
|
247
|
+
"""
|
|
248
|
+
params = overwrittenParams or {}
|
|
249
|
+
uri = 'request/clone/%s' % requestName
|
|
250
|
+
return self["requests"].post(uri, params)[0]['result']
|
|
251
|
+
|
|
252
|
+
def getGenericRequestInfo(self, queryDict):
|
|
253
|
+
"""
|
|
254
|
+
_getGenericRequestInfo_
|
|
255
|
+
:param queryDict: query dictionary which will be converted to url query string.
|
|
256
|
+
:type queryDict: dict
|
|
257
|
+
:returns list of dict [{'request': { any info request by mask}]
|
|
258
|
+
"""
|
|
259
|
+
query = self._createQuery(queryDict)
|
|
260
|
+
callname = 'request?%s' % query
|
|
261
|
+
return self._getResult(callname, verb="GET")
|
|
File without changes
|