1 ===================================================
2 Presentation and Analytics Layer - Low Level Design
3 ===================================================
15 The presentation and analytics layer (PAL) is the fourth layer of CSIT
16 hierarchy. The model of presentation and analytics layer consists of four
17 sub-layers, from bottom to top:
19 - sL1 - Data - input data to be processed:
21 - Static content - .rst text files, .svg static figures, and other files
22 stored in the CSIT git repository.
23 - Data to process - .xml files generated by Jenkins jobs executing tests,
24 stored as robot results files (output.xml).
25 - Specification - .yaml file with the models of report elements (tables,
26 plots, layout, ...) generated by this tool. There is also the configuration
27 of the tool and the specification of input data (jobs and builds).
29 - sL2 - Data processing
31 - The data are read from the specified input files (.xml) and stored as
32 multi-indexed `pandas.Series <https://pandas.pydata.org/pandas-docs/stable/
33 generated/pandas.Series.html>`_.
34 - This layer provides also interface to input data and filtering of the input
37 - sL3 - Data presentation - This layer generates the elements specified in the
40 - Tables: .csv files linked to static .rst files
41 - Plots: .html files generated using plot.ly linked to static .rst files
43 - sL4 - Report generation - Sphinx generates required formats and versions:
46 - versions: minimal, full (TODO: define the names and scope of versions)
55 The report specification file defines which data is used and which outputs are
56 generated. It is human readable and structured. It is easy to add / remove /
57 change items. The specification includes:
59 - Specification of the environment
60 - Configuration of debug mode (optional)
61 - Specification of input data (jobs, builds, files, ...)
62 - Specification of the output
63 - What and how is generated
65 - How: specification of all properties and parameters
68 Structure of the specification file
69 '''''''''''''''''''''''''''''''''''
71 The specification file is organized as a list of dictionaries distinguished by
92 Each type represents a section. The sections "environment", "debug", "input" and
93 "output" are only once in the specification; "table" and "plot" can be there
96 Sections "debug", "table" and "plot" are optional.
98 Table(s) and plot(s) are referred as "elements" in this text. It is possible to
99 define and implement other elements if needed.
105 This section has these parts:
107 - type: "environment" - says that this is the section "environment"
108 - configuration - configuration of the PAL
109 - paths - paths used by the PAL
110 - urls - urls pointing to the data sources
111 - make-dirs - a list of the directories to be created by the PAL while
112 preparing the environment
113 - remove-dirs - a list of the directories to be removed while cleaning the
115 - build-dirs - a list of the directories where the results are stored
117 The structure of the section "Environment" is as follows (example):
120 | type: "environment"
123 | # If the section "type: debug" is missing, CFG[DEBUG] is set to 0.
127 | DIR[WORKING]: "_tmp"
128 | DIR[BUILD,HTML]: "_build"
129 | DIR[BUILD,LATEX]: "_build_latex"
130 | DIR[RST]: "../../../docs/report"
132 | DIR[WORKING,DATA]: "{DIR[WORKING]}/data"
134 | DIR[STATIC,VPP]: "{DIR[STATIC]}/vpp"
135 | DIR[STATIC,ARCH]: "{DIR[STATIC]}/archive"
136 | DIR[STATIC,TREND]: "{DIR[STATIC]}/trending"
138 | DIR[PLOT,DPDK]: "{DIR[WORKING]}/dpdk_plot"
140 | DIR[DTR]: "{DIR[RST]}/detailed_test_results"
141 | DIR[DTR,PERF,DPDK]: "{DIR[DTR]}/dpdk_performance_results"
142 | DIR[DTR,PERF,VPP]: "{DIR[DTR]}/vpp_performance_results"
143 | DIR[DTR,PERF,HC]: "{DIR[DTR]}/honeycomb_performance_results"
144 | DIR[DTR,FUNC,VPP]: "{DIR[DTR]}/vpp_functional_results"
145 | DIR[DTR,FUNC,HC]: "{DIR[DTR]}/honeycomb_functional_results"
146 | DIR[DTR,FUNC,NSHSFC]: "{DIR[DTR]}/nshsfc_functional_results"
147 | DIR[DTR,PERF,VPP,IMPRV]: "{DIR[RST]}/vpp_performance_tests/performance_improvements"
149 | DIR[DTC]: "{DIR[RST]}/test_configuration"
150 | DIR[DTC,PERF,VPP]: "{DIR[DTC]}/vpp_performance_configuration"
151 | DIR[DTC,FUNC,VPP]: "{DIR[DTC]}/vpp_functional_configuration"
153 | DIR[DTO]: "{DIR[RST]}/test_operational_data"
154 | DIR[DTO,PERF,VPP]: "{DIR[DTO]}/vpp_performance_operational_data"
156 | DIR[CSS_PATCH_FILE]: "{DIR[STATIC]}/theme_overrides.css"
159 | URL[JENKINS,CSIT]: "https://jenkins.fd.io/view/csit/job"
160 | URL[JENKINS,HC]: "https://jenkins.fd.io/view/hc2vpp/job"
163 | # List the directories which are created while preparing the environment.
164 | # All directories MUST be defined in "paths" section.
165 | - "DIR[WORKING,DATA]"
166 | - "DIR[STATIC,VPP]"
167 | - "DIR[STATIC,DPDK]"
168 | - "DIR[STATIC,ARCH]"
169 | - "DIR[STATIC,TREND]"
172 | - "DIR[BUILD,LATEX]"
175 | # List the directories which are deleted while cleaning the environment.
176 | # All directories MUST be defined in "paths" section.
180 | # List the directories where the results (build) is stored.
181 | # All directories MUST be defined in "paths" section.
182 | - "DIR[BUILD,HTML]"
183 | - "DIR[BUILD,LATEX]"
185 It is possible to use defined items in the definition of other items, e.g.:
187 | DIR[WORKING,DATA]: "{DIR[WORKING]}/data"
189 will be automatically changed to
191 | DIR[WORKING,DATA]: "_tmp/data"
197 This section is optional and it configures the debug mode. It is used if we
198 do not want to download data files and use local files instead of them.
200 If the debug mode is configured, the "input" section is ignored.
202 This section has these parts:
204 - type: "debug" - says that this is the section "debug"
207 - input-format - xml or zip
208 - extract - if "zip" is defined as the input format, this file is extracted
209 from the zip file, otherwise this parameter is ignored
211 - builds - list of builds which data is used. There must be defined the job
212 name as the key and then list of builds and their output files.
214 The structure of the section "Debug" is as follows (example):
219 | input-format: "xml" # zip or xml
220 | extract: "output.xml" # Only for zip
222 | # The files must be in the directory DIR[WORKING,DATA]
223 | csit-vpp-perf-1704-all:
226 | file: "{DIR[WORKING,DATA]}/csit-vpp-perf-1707-all__17__output.xml"
232 This section is mandatory if the debug mode is not used, and defines the data
233 which will be used to generate elements.
235 This section has these parts:
237 - type: "input" - says that this section is the "input"
238 - general - parameters common to all builds:
240 - file-name: file to be downloaded
241 - download-path: path to be added to url pointing to the file, e.g.:
242 "{job}/{build}/robot/report/*zip*/{filename}"; {job}, {build} and
243 {filename} are replaced by proper values defined in this section
244 - extract: file to be extracted from downloaded zip file, e.g.: "output.xml";
245 if xml file is downloaded, this parameter is ignored.
247 - builds - list of jobs (keys) and builds which output data will be downloaded
249 The structure of the section "Input" is as follows (example from 17.07 report):
252 | type: "input" # Ignored in the debug mode
254 | file-name: "robot-plugin.zip"
255 | download-path: "{job}/{build}/robot/report/*zip*/{filename}"
256 | extract: "output.xml"
258 | csit-vpp-perf-1707-all:
270 | csit-dpdk-perf-1704-all:
281 | csit-vpp-functional-1707-ubuntu1604-virl:
282 | - lastSuccessfulBuild
283 | hc2vpp-csit-perf-master-ubuntu1604:
286 | hc2vpp-csit-integration-1707-ubuntu1604:
287 | - lastSuccessfulBuild
288 | csit-nsh_sfc-verify-func-1707-ubuntu1604-virl:
290 | csit-vpp-perf-1704-all:
301 | csit-dpdk-perf-1704-all:
317 This section specifies which format(s) will be generated (html, pdf) and which
318 versions for each format will be generated.
320 This section has these parts:
322 - type: "output" - says that this section is the "output"
323 - format: html or pdf
324 - version: defined for each format separately
326 The structure of the section "Output" is as follows (example):
337 TODO: define the names of versions
340 Content of "minimal" version
341 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343 TODO: define the name and content of this version
349 This section defines a table to be generated. There can be 0 or more "table"
352 This section has these parts:
354 - type: "table" - says that this section defines a table
355 - algorithm: Algorithm which is used to generate the table. The other
356 parameters in this section must provide all information needed by the used
358 - template: (optional) a .csv file used as a template while generating the
360 - output-file-format: (optional) format of the output file.
361 - output-file: file which the table will be written to
362 - columns: specification of table columns
363 - data: Specify the jobs and builds which data is used to generate the table
364 - filter: filter based on tags applied on the input data
365 - parameters: Only these parameters will be put to the output data structure
367 The structure of the section "Table" is as follows (example):
371 | title: "Performance improvments"
372 | algoritm: "performance-improvements"
373 | template: "templates/tmpl_performance_improvements.csv"
374 | output-file-format: "csv"
375 | output-file: "{DIR[WORKING]}/path/to/my_table.csv"
378 | title: "VPP Functionality"
384 | title: "VPP-17.04 mean [Mpps]"
385 | data: "vpp 1704 performance mean"
387 | title: "VPP-17.07 mean [Mpps]"
388 | data: "vpp 1707 performance mean"
390 | title: "VPP-17.07 stdev [Mpps]"
391 | data: "vpp 1707 performance stdev"
393 | title: "17.04 to 17.07 change"
394 | data: "change-relative 4 5"
397 | csit-vpp-perf-1707-all:
401 | # Keep this formatting, the filter is enclosed with " (quotation mark) and
402 | # each tag is enclosed with ' (apostrophe).
403 | filter: "'64B' and '1T1C' and ('L2BDMACSTAT' or 'L2BDMACLRN' or 'L2XCFWD') and not 'VHOST'"
412 This section defines a plot to be generated. There can be 0 or more "plot"
415 This section has these parts:
417 - type: "plot" - says that this section defines a plot
418 - output-file-format: (optional) format of the output file.
419 - output-file: file which the plot will be written to
420 - plot-type: Type of the plot. The other parameters in this section must
421 provide all information needed by plot.ly to generate the plot. For example:
423 - x-axis: x-axis title
424 - y-axis: y-axis title
426 - data: Specify the jobs and builds which data is used to generate the plot
427 - filter: filter applied on the input data
429 The structure of the section "Plot" is as follows (example):
433 | plot-type: "performance-box" # box, line
434 | output-file-type: "html"
435 | output-file: "{DIR[WORKING]}/path/to/my_plot.html"
436 | plot-title: "plot title"
437 | x-axis: "x-axis title"
438 | y-axis: "y-axis title"
440 | csit-vpp-perf-1707-all:
452 | - "'64B' and 'BASE' and 'NDRDISC' and '1T1C' and ('L2BDMACSTAT' or 'L2BDMACLRN' or 'L2XCFWD') and not 'VHOST'"
458 - Manually created / edited files
459 - .rst files, static .csv files, static pictures (.svg), ...
460 - Stored in CSIT gerrit
462 No more details about the static content in this document.
468 The PAL processes tests results and other information produced by Jenkins jobs.
469 The data are now stored as robot results in Jenkins (TODO: store the data in
470 nexus) either as .zip and / or .xml files.
476 As the first step, the data are downloaded and stored locally (typically on a
477 Jenkins slave). If .zip files are used, the given .xml files are extracted for
480 Parsing of the .xml files is performed by a class derived from
481 "robot.api.ResultVisitor", only necessary methods are overridden. All and only
482 necessary data is extracted from .xml file and stored in a structured form.
484 The parsed data are stored as the multi-indexed pandas.Series data type. Its
485 structure is as follows:
493 "job name", "build", "metadata", "suites", "tests" are indexes to access the
520 Using indexes data["job 1 name"]["build 1"]["tests"] (e.g.:
521 data["csit-vpp-perf-1704-all"]["17"]["tests"]) we get a list of all tests with
524 Data will not be accessible directly using indexes, but using getters and
527 **Structure of metadata:**
530 | "version": "VPP version",
531 | "job": "Jenkins job name"
532 | "build": "Information about the build"
535 **Structure of suites:**
539 | "doc": "Suite 1 documentation"
542 | "doc": "Suite N documentation"
545 **Structure of tests:**
549 | "name": "Test name",
550 | "parent": "Name of the parent of the test",
551 | "tags": ["tag 1", "tag 2", "tag n"],
552 | "type": "PDR" | "NDR",
555 | "unit": "pps" | "bps" | "percentage"
564 | "50": { # Only for NDR
569 | "10": { # Only for NDR
581 | "50": { # Only for NDR
586 | "10": { # Only for NDR
593 | "lossTolerance": "lossTolerance" # Only for PDR
595 | "DUT1": " DUT1 VAT History",
596 | "DUT2": " DUT2 VAT History"
598 | "show-run": "Show Run"
604 Note: ID is the lowercase full path to the test.
610 The first step when generating an element is getting the data needed to
611 construct the element. The data are filtered from the processed input data.
613 The data filtering is based on:
618 - required data - only this data is included in the output.
620 WARNING: The filtering is based on tags, so be careful with tagging.
622 For example, the element which specification includes:
625 | csit-vpp-perf-1707-all:
637 | - "'64B' and 'BASE' and 'NDRDISC' and '1T1C' and ('L2BDMACSTAT' or 'L2BDMACLRN' or 'L2XCFWD') and not 'VHOST'"
639 will be constructed using data from the job "csit-vpp-perf-1707-all", all listed
640 builds and the tests which list of tags fulfils the condition specified in the
643 The output data structure for filtered test data is:
664 Data analytics part implements:
666 - methods to compute statistical data from the filtered input data
674 Generates the plots an tables according to the report models specified in
675 specification file. The elements are generated using algorithms and data
676 specified in their models.
681 - tables are generated by algorithms implemented in PAL, the model includes the
682 algorithm and all necessary information.
684 - generated tables are stored in specified directories and linked to .rst files
690 - `plot.ly <https://plot.ly/>`_ is currently used to generate plots, the model
691 includes the type of plot and all necessary information.
692 - output format: html
693 - generated plots are stored in specified directories and linked to .rst files
699 Report is generated using Sphinx and Read the docs template. PAL generates html
700 and pdf format. It is possible to define the content of report by specifying
701 the version (TODO: define the names and content of versions)
706 1. Read the specification
707 2. Read the input data
708 3. Process the input data
709 4. For element (plot, table) defined in specification:
711 a. Get the data needed to construct the element using a filter
712 b. Generate the element
715 5. Generate the report
716 6. Store the report (Nexus)
718 The process is model driven. The elements’ models (tables, plots and report
719 itself) are defined in the specification file. Script reads the elements’ models
720 from specification file and generates the elements.
722 It is easy to add elements to be generated, if a new kind of element is
723 required, only a new algorithm is implemented and integrated.