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,463 @@
|
|
|
1
|
+
from __future__ import (division, print_function)
|
|
2
|
+
from builtins import str
|
|
3
|
+
from future.utils import viewitems, listvalues, listitems
|
|
4
|
+
|
|
5
|
+
import copy
|
|
6
|
+
import socket
|
|
7
|
+
from collections import defaultdict
|
|
8
|
+
|
|
9
|
+
from WMCore.Services.WMArchive.CMSSWMetrics import CMSSWMetrics
|
|
10
|
+
|
|
11
|
+
# From top level
|
|
12
|
+
|
|
13
|
+
WMARCHIVE_TOP_LEVEL_REMOVE_OUTSIDE_LAYER = ["steps"]
|
|
14
|
+
# convert data format under stpes["cmsRun1"/"logArch1"/"stageOut1"]["output"]
|
|
15
|
+
WMARCHIVE_REMOVE_OUTSIDE_LAYER = ["checksum", "dataset"]
|
|
16
|
+
# convert to list from str
|
|
17
|
+
WMARCHIVE_CONVERT_TO_LIST = ["lfn"]
|
|
18
|
+
|
|
19
|
+
WMARCHIVE_DATA_MAP = {"inputPath": "inputDataset",
|
|
20
|
+
"lfn": "outputLFNs", "input": "inputLFNs"}
|
|
21
|
+
|
|
22
|
+
WMARCHIVE_REMOVE_FIELD = ["user_dn", "user_vogroup", "user_vorole"]
|
|
23
|
+
WMARCHIVE_COMBINE_FIELD = {"outputDataset": ["primaryDataset", "processedDataset", "dataTier"]}
|
|
24
|
+
|
|
25
|
+
WMARCHIVE_LFN_REF_KEY = ["lfn", "files"]
|
|
26
|
+
WMARCHIVE_PFN_REF_KEY = []
|
|
27
|
+
WMARCHIVE_FILE_REF_KEY = {"LFN": WMARCHIVE_LFN_REF_KEY}
|
|
28
|
+
|
|
29
|
+
ERROR_TYPE = {'exitCode': int}
|
|
30
|
+
|
|
31
|
+
PERFORMANCE_TYPE = {'cpu': {'AvgEventCPU': float,
|
|
32
|
+
'AvgEventTime': float,
|
|
33
|
+
'MaxEventCPU': float,
|
|
34
|
+
'MaxEventTime': float,
|
|
35
|
+
'MinEventCPU': float,
|
|
36
|
+
'MinEventTime': float,
|
|
37
|
+
'TotalEventCPU': float,
|
|
38
|
+
'TotalJobCPU': float,
|
|
39
|
+
'TotalJobTime': float,
|
|
40
|
+
'EventThroughput': float,
|
|
41
|
+
'TotalLoopCPU': float,
|
|
42
|
+
'TotalInitTime': float,
|
|
43
|
+
'TotalInitCPU': float,
|
|
44
|
+
'NumberOfThreads': int,
|
|
45
|
+
'NumberOfStreams': int},
|
|
46
|
+
'memory': {'PeakValueRss': float,
|
|
47
|
+
'PeakValueVsize': float},
|
|
48
|
+
'storage': {'readAveragekB': float,
|
|
49
|
+
'readCachePercentageOps': float,
|
|
50
|
+
'readMBSec': float,
|
|
51
|
+
'readMaxMSec': float,
|
|
52
|
+
'readNumOps': float,
|
|
53
|
+
'readPercentageOps': float,
|
|
54
|
+
'readTotalMB': float,
|
|
55
|
+
'readTotalSecs': float,
|
|
56
|
+
'writeTotalMB': float,
|
|
57
|
+
'writeTotalSecs': float},
|
|
58
|
+
'cmssw': CMSSWMetrics()}
|
|
59
|
+
|
|
60
|
+
TOP_LEVEL_STEP_DEFAULT = {'analysis': {},
|
|
61
|
+
'cleanup': {},
|
|
62
|
+
'logs': {},
|
|
63
|
+
'errors': [],
|
|
64
|
+
'input': [],
|
|
65
|
+
'output': [],
|
|
66
|
+
'WMCMSSWSubprocess': {},
|
|
67
|
+
'performance': {}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
# only composed value need to bs set default value
|
|
71
|
+
STEP_DEFAULT = { # 'name': '',
|
|
72
|
+
'analysis': {},
|
|
73
|
+
'cleanup': {},
|
|
74
|
+
'logs': {},
|
|
75
|
+
'errors': [],
|
|
76
|
+
'input': [{ # 'catalog': '',
|
|
77
|
+
# 'events': -1,
|
|
78
|
+
# 'guid': '',
|
|
79
|
+
# 'input_source_class': '',
|
|
80
|
+
# 'input_type': '',
|
|
81
|
+
# 'lfn': -1,
|
|
82
|
+
# 'module_label': '',
|
|
83
|
+
# 'pfn': -1,
|
|
84
|
+
'runs': []}],
|
|
85
|
+
'output': [{ # 'acquisitionEra': '',
|
|
86
|
+
# 'adler32': '',
|
|
87
|
+
# 'applicationName': '',
|
|
88
|
+
# 'applicationVersion': '',
|
|
89
|
+
# 'async_dest': '',
|
|
90
|
+
# 'branch_hash': '',
|
|
91
|
+
# 'catalog': '',
|
|
92
|
+
# 'cksum': '',
|
|
93
|
+
# 'configURL': '',
|
|
94
|
+
# 'events': -1,
|
|
95
|
+
# 'globalTag': '',
|
|
96
|
+
# 'guid': '',
|
|
97
|
+
# 'inputDataset': '',
|
|
98
|
+
'inputLFNs': [],
|
|
99
|
+
# TODO change to empty string from None
|
|
100
|
+
# 'location': '',
|
|
101
|
+
# 'merged': False,
|
|
102
|
+
# 'module_label': '',
|
|
103
|
+
# 'output_module_class': '',
|
|
104
|
+
# 'outputDataset': '',
|
|
105
|
+
'outputLFNs': [],
|
|
106
|
+
# 'prep_id': '',
|
|
107
|
+
# 'processingStr': '',
|
|
108
|
+
# 'processingVer': -1,
|
|
109
|
+
'runs': [],
|
|
110
|
+
# 'size': -1,
|
|
111
|
+
# 'validStatus': '',
|
|
112
|
+
# "SEName": '',
|
|
113
|
+
# "PNN": '',
|
|
114
|
+
# "GUID": '',
|
|
115
|
+
# 'StageOutCommand': ''
|
|
116
|
+
}],
|
|
117
|
+
'WMCMSSWSubprocess': {},
|
|
118
|
+
'performance': {'cpu': {},
|
|
119
|
+
'memory': {},
|
|
120
|
+
'multicore': {},
|
|
121
|
+
'storage': {},
|
|
122
|
+
'cmssw': {}}
|
|
123
|
+
# 'site': 'T2_CH_CERN',
|
|
124
|
+
# 'start': 1454569735,
|
|
125
|
+
# 'status': 0,
|
|
126
|
+
# 'stop': 1454569736
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def cleanStep(idict):
|
|
131
|
+
"""
|
|
132
|
+
perform clean-up of PFNs attributes in place for given dictionary
|
|
133
|
+
|
|
134
|
+
:param idict: a FWJR report dictionary
|
|
135
|
+
:return: a dictionary without PFNs
|
|
136
|
+
"""
|
|
137
|
+
for step in ['input', 'output']:
|
|
138
|
+
data = idict.get(step, {})
|
|
139
|
+
for key, values in data.items():
|
|
140
|
+
for elem in values:
|
|
141
|
+
for skip in ['pfn', 'InputPFN', 'OutputPFN', 'inputpfns']:
|
|
142
|
+
if skip in elem:
|
|
143
|
+
del elem[skip]
|
|
144
|
+
data[key] = values
|
|
145
|
+
return idict
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def combineDataset(dataset):
|
|
149
|
+
dataset["outputDataset"] = "/%s/%s/%s" % (dataset.pop("primaryDataset"),
|
|
150
|
+
dataset.pop("processedDataset"),
|
|
151
|
+
dataset.pop("dataTier"))
|
|
152
|
+
return dataset
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def changeRunStruct(runDict):
|
|
156
|
+
runList = []
|
|
157
|
+
for run in runDict:
|
|
158
|
+
singleRun = {"runNumber": int(run)}
|
|
159
|
+
singleRun.update({'lumis': [], 'eventsPerLumi': []})
|
|
160
|
+
runList.append(singleRun)
|
|
161
|
+
|
|
162
|
+
return runList
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def _changeToFloat(value):
|
|
166
|
+
if value in ["-nan", "nan", "inf", ""]:
|
|
167
|
+
return -1.0
|
|
168
|
+
return float(value)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def _validateTypeAndSetDefault(sourceDict, stepDefault):
|
|
172
|
+
# check primitive time and remvoe if the values is composite type.
|
|
173
|
+
for key, value in listitems(sourceDict): # ACHTUNG! dict size changes while iterating
|
|
174
|
+
if key not in stepDefault and value in [[], {}, None, "None"]:
|
|
175
|
+
del sourceDict[key]
|
|
176
|
+
|
|
177
|
+
# set missing composite type defaut.
|
|
178
|
+
for category in stepDefault:
|
|
179
|
+
if (category not in sourceDict) or (category in sourceDict and not sourceDict[category]):
|
|
180
|
+
sourceDict[category] = stepDefault[category]
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def changePerformanceStruct(perfDict):
|
|
184
|
+
return [{"pName": prop, "value": _changeToFloat(value)} for prop, value in viewitems(perfDict)]
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def changeToList(aDict):
|
|
188
|
+
return [{"prop": prop, "value": value} for prop, value in viewitems(aDict)]
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def convertInput(inputList):
|
|
192
|
+
for inputDict in inputList:
|
|
193
|
+
if "runs" in inputDict:
|
|
194
|
+
inputDict['runs'] = changeRunStruct(inputDict["runs"])
|
|
195
|
+
|
|
196
|
+
_validateTypeAndSetDefault(inputDict, STEP_DEFAULT['input'][0])
|
|
197
|
+
|
|
198
|
+
return inputList
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def typeCastError(errorList):
|
|
202
|
+
for errorDict in errorList:
|
|
203
|
+
for key in errorDict:
|
|
204
|
+
if key in ERROR_TYPE:
|
|
205
|
+
value = errorDict[key]
|
|
206
|
+
errorDict[key] = ERROR_TYPE[key](value)
|
|
207
|
+
return errorList
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def typeCastPerformance(performDict):
|
|
211
|
+
newPerfDict = defaultdict(dict)
|
|
212
|
+
for key in PERFORMANCE_TYPE:
|
|
213
|
+
if key in performDict:
|
|
214
|
+
for param in PERFORMANCE_TYPE[key]:
|
|
215
|
+
if key == 'cmssw':
|
|
216
|
+
# so far we skip validation of cmssw metrics values
|
|
217
|
+
# since they may differ in different CMSSW releases
|
|
218
|
+
newPerfDict[key] = performDict[key]
|
|
219
|
+
continue
|
|
220
|
+
if param in performDict[key]:
|
|
221
|
+
try:
|
|
222
|
+
value = performDict[key][param]
|
|
223
|
+
if value in ["-nan", "nan", "inf", ""]:
|
|
224
|
+
value = -1
|
|
225
|
+
if PERFORMANCE_TYPE[key][param] == int:
|
|
226
|
+
# the received value comes from CMSSW FWJR and its type is string
|
|
227
|
+
# Although type is int, CMSSW FWJR string is constructed as float i.e. "3.0"
|
|
228
|
+
# In that case we convert to float first before type cast to int.
|
|
229
|
+
# since int("3.0") will raise an exception but int(float("3.0") won't
|
|
230
|
+
value = float(value)
|
|
231
|
+
newPerfDict[key][param] = PERFORMANCE_TYPE[key][param](value)
|
|
232
|
+
except ValueError as ex:
|
|
233
|
+
newPerfDict[key][param] = PERFORMANCE_TYPE[key][param](-1)
|
|
234
|
+
print("key: %s, param: %s, value: %s \n%s" % (key, param,
|
|
235
|
+
performDict[key][param], str(ex)))
|
|
236
|
+
return dict(newPerfDict)
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def convertOutput(outputList):
|
|
240
|
+
newOutputList = []
|
|
241
|
+
for itemList in outputList:
|
|
242
|
+
newOutputList.extend(itemList)
|
|
243
|
+
|
|
244
|
+
for outDict in newOutputList:
|
|
245
|
+
for field in WMARCHIVE_REMOVE_FIELD:
|
|
246
|
+
if field in outDict:
|
|
247
|
+
del outDict[field]
|
|
248
|
+
|
|
249
|
+
for field in WMARCHIVE_CONVERT_TO_LIST:
|
|
250
|
+
if field in outDict and isinstance(outDict[field], (str, bytes)):
|
|
251
|
+
outDict[field] = [outDict[field]]
|
|
252
|
+
|
|
253
|
+
for oldKey, newKey in viewitems(WMARCHIVE_DATA_MAP):
|
|
254
|
+
if oldKey in outDict:
|
|
255
|
+
outDict[newKey] = outDict[oldKey]
|
|
256
|
+
del outDict[oldKey]
|
|
257
|
+
|
|
258
|
+
if "runs" in outDict:
|
|
259
|
+
outDict['runs'] = changeRunStruct(outDict["runs"])
|
|
260
|
+
|
|
261
|
+
if "checksums" in outDict:
|
|
262
|
+
outDict.update(outDict["checksums"])
|
|
263
|
+
del outDict["checksums"]
|
|
264
|
+
|
|
265
|
+
if "dataset" in outDict:
|
|
266
|
+
outDict.update(combineDataset(outDict["dataset"]))
|
|
267
|
+
del outDict["dataset"]
|
|
268
|
+
|
|
269
|
+
if "location" in outDict and isinstance(outDict["location"], list):
|
|
270
|
+
if outDict["location"]:
|
|
271
|
+
outDict["location"] = outDict["location"][0]
|
|
272
|
+
else:
|
|
273
|
+
outDict["location"] = ""
|
|
274
|
+
|
|
275
|
+
_validateTypeAndSetDefault(outDict, STEP_DEFAULT['output'][0])
|
|
276
|
+
|
|
277
|
+
return newOutputList
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def convertStepValue(stepValue):
|
|
281
|
+
if "status" in stepValue:
|
|
282
|
+
if stepValue["status"] == "Failed":
|
|
283
|
+
stepValue["status"] = 1
|
|
284
|
+
else:
|
|
285
|
+
stepValue["status"] = int(stepValue["status"])
|
|
286
|
+
|
|
287
|
+
if "errors" in stepValue:
|
|
288
|
+
if not stepValue['errors']:
|
|
289
|
+
stepValue['errors'] = []
|
|
290
|
+
else:
|
|
291
|
+
typeCastError(stepValue['errors'])
|
|
292
|
+
|
|
293
|
+
input_keys = ['source', 'logArchives']
|
|
294
|
+
if "input" in stepValue:
|
|
295
|
+
if not stepValue['input']:
|
|
296
|
+
# if empty convert to list from {}
|
|
297
|
+
stepValue['input'] = []
|
|
298
|
+
|
|
299
|
+
elif len(stepValue['input']) > 1:
|
|
300
|
+
# assume only one input value
|
|
301
|
+
raise Exception("more than one input value %s" % list(stepValue['input']))
|
|
302
|
+
|
|
303
|
+
elif list(stepValue['input'].keys())[0] in input_keys:
|
|
304
|
+
stepValue['input'] = convertInput(stepValue['input'][list(stepValue['input'])[0]])
|
|
305
|
+
|
|
306
|
+
else:
|
|
307
|
+
raise Exception("Unknown input key %s" % list(stepValue['input']))
|
|
308
|
+
|
|
309
|
+
if "output" in stepValue:
|
|
310
|
+
# remove output module name layer
|
|
311
|
+
stepValue['output'] = convertOutput(listvalues(stepValue['output']))
|
|
312
|
+
|
|
313
|
+
if "performance" in stepValue:
|
|
314
|
+
stepValue["performance"] = typeCastPerformance(stepValue["performance"])
|
|
315
|
+
# If it needs to chnage to list format replace to this
|
|
316
|
+
# for category in stepValue["performance"]:
|
|
317
|
+
# stepValue["performance"][category] = changePerformanceStruct(stepValue["performance"][category])
|
|
318
|
+
|
|
319
|
+
_validateTypeAndSetDefault(stepValue["performance"], STEP_DEFAULT["performance"])
|
|
320
|
+
|
|
321
|
+
# If structure need to be changed with this uncomments
|
|
322
|
+
# listConvKeys = ['analysis', 'cleanup', 'logs', 'parameters']
|
|
323
|
+
# for key in listConvKeys:
|
|
324
|
+
# stepValue[key] = changeToList(stepValue[key])
|
|
325
|
+
|
|
326
|
+
return stepValue
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def convertSteps(steps):
|
|
330
|
+
stepList = []
|
|
331
|
+
for key, value in viewitems(steps):
|
|
332
|
+
stepItem = {}
|
|
333
|
+
stepItem['name'] = key
|
|
334
|
+
value = cleanStep(value)
|
|
335
|
+
stepItem.update(convertStepValue(value))
|
|
336
|
+
_validateTypeAndSetDefault(stepItem, TOP_LEVEL_STEP_DEFAULT)
|
|
337
|
+
stepList.append(stepItem)
|
|
338
|
+
return stepList
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
def convertToArchiverFormat(fwjr):
|
|
342
|
+
"""
|
|
343
|
+
"""
|
|
344
|
+
newFWJR = copy.deepcopy(fwjr)
|
|
345
|
+
if "steps" in newFWJR:
|
|
346
|
+
newFWJR["steps"] = convertSteps(newFWJR["steps"])
|
|
347
|
+
|
|
348
|
+
return newFWJR
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
def createFileArrayRef(fwjr, fArrayRef):
|
|
352
|
+
if isinstance(fwjr, list):
|
|
353
|
+
for item in fwjr:
|
|
354
|
+
createFileArrayRef(item, fArrayRef)
|
|
355
|
+
elif isinstance(fwjr, dict):
|
|
356
|
+
for key, value in viewitems(fwjr):
|
|
357
|
+
addKeyFlag = False
|
|
358
|
+
|
|
359
|
+
for fileType, keyList in viewitems(WMARCHIVE_FILE_REF_KEY):
|
|
360
|
+
for kw in keyList:
|
|
361
|
+
if kw in key.lower():
|
|
362
|
+
fArrayRef[fileType].add(key)
|
|
363
|
+
addKeyFlag = True
|
|
364
|
+
|
|
365
|
+
if not addKeyFlag:
|
|
366
|
+
createFileArrayRef(value, fArrayRef)
|
|
367
|
+
else:
|
|
368
|
+
return
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
def createFileArray(fwjr, fArray, fArrayRef):
|
|
372
|
+
if isinstance(fwjr, dict):
|
|
373
|
+
for key, value in viewitems(fwjr):
|
|
374
|
+
for fileType in WMARCHIVE_FILE_REF_KEY:
|
|
375
|
+
if key in fArrayRef[fileType]:
|
|
376
|
+
if isinstance(value, list):
|
|
377
|
+
for fileName in value:
|
|
378
|
+
fArray[fileType].add(fileName)
|
|
379
|
+
else: # this should be string
|
|
380
|
+
fArray[fileType].add(value)
|
|
381
|
+
createFileArray(value, fArray, fArrayRef)
|
|
382
|
+
elif isinstance(fwjr, list):
|
|
383
|
+
for item in fwjr:
|
|
384
|
+
createFileArray(item, fArray, fArrayRef)
|
|
385
|
+
else:
|
|
386
|
+
return
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
def changeToFileRef(fwjr, fArray, fArrayRef):
|
|
390
|
+
if isinstance(fwjr, dict):
|
|
391
|
+
for key, value in listitems(fwjr): # ACHTUNG! dict values change while iterating
|
|
392
|
+
for fileType in WMARCHIVE_FILE_REF_KEY:
|
|
393
|
+
if key in fArrayRef[fileType]:
|
|
394
|
+
if isinstance(value, list):
|
|
395
|
+
newRef = []
|
|
396
|
+
for fileName in value:
|
|
397
|
+
index = fArray[fileType].index(fileName)
|
|
398
|
+
newRef.append(index)
|
|
399
|
+
else: # this should be string
|
|
400
|
+
newRef = fArray[fileType].index(value)
|
|
401
|
+
fwjr[key] = newRef
|
|
402
|
+
changeToFileRef(value, fArray, fArrayRef)
|
|
403
|
+
elif isinstance(fwjr, list):
|
|
404
|
+
for item in fwjr:
|
|
405
|
+
changeToFileRef(item, fArray, fArrayRef)
|
|
406
|
+
else:
|
|
407
|
+
return
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
def createArchiverDoc(job, version=None):
|
|
411
|
+
"""
|
|
412
|
+
job_id is jobid + retry count same as couch db _id
|
|
413
|
+
"""
|
|
414
|
+
|
|
415
|
+
job_id = job["id"]
|
|
416
|
+
fwjr = job['doc']["fwjr"]
|
|
417
|
+
jobtype = job['doc']["jobtype"]
|
|
418
|
+
jobstate = job['doc']['jobstate']
|
|
419
|
+
create_ts = job['doc']['timestamp']
|
|
420
|
+
newfwjr = convertToArchiverFormat(fwjr)
|
|
421
|
+
|
|
422
|
+
fArrayRef = {}
|
|
423
|
+
fArray = {}
|
|
424
|
+
for fileType in WMARCHIVE_FILE_REF_KEY:
|
|
425
|
+
fArrayRef[fileType] = set()
|
|
426
|
+
fArray[fileType] = set()
|
|
427
|
+
|
|
428
|
+
createFileArrayRef(newfwjr, fArrayRef)
|
|
429
|
+
|
|
430
|
+
for fileType in WMARCHIVE_FILE_REF_KEY:
|
|
431
|
+
fArrayRef[fileType] = list(fArrayRef[fileType])
|
|
432
|
+
|
|
433
|
+
createFileArray(newfwjr, fArray, fArrayRef)
|
|
434
|
+
|
|
435
|
+
for fileType in WMARCHIVE_FILE_REF_KEY:
|
|
436
|
+
fArray[fileType] = list(fArray[fileType])
|
|
437
|
+
|
|
438
|
+
changeToFileRef(newfwjr, fArray, fArrayRef)
|
|
439
|
+
|
|
440
|
+
# convert to fwjr format
|
|
441
|
+
|
|
442
|
+
for fileType in WMARCHIVE_FILE_REF_KEY:
|
|
443
|
+
newfwjr["%sArrayRef" % fileType] = fArrayRef[fileType]
|
|
444
|
+
newfwjr["%sArray" % fileType] = fArray[fileType]
|
|
445
|
+
|
|
446
|
+
if version is None:
|
|
447
|
+
# add this trry to remove the dependency on WMCore code.
|
|
448
|
+
import WMCore
|
|
449
|
+
version = WMCore.__version__
|
|
450
|
+
# append meta data in fwjr
|
|
451
|
+
wnName = ""
|
|
452
|
+
if "WorkerNodeInfo" in fwjr:
|
|
453
|
+
wnName = fwjr["WorkerNodeInfo"].get("HostName", "")
|
|
454
|
+
|
|
455
|
+
newfwjr['meta_data'] = {'agent_ver': version,
|
|
456
|
+
'host': socket.gethostname().lower(),
|
|
457
|
+
'wn_name': wnName,
|
|
458
|
+
'fwjr_id': job_id,
|
|
459
|
+
'jobtype': jobtype,
|
|
460
|
+
'jobstate': jobstate,
|
|
461
|
+
'ts': create_ts
|
|
462
|
+
}
|
|
463
|
+
return newfwjr
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from __future__ import (division, print_function)
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
from WMCore.Services.Service import Service
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class WMArchive(Service):
|
|
9
|
+
"""
|
|
10
|
+
This is skelton class which need be implemented.
|
|
11
|
+
"""
|
|
12
|
+
def __init__(self, url, header = {}):
|
|
13
|
+
"""
|
|
14
|
+
responseType will be either xml or json
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
httpDict = {}
|
|
18
|
+
# url is end point
|
|
19
|
+
httpDict['endpoint'] = "%s/data" % url
|
|
20
|
+
|
|
21
|
+
# cherrypy converts request.body to params when content type is set
|
|
22
|
+
# application/x-www-form-urlencodeds
|
|
23
|
+
httpDict.setdefault("content_type", 'application/json')
|
|
24
|
+
httpDict.setdefault('cacheduration', 0)
|
|
25
|
+
httpDict.setdefault("accept_type", "application/json")
|
|
26
|
+
httpDict.update(header)
|
|
27
|
+
self.encoder = json.dumps
|
|
28
|
+
Service.__init__(self, httpDict)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def archiveData(self, data):
|
|
33
|
+
return self["requests"].post('', {'data': data})[0]['result']
|
|
File without changes
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
from WMCore.Services.Service import Service
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class WMBS(Service):
|
|
7
|
+
|
|
8
|
+
"""
|
|
9
|
+
API for dealing with retrieving information from PhEDEx DataService
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, dict={}):
|
|
13
|
+
"""
|
|
14
|
+
responseType will be either xml or 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 getJobSummaryFromCouchDB(self):
|
|
50
|
+
"""
|
|
51
|
+
get the job status summary by request (workflow) from couchDB
|
|
52
|
+
"""
|
|
53
|
+
args = {}
|
|
54
|
+
callname = 'jobsummary'
|
|
55
|
+
return self._getResult(callname, args = args, verb = "GET")
|
|
56
|
+
|
|
57
|
+
def getSiteSummaryFromCouchDB(self):
|
|
58
|
+
"""
|
|
59
|
+
returns number of complete jobs from the sites recorded in couchDB
|
|
60
|
+
within the one hour period of calling. This might not the exact number
|
|
61
|
+
since it could be gotten from the staled cache. (for performance reason)
|
|
62
|
+
However, it should be close enough monitor sites' health.
|
|
63
|
+
{'site': 'FNAL', 'complete': 1, 'success': 100, 'jobfailed':2}
|
|
64
|
+
complete : job is completed but not accounted.
|
|
65
|
+
"""
|
|
66
|
+
args = {}
|
|
67
|
+
callname = 'jobstatebysite'
|
|
68
|
+
return self._getResult(callname, args = args, verb = "GET")
|
|
69
|
+
|
|
70
|
+
def getBatchJobStatus(self):
|
|
71
|
+
"""
|
|
72
|
+
get the normalized job status from batch system
|
|
73
|
+
"""
|
|
74
|
+
args = {}
|
|
75
|
+
callname = 'batchjobstatus'
|
|
76
|
+
return self._getResult(callname, args = args, verb = "GET")
|
|
77
|
+
|
|
78
|
+
def getBatchJobStatusBySite(self):
|
|
79
|
+
"""
|
|
80
|
+
get the normalized job status from batch system by sites
|
|
81
|
+
"""
|
|
82
|
+
args = {}
|
|
83
|
+
callname = 'batchjobstatusbysite'
|
|
84
|
+
return self._getResult(callname, args = args, verb = "GET")
|
|
85
|
+
|
|
86
|
+
def getResourceInfo(self, tableFormat = True):
|
|
87
|
+
"""
|
|
88
|
+
"""
|
|
89
|
+
callname = 'listthresholdsforcreate'
|
|
90
|
+
args = {'tableFormat': tableFormat}
|
|
91
|
+
return self._getResult(callname, args = args)
|
|
92
|
+
|
|
93
|
+
def getSiteList(self):
|
|
94
|
+
"""
|
|
95
|
+
"""
|
|
96
|
+
callname = 'listsites'
|
|
97
|
+
return self._getResult(callname)
|
|
File without changes
|