From de3f21e33735b39af0d18d3574ab1fd58b4c8c3a Mon Sep 17 00:00:00 2001 From: yen3 Date: Wed, 23 Nov 2022 14:45:08 +0100 Subject: [PATCH] Document to run dltlyse with docker --- Dockerfile | 11 +++++++---- README.md | 35 ++++++++++++++++++++++++++++------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index ede656a..006a4ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN set -ex \ && git checkout ${LIBDLT_VERSION} \ && cd /dlt-daemon \ && cmake CMakeLists.txt \ - && make \ + && make -j \ && make install @@ -23,7 +23,7 @@ RUN set -ex \ && apk add python3 py3-pip py3-virtualenv \ && cd /build/dltlyse \ && pip install --no-cache-dir build wheel \ - && python3 -m build --sdist --wheel + && python3 -m build --wheel FROM alpine:3.17 @@ -33,8 +33,11 @@ COPY --from=builder /build/dltlyse/dist/dltlyse*.whl / RUN set -ex \ && ldconfig /usr/local/lib \ - && apk add --no-cache python3 \ + && apk add --no-cache python3 py3-six \ && apk add --no-cache --virtual .build-deps py3-pip git \ - && pip install --no-cache-dir six \ && pip install --no-cache-dir dltlyse*.whl \ && apk del .build-deps + +ENTRYPOINT [ "dltlyse" ] + +CMD [ "--help" ] diff --git a/README.md b/README.md index c01599b..569a5eb 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,38 @@ A Python module and a collection of plugins to support analysis of DLT traces. -# Installation +## Run dltlyse with docker -# Execution +1. Build the docker image -In SDK simply go to your result folder where your DLT files are and run: -``` -dltlyse *.dlt +```bash +git clone https://github.com/bmwcarit/dltlyse +cd dltlyse +docker build -t bmwcarit/dltlyse . ``` -Run dltlyse with "--help" option to see more command line options +2. Run the dltlyse container + +```bash +# Get the command line help +docker run -it --rm bmwcarit/dltlyse --help + +# Run with with dlt file(s) +docker run -it --rm \ + -v "$(pwd):/workspace" \ + -w /workspace bmwcarit/dltlyse \ + .dlt .dlt + +# To specify your own dltlyse plugins specify path to their folder: +docker run -it --rm \ + -v /path/to/plugins:/plugins \ + -v "$(pwd):/workspace" \ + -w /workspace \ + bmwcarit/dltlyse \ + -d /plugins .dlt +``` -# How it works +## How it works `dltlyse` reads all messages from given DLT trace file and passes each DLT message to __call__ of all enabled plugins. Plugin then decides if the message is interesting for it's purpose and collects data. @@ -64,3 +84,4 @@ class MyCustomPlugin(Plugin): stdout="Detailed log of failure", ) ``` +