Skip to content

Commit

Permalink
Merge pull request #132 from asam-ev/2024-08-21
Browse files Browse the repository at this point in the history
Add multiple improvements
  • Loading branch information
andreaskern74 authored Aug 22, 2024
2 parents 95e875f + 2eb7f3b commit e89c544
Show file tree
Hide file tree
Showing 62 changed files with 1,057 additions and 901 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/build-on-change-linux-bare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ on:
- runtime/**
- docker/**

workflow_dispatch: # Allows manual triggering of the workflow

jobs:
build-linux:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04

env:
TEST_ENABLED: ${{ github.event_name == 'pull_request' && 'ON' || 'OFF' }}
steps:
Expand Down Expand Up @@ -70,14 +73,29 @@ jobs:
echo Building framework...
cmake -G "Unix Makefiles" -B./build -S . \
-DCMAKE_INSTALL_PREFIX="/home/$(whoami)/qc-build" \
-DENABLE_FUNCTIONAL_TESTS=$TEST_ENABLED -DXERCES_ROOT="/usr" \
-DENABLE_FUNCTIONAL_TESTS=$TEST_ENABLED \
-DQt5_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5/" \
-DQt5XmlPatterns_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5XmlPatterns/"
cmake --build ./build --target install --config Release -j4
cmake --install ./build
echo Done.
shell: bash

- name: Prepare build artifacts
run: |
sudo chmod -R +x ./build/src/
shell: bash

- name: Archive release binaries
shell: bash
run: mkdir artifacts && cp ./build/src/result_pooling/ResultPooling ./build/src/report_modules/report_module_text/TextReport ./build/src/report_modules/report_module_github_ci/GithubCIReport ./build/src/report_modules/report_module_gui/ReportGUI artifacts/

- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: qc-framework-executables-ubuntu
path: artifacts

- name: Unit test execution
if: github.event_name == 'pull_request'
run: |
Expand All @@ -92,7 +110,7 @@ jobs:
if: github.event_name == 'pull_request' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: unit-test-report
name: unit-test-report-ubuntu
path: ${{ github.workspace }}/build/Testing/Temporary/LastTest.log

- name: Runtime test execution
Expand All @@ -109,5 +127,5 @@ jobs:
if: github.event_name == 'pull_request' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: runtime-test-report
name: runtime-test-report-ubuntu
path: ${{ github.workspace }}/runtime/runtime_test.log
17 changes: 17 additions & 0 deletions .github/workflows/build-on-change-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ on:
- runtime/**
- docker/**

workflow_dispatch: # Allows manual triggering of the workflow

jobs:
build-windows:
runs-on: windows-2019
Expand Down Expand Up @@ -114,6 +116,21 @@ jobs:
Write-Output "All installations and setups are complete!"
shell: pwsh

- name: Archive release binaries
run: |
mkdir artifacts
copy .\build\src\result_pooling\Release\ResultPooling.exe .\artifacts\
copy .\build\src\report_modules\report_module_text\Release\TextReport.exe .\artifacts\
copy .\build\src\report_modules\report_module_github_ci\Release\GithubCIReport.exe .\artifacts\
copy .\build\src\report_modules\report_module_gui\Release\ReportGUI.exe .\artifacts\
shell: cmd

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: qc-framework-executables-windows
path: artifacts

- name: Unit test execution
if: github.event_name == 'pull_request'
run: |
Expand Down
73 changes: 27 additions & 46 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

# How-to Build and Install

The ASAM Quality Checker Framework runs on Linux and Windows. The framework consists of both C++ and Python components.
The ASAM Quality Checker Framework runs on Linux and Windows. The framework consists of both C++ and Python modules.

## Toolchain

Expand All @@ -17,7 +17,7 @@ The ASAM Quality Checker Framework runs on Linux and Windows. The framework cons
- CMake 3.16 or newer
- Python 3.10 or newer (otherwise, Conda can be used to install Python 3.10 or newer)

## 3rd Party Dependencies for C++ Components
## 3rd Party Dependencies for C++ Modules

- Xerces-C++
- Qt 5
Expand All @@ -44,7 +44,7 @@ apt update && apt install -y \
git
```

## Build C++ components
## Build and install C++ modules

- Use CMakeLists.txt within the main directory as source directory
- Do not forget to set `CMAKE_INSTALL_PREFIX`
Expand Down Expand Up @@ -74,8 +74,7 @@ $ cmake -G "Visual Studio 16 2019" -A "x64" -T "v142" -B../build -S. ^
-DENABLE_FUNCTIONAL_TESTS=ON ^
-DGTest_ROOT="<gtest_root>" ^
-DASAM_OPENDRIVE_XSD_DIR="<asam_opendrive_xsd_dir>" ^
-DASAM_OPENSCENARIO_XSD_DIR="<asam_openscenario_xsd_dir>" ^
-DXERCES_ROOT="<xerces_c_root>" ^
-DASAM_OPENSCENARIO_XSD_DIR="<asam_openscenario_xsd_dir>" ^
-DQt5_ROOT="<qt5_root>"
$ cmake --build ../build --target ALL_BUILD --config Release
$ ctest --test-dir ../build -C Release
Expand All @@ -101,90 +100,72 @@ With the following CMake values:
| ---- | ----- | ----------- | ------- |
| ENABLE_FUNCTIONAL_TESTS | ON/OFF | choose whether the tests were created in the building process of the libraries or not | dependency to a valid gtest package needed (see <https://github.com/google/googletest>) |

## Setup Virtual Environment for Python Components
## Setup Virtual Environment for Python Modules

Virtual environment for Python components can be setup with both [virtualenv](https://docs.python.org/3/library/venv.html) (if Python 3.10 or newer is available on your computer) and [Conda](https://docs.anaconda.com/miniconda/) (if Python 3.10 or newer is not available on your computer).
We recommend installing Python modules in a virtual environment. Virtual environment for Python modules can be setup with both [virtualenv](https://docs.python.org/3/library/venv.html) (if Python 3.10 or newer is available on your computer) and [Conda](https://docs.anaconda.com/miniconda/) (if Python 3.10 or newer is not available on your computer).

Using Virtualenv:

```bash
python3 -m venv runtime-venv
source runtime-venv/bin/activate
python3 -m pip install --no-cache-dir -r runtime/requirements.txt
```

Using Conda:

```bash
conda create -y -n runtime-venv python=3.10
conda activate runtime-venv
python3 -m pip install --no-cache-dir -r runtime/requirements.txt
```

## Install ASAM Checker Bundles
## Install Python Modules

Python modules can be installed using `pip`.

```bash
pip install asam-qc-runtime@git+https://github.com/asam-ev/qc-framework#subdirectory=runtime
```

Standard ASAM Checker Bundles are implemented in Python. It is recommended to use virtual environment to setup standard ASAM Checker Bundles. Both [virtualenv](https://docs.python.org/3/library/venv.html) and [Conda](https://docs.anaconda.com/miniconda/) can be used to setup the virtual environment.
## Install ASAM Checker Bundles

### Using virtualenv
Standard ASAM Checker Bundles are implemented in Python and can be installed using `pip`.

#### ASAM OpenDrive Checker Bundle

```bash
git clone --single-branch --branch develop https://github.com/asam-ev/qc-opendrive.git
python3 -m venv opendrive-venv
source opendrive-venv/bin/activate
python3 -m pip install --no-cache-dir -r qc-opendrive/requirements.txt
pip install asam-qc-opendrive@git+https://github.com/asam-ev/qc-opendrive
```

#### ASAM OpenScenario XML Checker Bundle
To test the installation:

```bash
git clone --single-branch --branch develop https://github.com/asam-ev/qc-openscenarioxml.git
python3 -m venv openscenario-venv
source openscenario-venv/bin/activate
python3 -m pip install --no-cache-dir -r qc-openscenarioxml/requirements.txt
qc_opendrive --help
```

#### ASAM OTX Checker Bundle
#### ASAM OpenScenario XML Checker Bundle

```bash
git clone --single-branch --branch develop https://github.com/asam-ev/qc-otx.git
python3 -m venv otx-venv
source otx-venv/bin/activate
python3 -m pip install --no-cache-dir -r qc-otx/requirements.txt
pip install asam-qc-openscenarioxml@git+https://github.com/asam-ev/qc-openscenarioxml
```

### Using Conda

#### ASAM OpenDrive Checker Bundle
To test the installation:

```bash
git clone --single-branch --branch develop https://github.com/asam-ev/qc-opendrive.git
conda create -y -n opendrive-venv python=3.10
conda activate opendrive-venv
python3 -m pip install --no-cache-dir -r qc-opendrive/requirements.txt
qc_openscenario --help
```

#### ASAM OpenScenario XML Checker Bundle
#### ASAM OTX Checker Bundle

```bash
git clone --single-branch --branch develop https://github.com/asam-ev/qc-openscenarioxml.git
conda create -y -n openscenario-venv python=3.10
conda activate openscenario-venv
python3 -m pip install --no-cache-dir -r qc-openscenarioxml/requirements.txt
pip install asam-qc-otx@git+https://github.com/asam-ev/qc-otx
```

#### ASAM OTX Checker Bundle
To test the installation:

```bash
git clone --single-branch --branch develop https://github.com/asam-ev/qc-otx.git
conda create -y -n otx-venv python=3.10
conda activate otx-venv
python3 -m pip install --no-cache-dir -r qc-otx/requirements.txt
qc_otx --help
```

## Register ASAM Checker Bundles

Both standard ASAM Checker Bundles and custom Checker Bundles must be registered with the framework before they can be used.

**_Placeholder explaining how to register checker bundles with the framework using the manifest file_**.
Both standard ASAM Checker Bundles and custom Checker Bundles must be registered with the framework before they can be used. [The registration is done using manifest files](doc/manual/manifest_file.md).
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ The following features are provided:

- Modular framework specification that allow users to create their own checkers
to support the use cases described above
- Configuration GUI to select and parameterize checker rules
- Runtime to call the checker rule sets and merge all results
- Text report module to generate a human readable result file
- Report GUI to explore the results in the source code of the input file
Expand All @@ -76,7 +75,7 @@ An architecture overview and documentation is provided in the

## Using Docker-based demo pipeline

A [Docker-based demo pipeline](demo_pipeline/README.md) is provided to help users try out the latest development
A [Docker-based demo pipeline](doc/manual/demo_pipeline.md) is provided to help users try out the latest development
of the framework, as well as the [OpenDrive](https://github.com/asam-ev/qc-opendrive/tree/develop)
and [OpenScenario XML](https://github.com/asam-ev/qc-openscenarioxml/tree/develop) checker bundles.

Expand Down
6 changes: 3 additions & 3 deletions demo_pipeline/configuration_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ def main():
print("XOSC selected")
update_param_value(
XOSC_TEMPLATE_PATH,
"XoscFile",
"InputFile",
full_input_path,
os.path.join(GENERATED_CONFIG_PATH, "config.xml"),
)
elif input_file_extension == ".xodr":
print("XODR selected")
update_param_value(
XODR_TEMPLATE_PATH,
"XodrFile",
"InputFile",
full_input_path,
os.path.join(GENERATED_CONFIG_PATH, "config.xml"),
)
elif input_file_extension == ".otx":
print("OTX selected")
update_param_value(
OTX_TEMPLATE_PATH,
"OtxFile",
"InputFile",
full_input_path,
os.path.join(GENERATED_CONFIG_PATH, "config.xml"),
)
Expand Down
4 changes: 1 addition & 3 deletions demo_pipeline/otxBundle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
readonly CONFIG_FILE=$1

source /app/otx-venv/bin/activate
cd /app/qc-otx
python main.py -c $CONFIG_FILE
qc_otx -c $CONFIG_FILE
cp *.xqar /app/framework/bin/
6 changes: 4 additions & 2 deletions demo_pipeline/templates/otx_template.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Config>

<Param name="OtxFile" value="test.otx" />
<Param name="InputFile" value="test.otx" />

<CheckerBundle application="otxBundle">
<Param name="resultFile" value="otx_bundle_report.xqar" />
<Checker checkerId="basic_otx" maxLevel="1" minLevel="3" />
<Checker checkerId="core_otx" maxLevel="1" minLevel="3" />
<Checker checkerId="data_type_otx" maxLevel="1" minLevel="3" />
<Checker checkerId="zip_file_otx" maxLevel="1" minLevel="3" />
<Checker checkerId="state_machine_otx" maxLevel="1" minLevel="3" />
</CheckerBundle>

<ReportModule application="TextReport">
Expand Down
3 changes: 2 additions & 1 deletion demo_pipeline/templates/xodr_template.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Config>

<Param name="XodrFile" value="test.xodr" />
<Param name="InputFile" value="test.xodr" />

<CheckerBundle application="xodrBundle">
<Param name="resultFile" value="xodr_bundle_report.xqar" />
<Checker checkerId="semantic_xodr" maxLevel="1" minLevel="3" />
<Checker checkerId="geometry_xodr" maxLevel="1" minLevel="3" />
<Checker checkerId="performance_xodr" maxLevel="1" minLevel="3" />
</CheckerBundle>

<ReportModule application="TextReport">
Expand Down
3 changes: 1 addition & 2 deletions demo_pipeline/templates/xosc_template.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Config>

<Param name="XoscFile" value="template.xosc" />
<Param name="InputFile" value="template.xosc" />

<CheckerBundle application="xoscBundle">
<Param name="resultFile" value="xosc_bundle_report.xqar" />
Expand All @@ -10,7 +10,6 @@
<Checker checkerId="data_type_xosc" maxLevel="1" minLevel="3" />
<Checker checkerId="parameters_xosc" maxLevel="1" minLevel="3" />
<Checker checkerId="reference_xosc" maxLevel="1" minLevel="3" />
<Checker checkerId="schema_xosc" maxLevel="1" minLevel="3" />
</CheckerBundle>

<ReportModule application="TextReport">
Expand Down
4 changes: 1 addition & 3 deletions demo_pipeline/xodrBundle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
readonly CONFIG_FILE=$1

source /app/opendrive-venv/bin/activate
cd /app/qc-opendrive
python main.py -c $CONFIG_FILE
qc_opendrive -c $CONFIG_FILE
cp *.xqar /app/framework/bin/
4 changes: 1 addition & 3 deletions demo_pipeline/xoscBundle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
readonly CONFIG_FILE=$1

source /app/openscenario-venv/bin/activate
cd /app/qc-openscenarioxml
python main.py -c $CONFIG_FILE
qc_openscenario -c $CONFIG_FILE
cp *.xqar /app/framework/bin/
1 change: 0 additions & 1 deletion doc/manual/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ flowchart LR
- Checker Bundle
- Runs probably only on certain platforms, because a third party product
is not available for all platforms
- Must be able to print out to the command line which Checkers are included
- Result Pooling
- Summarizes all results (overview and detailed view possible)
- Gives each incident a unique Id → assignment results in different report
Expand Down
Loading

0 comments on commit e89c544

Please sign in to comment.