CSIT-1226: Fix bugs in pdf version 40/13940/10
authorTibor Frank <tifrank@cisco.com>
Fri, 3 Aug 2018 12:38:20 +0000 (14:38 +0200)
committerTibor Frank <tifrank@cisco.com>
Tue, 7 Aug 2018 06:47:08 +0000 (06:47 +0000)
Change-Id: I9c7abca28f98a581a8efb390c6ccf4f8937a958b
Signed-off-by: Tibor Frank <tifrank@cisco.com>
15 files changed:
docs/report/csit_framework_documentation/csit_design.rst
docs/report/csit_framework_documentation/index.rst [new file with mode: 0644]
docs/report/dpdk_performance_tests/index.rst [new file with mode: 0644]
docs/report/dpdk_performance_tests/overview.rst
docs/report/honeycomb_functional_tests/index.rst [new file with mode: 0644]
docs/report/index.html.template [moved from docs/report/index.rst with 68% similarity]
docs/report/index.pdf.template [new file with mode: 0644]
docs/report/introduction/index.rst [new file with mode: 0644]
docs/report/introduction/physical_testbeds.rst
docs/report/nsh_sfc_functional_tests/index.rst [new file with mode: 0644]
docs/report/vpp_functional_tests/index.rst [new file with mode: 0644]
docs/report/vpp_functional_tests/overview.rst
docs/report/vpp_performance_tests/index.rst [new file with mode: 0644]
docs/report/vpp_performance_tests/overview.rst
resources/tools/presentation/generator_report.py

index b0c5d4a..c18e4ea 100644 (file)
@@ -24,11 +24,12 @@ including CSIT framework is depicted in the figure below.
 
     .. raw:: latex
 
-       \begin{figure}[H]
-       \centering
-           \includesvg[width=0.90\textwidth]{../_tmp/src/csit_framework_documentation/csit_design_picture}
-           \label{fig:csit_design_picture}
-       \end{figure}
+        \begin{figure}[H]
+            \centering
+                \graphicspath{{../_tmp/src/csit_framework_documentation/}}
+                \includegraphics[width=0.90\textwidth]{csit_design_picture}
+                \label{fig:csit_design_picture}
+        \end{figure}
 
 .. only:: html
 
diff --git a/docs/report/csit_framework_documentation/index.rst b/docs/report/csit_framework_documentation/index.rst
new file mode 100644 (file)
index 0000000..0b3228d
--- /dev/null
@@ -0,0 +1,9 @@
+CSIT Framework Documentation
+============================
+
+.. toctree::
+
+    csit_design
+    csit_test_naming
+    pal_lld
+    csit_tag_description
diff --git a/docs/report/dpdk_performance_tests/index.rst b/docs/report/dpdk_performance_tests/index.rst
new file mode 100644 (file)
index 0000000..3aa3243
--- /dev/null
@@ -0,0 +1,11 @@
+DPDK Performance
+================
+
+.. toctree::
+
+    overview
+    csit_release_notes
+    packet_throughput_graphs/index
+    packet_latency_graphs/index
+    test_environment
+    documentation
index 81f5ed5..41881b8 100644 (file)
@@ -28,9 +28,10 @@ testbeds are shown in figures below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-2n-nic2nic}
-            \label{fig:logical-2n-nic2nic}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-2n-nic2nic}
+                \label{fig:logical-2n-nic2nic}
         \end{figure}
 
 .. only:: html
@@ -45,9 +46,10 @@ testbeds are shown in figures below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-3n-nic2nic}
-            \label{fig:logical-3n-nic2nic}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-3n-nic2nic}
+                \label{fig:logical-3n-nic2nic}
         \end{figure}
 
 .. only:: html
diff --git a/docs/report/honeycomb_functional_tests/index.rst b/docs/report/honeycomb_functional_tests/index.rst
new file mode 100644 (file)
index 0000000..ba0b8a0
--- /dev/null
@@ -0,0 +1,9 @@
+HoneyComb Functional
+====================
+
+.. toctree::
+
+    overview
+    csit_release_notes
+    test_environment
+    documentation
similarity index 68%
rename from docs/report/index.rst
rename to docs/report/index.html.template
index 40602c1..b5b55c0 100644 (file)
@@ -61,34 +61,32 @@ CSIT 18.07
     nsh_sfc_functional_tests/test_environment
     nsh_sfc_functional_tests/documentation
 
-.. only:: html
-
-    .. toctree::
-        :maxdepth: 2
-        :caption: Detailed Results
-
-        detailed_test_results/vpp_performance_results/index
-        detailed_test_results/vpp_mrr_results/index
-        detailed_test_results/cot_performance_results/index
-        detailed_test_results/dpdk_performance_results/index
-        detailed_test_results/vpp_functional_results/index
-        detailed_test_results/honeycomb_functional_results/index
-        detailed_test_results/nshsfc_functional_results/index
-
-    .. toctree::
-        :maxdepth: 2
-        :caption: Test Configuration
-
-        test_configuration/vpp_performance_configuration/index
-        test_configuration/vpp_mrr_configuration/index
-        test_configuration/cot_performance_configuration/index
-        test_configuration/vpp_functional_configuration/index
-
-    .. toctree::
-        :maxdepth: 2
-        :caption: Test Operational Data
-
-        test_operational_data/vpp_performance_operational_data/index
+.. toctree::
+    :maxdepth: 2
+    :caption: Detailed Results
+
+    detailed_test_results/vpp_performance_results/index
+    detailed_test_results/vpp_mrr_results/index
+    detailed_test_results/cot_performance_results/index
+    detailed_test_results/dpdk_performance_results/index
+    detailed_test_results/vpp_functional_results/index
+    detailed_test_results/honeycomb_functional_results/index
+    detailed_test_results/nshsfc_functional_results/index
+
+.. toctree::
+    :maxdepth: 2
+    :caption: Test Configuration
+
+    test_configuration/vpp_performance_configuration/index
+    test_configuration/vpp_mrr_configuration/index
+    test_configuration/cot_performance_configuration/index
+    test_configuration/vpp_functional_configuration/index
+
+.. toctree::
+    :maxdepth: 2
+    :caption: Test Operational Data
+
+    test_operational_data/vpp_performance_operational_data/index
 
 .. toctree::
     :maxdepth: 2
diff --git a/docs/report/index.pdf.template b/docs/report/index.pdf.template
new file mode 100644 (file)
index 0000000..54d9c7d
--- /dev/null
@@ -0,0 +1,14 @@
+CSIT 18.07
+==========
+
+.. toctree::
+    :numbered:
+
+    introduction/index
+    vpp_performance_tests/index
+    dpdk_performance_tests/index
+    vpp_functional_tests/index
+    honeycomb_functional_tests/index
+    nsh_sfc_functional_tests/index
+    csit_framework_documentation/index
+    indices
diff --git a/docs/report/introduction/index.rst b/docs/report/introduction/index.rst
new file mode 100644 (file)
index 0000000..7d4f4c0
--- /dev/null
@@ -0,0 +1,9 @@
+Introduction
+============
+
+.. toctree::
+
+    overview
+    general_notes
+    physical_testbeds
+    methodology
index c2cdd3e..454a751 100644 (file)
@@ -42,9 +42,10 @@ Physical testbed topology is depicted in a figure below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/introduction/testbed-3n-hsw}
-            \label{fig:testbed-3n-hsw}
+            \centering
+                \graphicspath{{../_tmp/src/introduction/}}
+                \includegraphics[width=0.90\textwidth]{testbed-3n-hsw}
+                \label{fig:testbed-3n-hsw}
         \end{figure}
 
 .. only:: html
@@ -94,9 +95,10 @@ processors. Physical testbed topology is depicted in a figure below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/introduction/testbed-3n-skx}
-            \label{fig:testbed-3n-skx}
+            \centering
+                \graphicspath{{../_tmp/src/introduction/}}
+                \includegraphics[width=0.90\textwidth]{testbed-3n-skx}
+                \label{fig:testbed-3n-skx}
         \end{figure}
 
 .. only:: html
@@ -146,9 +148,10 @@ processors. Physical testbed topology is depicted in a figure below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/introduction/testbed-2n-skx}
-            \label{fig:testbed-2n-skx}
+            \centering
+                \graphicspath{{../_tmp/src/introduction/}}
+                \includegraphics[width=0.90\textwidth]{testbed-2n-skx}
+                \label{fig:testbed-2n-skx}
         \end{figure}
 
 .. only:: html
diff --git a/docs/report/nsh_sfc_functional_tests/index.rst b/docs/report/nsh_sfc_functional_tests/index.rst
new file mode 100644 (file)
index 0000000..5e46717
--- /dev/null
@@ -0,0 +1,9 @@
+NSH_SFC Functional
+==================
+
+.. toctree::
+
+    overview
+    csit_release_notes
+    test_environment
+    documentation
diff --git a/docs/report/vpp_functional_tests/index.rst b/docs/report/vpp_functional_tests/index.rst
new file mode 100644 (file)
index 0000000..5c236e4
--- /dev/null
@@ -0,0 +1,9 @@
+VPP Functional
+==============
+
+.. toctree::
+
+    overview
+    csit_release_notes
+    test_environment
+    documentation
index 80c9131..035696d 100644 (file)
@@ -25,9 +25,10 @@ testbeds are shown in figures below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-2n-nic2nic}
-            \label{fig:logical-2n-nic2nic}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-2n-nic2nic}
+                \label{fig:logical-2n-nic2nic}
         \end{figure}
 
 .. only:: html
@@ -42,9 +43,10 @@ testbeds are shown in figures below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-3n-nic2nic}
-            \label{fig:logical-3n-nic2nic}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-3n-nic2nic}
+                \label{fig:logical-3n-nic2nic}
         \end{figure}
 
 .. only:: html
@@ -80,9 +82,10 @@ only. DUT (VPP) test topology with VM is shown in the figure below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-2n-vm-vhost}
-            \label{fig:logical-2n-vm-vhost}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-2n-vm-vhost}
+                \label{fig:logical-2n-vm-vhost}
         \end{figure}
 
 .. only:: html
@@ -97,9 +100,10 @@ only. DUT (VPP) test topology with VM is shown in the figure below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-3n-vm-vhost}
-            \label{fig:logical-3n-vm-vhost}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-3n-vm-vhost}
+                \label{fig:logical-3n-vm-vhost}
         \end{figure}
 
 .. only:: html
diff --git a/docs/report/vpp_performance_tests/index.rst b/docs/report/vpp_performance_tests/index.rst
new file mode 100644 (file)
index 0000000..abef2c8
--- /dev/null
@@ -0,0 +1,13 @@
+VPP Performance
+===============
+
+.. toctree::
+
+    overview
+    csit_release_notes
+    packet_throughput_graphs/index
+    throughput_speedup_multi_core/index
+    packet_latency_graphs/index
+    http_server_performance/index
+    test_environment
+    documentation/index
index bd0681d..7eb8235 100644 (file)
@@ -30,9 +30,10 @@ testbeds are shown in figures below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-2n-nic2nic}
-            \label{fig:logical-2n-nic2nic}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-2n-nic2nic}
+                \label{fig:logical-2n-nic2nic}
         \end{figure}
 
 .. only:: html
@@ -47,9 +48,10 @@ testbeds are shown in figures below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-3n-nic2nic}
-            \label{fig:logical-3n-nic2nic}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-3n-nic2nic}
+                \label{fig:logical-3n-nic2nic}
         \end{figure}
 
 .. only:: html
@@ -107,9 +109,10 @@ SUT running N of VM instances is shown in the figures below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-2n-vm-vhost}
-            \label{fig:logical-2n-vm-vhost}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-2n-vm-vhost}
+                \label{fig:logical-2n-vm-vhost}
         \end{figure}
 
 .. only:: html
@@ -124,9 +127,10 @@ SUT running N of VM instances is shown in the figures below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-3n-vm-vhost}
-            \label{fig:logical-3n-vm-vhost}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-3n-vm-vhost}
+                \label{fig:logical-3n-vm-vhost}
         \end{figure}
 
 .. only:: html
@@ -187,9 +191,10 @@ below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-2n-container-memif}
-            \label{fig:logical-2n-container-memif}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-2n-container-memif}
+                \label{fig:logical-2n-container-memif}
         \end{figure}
 
 .. only:: html
@@ -204,9 +209,10 @@ below.
     .. raw:: latex
 
         \begin{figure}[H]
-        \centering
-            \includesvg[width=0.90\textwidth]{../_tmp/src/vpp_performance_tests/logical-3n-container-memif}
-            \label{fig:logical-3n-container-memif}
+            \centering
+                \graphicspath{{../_tmp/src/vpp_performance_tests/}}
+                \includegraphics[width=0.90\textwidth]{logical-3n-container-memif}
+                \label{fig:logical-3n-container-memif}
         \end{figure}
 
 .. only:: html
index 287d078..dd200fa 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -148,11 +148,17 @@ def generate_html_report(release, spec, versions, report_version):
     logging.info("  Generating the html report, give me a few minutes, please "
                  "...")
 
+    working_dir = spec.environment["paths"]["DIR[WORKING,SRC]"]
+
+    cmd = 'cd {working_dir} && mv -f index.html.template index.rst'.\
+        format(working_dir=working_dir)
+    execute_command(cmd)
+
     cmd = HTML_BUILDER.format(
         release=release,
         report_version=report_version,
         date=datetime.datetime.utcnow().strftime('%m/%d/%Y %H:%M UTC'),
-        working_dir=spec.environment["paths"]["DIR[WORKING,SRC]"],
+        working_dir=working_dir,
         build_dir=spec.environment["paths"]["DIR[BUILD,HTML]"])
     execute_command(cmd)
 
@@ -183,16 +189,23 @@ def generate_pdf_report(release, spec, versions, report_version):
     logging.info("  Generating the pdf report, give me a few minutes, please "
                  "...")
 
-    convert_plots = "xvfb-run -a wkhtmltopdf {html} {pdf}.pdf"
+    working_dir = spec.environment["paths"]["DIR[WORKING,SRC]"]
+
+    cmd = 'cd {working_dir} && mv -f index.pdf.template index.rst'.\
+        format(working_dir=working_dir)
+    execute_command(cmd)
+
+    _convert_all_svg_to_pdf(spec.environment["paths"]["DIR[WORKING,SRC]"])
 
     # Convert PyPLOT graphs in HTML format to PDF.
+    convert_plots = "xvfb-run -a wkhtmltopdf {html} {pdf}"
     plots = get_files(spec.environment["paths"]["DIR[STATIC,VPP]"], "html")
     plots.extend(get_files(spec.environment["paths"]["DIR[STATIC,DPDK]"],
                            "html"))
     for plot in plots:
-        file_name = "{0}".format(plot.rsplit(".", 1)[0])
-        cmd = convert_plots.format(html=plot, pdf=file_name)
-        execute_command(cmd)
+        file_name = "{0}.pdf".format(plot.rsplit(".", 1)[0])
+        logging.info("Converting '{0}' to '{1}'".format(plot, file_name))
+        execute_command(convert_plots.format(html=plot, pdf=file_name))
 
     # Generate the LaTeX documentation
     build_dir = spec.environment["paths"]["DIR[BUILD,LATEX]"]
@@ -200,7 +213,7 @@ def generate_pdf_report(release, spec, versions, report_version):
         release=release,
         report_version=report_version,
         date=datetime.datetime.utcnow().strftime('%m/%d/%Y %H:%M UTC'),
-        working_dir=spec.environment["paths"]["DIR[WORKING,SRC]"],
+        working_dir=working_dir,
         build_dir=build_dir)
     execute_command(cmd)
 
@@ -242,3 +255,19 @@ def archive_report(spec):
                  base_dir=spec.environment["paths"]["DIR[BUILD,HTML]"])
 
     logging.info("  Done.")
+
+
+def _convert_all_svg_to_pdf(path):
+    """Convert all svg files on path "path" to pdf.
+
+    :param path: Path to the root directory with svg files to convert.
+    :type path: str
+    """
+
+    cmd = "inkscape -D -z --file={svg} --export-pdf={pdf} --export-latex"
+
+    svg_files = get_files(path, "svg", full_path=True)
+    for svg_file in svg_files:
+        pdf_file = "{0}.pdf".format(svg_file.rsplit('.', 1)[0])
+        logging.info("Converting '{0}' to '{1}'".format(svg_file, pdf_file))
+        execute_command(cmd.format(svg=svg_file, pdf=pdf_file))

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.