Skip to content

Commit

Permalink
Update Docker cross-build Image (autowarefoundation#2270)
Browse files Browse the repository at this point in the history
* Adding missing folder for OGRE in Docker crossbuild.

Signed-off-by: Joshua Whitley <[email protected]>

* Adding missing depends to Dockerfile.kinetic-crossbuild.

Signed-off-by: Joshua Whitley <[email protected]>

* Moves dependencies file up a level and builds in that folder.

Signed-off-by: Joshua Whitley <[email protected]>

* Fixing locations of files in Docker generic.

Signed-off-by: Joshua Whitley <[email protected]>

* Updated path and date for new image (autowarefoundation#14)

* Updated date for cross image

Signed-off-by: sgermanserrano <[email protected]>

* Updated path for FindCUDA file

Signed-off-by: sgermanserrano <[email protected]>
  • Loading branch information
Joshua Whitley authored and sgermanserrano committed May 22, 2019
1 parent ea8940b commit b734f19
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ build_cross:
- docker:dind
variables:
ROS_DISTRO: kinetic
AUTOWARE_DOCKER_DATE: 20190211
AUTOWARE_DOCKER_DATE: 20190521
AUTOWARE_HOME: $CI_PROJECT_DIR
AUTOWARE_TARGET_ARCH: aarch64
AUTOWARE_TARGET_PLATFORM: generic-aarch64
Expand Down
100 changes: 10 additions & 90 deletions docker/crossbuild/Dockerfile.kinetic-crossbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG AUTOWARE_DOCKER_ARCH
ARG AUTOWARE_TARGET_ARCH
FROM multiarch/alpine:${AUTOWARE_TARGET_ARCH}-latest-stable AS bootstrap

FROM ${AUTOWARE_DOCKER_ARCH}/ubuntu:16.04 AS sysroot
FROM ${AUTOWARE_DOCKER_ARCH}/ros:kinetic-perception AS sysroot
ARG AUTOWARE_TARGET_ARCH

COPY --from=bootstrap /usr/bin/qemu-${AUTOWARE_TARGET_ARCH}-static /usr/bin/qemu-${AUTOWARE_TARGET_ARCH}-static
Expand All @@ -16,103 +16,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
python-rosdep \
sudo

# Install ROS packages used by Autoware
COPY ./dependencies /tmp/dependencies
RUN apt-get update && \
sed "s/\$ROS_DISTRO/$ROS_DISTRO/g" "/tmp/dependencies" | xargs apt-get install -y

# Autoware dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
freeglut3-dev \
RUN apt-get install -y --no-install-recommends \
libarmadillo-dev \
libcurl4-openssl-dev \
libeigen3-dev \
libgflags-dev \
libgl1-mesa-dev \
libglew-dev \
libglu1-mesa-dev \
libgoogle-glog-dev \
libgtest-dev \
libnlopt-dev \
libopencv-dev \
libpcap0.8-dev \
libpcl-dev \
libpcl1.7 \
libqt5core5a \
libqt5gui5 \
libqt5opengl5 \
libqt5opengl5-dev \
libqt5widgets5 \
libssh2-1 \
libtinyxml-dev \
libx11-dev \
libxi-dev \
libxml2-dev \
libxmu-dev \
libyaml-cpp-dev \
python-flask \
python-serial \
qtbase5-dev \
ros-kinetic-angles \
ros-kinetic-automotive-platform-msgs \
ros-kinetic-camera-info-manager \
ros-kinetic-catkin \
ros-kinetic-cmake-modules \
ros-kinetic-cv-bridge \
ros-kinetic-diagnostic-msgs \
ros-kinetic-diagnostic-updater \
ros-kinetic-dynamic-reconfigure \
ros-kinetic-geometry-msgs \
ros-kinetic-gps-common \
ros-kinetic-grid-map-cv \
ros-kinetic-grid-map-msgs \
ros-kinetic-grid-map-ros \
ros-kinetic-image-geometry \
ros-kinetic-image-transport \
ros-kinetic-imu-filter-madgwick \
ros-kinetic-imu-tools \
ros-kinetic-jsk-recognition-msgs \
ros-kinetic-jsk-rviz-plugins \
ros-kinetic-message-filters \
ros-kinetic-message-generation \
ros-kinetic-message-runtime \
ros-kinetic-nav-msgs \
ros-kinetic-nlopt \
ros-kinetic-nmea-msgs \
ros-kinetic-nodelet \
ros-kinetic-pcl-conversions \
ros-kinetic-pcl-msgs \
ros-kinetic-pcl-ros \
ros-kinetic-pluginlib \
ros-kinetic-rosconsole \
ros-kinetic-roscpp \
ros-kinetic-roslaunch \
ros-kinetic-roslib \
ros-kinetic-roslint \
ros-kinetic-rospy \
ros-kinetic-rostest \
ros-kinetic-rosunit \
ros-kinetic-rqt-plot \
ros-kinetic-rviz \
ros-kinetic-sensor-msgs \
ros-kinetic-shape-msgs \
ros-kinetic-sound-play \
ros-kinetic-std-msgs \
ros-kinetic-std-srvs \
ros-kinetic-stereo-msgs \
ros-kinetic-tf \
ros-kinetic-tf2 \
ros-kinetic-tf2-ros \
ros-kinetic-visualization-msgs \
ros-kinetic-xacro \
ros-kinetic-rosbridge-server \
ros-kinetic-gazebo-ros \
ros-kinetic-gazebo-msgs \
ros-kinetic-gazebo-ros-control \
ros-kinetic-urdf \
ros-kinetic-xacro \
ros-kinetic-position-controllers \
ros-kinetic-transmission-interface \
ros-kinetic-velocity-controllers \
ros-kinetic-effort-controllers \
ros-kinetic-controller-manager \
ros-kinetic-robot-state-publisher \
ros-kinetic-joint-state-controller
python-flask && \
rm -rf /var/lib/apt/lists/*

RUN find / -depth -xdev -type l -lname '/*' -exec sh -c 'linkpath="$(readlink {})" && rm -f {} && ln -frsv "$linkpath" "{}"' \;

Expand All @@ -123,6 +42,7 @@ ENV AUTOWARE_SYSROOT /sysroot/${AUTOWARE_TARGET_PLATFORM}
COPY --from=sysroot /lib ${AUTOWARE_SYSROOT}/lib
COPY --from=sysroot /usr/include ${AUTOWARE_SYSROOT}/usr/include
COPY --from=sysroot /usr/lib ${AUTOWARE_SYSROOT}/usr/lib
COPY --from=sysroot /usr/share/OGRE ${AUTOWARE_SYSROOT}/usr/share/OGRE
COPY --from=sysroot /usr/share/pkgconfig ${AUTOWARE_SYSROOT}/usr/share/pkgconfig
COPY --from=sysroot /opt ${AUTOWARE_SYSROOT}/opt
COPY --from=sysroot /etc/alternatives ${AUTOWARE_SYSROOT}/etc/alternatives
Expand Down
2 changes: 1 addition & 1 deletion docker/crossbuild/Dockerfile.kinetic-crossbuild-driveworks
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ ARG AUTOWARE_TARGET_PLATFORM
FROM autoware/build:${AUTOWARE_TARGET_PLATFORM}-kinetic-20190102
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential
COPY files/FindCUDA.cmake /usr/share/cmake-3.5/Modules/FindCUDA.cmake
COPY crossbuild/files/FindCUDA.cmake /usr/share/cmake-3.5/Modules/FindCUDA.cmake
CMD . /opt/ros/kinetic/setup.sh && /bin/bash
9 changes: 6 additions & 3 deletions docker/crossbuild/build_cross_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,32 @@ if [ "$1" = "synquacer" ] || [ "$1" = "driveworks" ] || [ "$1" = "generic-aarch6
then
# Once we support for targets, change this to the appropriate Docker image
AUTOWARE_DOCKER_ARCH=arm64v8
AUTOWARE_DOCKER_DATE=20190102
AUTOWARE_DOCKER_DATE=20190521
AUTOWARE_TARGET_ARCH=aarch64
AUTOWARE_TARGET_PLATFORM=$1

echo "Using ${AUTOWARE_TARGET_PLATFORM} as the target architecture"
# Register QEMU as a handler for non-x86 targets
docker container run --rm --privileged multiarch/qemu-user-static:register

# Move up a level to include the dependencies file in the build context
cd ..

# Build Docker Image
docker image build \
--build-arg AUTOWARE_DOCKER_ARCH=${AUTOWARE_DOCKER_ARCH} \
--build-arg AUTOWARE_TARGET_ARCH=${AUTOWARE_TARGET_ARCH} \
--build-arg AUTOWARE_TARGET_PLATFORM=${AUTOWARE_TARGET_PLATFORM} \
-t autoware/build:${AUTOWARE_TARGET_PLATFORM}-kinetic-${AUTOWARE_DOCKER_DATE} \
-f Dockerfile.kinetic-crossbuild .
-f crossbuild/Dockerfile.kinetic-crossbuild .
if [ "$AUTOWARE_TARGET_PLATFORM" = "driveworks" ]
then
docker image build \
--build-arg AUTOWARE_DOCKER_ARCH=${AUTOWARE_DOCKER_ARCH} \
--build-arg AUTOWARE_TARGET_ARCH=${AUTOWARE_TARGET_ARCH} \
--build-arg AUTOWARE_TARGET_PLATFORM=${AUTOWARE_TARGET_PLATFORM} \
-t autoware/build:${AUTOWARE_TARGET_PLATFORM}-kinetic-${AUTOWARE_DOCKER_DATE} \
-f Dockerfile.kinetic-crossbuild-driveworks .
-f crossbuild/Dockerfile.kinetic-crossbuild-driveworks .
fi

# Deregister QEMU as a handler for non-x86 targets
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docker/generic/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> /etc/profile.d/ros.sh && \
#
# Install ROS packages used by Autoware
#
COPY ./docker/generic/dependencies /tmp/dependencies
COPY ./docker/dependencies /tmp/dependencies
RUN apt-get update && \
sed "s/\$ROS_DISTRO/$ROS_DISTRO/g" "/tmp/dependencies" | xargs apt-get install -y && \
rm -rf /var/lib/apt/lists/*
Expand Down
9 changes: 6 additions & 3 deletions docker/generic/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,14 @@ echo -e "\tBase only: $BASE_ONLY"

BASE=$IMAGE_NAME:$TAG_PREFIX-$ROS_DISTRO-base

# Move up a level to include the dependencies file in the build context
cd ..

docker build \
--rm \
--tag $BASE \
--build-arg ROS_DISTRO=$ROS_DISTRO \
--file Dockerfile.base ./../..
--file generic/Dockerfile.base ./..

CUDA_SUFFIX=""
if [ $CUDA == "on" ]; then
Expand All @@ -88,7 +91,7 @@ if [ $CUDA == "on" ]; then
--rm \
--tag $BASE$CUDA_SUFFIX \
--build-arg FROM_ARG=$BASE \
--file Dockerfile.cuda .
--file generic/Dockerfile.cuda ./generic
fi

if [ "$BASE_ONLY" == "true" ]; then
Expand All @@ -101,4 +104,4 @@ docker build \
--tag $IMAGE_NAME:$TAG_PREFIX-$ROS_DISTRO$CUDA_SUFFIX \
--build-arg FROM_ARG=$BASE$CUDA_SUFFIX \
--build-arg ROS_DISTRO=$ROS_DISTRO \
--file Dockerfile ./../..
--file generic/Dockerfile ./..

0 comments on commit b734f19

Please sign in to comment.