Skip to content

Commit e98ec3f

Browse files
authored
static-reports: Add README files and organize repository structure (zephyrproject-rtos#36)
Add directory structure and README files. Signed-off-by: Artur Wilczak <[email protected]>
1 parent 8e36024 commit e98ec3f

File tree

9 files changed

+160
-0
lines changed

9 files changed

+160
-0
lines changed
Loading
Loading
Loading

tools/static-twister-results-reporting/server-flask-app/.gitignore

Whitespace-only changes.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# FMOS static twister results reporting server - scripts
2+
3+
FMOS static twister results reporting server that web page for presenting results of twister run.
4+
All data are pulling from twister.json file stored in twister-out directory after twister ends tests.
5+
6+
Wiki page [link](https://wiki.ith.intel.com/display/timo/%5BDaily+Test%5D%3A+Static+Report+Setup+and+Daily+Test+Dashboard)
7+
8+
## Function Summary
9+
10+
**[platforms](//zep-fmos-static-reporting.igk.intel.com)** - show twister test results for all platforms loaded from twister.json file
11+
![Platforms.](/tools/static-twister-results-reporting/assets/images/print-screen-platforms.jpg)
12+
13+
**[platform](//zep-fmos-static-reporting.igk.intel.com/platform?p=frdm_k64f)** - show twister test results for the selected platform
14+
![Platform.](/tools/static-twister-results-reporting/assets/images/print-screen-platform.jpg)
15+
16+
**[components](//zep-fmos-static-reporting.igk.intel.com/components)** - show twister test result for components and subcomponents loaded from twister.json file
17+
![Components.](/tools/static-twister-results-reporting/assets/images/print-screen-components.jpg)
18+
19+
## Deployment
20+
21+
### Prepare the environment:
22+
23+
1. For server.
24+
25+
Create a project folder:
26+
```
27+
mkdir static-reporting
28+
cd static-reporting
29+
```
30+
31+
Clone files from github repository:
32+
`https://github.com/intel-innersource/os.rtos.zephyr.devops.ci/tree/main/tools/static-twister-results-reporting/server-flask-app`
33+
34+
Now let's verify app setting and set path to twister out data:
35+
Section # Paths settings in app/config_local.py file
36+
```
37+
DATA_PATH = r'/path/to/branches/directory/'
38+
```
39+
> [!NOTE]
40+
> Data layout for deployment on a server:
41+
> ```
42+
> DATA_PATH/
43+
> |-- branch_name/
44+
> | |-- run_date/
45+
> | | |-- twister_out/
46+
> | | | |-- twister.json
47+
> | |-- run_date2/
48+
> | | |-- twister_out/
49+
> | | | |-- twister.json
50+
> |-- branch_name_2/
51+
> | |-- run_date/
52+
> | | |-- twister_out/
53+
> | | | |-- twister.json
54+
> ```
55+
56+
Now let’s create and activate virtual environment:
57+
```
58+
python3 -m venv venv
59+
. venv/bin/activate
60+
```
61+
62+
Install requirements:
63+
```
64+
pip install -r requirements.txt
65+
```
66+
67+
Run run flask app:
68+
```
69+
flask run
70+
```
71+
72+
The output should be something like:
73+
```
74+
* Serving Flask app 'static_reports.py' (lazy loading)
75+
* Environment: production
76+
WARNING: This is a development server. Do not use it in a production deployment.
77+
Use a production WSGI server instead.
78+
* Debug mode: off
79+
* Running on all addresses.
80+
WARNING: This is a development server. Do not use it in a production deployment.
81+
* Running on http://192.168.0.2:8080/ (Press CTRL+C to quit)
82+
```
83+
84+
**Contacts: Artur Wilczak
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## App directory
2+
3+
This directory contains the Flask application code.
4+
The code has been organized into the following sub-directories:
5+
```
6+
# Sub-directories
7+
models # All models
8+
static # Static asset files that will be mapped to the "/static/" URL
9+
templates # Jinja2 HTML template files
10+
views # View functions
11+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## About
2+
3+
This theme is based on [Start Bootstrap - SB Admin 2](https://startbootstrap.com/theme/sb-admin-2/)
4+
Start Bootstrap is an open source library of free Bootstrap templates and themes. All of the free templates and themes on Start Bootstrap are released under the MIT license, which means you can use them for any purpose, even for commercial projects.
5+
6+
* <https://startbootstrap.com>
7+
* <https://twitter.com/SBootstrap>
8+
9+
Start Bootstrap was created by and is maintained by **[David Miller](https://davidmiller.io/)**.
10+
11+
* <https://davidmiller.io>
12+
* <https://twitter.com/davidmillerhere>
13+
* <https://github.com/davidtmiller>
14+
15+
Start Bootstrap is based on the [Bootstrap](https://getbootstrap.com/) framework created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thorton](https://twitter.com/fat).
16+
17+
## Copyright and License
18+
19+
Copyright 2023 FMOS Zephyr. Code released under the MIT license.
20+
Copyright 2013-2021 Start Bootstrap LLC. Code released under the [MIT](https://github.com/StartBootstrap/startbootstrap-resume/blob/master/LICENSE) license.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
> [!IMPORTANT]
2+
> Put here DataTables library
3+
> CDN:
4+
> `<link href="https://cdn.datatables.net/v/bs4/dt-1.13.8/datatables.min.css" rel="stylesheet">`
5+
> `<script src="https://cdn.datatables.net/v/bs4/dt-1.13.8/datatables.min.js"></script>`
6+
>
7+
> [Download](https://datatables.net/download/builder?bs4/dt-1.13.8)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# FMOS static twister results reporting server - scripts
2+
3+
FMOS static twister results reporting server that web page for presenting results of twister run.
4+
All data are pulling from twister.json file stored in twister-out directory after twister ends tests.
5+
6+
## Function Summary
7+
8+
1. backup-testresults-on-artifactory.sh -a <API key to X-JFrog-Artifactory> -s <path_to_all_test_results> -d <address_of_artifactory_folder>
9+
Script for uploading logs to the artifactory.
10+
11+
2. gh-api-download-artifacts.py
12+
This is a temporary script to pull daily test results from github CI. After merged the PR which include the new steps for pushing artifacts to static reporting server in workflow, this script will be sign as deprecated.
13+
14+
## Usage
15+
16+
For both scripts are set cron jobs
17+
18+
1. backup-testresults-on-artifactory.sh
19+
- 45 23 10 * * /usr/bin/backup-testresults-on-artifactory.sh -a <API key to X-JFrog-Artifactory> -s <path_to_all_test_results> -d <address_of_artifactory_folder> 2>&1
20+
1 - 9 day of month
21+
- 45 23 20 * * /usr/bin/backup-testresults-on-artifactory.sh -a <API key to X-JFrog-Artifactory> -s <path_to_all_test_results> -d <address_of_artifactory_folder> 2>&1
22+
10 - 19 day of month
23+
- 45 23 30 * * /usr/bin/backup-testresults-on-artifactory.sh -a <API key to X-JFrog-Artifactory> -s <path_to_all_test_results> -d <address_of_artifactory_folder> 2>&1
24+
20 - 29 day of month
25+
- 45 23 1 * * /usr/bin/backup-testresults-on-artifactory.sh -a <API key to X-JFrog-Artifactory> -s <path_to_all_test_results> -d <address_of_artifactory_folder> 2>&1
26+
30 - 31 day of month
27+
28+
2. gh-api-download-artifacts.py
29+
- 30 14 * * * python3 /usr/bin/gh-api-download-artifacts.py -b <branch_name> -w <all|hw|sim> -d <destination_dir_path> -t <GITHUB_TOKEN>
30+
31+
32+
## Deployment
33+
34+
These scripts must execute on a Static Reporting Server
35+
36+
**Important:** destination_dir_path must be exists.
37+
38+
**Contacts: Artur Wilczak

0 commit comments

Comments
 (0)