Kaynağa Gözat

- Add dockerscript humble support
- Clean up dockerscripts
- Updated README.md

Signed-off-by: Steve Pham <[email protected]>

Steve Pham 2 yıl önce
ebeveyn
işleme
2fa7544c8c

+ 5 - 16
Docker/Dockerfile.robot.ubuntu-galactic

@@ -5,11 +5,9 @@
 #
 
 FROM ros:galactic-ros-base-focal
-ARG minimal
+
 ENV WORKSPACE=/data/workspace
-ENV O3DE_REPO=https://github.com/o3de/o3de.git
-ENV ROS2_GEM_REPO=https://github.com/RobotecAI/o3de-ros2-gem.git
-ENV LOFT_GEM_REPO=https://github.com/o3de/loft-arch-vis-sample.git
+
 ENV O3DE_DEMO_REPO=https://github.com/RobotecAI/o3de-demo-project.git
 
 WORKDIR $WORKSPACE
@@ -17,16 +15,7 @@ WORKDIR $WORKSPACE
 RUN apt-get update && apt-get upgrade -y
 
 # Add additional package repositories needed for packages
-RUN apt-get install -y --no-install-recommends gpg wget curl
-
-RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
-    echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
-
-RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
-    curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
-    /bin/bash -c 'source /etc/os-release && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null'
-
-RUN apt-get update
+RUN apt-get install -y --no-install-recommends gpg wget
 
 #
 # Install packages needed for cloning and building from the source repos
@@ -49,8 +38,8 @@ RUN /bin/bash -c 'source /opt/ros/galactic/setup.bash && \
 
 # Install the O3DE-specific required packages
 RUN apt-get install -y --no-install-recommends libglu1-mesa-dev \
-                       							mesa-common-dev \
-                       							libnvidia-gl-470
+                                               mesa-common-dev \
+                                               libnvidia-gl-470
 
 # Clone the demo project and register the project
 RUN cd $WORKSPACE && \

+ 56 - 0
Docker/Dockerfile.robot.ubuntu-humble

@@ -0,0 +1,56 @@
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+FROM ros:humble-ros-base-jammy
+
+ENV WORKSPACE=/data/workspace
+
+ENV O3DE_DEMO_REPO=https://github.com/RobotecAI/o3de-demo-project.git
+
+WORKDIR $WORKSPACE
+
+RUN apt-get update && apt-get upgrade -y
+
+# Add additional package repositories needed for packages
+RUN apt-get install -y --no-install-recommends gpg wget curl
+
+#
+# Install packages needed for cloning and building from the source repos
+#
+
+# Install the git and build tools
+RUN apt-get install -y --no-install-recommends git 
+
+# Add additional ROS2/Galactic packages
+RUN /bin/bash -c 'source /opt/ros/humble/setup.bash && \
+                  apt install -y ros-${ROS_DISTRO}-desktop \
+                                 ros-${ROS_DISTRO}-slam-toolbox \
+                                 ros-${ROS_DISTRO}-navigation2 \
+                                 ros-${ROS_DISTRO}-nav2-bringup \
+                                 ros-${ROS_DISTRO}-pointcloud-to-laserscan \
+                                 ros-${ROS_DISTRO}-gazebo-msgs \
+                                 ros-${ROS_DISTRO}-ackermann-msgs \
+                                 ros-${ROS_DISTRO}-control-toolbox'
+
+
+# Install the O3DE-specific required packages
+RUN apt-get install -y --no-install-recommends libglu1-mesa-dev \
+                                               mesa-common-dev \
+                                               libnvidia-gl-470
+
+# Clone the demo project and register the project
+RUN cd $WORKSPACE && \
+    git clone --single-branch --branch main --recursive $O3DE_DEMO_REPO 
+
+COPY LaunchRViz.bash.ubuntu-humble /data/workspace/LaunchRViz.bash
+
+ENV NVIDIA_VISIBLE_DEVICES all
+ENV NVIDIA_DRIVER_CAPABILITIES all
+ 
+ENTRYPOINT ["/bin/bash", "-c"]
+
+
+

+ 1 - 4
Docker/Dockerfile.simulation.ubuntu-galactic

@@ -19,13 +19,10 @@ RUN apt-get update && apt-get upgrade -y
 # Add additional package repositories needed for packages
 RUN apt-get install -y --no-install-recommends gpg wget curl
 
+# Configure the installation of the minimal version of cmake (3.24) from kitware's apt repo since the default cmake version of ubuntu focal does not meet it
 RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
     echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
 
-RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
-    curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
-    /bin/bash -c 'source /etc/os-release && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null'
-
 RUN apt-get update
 
 #

+ 132 - 0
Docker/Dockerfile.simulation.ubuntu-humble

@@ -0,0 +1,132 @@
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+FROM ros:humble-ros-base-jammy
+
+ARG minimal
+
+ENV WORKSPACE=/data/workspace
+ENV O3DE_REPO=https://github.com/o3de/o3de.git
+ENV ROS2_GEM_REPO=https://github.com/RobotecAI/o3de-ros2-gem.git
+ENV LOFT_GEM_REPO=https://github.com/o3de/loft-arch-vis-sample.git
+ENV O3DE_DEMO_REPO=https://github.com/RobotecAI/o3de-demo-project.git
+
+WORKDIR $WORKSPACE
+
+RUN apt-get update && apt-get upgrade -y
+
+# Add additional package repositories needed for packages
+RUN apt-get install -y --no-install-recommends gpg wget curl build-essential libssl-dev
+
+# Build and install cmake 3.24.3 from source since the default cmake version of ubuntu focal does not meet it
+RUN cd /data/workspace && \
+    wget -c https://github.com/Kitware/CMake/archive/refs/tags/v3.24.3.tar.gz && \
+    wget -c https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3.tar.gz && \
+    tar -zxvf cmake-3.24.3.tar.gz && \
+    cd cmake-3.24.3 && \
+    ./bootstrap && \
+    make && \
+    make install && \
+    cmake --version
+
+#
+# Install packages needed for cloning and building from the source repos
+#
+
+# Install the git and build tools
+RUN apt-get install -y --no-install-recommends git \
+                       git-lfs \
+                       clang-12 \
+                       ninja-build
+
+# Install the O3DE-specific required packages
+RUN apt-get install -y --no-install-recommends libglu1-mesa-dev \
+                       libxcb-xinerama0 \
+                       libxcb-xinput0 \
+                       libxcb-xinput-dev \
+                       libxcb-xfixes0-dev \
+                       libxcb-xkb-dev \
+                       libxkbcommon-dev \
+                       libxkbcommon-x11-dev \
+                       libfontconfig1-dev \
+                       libcurl4-openssl-dev \
+                       libsdl2-dev \
+                       zlib1g-dev \
+                       mesa-common-dev \
+                       libssl-dev libxcb-icccm4 \
+                       libxcb-image0 \
+                       libxcb-keysyms1 \
+                       libxcb-render-util0 \
+                       libxcb-randr0 \
+                       libnvidia-gl-470 \
+                       ufw
+
+# Clone O3DE repo and register the engine
+RUN cd $WORKSPACE && \
+    git clone --single-branch --recursive --branch development $O3DE_REPO && \
+    cd o3de && \
+    git lfs install && \
+    git lfs pull
+
+RUN cd $WORKSPACE/o3de && \
+    python/get_python.sh
+RUN cd $WORKSPACE/o3de && \
+    $WORKSPACE/o3de/scripts/o3de.sh register --this-engine
+
+
+# Clone the ROS2 Gem and register it
+RUN cd $WORKSPACE && \
+    git clone $ROS2_GEM_REPO --single-branch --branch development && \
+    $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/o3de-ros2-gem
+
+# Add additional ROS2/Galactic packages
+RUN /bin/bash -c 'source /opt/ros/humble/setup.bash && \
+                  apt install -y ros-${ROS_DISTRO}-slam-toolbox \
+                                 ros-${ROS_DISTRO}-navigation2 \
+                                 ros-${ROS_DISTRO}-nav2-bringup \
+                                 ros-${ROS_DISTRO}-pointcloud-to-laserscan \
+                                 ros-${ROS_DISTRO}-gazebo-msgs \
+                                 ros-${ROS_DISTRO}-ackermann-msgs \
+                                 ros-${ROS_DISTRO}-control-toolbox'
+
+# Clone the loft scene and register the ArchVis Gem
+RUN cd $WORKSPACE && \
+    git clone --single-branch --recursive $LOFT_GEM_REPO && \
+    cd loft-arch-vis-sample && \
+    git lfs install && \
+    git lfs pull && \
+    $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/loft-arch-vis-sample/Gems/ArchVis/
+
+
+# Clone the demo project and register the project
+RUN cd $WORKSPACE && \
+    git clone --single-branch --branch main --recursive $O3DE_DEMO_REPO && \
+    cd o3de-demo-project && \
+    git lfs install && \
+    git lfs pull && \
+    $WORKSPACE/o3de/scripts/o3de.sh register -pp $WORKSPACE/o3de-demo-project/ 
+
+
+# Configure the project
+RUN cd $WORKSPACE/o3de-demo-project && \
+    /bin/bash -c 'source /opt/ros/humble/setup.bash && \
+                  cmake -B build/linux -S . -G "Ninja Multi-Config" -DCMAKE_BUILD_TYPE=profile -DLY_STRIP_DEBUG_SYMBOLS=TRUE -DLY_DISABLE_TEST_MODULES=ON'
+
+# Build the project
+RUN cd $WORKSPACE/o3de-demo-project && \
+    /bin/bash -c 'source /opt/ros/humble/setup.bash && \
+                  cmake --build build/linux --config profile --target AssetProcessorBatch ROS2-Gem-Demo.GameLauncher ROS2-Gem-Demo.Assets -j 12'
+
+
+COPY LaunchClient.bash.ubuntu-humble /data/workspace/LaunchClient.bash
+COPY delete_source.bash /data/workspace/delete_source.bash
+
+RUN if [ "$minimal" -eq "1" ]; then /bin/bash -c 'source /data/workspace/delete_source.bash'; else echo "Skipping source delete"; fi
+ 
+ENV NVIDIA_VISIBLE_DEVICES all
+ENV NVIDIA_DRIVER_CAPABILITIES all
+ 
+ENTRYPOINT ["/bin/bash", "-c"]

+ 20 - 0
Docker/LaunchClient.bash.ubuntu-humble

@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+unset LD_LIBRARY_PATH
+
+source /opt/ros/humble/setup.bash
+
+export LD_LIBRARY_PATH=/data/workspace/o3de-demo-project/build/linux/bin/profile:$LD_LIBRARY_PATH
+
+cd /data/workspace/o3de-demo-project/build/linux/bin/profile
+
+./ROS2-Gem-Demo.GameLauncher -bg_ConnectToAssetProcessor=0
+
+
+

+ 16 - 0
Docker/LaunchRViz.bash.ubuntu-humble

@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+unset LD_LIBRARY_PATH
+
+source /opt/ros/humble/setup.bash
+
+cd /data/workspace/o3de-demo-project/launch
+
+ros2 launch navigation.launch.py
+

+ 2 - 2
Docker/README.md

@@ -31,7 +31,7 @@ Select which docker image you would like to build and run the following commands
 
 sudo docker build --build-arg minimal=1 -t o3de_loft_demo_simulation:latest -f Dockerfile.simulation.ubuntu-galactic .
 
-sudo docker build -t o3de_loft_demo_simulation:latest -f Dockerfile.robot.ubuntu-galactic .
+sudo docker build -t o3de_loft_demo_robot:latest -f Dockerfile.robot.ubuntu-galactic .
 
 ```
 
@@ -39,7 +39,7 @@ sudo docker build -t o3de_loft_demo_simulation:latest -f Dockerfile.robot.ubuntu
 
 sudo docker build --build-arg minimal=1 -t o3de_loft_demo_simulation:latest -f Dockerfile.simulation.ubuntu-humble .
 
-sudo docker build -t o3de_loft_demo_simulation:latest -f Dockerfile.robot.ubuntu-humble .
+sudo docker build -t o3de_loft_demo_robot:latest -f Dockerfile.robot.ubuntu-humble .
 
 ```