Skip to content
Snippets Groups Projects

revamp links added to dashboard

Merged Maciej Pawel Szymanski requested to merge maszyman-revamp-linkdashboard into master
1 file
+ 8
73
Compare changes
  • Side-by-side
  • Inline
+ 8
73
@@ -366,80 +366,15 @@ def main():
id_ver = 0
# add to dictionary path to lhcbpr dashboard
try:
active_applications = \
urlopen(
"https://lblhcbpr.cern.ch/api/active/applications/"
).read()
active_options = \
urlopen(
"https://lblhcbpr.cern.ch/api/options/"
).read()
versions_count = json.loads(urlopen("https://lblhcbpr.cern.ch/api/versions/").read())['count']
active_versions = \
urlopen(
"https://lblhcbpr.cern.ch/api/versions/?page="+str(versions_count//10+1)
).read()
# getting the id of the project
act_app = json.loads(active_applications)
while True:
for app in act_app['results']:
if app['name'] == (options.app_name).upper():
id_app = app['id']
break
if id_app > 0 or not act_app['next']:
break
act_app = json.loads(urlopen(act_app['next']).read())
# getting the id of the test options
act_opt = json.loads(active_options)
while True:
for opt in act_opt['results']:
if opt['description'] == options.opt_name:
id_opt = opt['id']
break
if id_opt > 0 or not act_opt['next']:
break
act_opt = json.loads(urlopen(act_opt['next']).read())
# getting the id of the versions (nightlies are assumed)
act_ver = json.loads(active_versions)
while True:
for version in act_ver['results']:
if version['version'] == options.app_version and \
version['application']['name'] == (options.app_name).upper():
id_ver = version['id']
break
if id_ver > 0 or not act_ver['previous']:
break
act_ver = json.loads(urlopen(act_ver['previous']).read())
except Exception as ex:
logger.warning('Problems with connection with LHCbPR api: %s', ex)
if options.app_name.startswith("Moore"):
dataDict['lhcbpr_url'] = "https://lblhcbpr.cern.ch/#/app/hlt"
elif options.app_name == 'Brunel' and "upgradeprchecker" in options.opt_name.lower():
dataDict['lhcbpr_url'] = "https://cern.ch/lhcbpr-hlt/PerfTests/UpgradeThroughput/PrChecker_"\
+ options.app_version\
+ "_"\
+ str(options.platform)\
+ "_"\
+ options.startTime.replace(' ', '_')
elif options.app_name == 'Brunel' and "throughput" in options.handlers.lower():
dataDict['lhcbpr_url'] = "https://cern.ch/lhcbpr-hlt/PerfTests/UpgradeThroughput/Throughput_"\
+ options.app_version\
+ "_"\
+ str(options.opt_name)\
+ "_"\
+ str(options.platform)\
+ "_"\
+ options.startTime.replace(' ', '_')
if options.app_name.startswith("Moore") and "throughput" in options.handlers.lower():
dataDict['lhcbpr_url'] = f"https://cern.ch/lhcbpr-hlt/" \
f"PerfTests/UpgradeThroughput/" \
f"Throughput_{options.app_version}_" \
f"{str(options.opt_name)}_" \
f"{str(options.platform)}_" \
f"{options.startTime.replace(' ', '_')}"
else:
# generic url to jobs module
dataDict['lhcbpr_url'] = \
"https://lblhcbpr.cern.ch/#/app/jobs/list?apps={0}&options={1}&withNightly&nightlyVersionNumber=100&versions={2}".format(id_app, id_opt, id_ver)
dataDict['lhcbpr_url'] = f"https://lblhcbpr.cern.ch/{options.app_name}"
if options.send:
try:
Loading