acdcserver 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.
- 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/ParseXMLFile.py +115 -0
- WMCore/Algorithms/Permissions.py +27 -0
- WMCore/Algorithms/__init__.py +7 -0
- WMCore/Configuration.py +651 -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/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/MySQLCore.py +132 -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/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/Services/Requests.py +624 -0
- WMCore/Services/__init__.py +8 -0
- WMCore/Services/pycurl_manager.py +574 -0
- WMCore/WMException.py +183 -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
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/CouchDBLogo.png +0 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/DMWMLogo.png +0 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/collections.html +60 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/displaycollection.html +61 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/index.html +36 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/style/main.css +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_id +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/couchapp.json +4 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/filters/filterDeletedDocs.js +3 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/rewrites.json +81 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/validate_doc_update.js +9 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/vendor/acdc/_attachments/acdc.js +302 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/byCollectionName/map.js +9 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/byCollectionName/reduce.js +3 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/byTimestamp/map.js +10 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/coll_fileset_count/map.js +9 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/coll_fileset_count/reduce.js +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/coll_fileset_docs/map.js +3 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/coll_fileset_docs/reduce.js +3 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/.couchappignore +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/.couchapprc +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/_attachments/index.html +85 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/_attachments/style/main.css +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/_id +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/couchapp.json +4 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/updates/newgroup.js +18 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/updates/newuser.js +15 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/updates/ownthis.js +8 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/README.md +3 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/_attachments/jquery.couchapp.js +200 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/couchapp.js +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/date.js +23 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/metadata.json +4 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/path.js +77 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/template.js +33 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/groupuser/_attachments/groupuser.js +234 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/views/group_members/map.js +5 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/views/groups/map.js +5 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/views/name_map/map.js +5 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/views/owner_group_user/map.js +5 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/views/users/map.js +5 -0
- acdcserver-2.3.10.dist-info/LICENSE +202 -0
- acdcserver-2.3.10.dist-info/METADATA +17 -0
- acdcserver-2.3.10.dist-info/NOTICE +16 -0
- acdcserver-2.3.10.dist-info/RECORD +104 -0
- acdcserver-2.3.10.dist-info/WHEEL +5 -0
- acdcserver-2.3.10.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_WMObject_
|
|
4
|
+
|
|
5
|
+
Helper class that other objects should inherit from
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from builtins import object
|
|
9
|
+
__all__ = []
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class WMObject(object):
|
|
15
|
+
"""
|
|
16
|
+
Helper class that other objects should inherit from
|
|
17
|
+
"""
|
|
18
|
+
def __init__(self, config = {}):
|
|
19
|
+
#Config is a WMCore.Configuration
|
|
20
|
+
self.config = config
|
|
21
|
+
|
|
22
|
+
def makelist(self, thelist):
|
|
23
|
+
"""
|
|
24
|
+
Simple method to ensure thelist is a list
|
|
25
|
+
"""
|
|
26
|
+
if isinstance(thelist, set):
|
|
27
|
+
thelist = list(thelist)
|
|
28
|
+
elif not isinstance(thelist, list):
|
|
29
|
+
thelist = [thelist]
|
|
30
|
+
return thelist
|
|
31
|
+
|
|
32
|
+
def makeset(self, theset):
|
|
33
|
+
"""
|
|
34
|
+
Simple method to ensure theset is a set
|
|
35
|
+
"""
|
|
36
|
+
if not isinstance(theset, set):
|
|
37
|
+
theset = set(self.makelist(theset))
|
|
38
|
+
return theset
|
|
39
|
+
|
|
40
|
+
def flatten(self, list):
|
|
41
|
+
"""
|
|
42
|
+
If a list has only one element return just that element, otherwise
|
|
43
|
+
return the original list
|
|
44
|
+
"""
|
|
45
|
+
if len(list) == 1:
|
|
46
|
+
return list[0]
|
|
47
|
+
return list
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_WorkUnit_
|
|
4
|
+
|
|
5
|
+
Data object that contains details for a single work unit
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import absolute_import, division, print_function
|
|
10
|
+
|
|
11
|
+
from future.utils import listitems
|
|
12
|
+
|
|
13
|
+
import sys
|
|
14
|
+
import hashlib
|
|
15
|
+
import time
|
|
16
|
+
from functools import total_ordering
|
|
17
|
+
|
|
18
|
+
from Utils.Utilities import encodeUnicodeToBytes
|
|
19
|
+
from WMCore.DataStructs.WMObject import WMObject
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@total_ordering
|
|
23
|
+
class WorkUnit(WMObject, dict):
|
|
24
|
+
"""
|
|
25
|
+
_WorkUnit_
|
|
26
|
+
Data object that contains details for a single work unit
|
|
27
|
+
corresponding to tables workunit and frl_workunit_assoc
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
fieldsToCopy = ['taskid', 'retry_count', 'last_unit_count', 'last_submit_time', 'status', 'firstevent',
|
|
31
|
+
'lastevent', 'fileid']
|
|
32
|
+
fieldsForInfo = fieldsToCopy + ['run_lumi']
|
|
33
|
+
|
|
34
|
+
def __init__(self, taskID=None, retryCount=0, lastUnitCount=None, lastSubmitTime=int(time.time()),
|
|
35
|
+
status=0, firstEvent=1, lastEvent=sys.maxsize, fileid=None, runLumi=None):
|
|
36
|
+
super(WorkUnit, self).__init__(self)
|
|
37
|
+
self.setdefault('taskid', taskID)
|
|
38
|
+
self.setdefault('retry_count', retryCount)
|
|
39
|
+
self.setdefault('last_unit_count', lastUnitCount)
|
|
40
|
+
self.setdefault('last_submit_time', lastSubmitTime)
|
|
41
|
+
self.setdefault('status', status)
|
|
42
|
+
|
|
43
|
+
self.setdefault('firstevent', firstEvent)
|
|
44
|
+
self.setdefault('lastevent', lastEvent)
|
|
45
|
+
self.setdefault('fileid', fileid)
|
|
46
|
+
self.setdefault('run_lumi', runLumi)
|
|
47
|
+
|
|
48
|
+
def __lt__(self, rhs):
|
|
49
|
+
"""
|
|
50
|
+
Compare work units in task id, run, lumi, first event, last event
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
if self['taskid'] != rhs['taskid']:
|
|
54
|
+
return self['taskid'] < rhs['taskid']
|
|
55
|
+
if self['run_lumi'].run != rhs['run_lumi'].run:
|
|
56
|
+
return self['run_lumi'].run < rhs['run_lumi'].run
|
|
57
|
+
if self['run_lumi'].lumis != rhs['run_lumi'].lumis:
|
|
58
|
+
return self['run_lumi'].lumis < rhs['run_lumi'].lumis
|
|
59
|
+
if self['first_event'] != rhs['first_event']:
|
|
60
|
+
return self['first_event'] < rhs['first_event']
|
|
61
|
+
return self['last_event'] < rhs['last_event']
|
|
62
|
+
|
|
63
|
+
def __eq__(self, rhs):
|
|
64
|
+
"""
|
|
65
|
+
Work unit is equal if it has the same task, run, and lumi
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
return (self['taskid'] == rhs['taskid'] and self['run_lumi'].run == self['run_lumi'].run and
|
|
69
|
+
self['run_lumi'].lumis == self['run_lumi'].lumis and self['firstevent'] == rhs['firstevent'] and
|
|
70
|
+
self['lastevent'] == rhs['lastevent'])
|
|
71
|
+
|
|
72
|
+
def __hash__(self):
|
|
73
|
+
"""
|
|
74
|
+
Hash function for this dict.
|
|
75
|
+
"""
|
|
76
|
+
# Generate an immutable sorted string representing this object
|
|
77
|
+
# NOTE: the run object needs to be hashed
|
|
78
|
+
immutableSelf = []
|
|
79
|
+
for keyName in sorted(self):
|
|
80
|
+
if keyName == "run_lumi":
|
|
81
|
+
immutableSelf.append((keyName, hash(self[keyName])))
|
|
82
|
+
else:
|
|
83
|
+
immutableSelf.append((keyName, self[keyName]))
|
|
84
|
+
hashValue = hashlib.sha1(encodeUnicodeToBytes(str(immutableSelf)))
|
|
85
|
+
return int(hashValue.hexdigest()[:15], 16)
|
|
86
|
+
|
|
87
|
+
def json(self, thunker=None):
|
|
88
|
+
"""
|
|
89
|
+
_json_
|
|
90
|
+
|
|
91
|
+
Serialize the object. Only copy select fields and construct one new field.
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
jsonDict = {k: self[k] for k in WorkUnit.fieldsToCopy}
|
|
95
|
+
jsonDict["run_lumi"] = {"run_number": self['run_lumi'].run, "lumis": self['run_lumi'].lumis}
|
|
96
|
+
|
|
97
|
+
return jsonDict
|
|
98
|
+
|
|
99
|
+
def __to_json__(self, thunker=None):
|
|
100
|
+
"""
|
|
101
|
+
__to_json__
|
|
102
|
+
|
|
103
|
+
This is the standard way we jsonize other objects.
|
|
104
|
+
Included here so we have a uniform method.
|
|
105
|
+
"""
|
|
106
|
+
return self.json(thunker)
|
|
107
|
+
|
|
108
|
+
def getInfo(self):
|
|
109
|
+
"""
|
|
110
|
+
Returns: tuple of parameters for the work unit
|
|
111
|
+
"""
|
|
112
|
+
return tuple(self[x] for x in WorkUnit.fieldsForInfo)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_Workflow_
|
|
4
|
+
|
|
5
|
+
A class that describes some work to be undertaken on some files
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from builtins import str
|
|
9
|
+
from WMCore.DataStructs.Pickleable import Pickleable
|
|
10
|
+
|
|
11
|
+
class Workflow(Pickleable):
|
|
12
|
+
def __init__(self, spec = None, owner = "unknown", dn = "unknown",
|
|
13
|
+
group = "unknown", owner_vogroup = "unknown",
|
|
14
|
+
owner_vorole = "unknown", name = None, task = None,
|
|
15
|
+
wfType = None, priority = None):
|
|
16
|
+
self.spec = spec
|
|
17
|
+
self.name = name
|
|
18
|
+
# person making the request
|
|
19
|
+
self.owner = owner
|
|
20
|
+
self.dn = dn
|
|
21
|
+
self.vogroup = owner_vogroup
|
|
22
|
+
self.vorole = owner_vorole
|
|
23
|
+
self.group = group
|
|
24
|
+
# task is the name of the task within the Workload
|
|
25
|
+
self.task = task
|
|
26
|
+
self.wfType = wfType
|
|
27
|
+
self.outputMap = {}
|
|
28
|
+
self.priority = priority or 0
|
|
29
|
+
|
|
30
|
+
def addOutput(self, outputIdentifier, outputFileset,
|
|
31
|
+
mergedOutputFileset = None):
|
|
32
|
+
"""
|
|
33
|
+
_addOutput_
|
|
34
|
+
|
|
35
|
+
Associate an output of this workflow with a particular fileset.
|
|
36
|
+
"""
|
|
37
|
+
mappingDict = {"output_fileset": outputFileset,
|
|
38
|
+
"merged_output_fileset": mergedOutputFileset}
|
|
39
|
+
|
|
40
|
+
if outputIdentifier in self.outputMap:
|
|
41
|
+
self.outputMap[outputIdentifier].append(mappingDict)
|
|
42
|
+
else:
|
|
43
|
+
self.outputMap[outputIdentifier] = [mappingDict]
|
|
44
|
+
|
|
45
|
+
return
|
|
46
|
+
|
|
47
|
+
def __str__(self):
|
|
48
|
+
"""
|
|
49
|
+
__str__
|
|
50
|
+
|
|
51
|
+
Print out some useful info just because
|
|
52
|
+
this does not inherit from dict.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
d = {'id': self.id, 'spec': self.spec, 'name': self.name,
|
|
56
|
+
'owner': self.owner, 'task': self.task,
|
|
57
|
+
'vogroup': self.vogroup, 'vorole': self.vorole,
|
|
58
|
+
'group': self.group, 'wfType': self.wfType}
|
|
59
|
+
|
|
60
|
+
return str(d)
|