[Discourse.ros.org] [Next Generation ROS] --isolated in Docker image

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] --isolated in Docker image

Pito Salas via ros-users


I notice that your ROS2 Docker images are compiled with the `--isolated` flag. What is the advantage or tradeoff to that flag in that scenario? How does it affect the size of the Docker image?





---
[Visit Topic](https://discourse.ros.org/t/isolated-in-docker-image/3504/1) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] --isolated in Docker image

Pito Salas via ros-users


I used `--isolated` (as well as other flags) in the Docker images mostly because that's the ament invocation I use for development.

All the `--isolated` flag does is tell `ament_tools` to create an "isolated" install folder rather than a merged one, this means that each package will have it's own subfolder in the install directory.

Without `--isolated`:
```
install
 bin
 include
 lib
 local_setup.bash
 local_setup.sh
 local_setup.zsh
 opt
 _order_packages.py
 setup.bash
 setup.sh
 setup.zsh
 share
 src
```

With `--isolated`:
```
install
 actionlib_msgs
    include
    lib
    local_setup.bash
    local_setup.sh
    local_setup.zsh
    _order_packages.py
    setup.bash
    setup.sh
    setup.zsh
    share
...
 visualization_msgs
     include
     lib
     local_setup.bash
     local_setup.sh
     local_setup.zsh
     _order_packages.py
     setup.bash
     setup.sh
     setup.zsh
     share
```

The main advantage of this approach is that each package will have a different path for its includes, libraries etc (`X_INCLUDE_DIRS`, `X_LIBRARIES`...). This allows to make sure the dependencies are properly declared in CMake without relying on the fact that some files from projects that haven't been `find_package`'d are present in the install directory.

The drawback is that setting up the environment (`source (local_)setup.bash`) takes longer as a multitude of directories need to be added to environment variables (PATH, PYTHONPATH, LD_LIBRARY_PATH...).
On Windows with the `cmd` command line interpreter, environment variables are limited to 2048 characters making this approach unusable.

Other flags used in the docker images that differ from the ros2 installation instructions:
- `--parallel`: allows to build concurrently packages whose dependencies are satisfied. We don't advertise it as we faced some race conditions at install time when not using it in cmbination with `--isolated`
- `--symlink-install`: create symlinks in the install folder instead of copying the files. That allows faster install step as well as removing the need to rerun ament when modifying files that dont require compilation (e.g python scripts) in the source space.  This is also not an option on windows as symlinking files requires administrator permissions.
- `--cmake-args -DSECURITY=ON --`: compiles Fast-RTPS with DDS-Security enabled

Hope this helps





---
[Visit Topic](https://discourse.ros.org/t/isolated-in-docker-image/3504/2) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] --isolated in Docker image

Pito Salas via ros-users
In reply to this post by Pito Salas via ros-users


So you think disk usage is the same or does the isolated build duplicate copies of dependencies?

Have you looked into making the docker images run the local_setup.bash file as part of the image compilation so that it doesn't require any time during image startup?





---
[Visit Topic](https://discourse.ros.org/t/isolated-in-docker-image/3504/3) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] --isolated in Docker image

Pito Salas via ros-users
In reply to this post by Pito Salas via ros-users


A quick test seems to show that `--isolated` does significantly increase the drive space usage. That seems like something we don't want for Docker images.





---
[Visit Topic](https://discourse.ros.org/t/isolated-in-docker-image/3504/4) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] --isolated in Docker image

Pito Salas via ros-users
In reply to this post by Pito Salas via ros-users


[quote="BrannonKing, post:4, topic:3504"]
A quick test seems to show that `--isolated` does significantly increase the drive space usage.
[/quote]

As @marguedas mentioned before the isolated option should only change the location of installed files and only add a couple of scripts for each package. Please provide more information about the result of your comparison.





---
[Visit Topic](https://discourse.ros.org/t/isolated-in-docker-image/3504/5) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] --isolated in Docker image

Pito Salas via ros-users
In reply to this post by Pito Salas via ros-users


I see isolated builds cause a size increase on some of our internal projects. However, I just ran a build comparison on ROS2 itself and saw no significant size increase. I guess it's a non-issue. Our internal projects probably have poor dependency management; I know that ament's `--parallel` flag doesn't work on our internal projects because of file conflicts.





---
[Visit Topic](https://discourse.ros.org/t/isolated-in-docker-image/3504/6) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>