aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2020-03-15 18:58:46 +0100
committerTibor Frank <tifrank@cisco.com>2020-03-15 21:29:15 +0100
commitacd320f64d2049b2dfe6c4616d770383ff67f20d (patch)
treeb7a6c349c59deba12a01d132a4d7cf669920b0f4 /resources/tools/presentation
parentba0aefcc388c1bb11c55be33450cbc479e88cbb3 (diff)
PAL: Download .gz first
Change-Id: Ic83a63e5043ea1342b40e5b0aab189cfe24ba95c Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation')
-rw-r--r--resources/tools/presentation/input_data_files.py51
-rw-r--r--resources/tools/presentation/specification.yaml2
2 files changed, 19 insertions, 34 deletions
diff --git a/resources/tools/presentation/input_data_files.py b/resources/tools/presentation/input_data_files.py
index b1bb8cd20f..e1fa5b2284 100644
--- a/resources/tools/presentation/input_data_files.py
+++ b/resources/tools/presentation/input_data_files.py
@@ -17,6 +17,7 @@ Download all data.
import re
import logging
+import gzip
from os import rename, mkdir
from os.path import join
@@ -238,37 +239,10 @@ def download_and_unzip_data_file(spec, job, build, pid, log):
if not success:
- # Try to download .gz from docs.fd.io
-
- file_name = spec.input[u"file-name"]
- url = u"{0}/{1}".format(
- spec.environment[u"urls"][u"URL[NEXUS,DOC]"],
- spec.input[u"download-path"].format(
- job=job, build=build[u"build"], filename=file_name
- )
- )
- new_name = join(
- spec.environment[u"paths"][u"DIR[WORKING,DATA]"],
- f"{job}{SEPARATOR}{build[u'build']}{SEPARATOR}{file_name}"
- )
-
- logging.info(f"Downloading {url}")
-
- success, downloaded_name = _download_file(url, new_name, log, arch=arch)
-
- if not success:
-
- # Try to download .zip from docs.fd.io
-
- file_name = spec.input[u"zip-file-name"]
- new_name = join(
- spec.environment[u"paths"][u"DIR[WORKING,DATA]"],
- f"{job}{SEPARATOR}{build[u'build']}{SEPARATOR}{file_name}"
- )
+ # Try to download .gz or .zip from docs.fd.io
+ file_name = (spec.input[u"file-name"], spec.input[u"zip-file-name"])
release = re.search(REGEX_RELEASE, job).group(2)
- for rls in (release, u"master"):
- nexus_file_name = \
- f"{job}{SEPARATOR}{build[u'build']}{SEPARATOR}{file_name}"
+ for idx, rls in enumerate((release, u"master", )):
try:
rls = f"rls{int(rls)}"
except ValueError:
@@ -278,19 +252,30 @@ def download_and_unzip_data_file(spec, job, build, pid, log):
f"{spec.environment[u'urls'][u'URL[NEXUS,DOC]']}/"
f"{rls}/"
f"{spec.environment[u'urls'][u'DIR[NEXUS,DOC]']}/"
- f"{nexus_file_name}"
+ f"{job}{SEPARATOR}{build[u'build']}{SEPARATOR}{file_name[idx]}"
)
logging.info(f"Downloading {url}")
- success, downloaded_name = _download_file(url, new_name, log)
+ new_name = join(
+ spec.environment[u"paths"][u"DIR[WORKING,DATA]"],
+ f"{job}{SEPARATOR}{build[u'build']}{SEPARATOR}{file_name[idx]}"
+ )
+ success, downloaded_name = _download_file(
+ url, new_name, log, arch=arch
+ )
if success:
+ file_name = file_name[idx]
+ if file_name.endswith(u".gz"):
+ with gzip.open(downloaded_name[:-3], u"rb") as gzip_file:
+ file_content = gzip_file.read()
+ with open(downloaded_name[:-3], u"wb") as xml_file:
+ xml_file.write(file_content)
break
if not success:
# Try to download .zip from jenkins.fd.io
-
file_name = spec.input[u"zip-file-name"]
download_path = spec.input[u"zip-download-path"]
if job.startswith(u"csit-"):
diff --git a/resources/tools/presentation/specification.yaml b/resources/tools/presentation/specification.yaml
index 6d65874fd4..0febbc9575 100644
--- a/resources/tools/presentation/specification.yaml
+++ b/resources/tools/presentation/specification.yaml
@@ -3237,7 +3237,7 @@
reference:
title: "rls1908 xxv710"
data: "vpp-performance-changes-2n-skx-ref"
-# data-replacement: "replacement-1908-vpp-throughput-lat-tsa-2n-skx-vhost"
+ data-replacement: "replacement-1908-vpp-throughput-lat-tsa-2n-skx-vhost"
nic: "NIC_Intel-XXV710"
compare:
title: "rls2001 xxv710"