From 026af970cea91e071717d04b37b2ce9ec6567942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wr=C3=B3bel?= Date: Mon, 22 Aug 2022 16:53:45 +0200 Subject: [PATCH] #236: - added docker usage to README.md - removed not needed files from docker image --- README.md | 51 ++++++++++++++++++++++++++++++------------------- lbaf.Dockerfile | 3 --- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 81cf8f0bb..f332a8d65 100644 --- a/README.md +++ b/README.md @@ -129,40 +129,51 @@ python JSON_data_files_validator.py --dir_path=/data/8color-4node python JSON_data_files_validator.py --dir_path=../../data/8color-4node --file_prefix=data --file_suffix=json ``` -[//]: # (## Getting Started with Docker) +## Getting Started with Docker -[//]: # (### Example use:) +### Example use: -[//]: # () -[//]: # (Replace `` with path to existing directory which will be mapped with `/lbaf/in` in container) +Replace `` with path to existing directory which will be mapped with `/lbaf/in` in container -[//]: # () -[//]: # (Replace `` with path to existing directory which will be mapped with `/lbaf/out` in container) +Replace `` with path to existing directory which will be mapped with `/lbaf/out` in container -[//]: # (```shell) +Put `conf.yaml` inside mapped `` and set `output_dir` in `conf.yaml` to `/lbaf/out` -[//]: # (docker run -it -v ":/lbaf/out" -v ":/lbaf/in" nganalytics/lbaf "python src/Applications/NodeGossiper.py -l /lbaf/data/vt_example_lb_stats/stats -x 4 -y 2 -z 1 -s 0 -f 4 -k 4 -i 4 -c 1 -e" "/bin/bash") +When using sample data from repository set `data_stem` in `conf.yaml` to e.g. `/lbaf/data/synthetic_lb_data/data` -[//]: # (```) +When using other data put the data inside mapped `` and set `data_stem` in `conf.yaml` to e.g. `/lbaf/in//` -[//]: # (### Example use explained:) +#### Building locally (otherwise docker image will be pulled from dockerhub): +```shell +cd +docker build -t nganalytics/lbaf:latest . -f lbaf.Dockerfile +``` + +#### Running: +```shell +docker run -it -v ":/lbaf/out" -v ":/lbaf/in" nganalytics/lbaf "python /lbaf/src/lbaf/Applications/LBAF_app.py --config=/lbaf/in/conf.yaml" "/bin/bash" +# in order to exit container +exit +``` + +### Example use explained: -[//]: # (- container starts with interactive mode (stdout visible)) +- container starts with interactive mode (stdout visible) -[//]: # (- two volumes are mounted(data exchange between host and container possible):) +- two volumes are mounted(data exchange between host and container possible): -[//]: # ( - directory `` on the host and `/lbaf/in` is mount inside container) + - directory `` on the host and `/lbaf/in` is mount inside container -[//]: # ( - directory `` on the host and `/lbaf/out` is mount inside container) + - directory `` on the host and `/lbaf/out` is mount inside container -[//]: # (- docker image `nganalytics/lbaf`) +- docker image `nganalytics/lbaf` -[//]: # (- commands executed inside container:) +- commands executed inside container: -[//]: # ( - sample LBAF usage:) + - sample LBAF usage: -[//]: # ( ```"python src/Applications/NodeGossiper.py -l /lbaf/data/vt_example_lb_stats/stats -x 4 -y 2 -z 1 -s 0 -f 4 -k 4 -i 4 -c 1 -e"```) + ```"python /lbaf/src/lbaf/Applications/LBAF_app.py --config=/lbaf/in/conf.yaml"``` -[//]: # ( - command to stay inside container, after above command is completed:) + - command to stay inside container, after above command is completed: -[//]: # ( ```"/bin/bash"```) \ No newline at end of file + ```"/bin/bash"``` \ No newline at end of file diff --git a/lbaf.Dockerfile b/lbaf.Dockerfile index 8ab3a9b83..ceb797f15 100644 --- a/lbaf.Dockerfile +++ b/lbaf.Dockerfile @@ -27,9 +27,6 @@ ENV DISPLAY :99.0 COPY src /lbaf/src COPY data /lbaf/data COPY scripts/entrypoint.sh /lbaf/entrypoint.sh -COPY scripts/test_lbaf.py /lbaf/tests/test_lbaf.py -COPY scripts/run_tests.sh /lbaf/tests/run_tests.sh -COPY scripts/test_config/conf.yaml /lbaf/src/Applications/conf.yaml WORKDIR /lbaf RUN mkdir /lbaf/in /lbaf/out