From 46edd873d59aed13193f5e7f9fa606bd45cc99e9 Mon Sep 17 00:00:00 2001 From: Marika Lehmann Date: Fri, 18 Dec 2020 11:15:28 +0100 Subject: [PATCH] iox-#433 update Dockerfile and readme Signed-off-by: Marika Lehmann --- tools/docker/Dockerfile | 37 +++++++-------- tools/docker/README.md | 102 ++++++++++++++++------------------------ 2 files changed, 59 insertions(+), 80 deletions(-) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 93983751b8..43b3684159 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2020 by Robert Bosch GmbH. All rights reserved. +# Copyright (c) 2019, 2020 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -52,24 +52,23 @@ ENV PATH="/root/cmake-3.16.3-Linux-x86_64/bin:${PATH}" # Configuration ## Maven Proxy - required for usage from behind a corporate proxy. Corporate proxy should be bound to the docker network bridge at 172.17.0.1. -## If you are not behind a corporate proxy this can be ignored and shouldn't interfere with regular usage. -RUN mkdir -p /root/.m2 -RUN echo '\n\ - \n\ - \n\ - \n\ - true \n\ - http \n\ - 172.17.0.1 \n\ - 3128 \n\ - 127.0.0.1 \n\ - \n\ - \n\ - \n'\ ->> /root/.m2/settings.xml +#RUN mkdir -p /root/.m2 +#RUN echo '\n\ +# \n\ + # \n\ + # \n\ + #true \n\ + #http \n\ + #172.17.0.1 \n\ + #3128 \n\ + #127.0.0.1 \n\ + # \n\ + # \n\ +# \n'\ +#>> /root/.m2/settings.xml ADD . /iceoryx WORKDIR /iceoryx diff --git a/tools/docker/README.md b/tools/docker/README.md index 81e57a937b..c3ca6b057a 100644 --- a/tools/docker/README.md +++ b/tools/docker/README.md @@ -31,30 +31,32 @@ To bind a shell to the container, simply run the following script from any locat You will then be dropped into a bash shell where you can access all iceoryx binaries. All iceoryx binaries are directly available in the $PATH of the shell. -For example, to start the sender application, you need only run the following from the bound bash shell: +For example, to start a sender application, you can run the following from the bound bash shell: ``` -root@b10b3630f6d3:/# ice-publisher-simple -2020-07-02 16:18:58.811 [ Debug ]: Application registered management segment 0x7f9c7fbc4000 with size 71546016 to id 1 -2020-07-02 16:18:58.811 [ Info ]: Application registered payload segment 0x7f9c76d0a000 with size 149655680 to id 2 -Sending: 0 -Sending: 1 -Sending: 2 +root@b10b3630f6d3:/# iox-ex-publisher-untyped-modern +2020-12-18 09:04:12.813 [ Debug ]: Application registered management segment 0x7fa1a47c4000 with size 64244064 to id 1 +2020-12-18 09:04:12.813 [ Info ]: Application registered payload segment 0x7fa19b98a000 with size 149134400 to id 2 ``` -To run the receiver application, bind another shell to the container and run the following: +To run the corresponding receiver application, bind another shell to the container and run the following: ``` -root@b10b3630f6d3:/# ice-subscriber-simple -2020-07-02 16:21:00.242 [ Debug ]: Application registered management segment 0x7f9d8fbc4000 with size 71546016 to id 1 -2020-07-02 16:21:00.242 [ Info ]: Application registered payload segment 0x7f9d86d0a000 with size 149655680 to id 2 -Callback: 1 -Callback: 2 -Callback: 3 +root@b10b3630f6d3:/# iox-ex-subscriber-untyped-modern +2020-12-18 09:04:21.692 [ Debug ]: Application registered management segment 0x7fcda1597000 with size 64244064 to id 1 +2020-12-18 09:04:21.692 [ Info ]: Application registered payload segment 0x7fcd9875d000 with size 149134400 to id 2 +Got value: (10, 10, 10) +Got value: (10, 10, 10) +Got value: (11, 11, 11) +Got value: (11, 11, 11) +Got value: (12, 12, 12) +... ``` The complete communication flow should now be observable. +There are a lot more binaries to test, detailed explanations for each can be found in [iceoryx_examples](./../../iceoryx_examples). + ## Using `screen` Another way of interacting with the daemon and examples is to use [screen](https://www.gnu.org/software/screen/) (also included in the Docker image) to start executables in different virtual screens that you attach to and detach from as your experiments may require. @@ -75,15 +77,9 @@ Again, all iceoryx applications are directly available in the $PATH. To launch an example sender application, run the corresponding binary: ``` -root@3b93f0d3eda2:/iceoryx# screen -#[Enter] -root@3b93f0d3eda2:/iceoryx# ice-publisher-simple -Sending: 0 -Sending: 1 -Sending: 2 -Sending: 3 -Sending: 4 -... +root@b10b3630f6d3 /# iox-ex-publisher-untyped-modern +2020-12-18 09:28:17.541 [ Debug ]: Application registered management segment 0x7f2f615d9000 with size 64244064 to id 1 +2020-12-18 09:28:17.541 [ Info ]: Application registered payload segment 0x7f2f5879f000 with size 149134400 to id 2 ``` Press `[Ctrl]+A D` to detach from this virtual screen. @@ -91,14 +87,17 @@ Press `[Ctrl]+A D` to detach from this virtual screen. Then, the receiver application can be started in a separate virtual screen: ``` -root@3b93f0d3eda2:/iceoryx# screen +root@b10b3630f6d3:/# screen #[Enter] -root@3b93f0d3eda2:/iceoryx# ice-subscriber-simple -Not subscribed -Receiving: 12 -Receiving: 13 -Receiving: 14 -Receiving: 15 +root@b10b3630f6d3 /# iox-ex-subscriber-untyped-modern +2020-12-18 09:29:24.082 [ Debug ]: Application registered management segment 0x7f39fb9fe000 with size 64244064 to id 1 +2020-12-18 09:29:24.083 [ Info ]: Application registered payload segment 0x7f39f2bc4000 with size 149134400 to id 2 +Got value: (14, 14, 14) +Got value: (14, 14, 14) +Got value: (15, 15, 15) +Got value: (15, 15, 15) +Got value: (16, 16, 16) +Got value: (16, 16, 16) ... ``` @@ -110,11 +109,10 @@ As an exercise, you can return to previous screen sessions to observe their curr For examples, here we list all screens and return to the one running the sender: ``` -root@d3e51ca29d56:/iceoryx# screen -r +root@b10b3630f6d3:/# screen -r There are several suitable screens on: - 66.pts-0.d3e51ca29d56 (12/06/19 08:55:00) (Detached) - 35.pts-0.d3e51ca29d56 (12/06/19 08:54:48) (Detached) - 17.pts-0.d3e51ca29d56 (12/06/19 08:53:57) (Detached) + 66.pts-0.b10b3630f6d3 (12/18/20 09:29:24) (Detached) + 35.pts-0.b10b3630f6d3 (12/18/20 09:28:17) (Detached) Type "screen [-d] -r [pid.]tty.host" to resume one of them. ``` @@ -124,41 +122,23 @@ Try the following to return to the sender application (adjust the PID as per you screen -r 35 ``` -You should see again the virtual screen of the sender application: - -``` -Sending: 212 -Sending: 213 -Sending: 214 -Sending: 215 -Sending: 216 -... -``` - -You can stop the sender with `[Ctrl]+C`, and then detach from this screen with `[Ctrl]+A D`, and return to the receiver screen with (adjusting the PID as per your `screen -r` output above): +You should see again the virtual screen of the sender application. You can stop the sender with `[Ctrl]+C`, and then detach +from this screen with `[Ctrl]+A D`, and return to the receiver screen with (adjusting the PID as per your `screen -r` output above): ``` screen -r 66 ``` -and you should see current receiver output such as: - -``` -Not subscribed -Not subscribed -Not subscribed -Not subscribed -Not subscribed -... -``` +and you should see the receiver output again. As an exercise, try return to the sender screen and relaunch the sender, then detach from the sender screen and attach to the receiver screen and see the output based on the new sender: ``` -Receiving: 103 -Receiving: 104 -Receiving: 105 -Receiving: 106 -Receiving: 107 +Got value: (104, 104, 104) +Got value: (104, 104, 104) +Got value: (105, 105, 105) +Got value: (105, 105, 105) +Got value: (106, 106, 106) +Got value: (106, 106, 106) ... ```