Skip to content

Commit

Permalink
Update runtime component to use manifests (#130)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Abrahão <[email protected]>
  • Loading branch information
patrickpa authored Aug 23, 2024
1 parent 7c08f1d commit 30bfea9
Show file tree
Hide file tree
Showing 33 changed files with 925 additions and 326 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-on-change-linux-bare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:

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

env:
TEST_ENABLED: ${{ github.event_name == 'pull_request' && 'ON' || 'OFF' }}
Expand Down Expand Up @@ -120,8 +120,9 @@ jobs:
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
curl -sSL https://install.python-poetry.org | python3 -
poetry install --with dev
poetry run pytest -rA > runtime_test.log
- name: Archive runtime test results
if: github.event_name == 'pull_request' && (success() || failure())
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-on-change-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ jobs:
Copy-Item -Path "$env:WORKING_PATH\qc-framework\qc-framework\out_build\examples\checker_bundle_example\Release\DemoCheckerBundle.exe" -Destination "$env:WORKING_PATH\qc-framework\qc-framework\bin"
cd "$env:WORKING_PATH\qc-framework\qc-framework\runtime"
python3 -m pip install -r requirements.txt
python3 -m pytest
python3 -m pip install poetry
python3 -m poetry install
python3 -m poetry run pytest
Write-Output "All runtime tests done."
shell: pwsh
9 changes: 9 additions & 0 deletions demo_pipeline/manifests/framework_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"manifest_file_path": [
"/app/demo_pipeline/manifests/otx_manifest.json",
"/app/demo_pipeline/manifests/osc_manifest.json",
"/app/demo_pipeline/manifests/odr_manifest.json",
"/app/demo_pipeline/manifests/result_pooling.json",
"/app/demo_pipeline/manifests/text_report.json"
]
}
10 changes: 10 additions & 0 deletions demo_pipeline/manifests/odr_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": [
{
"name": "xodrBundle",
"exec_type": "executable",
"module_type": "checker_bundle",
"exec_command": "cd $ASAM_QC_FRAMEWORK_WORKING_DIR && qc_opendrive -c $ASAM_QC_FRAMEWORK_CONFIG_FILE"
}
]
}
10 changes: 10 additions & 0 deletions demo_pipeline/manifests/osc_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": [
{
"name": "xoscBundle",
"exec_type": "executable",
"module_type": "checker_bundle",
"exec_command": "cd $ASAM_QC_FRAMEWORK_WORKING_DIR && qc_openscenario -c $ASAM_QC_FRAMEWORK_CONFIG_FILE"
}
]
}
10 changes: 10 additions & 0 deletions demo_pipeline/manifests/otx_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": [
{
"name": "otxBundle",
"exec_type": "executable",
"module_type": "checker_bundle",
"exec_command": "cd $ASAM_QC_FRAMEWORK_WORKING_DIR && qc_otx -c $ASAM_QC_FRAMEWORK_CONFIG_FILE"
}
]
}
10 changes: 10 additions & 0 deletions demo_pipeline/manifests/result_pooling.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": [
{
"name": "ResultPooling",
"exec_type": "executable",
"module_type": "result_pooling",
"exec_command": "cd $ASAM_QC_FRAMEWORK_WORKING_DIR && /app/framework/bin/ResultPooling $ASAM_QC_FRAMEWORK_WORKING_DIR $ASAM_QC_FRAMEWORK_CONFIG_FILE"
}
]
}
10 changes: 10 additions & 0 deletions demo_pipeline/manifests/text_report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": [
{
"name": "TextReport",
"exec_type": "executable",
"module_type": "report_module",
"exec_command": "cd $ASAM_QC_FRAMEWORK_WORKING_DIR && /app/framework/bin/TextReport $ASAM_QC_FRAMEWORK_CONFIG_FILE"
}
]
}
10 changes: 0 additions & 10 deletions demo_pipeline/otxBundle

This file was deleted.

4 changes: 2 additions & 2 deletions demo_pipeline/run_pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

python3 /app/demo_pipeline/configuration_generator.py

python3 /app/framework/runtime/runtime/runtime.py \
qc_runtime \
--config "/tmp/generated_config/config.xml" \
--install_dir "/app/framework/bin"
--manifest "/app/demo_pipeline/manifests/framework_manifest.json"

mkdir -p /out/qc-result-$INPUT_FILENAME
cp /app/framework/bin/*.xqar /out/qc-result-$INPUT_FILENAME
Expand Down
4 changes: 2 additions & 2 deletions demo_pipeline/templates/otx_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Param name="InputFile" value="test.otx" />

<CheckerBundle application="otxBundle">
<Param name="resultFile" value="otx_bundle_report.xqar" />
<Param name="resultFile" value="/app/framework/bin/otx_bundle_report.xqar" />
<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" />
Expand All @@ -13,7 +13,7 @@

<ReportModule application="TextReport">
<Param name="strInputFile" value="Result.xqar" />
<Param name="strReportFile" value="Report.txt" />
<Param name="strReportFile" value="/app/framework/bin/Report.txt" />
</ReportModule>

</Config>
4 changes: 2 additions & 2 deletions demo_pipeline/templates/xodr_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<Param name="InputFile" value="test.xodr" />

<CheckerBundle application="xodrBundle">
<Param name="resultFile" value="xodr_bundle_report.xqar" />
<Param name="resultFile" value="/app/framework/bin/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">
<Param name="strInputFile" value="Result.xqar" />
<Param name="strReportFile" value="Report.txt" />
<Param name="strReportFile" value="/app/framework/bin/Report.txt" />
</ReportModule>

</Config>
4 changes: 2 additions & 2 deletions demo_pipeline/templates/xosc_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Param name="InputFile" value="template.xosc" />

<CheckerBundle application="xoscBundle">
<Param name="resultFile" value="xosc_bundle_report.xqar" />
<Param name="resultFile" value="/app/framework/bin/xosc_bundle_report.xqar" />
<Checker checkerId="basic_xosc" maxLevel="1" minLevel="3" />
<Checker checkerId="schema_xosc" maxLevel="1" minLevel="3" />
<Checker checkerId="data_type_xosc" maxLevel="1" minLevel="3" />
Expand All @@ -14,7 +14,7 @@

<ReportModule application="TextReport">
<Param name="strInputFile" value="Result.xqar" />
<Param name="strReportFile" value="Report.txt" />
<Param name="strReportFile" value="/app/framework/bin/Report.txt" />
</ReportModule>

</Config>
10 changes: 0 additions & 10 deletions demo_pipeline/xodrBundle

This file was deleted.

10 changes: 0 additions & 10 deletions demo_pipeline/xoscBundle

This file was deleted.

20 changes: 7 additions & 13 deletions docker/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,13 @@ RUN echo "Building framework..." && \
cmake --install ./build && \
echo "Done."


# Copy bash script to install dir - OpenSCENARIO + OpenDRIVE + OTX
RUN chmod +x /app/demo_pipeline/xoscBundle && \
cp /app/demo_pipeline/xoscBundle /home/root/qc-build/bin/xoscBundle && \
chmod +x /app/demo_pipeline/xodrBundle && \
cp /app/demo_pipeline/xodrBundle /home/root/qc-build/bin/xodrBundle && \
chmod +x /app/demo_pipeline/otxBundle && \
cp /app/demo_pipeline/otxBundle /home/root/qc-build/bin/otxBundle

RUN python3 -m pip install --no-cache-dir -r /app/demo_pipeline/requirements.txt && \
python3 -m pip install --no-cache-dir -r /app/framework/runtime/requirements.txt && \
python3 -m pip install --no-cache-dir /app/framework/runtime && \
python3 -m pip install asam-qc-opendrive@git+https://github.com/asam-ev/qc-opendrive@develop && \
python3 -m pip install asam-qc-openscenarioxml@git+https://github.com/asam-ev/qc-openscenarioxml@develop && \
python3 -m pip install asam-qc-otx@git+https://github.com/asam-ev/qc-otx@develop


# Runtime test stage
FROM ubuntu:22.04 as runtime_test

Expand All @@ -75,6 +66,7 @@ RUN echo "Installing Qt..." && \
qtbase5-dev \
libqt5xmlpatterns5-dev \
libxerces-c-dev \
python3-pip \
pkg-config && \
echo "Dependencies installed."

Expand All @@ -95,7 +87,9 @@ SHELL ["/bin/bash", "-c"]
COPY --from=framework_builder /usr/local/lib/python3.10/dist-packages /usr/local/lib/python3.10/dist-packages
COPY --from=framework_builder /usr/local/bin /usr/local/bin

CMD python3 -m pytest -rA > runtime_test.log && cp /app/framework/runtime/runtime_test.log /out/runtime_test.log
RUN python3 -m pip install poetry==1.8.3
RUN poetry install --with dev
CMD poetry run pytest -rA > runtime_test.log && cp /app/framework/runtime/runtime_test.log /out/runtime_test.log

# Runtime stage
FROM framework_builder as unit_test
Expand Down
Loading

0 comments on commit 30bfea9

Please sign in to comment.