Skip to content

Commit

Permalink
iox-eclipse-iceoryx#433 update Dockerfile and readme
Browse files Browse the repository at this point in the history
Signed-off-by: Marika Lehmann <[email protected]>
  • Loading branch information
FerdinandSpitzschnueffler committed Dec 18, 2020
1 parent 7aebe58 commit 46edd87
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 80 deletions.
37 changes: 18 additions & 19 deletions tools/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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\
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" \n\
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \n\
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 \n\
http://maven.apache.org/xsd/settings-1.0.0.xsd"> \n\
<proxies> \n\
<proxy> \n\
<active>true</active> \n\
<protocol>http</protocol> \n\
<host>172.17.0.1</host> \n\
<port>3128</port> \n\
<nonProxyHosts>127.0.0.1</nonProxyHosts> \n\
</proxy> \n\
</proxies> \n\
</settings> \n'\
>> /root/.m2/settings.xml
#RUN mkdir -p /root/.m2
#RUN echo '\n\
#<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" \n\
#xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \n\
#xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 \n\
#http://maven.apache.org/xsd/settings-1.0.0.xsd"> \n\
#<proxies> \n\
#<proxy> \n\
#<active>true</active> \n\
#<protocol>http</protocol> \n\
#<host>172.17.0.1</host> \n\
#<port>3128</port> \n\
#<nonProxyHosts>127.0.0.1</nonProxyHosts> \n\
#</proxy> \n\
#</proxies> \n\
#</settings> \n'\
#>> /root/.m2/settings.xml

ADD . /iceoryx
WORKDIR /iceoryx
Expand Down
102 changes: 41 additions & 61 deletions tools/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -75,30 +77,27 @@ 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.

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)
...
```

Expand All @@ -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.
```

Expand All @@ -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)
...
```

0 comments on commit 46edd87

Please sign in to comment.