ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rti-connext-dds package prevents building ros2 from source in docker image

asked 2021-09-14 14:21:36 -0500

strike_eagle_iii gravatar image

updated 2021-09-16 16:33:41 -0500

I need to build ros2 galactic from source so I can run it on Ubuntu 18.04 roughly following this Dockerfile. I have a different base image that is based on nvidia's cuda's images. I'm running into an issue that the rti-connext-dds package is prompting me to look at a license agreement which is breaking the docker build. I plan on using cyclone-dds...is there a way to force the connext-dds package to not prompt or to just omit that package? The normal DEBIAN_FRONTEND=noninteractive doesn't seem to work.

The full Dockerfile is kind of long and in it's current state expects a .deb file for TensorRT is present on the building system and served up via http so it can be wget'd into the build (has size advantages over just copying it), however I'm pretty sure that is irrelevant to the issue at hand and so it can probably be commented out.

In the end, I just skipped installing rti-connext-dds-5.3.1 (it will need to be removed from the skipped keys to reproduce the behavior) and that got me going again, although it doesn't really fix the problem.

FROM nvidia/cudagl:10.2-devel-ubuntu18.04 as devel

ARG DEBIAN_FRONTEND=noninteractive
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# setup timezone
# https://serverfault.com/questions/683605/docker-container-time-timezone-will-not-reflect-changes/683651
RUN echo 'America/New_York' > /etc/timezone && \
  ln -s /usr/share/zoneinfo/America/New_York /etc/localtime && \
  apt-get update && apt-get install -q -y tzdata

RUN apt-get update && apt-get upgrade -y && \
  apt-get autoremove -y && \
  apt-get clean -y && \
  rm -rf /var/lib/apt/lists/*

ARG CMAKE_VERSION=3.21.2
ARG GCC_VERSION=11

# install basic build environment
RUN apt-get update && \
  apt-get install --no-install-recommends -y \ 
  software-properties-common \
  wget \
  curl \
  git \
  gitk \
  gdb \ 
  pkg-config \
  ninja-build \
  python3-dev \
  python3-pip && \
  add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
  apt-get install gcc-${GCC_VERSION} g++-${GCC_VERSION} -y && \
  update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7 && \
  update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 70 --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} && \
  wget -O cmake.sh https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh && \
  chmod +x cmake.sh && \
  ./cmake.sh --prefix=/usr/local --skip-license && \
  apt-get autoremove -y && \
  apt-get clean -y && \
  add-apt-repository ppa:ubuntu-toolchain-r/test -yr && \
  rm -rf /var/lib/apt/lists/* cmake.sh

# install TensorRT
#COPY nv-tensorrt-repo-ubuntu1804-cuda10.2-trt8.0.1.6-ga-20210626_1-1_amd64.deb /trt.deb
# this requires a simple http server be running on local host and that the build command was issued
# with the --network=host option
# https://docs.nvidia.com/deeplearning/tensorrt/sample-support-guide/index.html#c_samples_section
RUN wget -O /trt.deb http://localhost:8000/nv-tensorrt-repo-ubuntu1804-cuda10.2-trt8.0.1.6-ga-20210626_1-1_amd64.deb && \
  dpkg -i \
  /trt.deb && \
  cd /var/nv-tensorrt-repo-ubuntu1804-cuda10.2-trt8.0.1.6-ga-20210626 && \
  dpkg -i \
  libcudnn8_8.2.1.32-1+cuda10.2_amd64.deb \
  libnvinfer8_8.0.1-1+cuda10.2_amd64.deb \
  libnvonnxparsers8_8 ...
(more)
edit retag flag offensive close merge delete

Comments

Can you give the exact Dockerfile you're using and the exact line that is causing the error?

Jaron gravatar image Jaron  ( 2021-09-14 20:53:43 -0500 )edit

Dockerfile in all its glory is posted

strike_eagle_iii gravatar image strike_eagle_iii  ( 2021-09-15 09:02:02 -0500 )edit

Could you clarify what your question is?

Is it how to deal with the rti-connext.deb in a Dockerfile or something else?

Please update your question title to be more descriptive, as right now it's very generic.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-15 11:18:22 -0500 )edit

yes that's it...because that file get's installed in a Dockerfile, user interactivity isn't possible...the DEBIAN_FRONTEND variable is supposed to fix that, but it appears not to be respected. I worked around it by skipping it's installation, but that's not a fix.

strike_eagle_iii gravatar image strike_eagle_iii  ( 2021-09-16 13:55:52 -0500 )edit

Please update your questions title to be more descriptive.

"build ros 2 in a docker image" does not describe your problem accurately.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-16 14:41:31 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-09-16 14:40:47 -0500

gvdhoorn gravatar image

updated 2021-09-16 14:43:30 -0500

Note: I've assumed here your actual problem is you'd like to be able to install RTI Connext non-interactively during a Docker build. If instead you're not interested in installing RTI Connext at all, that would be a different question.


You could take a look at how the ros-tooling/setup-ros Github Action does this.

It supports installing RTI Connext from the same .deb as you refer to. Only thing needed is to add install-connext: true to the Actions configuration .yaml.

From ros-tooling/setup-ros/src/package_manager/apt.ts:

const CONNEXT_APT_PACKAGE_NAME = "rti-connext-dds-5.3.1"; // RTI Connext

const aptCommandLine: string[] = [
    "DEBIAN_FRONTEND=noninteractive",
    "RTI_NC_LICENSE_ACCEPTED=yes",
    "apt-get",
    "install",
    "--no-install-recommends",
    "--quiet",
    "--yes",
];

The important bit here is of course RTI_NC_LICENSE_ACCEPTED=yes.

user interactivity isn't possible...the DEBIAN_FRONTEND variable is supposed to fix that, but it appears not to be respected

I don't believe this is necessarily always true. I've encountered other (commercially distributed) .debs which also needed special interaction sequences which would not support noninteractive.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-09-14 14:21:36 -0500

Seen: 320 times

Last updated: Sep 16 '21