CMS 3D CMS Logo

conddb_version_mgr.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 from __future__ import print_function
4 import cx_Oracle
5 import datetime
6 import calendar
7 import sys
8 import logging
9 import CondCore.Utilities.conddb_serialization_metadata as sm
10 import CondCore.Utilities.credentials as auth
11 import CondCore.Utilities.conddb_time as conddb_time
12 import os
13 
14 authPathEnvVar = 'COND_AUTH_PATH'
15 prod_db_service = ('cms_orcon_prod',{'w':'cms_orcon_prod/cms_cond_general_w','r':'cms_orcon_prod/cms_cond_general_r'})
16 adg_db_service = ('cms_orcon_adg',{'r':'cms_orcon_adg/cms_cond_general_r'})
17 dev_db_service = ('cms_orcoff_prep',{'w':'cms_orcoff_prep/cms_cond_general_w','r':'cms_orcoff_prep/cms_cond_general_r'})
18 schema_name = 'CMS_CONDITIONS'
19 
20 fmt_str = "[%(asctime)s] %(levelname)s: %(message)s"
21 logLevel = logging.INFO
22 logFormatter = logging.Formatter(fmt_str)
23 
24 def print_table( headers, table ):
25  ws = []
26  for h in headers:
27  ws.append(len(h))
28  for row in table:
29  ind = 0
30  for c in row:
31  c = str(c)
32  if ind<len(ws):
33  if len(c)> ws[ind]:
34  ws[ind] = len(c)
35  ind += 1
36 
37  def printf( row ):
38  line = ''
39  ind = 0
40  for w in ws:
41  fmt = '{:<%s}' %w
42  if ind<len(ws):
43  line += (fmt.format( row[ind] )+' ')
44  ind += 1
45  print(line)
46  printf( headers )
47  hsep = ''
48  for w in ws:
49  fmt = '{:-<%s}' %w
50  hsep += (fmt.format('')+' ')
51  print(hsep)
52  for row in table:
53  printf( row )
54 
56  def __init__(self, db ):
57  self.db = db
58  self.cmssw_boost_map = {}
59  self.boost_run_map = []
60 
61  def fetch_cmssw_boost_map( self ):
62  cursor = self.db.cursor()
63  cursor.execute('SELECT BOOST_VERSION, CMSSW_VERSION FROM CMSSW_BOOST_MAP');
64  rows = cursor.fetchall()
65  self.cmssw_boost_map = {}
66  for r in rows:
67  self.cmssw_boost_map[r[1]]=r[0]
68  return self.cmssw_boost_map
69 
70  def fetch_boost_run_map( self ):
71  cursor = self.db.cursor()
72  cursor.execute('SELECT RUN_NUMBER, RUN_START_TIME, BOOST_VERSION, INSERTION_TIME FROM BOOST_RUN_MAP ORDER BY RUN_NUMBER, INSERTION_TIME')
73  rows = cursor.fetchall()
74  self.boost_run_map = []
75  for r in rows:
76  self.boost_run_map.append( (r[0],r[1],r[2],str(r[3])) )
77  return self.boost_run_map
78 
79  def insert_boost_run_range( self, run, boost_version, min_ts ):
80  cursor = self.db.cursor()
81  cursor.execute('SELECT MIN(RUN_NUMBER) FROM RUN_INFO WHERE RUN_NUMBER >= :RUN',(run,))
82  res = cursor.fetchone()
83  if res is not None and res[0] is not None:
84  min_run = res[0]
85  cursor.execute('SELECT START_TIME FROM RUN_INFO WHERE RUN_NUMBER=:RUN',(min_run,))
86  min_run_time = cursor.fetchone()[0]
87  min_run_ts = calendar.timegm( min_run_time.utctimetuple() ) << 32
88  else:
89  min_run = run
90  min_run_ts = conddb_time.string_to_timestamp(min_ts)
91  now = datetime.datetime.utcnow()
92  cursor.execute('INSERT INTO BOOST_RUN_MAP ( RUN_NUMBER, RUN_START_TIME, BOOST_VERSION, INSERTION_TIME ) VALUES (:RUN, :RUN_START_T, :BOOST, :TIME)',(run,min_run_ts,boost_version,now) )
93 
94  def insert_cmssw_boost( self, cmssw_version,boost_version ):
95  cursor = self.db.cursor()
96  cursor.execute('INSERT INTO CMSSW_BOOST_MAP ( CMSSW_VERSION, BOOST_VERSION ) VALUES ( :CMSSW_VERSION, :BOOST_VERSION )',(cmssw_version,boost_version))
97 
98  def lookup_boost_in_cmssw( self, cmssw_version ):
99  cmssw_v = sm.check_cmssw_version( cmssw_version )
100  the_arch = None
101  releaseRoot = None
102  if sm.is_release_cycle( cmssw_v ):
103  cmssw_v = sm.strip_cmssw_version( cmssw_v )
104  archs = sm.get_production_arch( cmssw_v )
105  for arch in archs:
106  path = sm.get_release_root( cmssw_v, arch )
107  if os.path.exists(os.path.join(path,cmssw_v)):
108  releaseRoot = path
109  the_arch = arch
110  break
111  if releaseRoot is None:
112  for arch in archs:
113  the_arch = arch
114  releaseRoot = sm.get_release_root( cmssw_v, arch )
115  for r in sorted (os.listdir( releaseRoot )):
116  if r.startswith(cmssw_v):
117  cmssw_v = r
118  logging.debug('Boost version will be verified in release %s' %cmssw_v)
119 
120  if cmssw_v in self.cmssw_boost_map.keys():
121  return self.cmssw_boost_map[cmssw_v]
122 
123  if releaseRoot is None:
124  archs = sm.get_production_arch( cmssw_v )
125  for arch in archs:
126  path = sm.get_release_root( cmssw_v, arch )
127  if os.path.exists(os.path.join(path,cmssw_v)):
128  releaseRoot = path
129  the_arch = arch
130  break
131  logging.debug('Release path: %s' %releaseRoot)
132  boost_version = sm.get_cmssw_boost( the_arch, '%s/%s' %(releaseRoot,cmssw_v) )
133  if not boost_version is None:
134  self.cmssw_boost_map[cmssw_v] = boost_version
135  self.insert_cmssw_boost( cmssw_v,boost_version )
136  return boost_version
137 
138  def populate_for_gts( self ):
139  cursor = self.db.cursor()
140  cursor.execute('SELECT DISTINCT(RELEASE) FROM GLOBAL_TAG')
141  rows = cursor.fetchall()
142  for r in rows:
143  self.lookup_boost_in_cmssw( r[0] )
144 
146  def __init__( self ):
147  self.db = None
148  self.version_db = None
149  self.args = None
150  self.logger = logging.getLogger()
151  self.logger.setLevel(logLevel)
152  consoleHandler = logging.StreamHandler(sys.stdout)
153  consoleHandler.setFormatter(logFormatter)
154  self.logger.addHandler(consoleHandler)
155  self.iovs = None
156  self.versionIovs = None
157 
158  def connect( self ):
159  if self.args.db is None:
160  self.args.db = 'pro'
161  if self.args.db == 'dev' or self.args.db == 'oradev' :
162  db_service = dev_db_service
163  elif self.args.db == 'orapro':
164  db_service = adg_db_service
165  elif self.args.db != 'onlineorapro' or self.args.db != 'pro':
166  db_service = prod_db_service
167  else:
168  raise Exception("Database '%s' is not known." %args.db )
169  if self.args.accessType not in db_service[1].keys():
170  raise Exception('The specified database connection %s does not support the requested action.' %db_service[0])
171  service = db_service[1][self.args.accessType]
172  creds = auth.get_credentials( authPathEnvVar, service, self.args.auth )
173  if creds is None:
174  raise Exception("Could not find credentials for service %s" %service)
175  (username, account, pwd) = creds
176  connStr = '%s/%s@%s' %(username,pwd,db_service[0])
177  self.db = cx_Oracle.connect(connStr)
178  logging.info('Connected to %s as user %s' %(db_service[0],username))
179  self.db.current_schema = schema_name
180 
181  def process_tag_boost_version( self, t, timetype, tagBoostVersion, minIov, timeCut, validate ):
182  if self.iovs is None:
183  self.iovs = []
184  cursor = self.db.cursor()
185  stmt = 'SELECT IOV.SINCE SINCE, IOV.INSERTION_TIME INSERTION_TIME, P.STREAMER_INFO STREAMER_INFO FROM TAG, IOV, PAYLOAD P WHERE TAG.NAME = IOV.TAG_NAME AND P.HASH = IOV.PAYLOAD_HASH AND TAG.NAME = :TAG_NAME'
186  params = (t,)
187  if timeCut and tagBoostVersion is not None and not validate:
188  whereClauseOnSince = ' AND IOV.INSERTION_TIME>:TIME_CUT'
189  stmt = stmt + whereClauseOnSince
190  params = params + (timeCut,)
191  stmt = stmt + ' ORDER BY SINCE'
192  logging.debug('Executing: "%s"' %stmt)
193  cursor.execute(stmt,params)
194  for r in cursor:
195  streamer_info = str(r[2].read())
196  self.iovs.append((r[0],r[1],streamer_info))
197  niovs = 0
198  self.versionIovs = []
199  lastBoost = None
200  update = False
201  if tagBoostVersion is not None:
202  update = True
203  for iov in self.iovs:
204  if validate and timeCut is not None and timeCut < iov[1]:
205  continue
206  niovs += 1
207  iovBoostVersion, tagBoostVersion = sm.update_tag_boost_version( tagBoostVersion, minIov, iov[2], iov[0], timetype, self.version_db.boost_run_map )
208  if minIov is None or iov[0]<minIov:
209  minIov = iov[0]
210  logging.debug('iov: %s - inserted on %s - streamer: %s' %(iov[0],iov[1],iov[2]))
211  logging.debug('current tag boost version: %s minIov: %s' %(tagBoostVersion,minIov))
212  if lastBoost is None or lastBoost!=iovBoostVersion:
213  self.versionIovs.append((iov[0],iovBoostVersion))
214  lastBoost = iovBoostVersion
215 
216  if tagBoostVersion is None:
217  if niovs == 0:
218  logging.warning( 'No iovs found. boost version cannot be determined.')
219  return None, None
220  else:
221  logging.error('Could not determine the tag boost version.' )
222  return None, None
223  else:
224  if niovs == 0:
225  logging.info('Tag boost version has not changed.')
226  else:
227  msg = 'Found tag boost version %s ( min iov: %s ) combining payloads from %s iovs' %(tagBoostVersion,minIov,niovs)
228  if timeCut is not None:
229  if update:
230  msg += ' (iov insertion time>%s)' %str(timeCut)
231  else:
232  msg += ' (iov insertion time<%s)' %str(timeCut)
233  logging.info( msg )
234  return tagBoostVersion, minIov
235 
236  def validate_boost_version( self, t, timetype, tagBoostVersion ):
237  cursor = self.db.cursor()
238  cursor.execute('SELECT GT.NAME, GT.RELEASE, GT.SNAPSHOT_TIME FROM GLOBAL_TAG GT, GLOBAL_TAG_MAP GTM WHERE GT.NAME = GTM.GLOBAL_TAG_NAME AND GTM.TAG_NAME = :TAG_NAME',(t,))
239  rows = cursor.fetchall()
240  invalid_gts = []
241  ngt = 0
242  gts = []
243  for r in rows:
244  gts.append((r[0],r[1],r[2]))
245  if len(gts)>0:
246  logging.info('validating %s gts.' %len(gts))
247  boost_snapshot_map = {}
248  for gt in gts:
249  ngt += 1
250  logging.debug('Validating for GT %s (release %s)' %(gt[0],gt[1]))
251  gtCMSSWVersion = sm.check_cmssw_version( gt[1] )
252  gtBoostVersion = self.version_db.lookup_boost_in_cmssw( gtCMSSWVersion )
253  if sm.cmp_boost_version( gtBoostVersion, tagBoostVersion )<0:
254  logging.warning( 'The boost version computed from all the iovs in the tag (%s) is incompatible with the gt [%s] %s (consuming ver: %s, snapshot: %s)' %(tagBoostVersion,ngt,gt[0],gtBoostVersion,str(gt[2])))
255  if str(gt[2]) not in boost_snapshot_map.keys():
256  tagSnapshotBoostVersion = None
257  minIov = None
258  tagSnapshotBoostVersion, minIov = self.process_tag_boost_version(t, timetype, tagSnapshotBoostVersion, minIov, gt[2])
259  if tagSnapshotBoostVersion is not None:
260  boost_snapshot_map[str(gt[2])] = tagSnapshotBoostVersion
261  else:
262  continue
263  else:
264  tagSnapshotBoostVersion = boost_snapshot_map[str(gt[2])]
265  if sm.cmp_boost_version( gtBoostVersion, tagSnapshotBoostVersion )<0:
266  logging.error('The snapshot from tag used by gt %s (consuming ver: %s) has an incompatible combined boost version %s' %(gt[0],gtBoostVersion,tagSnapshotBoostVersion))
267  invalid_gts.append( ( gt[0], gtBoostVersion ) )
268  if len(invalid_gts)==0:
269  if ngt>0:
270  logging.info('boost version for the tag validated in %s referencing Gts' %(ngt))
271  else:
272  logging.info('No GT referencing this tag found.')
273  else:
274  logging.error( 'boost version for the tag is invalid.')
275  return invalid_gts
276 
277  def update_tag_boost_version_in_db( self, t, tagBoostVersion, minIov, update ):
278  cursor = self.db.cursor()
279  now = datetime.datetime.utcnow()
280  if update:
281  cursor.execute('UPDATE TAG_METADATA SET MIN_SERIALIZATION_V=:BOOST_V, MIN_SINCE=:MIN_IOV, MODIFICATION_TIME=:NOW WHERE TAG_NAME = :NAME',( tagBoostVersion,minIov,now,t))
282  else:
283  cursor.execute('INSERT INTO TAG_METADATA ( TAG_NAME, MIN_SERIALIZATION_V, MIN_SINCE, MODIFICATION_TIME ) VALUES ( :NAME, :BOOST_V, :MIN_IOV, :NOW )',(t, tagBoostVersion,minIov,now))
284  logging.info('Minimum boost version for the tag updated.')
285 
286  def update_tags( self ):
287  cursor = self.db.cursor()
288  self.version_db = version_db( self.db )
289  self.version_db.fetch_cmssw_boost_map()
290  self.version_db.fetch_boost_run_map()
291  tags = {}
292  wpars = ()
293  if self.args.name is not None:
294  stmt0 = 'SELECT NAME FROM TAG WHERE NAME = :TAG_NAME'
295  wpars = (self.args.name,)
296  cursor.execute(stmt0,wpars);
297  rows = cursor.fetchall()
298  found = False
299  for r in rows:
300  found = True
301  break
302  if not found:
303  raise Exception('Tag %s does not exists in the database.' %self.args.name )
304  tags[self.args.name] = None
305  stmt1 = 'SELECT MIN_SERIALIZATION_V, MIN_SINCE, CAST(MODIFICATION_TIME AS TIMESTAMP(0)) FROM TAG_METADATA WHERE TAG_NAME = :NAME'
306  cursor.execute(stmt1,wpars);
307  rows = cursor.fetchall()
308  for r in rows:
309  tags[self.args.name] = (r[0],r[1],r[2])
310  else:
311  stmt0 = 'SELECT NAME FROM TAG WHERE NAME NOT IN ( SELECT TAG_NAME FROM TAG_METADATA) ORDER BY NAME'
312  nmax = 100
313  if self.args.max is not None:
314  nmax = self.args.max
315  if self.args.all:
316  nmax = -1
317  if nmax >=0:
318  stmt0 = 'SELECT NAME FROM (SELECT NAME FROM TAG WHERE NAME NOT IN ( SELECT TAG_NAME FROM TAG_METADATA ) ORDER BY NAME) WHERE ROWNUM<= :MAXR'
319  wpars = (nmax,)
320  cursor.execute(stmt0,wpars);
321  rows = cursor.fetchall()
322  for r in rows:
323  tags[r[0]] = None
324  stmt1 = 'SELECT T.NAME NAME, TM.MIN_SERIALIZATION_V MIN_SERIALIZATION_V, TM.MIN_SINCE MIN_SINCE, CAST(TM.MODIFICATION_TIME AS TIMESTAMP(0)) MODIFICATION_TIME FROM TAG T, TAG_METADATA TM WHERE T.NAME=TM.TAG_NAME AND CAST(TM.MODIFICATION_TIME AS TIMESTAMP(0)) < (SELECT MAX(INSERTION_TIME) FROM IOV WHERE IOV.TAG_NAME=TM.TAG_NAME) ORDER BY NAME'
325  nmax = nmax-len(tags)
326  if nmax >=0:
327  stmt1 = 'SELECT NAME, MIN_SERIALIZATION_V, MIN_SINCE, MODIFICATION_TIME FROM (SELECT T.NAME NAME, TM.MIN_SERIALIZATION_V MIN_SERIALIZATION_V, TM.MIN_SINCE MIN_SINCE, CAST(TM.MODIFICATION_TIME AS TIMESTAMP(0)) MODIFICATION_TIME FROM TAG T, TAG_METADATA TM WHERE T.NAME=TM.TAG_NAME AND CAST(TM.MODIFICATION_TIME AS TIMESTAMP(0)) < (SELECT MAX(INSERTION_TIME) FROM IOV WHERE IOV.TAG_NAME=TM.TAG_NAME) ORDER BY NAME) WHERE ROWNUM<= :MAXR'
328  wpars = (nmax,)
329  cursor.execute(stmt1,wpars);
330  rows = cursor.fetchall()
331  i = 0
332  for r in rows:
333  i += 1
334  if nmax >=0 and i>nmax:
335  break
336  tags[r[0]] = (r[1],r[2],r[3])
337  logging.info( 'Processing boost version for %s tags' %len(tags))
338  count = 0
339  for t in sorted(tags.keys()):
340  count += 1
341  try:
342  update = False
343  cursor.execute('SELECT TIME_TYPE FROM TAG WHERE NAME= :TAG_NAME',(t,))
344  timetype = cursor.fetchone()[0]
345  self.iovs = None
346  logging.info('************************************************************************')
347  logging.info('Tag [%s] %s - timetype: %s' %(count,t,timetype))
348  tagBoostVersion = None
349  minIov = None
350  timeCut = None
351  if tags[t] is not None:
352  update = True
353  tagBoostVersion = tags[t][0]
354  minIov = tags[t][1]
355  timeCut = tags[t][2]
356  tagBoostVersion, minIov = self.process_tag_boost_version( t, timetype, tagBoostVersion, minIov, timeCut, self.args.validate )
357  if tagBoostVersion is None:
358  continue
359  logging.debug('boost versions in the %s iovs: %s' %(len(self.iovs),str(self.versionIovs)))
360  if self.args.validate:
361  invalid_gts = self.validate_boost_version( t, timetype, tagBoostVersion )
362  if len(invalid_gts)>0:
363  with open('invalid_tags_in_gts.txt','a') as error_file:
364  for gt in invalid_gts:
365  error_file.write('Tag %s (boost %s) is invalid for GT %s ( boost %s) \n' %(t,tagBoostVersion,gt[0],gt[1]))
366  if len(self.iovs):
367  if self.iovs[0][0]<minIov:
368  minIov = self.iovs[0]
369  self.update_tag_boost_version_in_db( t, tagBoostVersion, minIov, update )
370  self.db.commit()
371  except Exception as e:
372  logging.error(str(e))
373 
374  def insert_boost_run( self ):
375  cursor = self.db.cursor()
376  self.version_db = version_db( self.db )
377  if self.args.min_ts is None:
378  raise Exception("Run %s has not been found in the database - please provide an explicit TimeType value with the min_ts parameter ." %self.args.since )
379  self.version_db.insert_boost_run_range( self.args.since, self.args.label, self.args.min_ts )
380  self.db.commit()
381  logging.info('boost version %s inserted with since %s' %(self.args.label,self.args.since))
382 
383  def list_boost_run( self ):
384  cursor = self.db.cursor()
385  self.version_db = version_db( self.db )
386  self.version_db.fetch_boost_run_map()
387  headers = ['Run','Run start time','Boost Version','Insertion time']
388  print_table( headers, self.version_db.boost_run_map )
389 
391  cursor = self.db.cursor()
392  tag = self.args.tag_name
393  cursor.execute('SELECT TIME_TYPE FROM TAG WHERE NAME= :TAG_NAME',(tag,))
394  rows = cursor.fetchall()
395  timeType = None
396  t_modificationTime = None
397  for r in rows:
398  timeType = r[0]
399  if timeType is None:
400  raise Exception("Tag %s does not exist in the database." %tag)
401  cursor.execute('SELECT MAX(INSERTION_TIME) FROM IOV WHERE TAG_NAME= :TAG_NAME',(tag,))
402  rows = cursor.fetchall()
403  for r in rows:
404  t_modificationTime = r[0]
405  if t_modificationTime is None:
406  raise Exception("Tag %s does not have any iov stored." %tag)
407  logging.info('Tag %s - timetype: %s' %(tag,timeType))
408  cursor.execute('SELECT MIN_SERIALIZATION_V, MIN_SINCE, MODIFICATION_TIME FROM TAG_METADATA WHERE TAG_NAME= :TAG_NAME',(tag,))
409  rows = cursor.fetchall()
410  tagBoostVersion = None
411  minIov = None
412  v_modificationTime = None
413  for r in rows:
414  tagBoostVersion = r[0]
415  minIov = r[1]
416  v_modificationTime = r[2]
417  if v_modificationTime is not None:
418  if t_modificationTime > v_modificationTime:
419  logging.warning('The minimum boost version stored is out of date.')
420  else:
421  logging.info('The minimum boost version stored is up to date.')
422  mt = '-'
423  if v_modificationTime is not None:
424  mt = str(v_modificationTime)
425  r_tagBoostVersion = None
426  if self.args.rebuild or self.args.full:
427  self.version_db = version_db( self.db )
428  self.version_db.fetch_boost_run_map()
429  timeCut = None
430  logging.info('Calculating minimum boost version for the available iovs...')
431  r_tagBoostVersion, r_minIov = self.process_tag_boost_version( tag, timeType, tagBoostVersion, minIov, timeCut )
432  print('# Currently stored: %s (min iov:%s)' %(tagBoostVersion,minIov))
433  print('# Last update: %s' %mt)
434  print('# Last update on the iovs: %s' %str(t_modificationTime))
435  if self.args.rebuild or self.args.full:
436  print('# Based on the %s available IOVs: %s (min iov:%s)' %(len(self.iovs),r_tagBoostVersion,r_minIov))
437  if self.args.full:
438  headers = ['Run','Boost Version']
439  print_table( headers, self.versionIovs )
440 
441 import optparse
442 import argparse
443 
444 def main():
445  tool = conddb_tool()
446  parser = argparse.ArgumentParser(description='CMS conddb command-line tool for serialiation metadata. For general help (manual page), use the help subcommand.')
447  parser.add_argument('--db', type=str, help='The target database: pro ( for prod ) or dev ( for prep ). default=pro')
448  parser.add_argument("--auth","-a", type=str, help="The path of the authentication file")
449  parser.add_argument('--verbose', '-v', action='count', help='The verbosity level')
450  parser_subparsers = parser.add_subparsers(title='Available subcommands')
451  parser_update_tags = parser_subparsers.add_parser('update_tags', description='Update the existing tag headers with the boost version')
452  parser_update_tags.add_argument('--name', '-n', type=str, help='Name of the specific tag to process (default=None - in this case all of the tags will be processed.')
453  parser_update_tags.add_argument('--max', '-m', type=int, help='the maximum number of tags processed',default=100)
454  parser_update_tags.add_argument('--all',action='store_true', help='process all of the tags with boost_version = None')
455  parser_update_tags.add_argument('--validate',action='store_true', help='validate the tag/boost version under processing')
456  parser_update_tags.set_defaults(func=tool.update_tags,accessType='w')
457  parser_insert_boost_version = parser_subparsers.add_parser('insert', description='Insert a new boost version range in the run map')
458  parser_insert_boost_version.add_argument('--label', '-l',type=str, help='The boost version label',required=True)
459  parser_insert_boost_version.add_argument('--since', '-s',type=int, help='The since validity (run number)',required=True)
460  parser_insert_boost_version.add_argument('--min_ts', '-t',type=str, help='The since validity (Time timetype)', required=False)
461  parser_insert_boost_version.set_defaults(func=tool.insert_boost_run,accessType='w')
462  parser_list_boost_versions = parser_subparsers.add_parser('list', description='list the boost versions in the run map')
463  parser_list_boost_versions.set_defaults(func=tool.list_boost_run,accessType='r')
464  parser_show_version = parser_subparsers.add_parser('show_tag', description='Display the minimum boost version for the specified tag (the value stored, by default)')
465  parser_show_version.add_argument('tag_name',help='The name of the tag')
466  parser_show_version.add_argument('--rebuild','-r',action='store_true',default=False,help='Re-calculate the minimum boost versio ')
467  parser_show_version.add_argument('--full',action='store_true',default=False,help='Recalulate the minimum boost version, listing the versions in the iov sequence')
468  parser_show_version.set_defaults(func=tool.show_tag_boost_version,accessType='r')
469  args = parser.parse_args()
470  tool.args = args
471  if args.verbose >=1:
472  tool.logger.setLevel(logging.DEBUG)
473  tool.connect()
474  return args.func()
475  else:
476  try:
477  tool.connect()
478  sys.exit( args.func())
479  except Exception as e:
480  logging.error(e)
481  sys.exit(1)
482 
483 if __name__ == '__main__':
484  main()
def print_table(headers, table)
def lookup_boost_in_cmssw(self, cmssw_version)
def string_to_timestamp(sdt)
Definition: conddb_time.py:25
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def insert_cmssw_boost(self, cmssw_version, boost_version)
def validate_boost_version(self, t, timetype, tagBoostVersion)
def insert_boost_run_range(self, run, boost_version, min_ts)
Definition: main.py:1
#define str(s)
def process_tag_boost_version(self, t, timetype, tagBoostVersion, minIov, timeCut, validate)
def update_tag_boost_version_in_db(self, t, tagBoostVersion, minIov, update)