wmglobalqueue 2.3.10__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 +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.3.10.data/data/bin/wmc-dist-patch +15 -0
- wmglobalqueue-2.3.10.data/data/bin/wmc-dist-unpatch +8 -0
- wmglobalqueue-2.3.10.data/data/bin/wmc-httpd +3 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/.couchapprc +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/README.md +40 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/_attachments/index.html +264 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/_attachments/js/ElementInfoByWorkflow.js +96 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/_attachments/js/StuckElementInfo.js +57 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/_attachments/js/WorkloadInfoTable.js +80 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/_attachments/js/dataTable.js +70 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/_attachments/js/namespace.js +23 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/_attachments/style/main.css +75 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/couchapp.json +4 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/filters/childQueueFilter.js +13 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/filters/filterDeletedDocs.js +3 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/filters/queueFilter.js +11 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/language +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/lib/mustache.js +333 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/lib/validate.js +27 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/lib/workqueue_utils.js +61 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/lists/elementsDetail.js +28 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/lists/filter.js +86 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/lists/stuckElements.js +38 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/lists/workRestrictions.js +153 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/lists/workflowSummary.js +28 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/rewrites.json +73 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/shows/redirect.js +23 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/shows/status.js +40 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/templates/ElementSummaryByWorkflow.html +27 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/templates/StuckElementSummary.html +26 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/templates/TaskStatus.html +23 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/templates/WorkflowSummary.html +27 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/templates/partials/workqueue-common-lib.html +2 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/templates/partials/yui-lib-remote.html +16 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/templates/partials/yui-lib.html +18 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/updates/in-place.js +50 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/validate_doc_update.js +8 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/vendor/couchapp/_attachments/jquery.couch.app.js +235 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/vendor/couchapp/_attachments/jquery.pathbinder.js +173 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/activeData/map.js +8 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/activeData/reduce.js +2 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/activeParentData/map.js +8 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/activeParentData/reduce.js +2 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/activePileupData/map.js +8 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/activePileupData/reduce.js +2 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/analyticsData/map.js +11 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/analyticsData/reduce.js +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/availableByPriority/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/conflicts/map.js +5 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/elements/map.js +5 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/elementsByData/map.js +8 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/elementsByParent/map.js +8 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/elementsByParentData/map.js +8 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/elementsByPileupData/map.js +8 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/elementsByStatus/map.js +8 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/elementsBySubscription/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/elementsByWorkflow/map.js +8 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/elementsByWorkflow/reduce.js +3 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/elementsDetailByWorkflowAndStatus/map.js +26 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobInjectStatusByRequest/map.js +10 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobInjectStatusByRequest/reduce.js +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobStatusByRequest/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobStatusByRequest/reduce.js +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndPriority/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndPriority/reduce.js +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndStatus/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndStatus/reduce.js +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobsByRequest/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobsByRequest/reduce.js +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobsByStatus/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobsByStatus/reduce.js +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobsByStatusAndPriority/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/jobsByStatusAndPriority/reduce.js +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/openRequests/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/recent-items/map.js +5 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/siteWhitelistByRequest/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/siteWhitelistByRequest/reduce.js +1 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/specsByWorkflow/map.js +5 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/stuckElements/map.js +38 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/wmbsInjectStatusByRequest/map.js +12 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/wmbsInjectStatusByRequest/reduce.js +3 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/wmbsUrl/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/wmbsUrl/reduce.js +2 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/wmbsUrlByRequest/map.js +6 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/wmbsUrlByRequest/reduce.js +2 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/workflowSummary/map.js +9 -0
- wmglobalqueue-2.3.10.data/data/data/couchapps/WorkQueue/views/workflowSummary/reduce.js +10 -0
- wmglobalqueue-2.3.10.dist-info/LICENSE +202 -0
- wmglobalqueue-2.3.10.dist-info/METADATA +24 -0
- wmglobalqueue-2.3.10.dist-info/NOTICE +16 -0
- wmglobalqueue-2.3.10.dist-info/RECORD +345 -0
- wmglobalqueue-2.3.10.dist-info/WHEEL +5 -0
- wmglobalqueue-2.3.10.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_File_
|
|
4
|
+
|
|
5
|
+
Data object that contains details for a single file
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from builtins import str, bytes
|
|
9
|
+
__all__ = []
|
|
10
|
+
|
|
11
|
+
from WMCore.DataStructs.Run import Run
|
|
12
|
+
from WMCore.DataStructs.WMObject import WMObject
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class File(WMObject, dict):
|
|
16
|
+
"""
|
|
17
|
+
_File_
|
|
18
|
+
Data object that contains details for a single file
|
|
19
|
+
|
|
20
|
+
TODO
|
|
21
|
+
- use the decorator `from functools import total_ordering` after
|
|
22
|
+
dropping support for python 2.6
|
|
23
|
+
- then, drop __ne__, __le__, __gt__, __ge__
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
def __init__(self, lfn="", size=0, events=0, checksums=None,
|
|
27
|
+
parents=None, locations=None, merged=False):
|
|
28
|
+
dict.__init__(self)
|
|
29
|
+
checksums = checksums or {}
|
|
30
|
+
self.setdefault("lfn", lfn)
|
|
31
|
+
self.setdefault("size", size)
|
|
32
|
+
self.setdefault("events", events)
|
|
33
|
+
self.setdefault("checksums", checksums)
|
|
34
|
+
self.setdefault('runs', set())
|
|
35
|
+
self.setdefault('merged', merged)
|
|
36
|
+
self.setdefault('last_event', 0)
|
|
37
|
+
self.setdefault('first_event', 0)
|
|
38
|
+
if locations is None:
|
|
39
|
+
self.setdefault("locations", set())
|
|
40
|
+
else:
|
|
41
|
+
self.setdefault("locations", locations)
|
|
42
|
+
|
|
43
|
+
if parents is None:
|
|
44
|
+
self.setdefault("parents", set())
|
|
45
|
+
else:
|
|
46
|
+
self.setdefault("parents", parents)
|
|
47
|
+
|
|
48
|
+
def addRun(self, run):
|
|
49
|
+
"""
|
|
50
|
+
_addRun_
|
|
51
|
+
|
|
52
|
+
run should be an instance of WMCore.DataStructs.Run
|
|
53
|
+
|
|
54
|
+
Add a run container to this file, tweak the run and lumi
|
|
55
|
+
keys to be max run and max lumi for backwards compat.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
if not isinstance(run, Run):
|
|
61
|
+
msg = "addRun argument must be of type WMCore.DataStructs.Run"
|
|
62
|
+
raise RuntimeError(msg)
|
|
63
|
+
|
|
64
|
+
addFlag = False
|
|
65
|
+
for runMember in self['runs']:
|
|
66
|
+
if runMember.run == run.run:
|
|
67
|
+
# this rely on Run object overwrite __add__ to update self
|
|
68
|
+
runMember + run
|
|
69
|
+
addFlag = True
|
|
70
|
+
|
|
71
|
+
if not addFlag:
|
|
72
|
+
self['runs'].add(run)
|
|
73
|
+
return
|
|
74
|
+
|
|
75
|
+
def load(self):
|
|
76
|
+
"""
|
|
77
|
+
A DataStructs file has nothing to load from, other implementations will
|
|
78
|
+
over-ride this method.
|
|
79
|
+
"""
|
|
80
|
+
if self['id']:
|
|
81
|
+
self['lfn'] = '/store/testing/%s' % self['id']
|
|
82
|
+
|
|
83
|
+
def save(self):
|
|
84
|
+
"""
|
|
85
|
+
A DataStructs file has nothing to save to, other implementations will
|
|
86
|
+
over-ride this method.
|
|
87
|
+
"""
|
|
88
|
+
pass
|
|
89
|
+
|
|
90
|
+
def setLocation(self, pnn):
|
|
91
|
+
# Make sure we don't add None, [], "" as file location
|
|
92
|
+
if pnn:
|
|
93
|
+
self['locations'] = self['locations'] | set(self.makelist(pnn))
|
|
94
|
+
|
|
95
|
+
def __eq__(self, rhs):
|
|
96
|
+
"""
|
|
97
|
+
File is equal if it has the same name
|
|
98
|
+
"""
|
|
99
|
+
eq = False
|
|
100
|
+
if isinstance(rhs, type(self)):
|
|
101
|
+
eq = self['lfn'] == rhs['lfn']
|
|
102
|
+
elif isinstance(rhs, (str, bytes)):
|
|
103
|
+
eq = self['lfn'] == rhs
|
|
104
|
+
return eq
|
|
105
|
+
|
|
106
|
+
def __ne__(self, rhs):
|
|
107
|
+
return not self.__eq__(rhs)
|
|
108
|
+
|
|
109
|
+
def __hash__(self):
|
|
110
|
+
thisHash = self['lfn'].__hash__()
|
|
111
|
+
return thisHash
|
|
112
|
+
|
|
113
|
+
def __lt__(self, rhs):
|
|
114
|
+
"""
|
|
115
|
+
Sort files based on lexicographical ordering of the value connected
|
|
116
|
+
to the 'lfn' key
|
|
117
|
+
"""
|
|
118
|
+
eq = False
|
|
119
|
+
if isinstance(rhs, type(self)):
|
|
120
|
+
eq = self['lfn'] < rhs['lfn']
|
|
121
|
+
elif isinstance(rhs, (str, bytes)):
|
|
122
|
+
eq = self['lfn'] < rhs
|
|
123
|
+
return eq
|
|
124
|
+
|
|
125
|
+
def __le__(self, other):
|
|
126
|
+
return self.__lt__(other) or self.__eq__(other)
|
|
127
|
+
|
|
128
|
+
def __gt__(self, other):
|
|
129
|
+
return not self.__le__(other)
|
|
130
|
+
|
|
131
|
+
def __ge__(self, other):
|
|
132
|
+
return not self.__lt__(other)
|
|
133
|
+
|
|
134
|
+
def json(self, thunker=None):
|
|
135
|
+
"""
|
|
136
|
+
_json_
|
|
137
|
+
|
|
138
|
+
Serialize the file object. This will convert all Sets() to lists and
|
|
139
|
+
weed out the internal data structures that don't need to be shared.
|
|
140
|
+
"""
|
|
141
|
+
fileDict = {"last_event": self["last_event"],
|
|
142
|
+
"first_event": self["first_event"],
|
|
143
|
+
"lfn": self["lfn"],
|
|
144
|
+
"locations": list(self["locations"]),
|
|
145
|
+
"id": self.get("id", None),
|
|
146
|
+
"checksums": self["checksums"],
|
|
147
|
+
"events": self["events"],
|
|
148
|
+
"merged": self["merged"],
|
|
149
|
+
"size": self["size"],
|
|
150
|
+
"runs": [],
|
|
151
|
+
"parents": []}
|
|
152
|
+
|
|
153
|
+
for parent in self["parents"]:
|
|
154
|
+
if isinstance(parent, (str, bytes)):
|
|
155
|
+
# Then for some reason, we're passing strings
|
|
156
|
+
# Done specifically for ErrorHandler
|
|
157
|
+
fileDict['parents'].append(parent)
|
|
158
|
+
elif thunker is None:
|
|
159
|
+
continue
|
|
160
|
+
else:
|
|
161
|
+
fileDict["parents"].append(thunker._thunk(parent))
|
|
162
|
+
|
|
163
|
+
for run in self["runs"]:
|
|
164
|
+
runDict = {"run_number": run.run,
|
|
165
|
+
"lumis": run.lumis}
|
|
166
|
+
fileDict["runs"].append(runDict)
|
|
167
|
+
|
|
168
|
+
return fileDict
|
|
169
|
+
|
|
170
|
+
def __to_json__(self, thunker=None):
|
|
171
|
+
"""
|
|
172
|
+
__to_json__
|
|
173
|
+
|
|
174
|
+
This is the standard way we jsonize other objects.
|
|
175
|
+
Included here so we have a uniform method.
|
|
176
|
+
"""
|
|
177
|
+
return self.json(thunker)
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_Fileset_
|
|
4
|
+
|
|
5
|
+
Data object that contains a set of files
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import print_function
|
|
10
|
+
from builtins import str, map
|
|
11
|
+
|
|
12
|
+
from operator import itemgetter
|
|
13
|
+
from WMCore.DataStructs.WMObject import WMObject
|
|
14
|
+
__all__ = []
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Fileset(WMObject):
|
|
18
|
+
"""
|
|
19
|
+
_Fileset_
|
|
20
|
+
Data object that contains a set of files
|
|
21
|
+
"""
|
|
22
|
+
def __init__(self, name=None, files=None):
|
|
23
|
+
"""
|
|
24
|
+
Assume input files are new
|
|
25
|
+
"""
|
|
26
|
+
self.name = name
|
|
27
|
+
self.files = set()
|
|
28
|
+
|
|
29
|
+
if files is None:
|
|
30
|
+
self.newfiles = set()
|
|
31
|
+
else:
|
|
32
|
+
self.newfiles = files
|
|
33
|
+
|
|
34
|
+
# assume that the fileset is open at first
|
|
35
|
+
self.open = True
|
|
36
|
+
|
|
37
|
+
# assume that the lastUpdate of fileset is 0 at first
|
|
38
|
+
self.lastUpdate = 0
|
|
39
|
+
|
|
40
|
+
def setLastUpdate(self, timeUpdate):
|
|
41
|
+
"""
|
|
42
|
+
_setLastUpdate_
|
|
43
|
+
|
|
44
|
+
Change the last update time of this fileset. The lastUpdate parameter is a int
|
|
45
|
+
representing the last time where the fileset was modifed.
|
|
46
|
+
"""
|
|
47
|
+
self.lastUpdate = timeUpdate
|
|
48
|
+
|
|
49
|
+
def addFile(self, file):
|
|
50
|
+
"""
|
|
51
|
+
Add a (set of) file(s) to the fileset
|
|
52
|
+
If the file is already in self.files update that entry
|
|
53
|
+
e.g. to handle updated location
|
|
54
|
+
If the file is already in self.newfiles update that entry
|
|
55
|
+
e.g. to handle updated location
|
|
56
|
+
Else add the file to self.newfiles
|
|
57
|
+
"""
|
|
58
|
+
file = self.makeset(file)
|
|
59
|
+
new = file - self.getFiles(type='set')
|
|
60
|
+
self.newfiles = self.makeset(self.newfiles) | new
|
|
61
|
+
|
|
62
|
+
updated = self.makeset(file) & self.getFiles(type='set')
|
|
63
|
+
"updated contains the original location information for updated files"
|
|
64
|
+
|
|
65
|
+
self.files = self.files.union(updated)
|
|
66
|
+
|
|
67
|
+
def getFiles(self, type='list'):
|
|
68
|
+
if type == 'list':
|
|
69
|
+
"""
|
|
70
|
+
List all files in the fileset - returns a set of file objects
|
|
71
|
+
sorted by lfn.
|
|
72
|
+
"""
|
|
73
|
+
files = list(self.getFiles(type='set'))
|
|
74
|
+
|
|
75
|
+
try:
|
|
76
|
+
files.sort(key=itemgetter('lfn'))
|
|
77
|
+
except Exception as e:
|
|
78
|
+
print('Problem with listFiles for fileset:', self.name)
|
|
79
|
+
print(files.pop())
|
|
80
|
+
raise e
|
|
81
|
+
return files
|
|
82
|
+
elif type == 'set':
|
|
83
|
+
return self.makeset(self.files) | self.makeset(self.newfiles)
|
|
84
|
+
elif type == 'lfn':
|
|
85
|
+
"""
|
|
86
|
+
All the lfn's for files in the filesets
|
|
87
|
+
"""
|
|
88
|
+
def getLFN(file):
|
|
89
|
+
return file["lfn"]
|
|
90
|
+
files = list(map(getLFN, self.getFiles(type='list')))
|
|
91
|
+
return files
|
|
92
|
+
elif type == 'id':
|
|
93
|
+
"""
|
|
94
|
+
All the id's for files in the filesets
|
|
95
|
+
"""
|
|
96
|
+
def getID(file):
|
|
97
|
+
return file["id"]
|
|
98
|
+
|
|
99
|
+
files = list(map(getID, self.getFiles(type='list')))
|
|
100
|
+
return files
|
|
101
|
+
|
|
102
|
+
def listNewFiles(self):
|
|
103
|
+
"""
|
|
104
|
+
List all files in the fileset that are new - e.g. not in the DB - returns a set
|
|
105
|
+
"""
|
|
106
|
+
return self.newfiles
|
|
107
|
+
|
|
108
|
+
def commit(self):
|
|
109
|
+
"""
|
|
110
|
+
Add contents of self.newfiles to self, empty self.newfiles
|
|
111
|
+
"""
|
|
112
|
+
self.files = self.makeset(self.files) | self.makeset(self.newfiles)
|
|
113
|
+
self.newfiles = set()
|
|
114
|
+
|
|
115
|
+
def __len__(self):
|
|
116
|
+
return len(self.getFiles(type='set'))
|
|
117
|
+
|
|
118
|
+
def __iter__(self):
|
|
119
|
+
for file in self.getFiles():
|
|
120
|
+
yield file
|
|
121
|
+
|
|
122
|
+
def markOpen(self, isOpen):
|
|
123
|
+
"""
|
|
124
|
+
_markOpen_
|
|
125
|
+
|
|
126
|
+
Change the open status of this fileset. The isOpen parameter is a bool
|
|
127
|
+
representing whether or not the fileset is open.
|
|
128
|
+
"""
|
|
129
|
+
self.open = isOpen
|
|
130
|
+
|
|
131
|
+
def __str__(self):
|
|
132
|
+
"""
|
|
133
|
+
__str__
|
|
134
|
+
|
|
135
|
+
Write out something useful
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
st = {'name': self.name, 'files': self.files}
|
|
139
|
+
|
|
140
|
+
return str(st)
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_Job_
|
|
4
|
+
|
|
5
|
+
Data object that describes a job
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from builtins import map, range
|
|
10
|
+
|
|
11
|
+
__all__ = []
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from WMCore.DataStructs.Mask import Mask
|
|
15
|
+
from WMCore.DataStructs.WMObject import WMObject
|
|
16
|
+
from WMCore.Configuration import ConfigSection
|
|
17
|
+
|
|
18
|
+
import time
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Job(WMObject, dict):
|
|
22
|
+
def __init__(self, name = None, files = None):
|
|
23
|
+
"""
|
|
24
|
+
A job has a jobgroup which gives it its subscription and workflow.
|
|
25
|
+
inputFiles is a list containing files associated to a job
|
|
26
|
+
last_update is the time the job last changed
|
|
27
|
+
"""
|
|
28
|
+
dict.__init__(self)
|
|
29
|
+
self.baggage = ConfigSection("baggage")
|
|
30
|
+
if files == None:
|
|
31
|
+
self["input_files"] = []
|
|
32
|
+
else:
|
|
33
|
+
self["input_files"] = files
|
|
34
|
+
|
|
35
|
+
self["id"] = None
|
|
36
|
+
self["jobgroup"] = None
|
|
37
|
+
self["name"] = name
|
|
38
|
+
self["state"] = 'new'
|
|
39
|
+
self["state_time"] = int(time.time())
|
|
40
|
+
self["outcome"] = "failure"
|
|
41
|
+
self["retry_count"] = 0
|
|
42
|
+
self["location"] = None
|
|
43
|
+
self["mask"] = Mask()
|
|
44
|
+
self["task"] = None
|
|
45
|
+
self["fwjr"] = None
|
|
46
|
+
self["fwjr_path"] = None
|
|
47
|
+
self["workflow"] = None
|
|
48
|
+
self["owner"] = None
|
|
49
|
+
self["estimatedJobTime"] = None
|
|
50
|
+
self["estimatedMemoryUsage"] = None
|
|
51
|
+
self["estimatedDiskUsage"] = None
|
|
52
|
+
return
|
|
53
|
+
|
|
54
|
+
# //
|
|
55
|
+
# // Use property to define getter/setter API for task
|
|
56
|
+
#// makes job.task and job.tast = "value" possible
|
|
57
|
+
task = property(lambda self: self['task'],
|
|
58
|
+
lambda self, x: self.__setitem__('task',x))
|
|
59
|
+
|
|
60
|
+
def save(self):
|
|
61
|
+
"""
|
|
62
|
+
_save_
|
|
63
|
+
|
|
64
|
+
Bogus method to make this look more like the WMBS JOB.
|
|
65
|
+
"""
|
|
66
|
+
return
|
|
67
|
+
|
|
68
|
+
def getFiles(self, type = "list"):
|
|
69
|
+
"""
|
|
70
|
+
_getFiles_
|
|
71
|
+
|
|
72
|
+
Retrieve information about the input files for the job. The type
|
|
73
|
+
parameter can be set to one of the following:
|
|
74
|
+
list - A list of File objects will be returned
|
|
75
|
+
set - A set of File objects will be returned
|
|
76
|
+
lfn - A list of LFNs will be returned
|
|
77
|
+
id - A list if File IDs will be returned
|
|
78
|
+
"""
|
|
79
|
+
if type == "list":
|
|
80
|
+
return self["input_files"]
|
|
81
|
+
elif type == "set":
|
|
82
|
+
return self.makeset(self["input_files"])
|
|
83
|
+
elif type == "lfn":
|
|
84
|
+
def getLFN(file):
|
|
85
|
+
return file["lfn"]
|
|
86
|
+
|
|
87
|
+
lfns = list(map(getLFN, self["input_files"]))
|
|
88
|
+
return lfns
|
|
89
|
+
elif type == "id":
|
|
90
|
+
def getID(file):
|
|
91
|
+
return file["id"]
|
|
92
|
+
|
|
93
|
+
ids = list(map(getID, self["input_files"]))
|
|
94
|
+
return ids
|
|
95
|
+
|
|
96
|
+
def addFile(self, file):
|
|
97
|
+
"""
|
|
98
|
+
_addFile_
|
|
99
|
+
|
|
100
|
+
Add a file or list of files to the job's input.
|
|
101
|
+
"""
|
|
102
|
+
if isinstance(file, list):
|
|
103
|
+
self["input_files"].extend(file)
|
|
104
|
+
else:
|
|
105
|
+
self["input_files"].append(file)
|
|
106
|
+
|
|
107
|
+
return
|
|
108
|
+
|
|
109
|
+
def changeState(self, newState):
|
|
110
|
+
"""
|
|
111
|
+
_changeState_
|
|
112
|
+
|
|
113
|
+
Change the state of the job.
|
|
114
|
+
"""
|
|
115
|
+
self["state"] = newState
|
|
116
|
+
self["state_time"] = int(time.time())
|
|
117
|
+
|
|
118
|
+
return
|
|
119
|
+
|
|
120
|
+
def changeOutcome(self, jobOutcome):
|
|
121
|
+
"""
|
|
122
|
+
_changeOutcome_
|
|
123
|
+
|
|
124
|
+
Change the final outcome of the job, can be either success or fail.
|
|
125
|
+
"""
|
|
126
|
+
self["outcome"] = jobOutcome
|
|
127
|
+
return
|
|
128
|
+
|
|
129
|
+
def addResourceEstimates(self, jobTime = None, memory = None, disk = None):
|
|
130
|
+
"""
|
|
131
|
+
_addResourceEstimates_
|
|
132
|
+
|
|
133
|
+
Add to the current resource estimates, if None then initialize them
|
|
134
|
+
to the given value. Each value can be set independently.
|
|
135
|
+
"""
|
|
136
|
+
if not self["estimatedJobTime"]:
|
|
137
|
+
self["estimatedJobTime"] = jobTime
|
|
138
|
+
elif jobTime:
|
|
139
|
+
self["estimatedJobTime"] += jobTime
|
|
140
|
+
|
|
141
|
+
if not self["estimatedMemoryUsage"]:
|
|
142
|
+
self["estimatedMemoryUsage"] = memory
|
|
143
|
+
elif memory:
|
|
144
|
+
self["estimatedMemoryUsage"] += memory
|
|
145
|
+
|
|
146
|
+
if not self["estimatedDiskUsage"]:
|
|
147
|
+
self["estimatedDiskUsage"] = disk
|
|
148
|
+
elif disk:
|
|
149
|
+
self["estimatedDiskUsage"] += disk
|
|
150
|
+
|
|
151
|
+
return
|
|
152
|
+
|
|
153
|
+
def getBaggage(self):
|
|
154
|
+
"""
|
|
155
|
+
_getBaggage_
|
|
156
|
+
|
|
157
|
+
Get a reference to the embedded ConfigSection that is
|
|
158
|
+
used to store per job arguments needed to be propagated at
|
|
159
|
+
submission time
|
|
160
|
+
|
|
161
|
+
"""
|
|
162
|
+
return self.baggage
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def addBaggageParameter(self, attrName, value):
|
|
166
|
+
"""
|
|
167
|
+
_addBaggageParameter_
|
|
168
|
+
|
|
169
|
+
Add an attribute as process.pset1.pset2.param = value
|
|
170
|
+
Value should be the appropriate python type
|
|
171
|
+
|
|
172
|
+
"""
|
|
173
|
+
currentPSet = self.baggage
|
|
174
|
+
paramList = attrName.split(".")
|
|
175
|
+
for i in range(0, len(paramList)):
|
|
176
|
+
param = paramList.pop(0)
|
|
177
|
+
if len(paramList) > 0:
|
|
178
|
+
if not hasattr(currentPSet, param):
|
|
179
|
+
currentPSet.section_(param)
|
|
180
|
+
currentPSet = getattr(currentPSet, param)
|
|
181
|
+
else:
|
|
182
|
+
setattr(currentPSet, param, value)
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_JobGroup_
|
|
4
|
+
|
|
5
|
+
Definition of JobGroup:
|
|
6
|
+
Set of jobs running on same input file for same Workflow
|
|
7
|
+
Set of jobs for a single subscription
|
|
8
|
+
Required for certain job splitting Algo's (.g. event split to make complete
|
|
9
|
+
lumi)
|
|
10
|
+
Subscription:JobGroup == 1:N
|
|
11
|
+
JobGroup:Jobs = 1:N
|
|
12
|
+
JobGroup:InFile = 1:1
|
|
13
|
+
JobGroup:MergedOutFile = N:1
|
|
14
|
+
JobGroup at least one Lumi section
|
|
15
|
+
|
|
16
|
+
A JobGroup is a set of jobs and a Fileset that contains their output.
|
|
17
|
+
|
|
18
|
+
JobGroup knows the Subscription and passes the Workflow to Jobs in the group.
|
|
19
|
+
|
|
20
|
+
Jobs know their status (active, failed, complete) and know the files they run
|
|
21
|
+
on but don't know the group. They do know their subscription and corresponding
|
|
22
|
+
workflow. This means Jobs can update their state in the database without
|
|
23
|
+
talking to the group, and WMBS JobGroups can calculate status from the database
|
|
24
|
+
instead of the in memory objects.
|
|
25
|
+
|
|
26
|
+
The group has a status call which goes through the jobs and updates the db for
|
|
27
|
+
state changes and then returns the status of the group (active, failed,
|
|
28
|
+
complete).
|
|
29
|
+
|
|
30
|
+
WMAgent deals with groups and calls group.status periodically
|
|
31
|
+
"""
|
|
32
|
+
from __future__ import print_function
|
|
33
|
+
|
|
34
|
+
import datetime
|
|
35
|
+
|
|
36
|
+
from WMCore.DataStructs.Fileset import Fileset
|
|
37
|
+
from WMCore.DataStructs.WMObject import WMObject
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class JobGroup(WMObject):
|
|
41
|
+
"""
|
|
42
|
+
JobGroups are sets of jobs running on files who's output needs to be merged
|
|
43
|
+
together.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
def __init__(self, subscription=None, jobs=None):
|
|
47
|
+
self.jobs = []
|
|
48
|
+
self.newjobs = []
|
|
49
|
+
self.id = 0
|
|
50
|
+
|
|
51
|
+
if isinstance(jobs, list):
|
|
52
|
+
self.newjobs = jobs
|
|
53
|
+
elif jobs is not None:
|
|
54
|
+
self.newjobs = [jobs]
|
|
55
|
+
|
|
56
|
+
self.subscription = subscription
|
|
57
|
+
self.output = Fileset()
|
|
58
|
+
self.last_update = datetime.datetime.now()
|
|
59
|
+
|
|
60
|
+
def add(self, job):
|
|
61
|
+
"""
|
|
62
|
+
_add_
|
|
63
|
+
|
|
64
|
+
Add a Job or list of jobs to the JobGroup.
|
|
65
|
+
"""
|
|
66
|
+
jobList = self.makelist(job)
|
|
67
|
+
self.newjobs.extend(jobList)
|
|
68
|
+
return
|
|
69
|
+
|
|
70
|
+
def commit(self):
|
|
71
|
+
"""
|
|
72
|
+
_commit_
|
|
73
|
+
|
|
74
|
+
Move any jobs in the newjobs dict to the job dict. Empty the newjobs
|
|
75
|
+
dict.
|
|
76
|
+
"""
|
|
77
|
+
self.jobs.extend(self.newjobs)
|
|
78
|
+
self.newjobs = []
|
|
79
|
+
|
|
80
|
+
def commitBulk(self):
|
|
81
|
+
"""
|
|
82
|
+
Dummy method for consistency with WMBS implementation
|
|
83
|
+
"""
|
|
84
|
+
self.commit()
|
|
85
|
+
|
|
86
|
+
def addOutput(self, file):
|
|
87
|
+
"""
|
|
88
|
+
_addOutput_
|
|
89
|
+
|
|
90
|
+
Add a File to the JobGroup's output fileset. The File is committed
|
|
91
|
+
to the Fileset immediately.
|
|
92
|
+
"""
|
|
93
|
+
self.output.addFile(file)
|
|
94
|
+
self.output.commit()
|
|
95
|
+
|
|
96
|
+
def getJobs(self, type="list"):
|
|
97
|
+
"""
|
|
98
|
+
_getJobs_
|
|
99
|
+
|
|
100
|
+
Retrieve all of the jobs in the JobGroup. The output will either be
|
|
101
|
+
returned as a list of Job objects (when type is "list") or a list of
|
|
102
|
+
Job IDs (when type is "id").
|
|
103
|
+
"""
|
|
104
|
+
if type == "list":
|
|
105
|
+
return self.jobs
|
|
106
|
+
elif type == "id":
|
|
107
|
+
jobIDs = []
|
|
108
|
+
|
|
109
|
+
for job in self.jobs:
|
|
110
|
+
jobIDs.append(job["id"])
|
|
111
|
+
|
|
112
|
+
return jobIDs
|
|
113
|
+
else:
|
|
114
|
+
print("Unknown type: %s" % type)
|
|
115
|
+
|
|
116
|
+
return
|
|
117
|
+
|
|
118
|
+
def getOutput(self, type="list"):
|
|
119
|
+
"""
|
|
120
|
+
_getOutput_
|
|
121
|
+
|
|
122
|
+
Retrieve all of the files that are in the JobGroup's output fileset.
|
|
123
|
+
Type can be one of the following: list, set, lfn, id.
|
|
124
|
+
"""
|
|
125
|
+
return self.output.getFiles(type=type)
|
|
126
|
+
|
|
127
|
+
def getLength(self, obj):
|
|
128
|
+
"""
|
|
129
|
+
This just gets a length for either dict or list objects
|
|
130
|
+
"""
|
|
131
|
+
if isinstance(obj, (dict, list)):
|
|
132
|
+
return len(obj)
|
|
133
|
+
else:
|
|
134
|
+
return 0
|
|
135
|
+
|
|
136
|
+
def __len__(self):
|
|
137
|
+
"""
|
|
138
|
+
Allows use of len() on JobGroup
|
|
139
|
+
"""
|
|
140
|
+
return self.getLength(self.jobs) + self.getLength(self.newjobs)
|
|
141
|
+
|
|
142
|
+
# return len(self.jobs.keys()) + len(self.newjobs.keys())
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_JobPackage_
|
|
4
|
+
|
|
5
|
+
Data structure for storing and retreiving multiple job objects.
|
|
6
|
+
"""
|
|
7
|
+
import pickle
|
|
8
|
+
from Utils.PythonVersion import HIGHEST_PICKLE_PROTOCOL
|
|
9
|
+
from WMCore.DataStructs.WMObject import WMObject
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class JobPackage(WMObject, dict):
|
|
13
|
+
"""
|
|
14
|
+
_JobPackage_
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, directory=None):
|
|
18
|
+
"""
|
|
19
|
+
__init__
|
|
20
|
+
|
|
21
|
+
Allow you to set a directory where the
|
|
22
|
+
package will be stored.
|
|
23
|
+
This is then saved for use by the
|
|
24
|
+
JobSubmitter
|
|
25
|
+
"""
|
|
26
|
+
dict.__init__(self)
|
|
27
|
+
self.setdefault('directory', directory)
|
|
28
|
+
|
|
29
|
+
def save(self, fileName):
|
|
30
|
+
"""
|
|
31
|
+
_save_
|
|
32
|
+
|
|
33
|
+
Pickle this object and save it to disk.
|
|
34
|
+
"""
|
|
35
|
+
with open(fileName, 'wb') as fileHandle:
|
|
36
|
+
pickle.dump(self, fileHandle, protocol=HIGHEST_PICKLE_PROTOCOL)
|
|
37
|
+
return
|
|
38
|
+
|
|
39
|
+
def load(self, fileName):
|
|
40
|
+
"""
|
|
41
|
+
_load_
|
|
42
|
+
|
|
43
|
+
Load a pickled JobPackage object.
|
|
44
|
+
"""
|
|
45
|
+
self.clear()
|
|
46
|
+
with open(fileName, 'rb') as fileHandle:
|
|
47
|
+
loadedJobPackage = pickle.load(fileHandle)
|
|
48
|
+
self.update(loadedJobPackage)
|
|
49
|
+
return
|