-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from asam-ev/2024-06-18
Update result file schema and add demo pipeline
- Loading branch information
Showing
56 changed files
with
1,776 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build and push demo pipeline image | ||
|
||
on: | ||
schedule: | ||
- cron: '0 4 * * *' # 04:00 AM UTC every day | ||
|
||
jobs: | ||
build-and-push-demo: | ||
runs-on: ubuntu-22.04 | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: develop # @TODO remove it later | ||
|
||
- name: Get current date | ||
id: date | ||
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: docker/Dockerfile.linux | ||
push: true | ||
target: demo_pipeline | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/qc-framework:demo-pipeline-latest | ||
ghcr.io/${{ github.repository_owner }}/qc-framework:demo-pipeline-${{ env.DATE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: Build framework on Linux Bare | ||
|
||
on: | ||
# execute on every PR made targeting the branches bellow | ||
pull_request: | ||
branches: | ||
- main | ||
- develop # can be removed on main merge | ||
paths: # we only include paths critical for building to avoid unnecessary runs | ||
- src/** | ||
- include/** | ||
- scripts/cmake/** | ||
- test/** | ||
- .github/workflows/** | ||
- doc/** | ||
- runtime/** | ||
- docker/** | ||
|
||
# execute on every push made targeting the branches bellow | ||
push: | ||
branches: | ||
- main | ||
- develop # can be removed on main merge | ||
paths: # we only include paths critical for building to avoid unnecessary runs | ||
- src/** | ||
- include/** | ||
- scripts/cmake/** | ||
- test/** | ||
- .github/workflows/** | ||
- doc/** | ||
- runtime/** | ||
- docker/** | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
TEST_ENABLED: ${{ github.event_name == 'pull_request' && 'ON' || 'OFF' }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Create dependencies build space | ||
run: mkdir dependencies | ||
shell: bash | ||
|
||
- name: Install dependencies | ||
working-directory: dependencies | ||
run: | | ||
echo "Installing Dependencies..." | ||
sudo apt update | ||
sudo apt install \ | ||
g++ \ | ||
g++-10 \ | ||
make \ | ||
build-essential \ | ||
cmake \ | ||
libgtest-dev \ | ||
qtbase5-dev \ | ||
libqt5xmlpatterns5-dev \ | ||
libxerces-c-dev \ | ||
pkg-config | ||
echo "Dependencies installed." | ||
shell: bash | ||
|
||
- name: Build framework | ||
# Currently this is building without the XSD file. If we want to expose | ||
# the build artifact after, we might as well need to add the XSD file. | ||
run: | | ||
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" \ | ||
-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: Unit test execution | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
echo Starting tests... | ||
ctest --test-dir build -C Release | ||
echo All tests done. | ||
shell: bash | ||
|
||
- name: Archive test results | ||
if: github.event_name == 'pull_request' && (success() || failure()) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: unit-test-report | ||
path: ${{ github.workspace }}/build/Testing/Temporary/LastTest.log | ||
|
||
- name: Runtime test execution | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
mv build out_build | ||
cp -r /home/$(whoami)/qc-build/bin bin | ||
cp out_build/examples/checker_bundle_example/DemoCheckerBundle bin/ | ||
cd runtime | ||
python3 -m pip install -r requirements.txt | ||
python3 -m pytest -rA > runtime_test.log | ||
- name: Archive runtime test results | ||
if: github.event_name == 'pull_request' && (success() || failure()) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: runtime-test-report | ||
path: ${{ github.workspace }}/runtime/runtime_test.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: no-commit-to-branch | ||
args: [--branch=main] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: v16.0.6 | ||
hooks: | ||
- id: clang-format | ||
files: \.(c|cc|cxx|cpp|h|hpp|hxx)$ | ||
args: ["--style=file", "-i"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Demo pipeline | ||
|
||
The demo pipeline allow users to process OpenDRIVE and OpenSCENARIO XML files with respecting checkers and inspect the resulting `xqar` and `txt` files. | ||
|
||
### Download and run | ||
|
||
The demo pipeline is provided as a public Docker image in the Github container registry. | ||
|
||
To process a file, the `docker run` command below can be used and the following information can be specified: | ||
- The input folder which contains the input file. | ||
- The name the input file. | ||
- The output folder where the output files can be saved. | ||
|
||
``` | ||
docker run \ | ||
-e INPUT_FILENAME=YOUR_INPUT_FILENAME \ | ||
-v YOUR_INPUT_FOLDER:/input_directory \ | ||
-v YOUR_OUTPUT_FOLDER:/out \ | ||
-e USER_ID=$(id -u) \ | ||
-e GROUP_ID=$(id -g) \ | ||
--rm --name demo_pipeline ghcr.io/asam-ev/qc-framework:demo-pipeline-latest | ||
``` | ||
|
||
E.g. To process the file at `/home/user/xodr_files/test_ramp.xosc` | ||
|
||
``` | ||
docker run \ | ||
-e INPUT_FILENAME=test_ramp.xosc \ | ||
-v /home/user/xodr_files:/input_directory \ | ||
-v /home/user/output:/out \ | ||
-e USER_ID=$(id -u) \ | ||
-e GROUP_ID=$(id -g) \ | ||
--rm --name demo_pipeline ghcr.io/asam-ev/qc-framework:demo-pipeline-latest | ||
``` | ||
|
||
Alternatively, you can go to the input folder and execute the following command, which requires only the input file name to be specified. The output will be saved in the same folder. | ||
|
||
``` | ||
cd /home/user/xodr_files | ||
docker run \ | ||
-e INPUT_FILENAME=test_ramp.xosc \ | ||
-v $(pwd):/input_directory \ | ||
-v $(pwd):/out \ | ||
-e USER_ID=$(id -u) \ | ||
-e GROUP_ID=$(id -g) \ | ||
--rm --name demo_pipeline ghcr.io/asam-ev/qc-framework:demo-pipeline-latest | ||
``` | ||
|
||
The docker image will automatically: | ||
- Detect the type of file passed as input. | ||
- Create the specific config according to [config schema](../doc/schema/config_format.xsd). | ||
- Execute the runtime with specific checker, result pooling and text result application. | ||
|
||
Currently the demo_pipeline will clone and execute: | ||
|
||
- [OpenDRIVE checker @ develop branch](https://github.com/asam-ev/qc-opendrive/tree/develop) | ||
- [OpenSCENARIO XML checker @ develop branch](https://github.com/asam-ev/qc-openscenarioxml/tree/develop) | ||
|
||
After the execution, in the specified output folder you will find: | ||
|
||
- Specific CheckerBundle `xqar` result file. | ||
- ResultPooling `Result.xqar` result file. | ||
- TextReport `Report.txt` text file. | ||
|
||
Some OpenDrive and OpenScenario XML test files are available to try out. | ||
- [OpenDrive test files](https://github.com/asam-ev/qc-opendrive/tree/develop/tests/data) | ||
- [OpenScenario XML test files](https://github.com/asam-ev/qc-openscenarioxml/tree/develop/tests/data) | ||
|
||
### Local build instructions | ||
|
||
In case of local build of demo_pipeline docker image, you can execute: | ||
|
||
``` | ||
cd .. | ||
DOCKER_BUILDKIT=1 \ | ||
docker build \ | ||
-f docker/Dockerfile.linux \ | ||
--target demo_pipeline \ | ||
-t demo_pipeline . | ||
``` |
Oops, something went wrong.