aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2017-08-02 11:34:42 +0200
committerPeter Mikus <pmikus@cisco.com>2017-08-02 12:37:32 +0200
commitbbcaa22c4425c32c3e3d2bcde434cdefc6b9a992 (patch)
tree79744d45bf4b5cb937f57d93fc9982605ded1e91 /resources/tools
parent1a65bb060fb464ea0113ec082af66fce481c7773 (diff)
CSIT-744 Update report content for proper parsing
Follow the good practices for formatting. Update the content of release report RST files to use the proper directives like :cite:, :footnote:, :abbr:, :captions: etc.With these markings we will be able to format output in proper way and style it in various sphinx output builders. Change-Id: Ibbb538d43c3bd364a6acdcc990097a477f49de00 Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/tools')
-rw-r--r--resources/tools/report_gen/conf.py21
-rw-r--r--resources/tools/report_gen/run_plot.py1
-rw-r--r--resources/tools/report_gen/run_report.cfg9
-rwxr-xr-xresources/tools/report_gen/run_report.sh87
4 files changed, 63 insertions, 55 deletions
diff --git a/resources/tools/report_gen/conf.py b/resources/tools/report_gen/conf.py
index 87120a5baf..099e66de70 100644
--- a/resources/tools/report_gen/conf.py
+++ b/resources/tools/report_gen/conf.py
@@ -108,8 +108,6 @@ pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
-# pdf_documents = [('index', u'rst2pdf', u'Sample rst2pdf doc', u'Your Name'),]
-
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -143,7 +141,7 @@ latex_engine = 'pdflatex'
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
- #'papersize': 'a4paper',
+ 'papersize': 'a4paper',
# The font size ('10pt', '11pt' or '12pt').
#
@@ -163,6 +161,12 @@ latex_elements = {
#
'figure_align': 'H',
+ # Latex font setup
+ #
+ 'fontpkg': r'''
+ \renewcommand{\familydefault}{\sfdefault}
+ ''',
+
# Latex other setup
#
'extraclassoptions': 'openany',
@@ -173,9 +177,6 @@ latex_elements = {
shadowsep=0pt,
shadowsize=0pt,
shadowrule=0pt
- ''',
- 'fontpkg': r'''
- \renewcommand{\familydefault}{\sfdefault}
'''
}
@@ -183,19 +184,19 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- (master_doc, 'csit.tex', u'CSIT Report',
+ (master_doc, 'csit.tex', u'CSIT REPORT',
u'', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#
-latex_logo = 'fdio.pdf'
+# latex_logo = 'fdio.pdf'
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#
-latex_use_parts = True
+# latex_use_parts = True
# If true, show page references after internal links.
#
@@ -203,7 +204,7 @@ latex_show_pagerefs = True
# If true, show URL addresses after external links.
#
-# latex_show_urls = False
+latex_show_urls = 'footnote'
# Documents to append as an appendix to all manuals.
#
diff --git a/resources/tools/report_gen/run_plot.py b/resources/tools/report_gen/run_plot.py
index 98fc2baecc..0a95396ac9 100644
--- a/resources/tools/report_gen/run_plot.py
+++ b/resources/tools/report_gen/run_plot.py
@@ -200,6 +200,7 @@ def main():
name=str(i+1)+'. '+suite.lower().replace('-ndrdisc',''),
hoverinfo='x+y',
boxpoints='outliers',
+ whiskerwidth=0,
))
elif args.plot == 'scatter':
traces.append(plgo.Scatter(
diff --git a/resources/tools/report_gen/run_report.cfg b/resources/tools/report_gen/run_report.cfg
index 3ff9e605a5..b35f490e50 100644
--- a/resources/tools/report_gen/run_report.cfg
+++ b/resources/tools/report_gen/run_report.cfg
@@ -7,13 +7,18 @@ declare -r FALSE=1
typeset -A DIR
typeset -A URL
typeset -A JOB
+typeset -A CFG
+
+CFG[DEBUG]=0
+CFG[BLD_LATEX]=1
+CFG[BLD_HTML]=1
DIR[WORKING]=_tmp
-DIR[BUILD]=_build
+DIR[BUILD,HTML]=_build
DIR[BUILD,LATEX]=_build_latex
DIR[RST]=../../../docs/report
-DIR[STATIC]=${DIR[BUILD]}/_static
+DIR[STATIC]=${DIR[BUILD,HTML]}/_static
DIR[STATIC,VPP]=${DIR[STATIC]}/vpp
DIR[STATIC,DPDK]=${DIR[STATIC]}/dpdk
DIR[STATIC,ARCH]=${DIR[STATIC]}/archive
diff --git a/resources/tools/report_gen/run_report.sh b/resources/tools/report_gen/run_report.sh
index bf6d5844dd..597cff055a 100755
--- a/resources/tools/report_gen/run_report.sh
+++ b/resources/tools/report_gen/run_report.sh
@@ -2,19 +2,26 @@
set -x
-# Process parameters
-# Debugging
-DEBUG=0
-# Latex Builder
-LATEX=0
+# Script directory
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+# Get actual date
+DATE=$(date -u '+%d-%b-%Y')
+# Load configuration
+source ${SCRIPT_DIR}/run_report.cfg
+
+# Process parameters
for i in "$@"; do
case $i in
--debug)
- DEBUG=1
+ CFG[DEBUG]=1
+ ;;
+ --no_latex)
+ CFG[BLD_LATEX]=0
;;
- --latex)
- LATEX=1
+ --no_html)
+ CFG[BLD_HTML]=0
;;
*)
# unknown option
@@ -22,20 +29,11 @@ case $i in
esac
done
-# Script directory
-SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-# Get actual date
-DATE=$(date -u '+%d-%b-%Y')
-
-# Load configuration
-source ${SCRIPT_DIR}/run_report.cfg
-
# Install system dependencies
sudo apt-get -y update
sudo apt-get -y install libxml2 libxml2-dev libxslt-dev build-essential \
zlib1g-dev unzip
-if [[ ${LATEX} -eq 1 ]] ;
+if [[ ${CFG[BLD_LATEX]} -eq 1 ]] ;
then
sudo apt-get -y install librsvg2-bin texlive-latex-recommended \
texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra latexmk wkhtmltopdf
@@ -47,7 +45,7 @@ trap 'rm -rf ${DIR[WORKING]}; exit' EXIT
trap 'rm -rf ${DIR[WORKING]}; exit' ERR
# Remove the old build
-rm -rf ${DIR[BUILD]} || true
+rm -rf ${DIR[BUILD,HTML]} || true
rm -rf ${DIR[BUILD,LATEX]} || true
rm -rf ${DIR[WORKING]} || true
@@ -74,7 +72,7 @@ mkdir -p ${DIR[PLOT,DPDK]}
### VPP PERFORMANCE SOURCE DATA
-#if [[ ${DEBUG} -eq 1 ]] ;
+#if [[ ${CFG[DEBUG]} -eq 1 ]] ;
# cp ./${JOB[PERF,VPP]}-${JOB[PERF,VPP,FBLD]}.zip ${DIR[STATIC,ARCH]}/${JOB[PERF,VPP]}-${JOB[PERF,VPP,FBLD]}.zip
#fi
@@ -82,13 +80,13 @@ blds=${JOB[PERF,VPP,BLD]}
for i in ${blds[@]}; do
curl --silent ${URL[JENKINS,CSIT]}/${JOB[PERF,VPP]}/${i}/robot/report/output_perf_data.xml \
--output ${DIR[PLOT,VPP]}/${JOB[PERF,VPP]}-${i}.xml
- if [[ ${DEBUG} -eq 0 ]] ;
+ if [[ ${CFG[DEBUG]} -eq 0 ]] ;
then
curl --fail --silent ${URL[JENKINS,CSIT]}/${JOB[PERF,VPP]}/${i}/robot/report/\*zip\*/robot-plugin.zip \
--output ${DIR[STATIC,ARCH]}/${JOB[PERF,VPP]}-${i}.zip
fi
done
-if [[ ${DEBUG} -eq 0 ]] ;
+if [[ ${CFG[DEBUG]} -eq 0 ]] ;
then
curl --fail --silent ${URL[JENKINS,CSIT]}/${JOB[PERF,VPP]}/${JOB[PERF,VPP,FBLD]}/robot/report/\*zip\*/robot-plugin.zip \
--output ${DIR[STATIC,ARCH]}/${JOB[PERF,VPP]}-${JOB[PERF,VPP,FBLD]}.zip
@@ -103,7 +101,7 @@ done
### DPDK PERFORMANCE SOURCE DATA
-#if [[ ${DEBUG} -eq 1 ]] ;
+#if [[ ${CFG[DEBUG]} -eq 1 ]] ;
# cp ./${JOB[PERF,DPDK]}-${JOB[PERF,DPDK,FBLD]}.zip ${DIR[STATIC,ARCH]}/${JOB[PERF,DPDK]}-${JOB[PERF,DPDK,FBLD]}.zip
#fi
@@ -111,7 +109,7 @@ blds=${JOB[PERF,DPDK,BLD]}
for i in ${blds[@]}; do
curl --silent ${URL[JENKINS,CSIT]}/${JOB[PERF,DPDK]}/${i}/robot/report/output_perf_data.xml \
--output ${DIR[PLOT,DPDK]}/${JOB[PERF,DPDK]}-${i}.xml
- if [[ ${DEBUG} -eq 0 ]] ;
+ if [[ ${CFG[DEBUG]} -eq 0 ]] ;
then
curl --fail --silent ${URL[JENKINS,CSIT]}/${JOB[PERF,DPDK]}/${i}/robot/report/\*zip\*/robot-plugin.zip \
--output ${DIR[STATIC,ARCH]}/${JOB[PERF,DPDK]}-${i}.zip
@@ -121,11 +119,11 @@ cp ${DIR[PLOT,DPDK]}/* ${DIR[STATIC,TREND]}
### FUNCTIONAL SOURCE DATA
-#if [[ ${DEBUG} -eq 1 ]] ;
+#if [[ ${CFG[DEBUG]} -eq 1 ]] ;
# cp ./${JOB[FUNC,VPP]}-${JOB[FUNC,VPP,BLD]}.zip ${DIR[STATIC,ARCH]}/${JOB[FUNC,VPP]}-${JOB[FUNC,VPP,BLD]}.zip
#fi
-if [[ ${DEBUG} -eq 0 ]] ;
+if [[ ${CFG[DEBUG]} -eq 0 ]] ;
then
curl --fail --silent ${URL[JENKINS,CSIT]}/${JOB[FUNC,VPP]}/${JOB[FUNC,VPP,BLD]}/robot/report/\*zip\*/robot-plugin.zip \
--output ${DIR[STATIC,ARCH]}/${JOB[FUNC,VPP]}-${JOB[FUNC,VPP,BLD]}.zip
@@ -133,11 +131,11 @@ fi
### HONEYCOMB FUNCTIONAL SOURCE DATA
-#if [[ ${DEBUG} -eq 1 ]] ;
+#if [[ ${CFG[DEBUG]} -eq 1 ]] ;
# cp ./${JOB[FUNC,HC]}-${JOB[FUNC,HC,BLD]}.zip ${DIR[STATIC,ARCH]}/${JOB[FUNC,HC]}-${JOB[FUNC,HC,BLD]}.zip
#fi
-if [[ ${DEBUG} -eq 0 ]] ;
+if [[ ${CFG[DEBUG]} -eq 0 ]] ;
then
curl --fail --silent ${URL[JENKINS,HC]}/${JOB[FUNC,HC]}/${JOB[FUNC,HC,BLD]}/robot/report/\*zip\*/robot-plugin.zip \
--output ${DIR[STATIC,ARCH]}/${JOB[FUNC,HC]}-${JOB[FUNC,HC,BLD]}.zip
@@ -145,11 +143,11 @@ fi
### HONEYCOMB PERFORMANCE SOURCE DATA
-#if [[ ${DEBUG} -eq 1 ]] ;
+#if [[ ${CFG[DEBUG]} -eq 1 ]] ;
# cp ./${JOB[PERF,HC]}-${JOB[PERF,HC,BLD]}.zip ${DIR[STATIC,ARCH]}/${JOB[PERF,HC]}-${JOB[PERF,HC,BLD]}.zip
#fi
-if [[ ${DEBUG} -eq 0 ]] ;
+if [[ ${CFG[DEBUG]} -eq 0 ]] ;
then
blds=${JOB[PERF,HC,BLD]}
for i in ${blds[@]}; do
@@ -160,11 +158,11 @@ fi
### NSH_SFC SOURCE DATA
-#if [[ ${DEBUG} -eq 1 ]] ;
+#if [[ ${CFG[DEBUG]} -eq 1 ]] ;
# cp ./${JOB[FUNC,NSH]}-${JOB[FUNC,NSH,BLD]}.zip ${DIR[STATIC,ARCH]}/${JOB[FUNC,NSH]}-${JOB[FUNC,NSH,BLD]}.zip
#fi
-if [[ ${DEBUG} -eq 0 ]] ;
+if [[ ${CFG[DEBUG]} -eq 0 ]] ;
then
curl --fail --silent ${URL[JENKINS,CSIT]}/${JOB[FUNC,NSH]}/${JOB[FUNC,NSH,BLD]}/robot/report/\*zip\*/robot-plugin.zip \
--output ${DIR[STATIC,ARCH]}/${JOB[FUNC,NSH]}-${JOB[FUNC,NSH,BLD]}.zip
@@ -172,7 +170,7 @@ fi
# Data post processing
-if [[ ${DEBUG} -eq 0 ]] ;
+if [[ ${CFG[DEBUG]} -eq 0 ]] ;
then
# VPP PERF
unzip -o ${DIR[STATIC,ARCH]}/${JOB[PERF,VPP]}-${JOB[PERF,VPP,FBLD]}.zip -d ${DIR[WORKING]}/
@@ -224,7 +222,7 @@ then
fi
# Generate tables for performance improvements
-if [[ ${DEBUG} -eq 0 ]] ;
+if [[ ${CFG[DEBUG]} -eq 0 ]] ;
then
python run_improvments_tables.py \
--input ${DIR[DTR,PERF,VPP,IMPRV]} \
@@ -578,12 +576,14 @@ python run_plot.py --input ${DIR[PLOT,DPDK]} \
--xpath '//*[@framesize="64B" and contains(@tags,"BASE") and contains(@tags,"NDRDISC") and contains(@tags,"2T2C") and contains(@tags,"IP4FWD")]' --latency lat_50
# HTML BUILDER
-sphinx-build -v -c . -a -b html -E \
- -D release=$1 -D version="$1 report - $DATE" \
- ${DIR[RST]} ${DIR[BUILD]}/
+if [[ ${CFG[BLD_HTML]} -eq 1 ]] ;
+then
+ sphinx-build -v -c . -a -b html -E \
+ -D release=$1 -D version="$1 report - $DATE" \
+ ${DIR[RST]} ${DIR[BUILD,HTML]}/
-# Patch the CSS for tables layout
-cat - > ${DIR[CSS_PATCH_FILE]} <<"_EOF"
+ # Patch the CSS for tables layout
+ cat - > ${DIR[CSS_PATCH_FILE]} <<"_EOF"
/* override table width restrictions */
@media screen and (min-width: 767px) {
.wy-table-responsive table td, .wy-table-responsive table th {
@@ -598,9 +598,10 @@ cat - > ${DIR[CSS_PATCH_FILE]} <<"_EOF"
}
}
_EOF
+fi
# LATEX BUILDER
-if [[ ${LATEX} -eq 1 ]] ;
+if [[ ${CFG[BLD_LATEX]} -eq 1 ]] ;
then
# Convert PyPLOT graphs in HTML format to PDF.
for f in ${DIR[STATIC,VPP]}/*; do
@@ -609,7 +610,7 @@ then
for f in ${DIR[STATIC,DPDK]}/*; do
wkhtmltopdf ${f} ${f%.html}.pdf
done
- rsvg-convert -z 10 -f pdf -o fdio.pdf fdio.svg
+ #rsvg-convert -z 10 -f pdf -o fdio.pdf fdio.svg
# Generate the LaTeX documentation
sphinx-build -v -c . -a -b latex -E \
@@ -620,9 +621,9 @@ then
pdflatex -interaction nonstopmode csit.tex || true
cp csit.pdf ../${DIR[STATIC,ARCH]}/csit_$1.pdf
cd ${SCRIPT_DIR}
- rm -f fdio.pdf
+ #rm -f fdio.pdf
fi
# Create archive
echo Creating csit.report.tar.gz ...
-tar -czvf ./csit.report.tar.gz ${DIR[BUILD]}
+tar -czvf ./csit.report.tar.gz ${DIR[BUILD,HTML]}