o3de / RobotVacuumSample

This sample project demonstrating a robotic vacuum simulation project navigating through the O3DE Loft scene using the ROS 2 Gem and the ROS 2 navigation stack.
Other
22 stars 6 forks source link

Docker image build fails during the step with O3DE clone, configuration and build - exit code: 1 #25

Closed LB-ArturZieba closed 1 year ago

LB-ArturZieba commented 1 year ago

Describe the bug Docker image build fails when it reaches the step where O3DE engine is cloned, configured and built. This prevents the image from being generated.

Terminal snippet with the error (full log can be found in the Full Terminal log and PC hardinfo file section):

#0 2447.2 In file included from /data/workspace/o3de-extras/Gems/ROS2/Code/Source/VehicleDynamics/DriveModels/AckermannDriveModel.h:11:
#0 2447.2 /data/workspace/o3de-extras/Gems/ROS2/Code/Include/ROS2/VehicleDynamics/DriveModels/PidConfiguration.h:11:10: fatal error: 'control_toolbox/pid.hpp' file not found
#0 2447.2 #include <control_toolbox/pid.hpp>
#0 2447.2          ^~~~~~~~~~~~~~~~~~~~~~~~~
#0 2447.2 1 error generated.
#0 2449.9 [956/1074] Building CXX object External/WhiteBox-288c56ac/Code/CMakeFiles/WhiteBox.Editor.Static.dir/profile/Unity/unity_3_cxx.cxx.o
#0 2450.5 [957/1074] Building CXX object External/ROS2-4e7b3125/Code/CMakeFiles/ROS2.Static.dir/profile/Unity/unity_4_cxx.cxx.o
#0 2450.5 FAILED: External/ROS2-4e7b3125/Code/CMakeFiles/ROS2.Static.dir/profile/Unity/unity_4_cxx.cxx.o 
#0 2450.5 /usr/bin/clang++-12 -DAZ_BUILD_CONFIGURATION_TYPE=\"profile\" -DAZ_ENABLE_DEBUG_TOOLS -DAZ_ENABLE_TRACING -DAZ_PHYSICS_DEBUG_ENABLED -DAZ_PROFILE_BUILD -DDEFAULT_RMW_IMPLEMENTATION=rmw_fastrtps_cpp -DIMGUI_API_IMPORT -DIMGUI_ENABLED -DIMGUI_INCLUDE_IMGUI_USER_H -DLINUX -DLINUX64 -DNDEBUG -DO3DE_STACK_CAPTURE_DEPTH=3 -DPAL_TRAIT_LINUX_WINDOW_MANAGER_XCB -DPHYSX_ENABLE_MULTI_THREADING -DRCUTILS_ENABLE_FAULT_INJECTION -D_FORTIFY_SOURCE=2 -D_HAS_EXCEPTIONS=0 -D_PROFILE -D__linux__ -DCMAKE_INTDIR=\"profile\" -I/data/workspace/o3de-extras/Gems/ROS2/Code/Include -I/data/workspace/o3de-extras/Gems/ROS2/Code/Source -I/data/workspace/o3de-extras/Gems/ROS2/Code/Source/VehicleDynamics -I/opt/ros/humble/include -I/opt/ros/humble/include/nav_msgs -I/opt/ros/humble/lib/x86_64-linux-gnu/urdfdom/cmake/../../../../include/urdfdom -I/opt/ros/humble/lib/x86_64-linux-gnu/urdfdom_headers/cmake/../../../../include/urdfdom_headers -I/opt/ros/humble/include/tf2_ros -I/opt/ros/humble/include/rclcpp_components -I/opt/ros/humble/include/message_filters -I/opt/ros/humble/include/tf2 -I/opt/ros/humble/include/ackermann_msgs -I/opt/ros/humble/include/gazebo_msgs -I/opt/ros/humble/include/realtime_tools -I/data/workspace/o3de/Gems/StartingPointInput/Code/Include -I/data/workspace/o3de/Code/Framework/AzCore/. -I/data/workspace/o3de/Code/Framework/AzCore/Platform/Linux -I/data/workspace/o3de/Code/Framework/AzCore/Platform/Common -I/data/workspace/o3de/Code/Framework/AzFramework/. -I/data/workspace/o3de/Code/Framework/AzFramework/Platform/Linux -I/data/workspace/o3de/Code/Framework/AzFramework/Platform/Common/Xcb -I/data/workspace/o3de/Code/Framework/AzNetworking/. -I/data/workspace/o3de/Code/Framework/AzNetworking/Platform/Common -I/data/workspace/o3de/Code/Framework/AzNetworking/Platform/Linux -I/data/workspace/RobotVacuumSample/build/linux/o3de/Code/Framework/AzNetworking/Azcg/Generated/AzNetworking -I/data/workspace/o3de/Gems/Atom/RPI/Code/Include -I/data/workspace/o3de/Gems/Atom/RPI/Code/External -I/data/workspace/o3de/Code/Framework/AtomCore/. -I/data/workspace/o3de/Gems/Atom/RHI/Code/Include -I/data/workspace/o3de/Gems/Atom/Feature/Common/Code/Include -I/data/workspace/o3de/Gems/Atom/Feature/Common/Code/Source -I/data/workspace/o3de/Gems/Atom/Utils/Code/Include -I/data/workspace/o3de/Gems/Profiler/Code/Include -I/data/workspace/o3de/Gems/ImGui/Code/../External/ImGui/v1.82 -I/data/workspace/o3de/Gems/ImGui/Code/Include -I/data/workspace/o3de/Gems/Atom/Feature/Common/Code/3rdParty/ACES -I/data/workspace/o3de/Gems/Atom/Component/DebugCamera/Code/Include -I/data/workspace/o3de/Gems/PhysX/Code/. -I/data/workspace/o3de/Gems/PhysX/Code/Source -I/data/workspace/o3de/Gems/PhysX/Code/Source/Platform/Linux -I/data/workspace/o3de/Gems/PhysX/Code/Include -I/data/workspace/o3de/Code/Legacy/CryCommon/. -I/data/workspace/o3de/Code/Legacy/CryCommon/.. -I/data/workspace/o3de/Code/Legacy/CryCommon/Platform/Linux -isystem /opt/ros/humble/include/rclcpp -isystem /opt/ros/humble/include/ament_index_cpp -isystem /opt/ros/humble/include/libstatistics_collector -isystem /opt/ros/humble/include/rcl -isystem /opt/ros/humble/include/rcpputils -isystem /opt/ros/humble/include/rcutils -isystem /opt/ros/humble/include/builtin_interfaces -isystem /opt/ros/humble/include/rosgraph_msgs -isystem /opt/ros/humble/include/rosidl_typesupport_cpp -isystem /opt/ros/humble/include/rosidl_typesupport_c -isystem /opt/ros/humble/include/rosidl_runtime_cpp -isystem /opt/ros/humble/include/rcl_yaml_param_parser -isystem /opt/ros/humble/include/statistics_msgs -isystem /opt/ros/humble/include/tracetools -isystem /opt/ros/humble/include/rosidl_runtime_c -isystem /opt/ros/humble/include/rosidl_typesupport_interface -isystem /opt/ros/humble/include/rosidl_typesupport_fastrtps_c -isystem /opt/ros/humble/include/rosidl_typesupport_fastrtps_cpp -isystem /opt/ros/humble/include/rmw -isystem /opt/ros/humble/include/rosidl_typesupport_introspection_c -isystem /opt/ros/humble/include/rosidl_typesupport_introspection_cpp -isystem /opt/ros/humble/include/std_msgs -isystem /opt/ros/humble/include/geometry_msgs -isystem /opt/ros/humble/include/sensor_msgs -isystem /opt/ros/humble/include/rcl_interfaces -isystem /opt/ros/humble/include/rclcpp_action -isystem /opt/ros/humble/include/tf2_msgs -isystem /opt/ros/humble/include/trajectory_msgs -isystem /opt/ros/humble/include/control_msgs -isystem /opt/ros/humble/include/fastcdr -isystem /opt/ros/humble/include/rcl_logging_interface -isystem /opt/ros/humble/include/libyaml_vendor -isystem /opt/ros/humble/include/class_loader -isystem /opt/ros/humble/include/composition_interfaces -isystem /opt/ros/humble/include/unique_identifier_msgs -isystem /opt/ros/humble/include/action_msgs -isystem /opt/ros/humble/include/rcl_action -isystem /root/.o3de/3rdParty/packages/Lua-5.4.4-rev1-linux/Lua/include -isystem /root/.o3de/3rdParty/packages/RapidJSON-1.1.0-rev1-multiplatform/RapidJSON/include -isystem /root/.o3de/3rdParty/packages/RapidXML-1.13-rev1-multiplatform/RapidXML/include -isystem /root/.o3de/3rdParty/packages/zlib-1.2.11-rev5-linux/zlib/include -isystem /root/.o3de/3rdParty/packages/zstd-1.35-multiplatform/zstd/lib -isystem /root/.o3de/3rdParty/packages/cityhash-1.1-multiplatform/cityhash/src -isystem /root/.o3de/3rdParty/packages/lz4-1.9.3-vcpkg-rev4-linux/lz4/lz4/include -isystem /root/.o3de/3rdParty/packages/png-1.6.37-rev2-linux/png/include -isystem /root/.o3de/3rdParty/packages/tiff-4.2.0.15-rev3-linux/tiff/include -isystem /root/.o3de/3rdParty/packages/PhysX-4.1.2.29882248-rev5-linux/PhysX/shared/include -isystem /root/.o3de/3rdParty/packages/PhysX-4.1.2.29882248-rev5-linux/PhysX/shared/include/foundation -isystem /root/.o3de/3rdParty/packages/PhysX-4.1.2.29882248-rev5-linux/PhysX/shared/include/geometry -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Wno-inconsistent-missing-override -Wrange-loop-analysis -Wno-unknown-warning-option -Wno-parentheses -Wno-reorder -Wno-switch -Wno-undefined-var-template -msse4.1  -O2 -g -fstack-protector-all -fstack-check -fPIC -std=c++17 -MD -MT External/ROS2-4e7b3125/Code/CMakeFiles/ROS2.Static.dir/profile/Unity/unity_4_cxx.cxx.o -MF External/ROS2-4e7b3125/Code/CMakeFiles/ROS2.Static.dir/profile/Unity/unity_4_cxx.cxx.o.d -o External/ROS2-4e7b3125/Code/CMakeFiles/ROS2.Static.dir/profile/Unity/unity_4_cxx.cxx.o -c /data/workspace/RobotVacuumSample/build/linux/External/ROS2-4e7b3125/Code/CMakeFiles/ROS2.Static.dir/Unity/unity_4_cxx.cxx
#0 2450.5 In file included from /data/workspace/RobotVacuumSample/build/linux/External/ROS2-4e7b3125/Code/CMakeFiles/ROS2.Static.dir/Unity/unity_4_cxx.cxx:11:
#0 2450.5 In file included from /data/workspace/o3de-extras/Gems/ROS2/Code/Source/VehicleDynamics/DriveModels/AckermannDriveModel.cpp:9:
#0 2450.5 In file included from /data/workspace/o3de-extras/Gems/ROS2/Code/Source/VehicleDynamics/DriveModels/AckermannDriveModel.h:11:
#0 2450.5 /data/workspace/o3de-extras/Gems/ROS2/Code/Include/ROS2/VehicleDynamics/DriveModels/PidConfiguration.h:11:10: fatal error: 'control_toolbox/pid.hpp' file not found
#0 2450.5 #include <control_toolbox/pid.hpp>
#0 2450.5          ^~~~~~~~~~~~~~~~~~~~~~~~~
#0 2450.5 1 error generated.
#0 2453.2 [958/1074] Building CXX object External/WhiteBox-288c56ac/Code/CMakeFiles/WhiteBox.Editor.Static.dir/profile/Unity/unity_1_cxx.cxx.o
#0 2485.2 [959/1074] Building CXX object External/PhysX-dc2e37a1/Code/CMakeFiles/PhysX.Editor.Static.dir/profile/Unity/unity_0_cxx.cxx.o
#0 2506.0 [960/1074] Building CXX object External/ScriptCanvas-8caffd05/Code/CMakeFiles/ScriptCanvas.Static.dir/profile/Unity/unity_13_cxx.cxx.o
#0 2520.9 [961/1074] Building CXX object External/WhiteBox-288c56ac/Code/CMakeFiles/WhiteBox.Editor.Static.dir/profile/Unity/unity_0_cxx.cxx.o
#0 2825.0 [962/1074] Building CXX object External/ScriptCanvas-8caffd05/Code/CMakeFiles/ScriptCanvas.Static.dir/profile/Unity/unity_11_cxx.cxx.o
#0 2825.0 ninja: build stopped: subcommand failed.
------
Dockerfile:99
--------------------
  98 |     # Clone O3DE repos, register, build, and cleanup in the same layer to reduce the size
  99 | >>> RUN if [ "${IMAGE_TYPE}" = "simulation" ]; then \
 100 | >>>         apt-get install -y --no-install-recommends ros-${ROS_DISTRO}-desktop && \
 101 | >>>         cd $WORKSPACE && \
 102 | >>>         git clone --recursive $O3DE_REPO && \
 103 | >>>         git -C $WORKSPACE/o3de checkout $O3DE_BRANCH &&\
 104 | >>>         git -C $WORKSPACE/o3de lfs install && \
 105 | >>>         git -C $WORKSPACE/o3de lfs pull && \
 106 | >>>         $WORKSPACE/o3de/python/get_python.sh && \
 107 | >>>         $WORKSPACE/o3de/scripts/o3de.sh register -ep $WORKSPACE/o3de && \
 108 | >>>         git clone $O3DE_EXTRAS_REPO && \
 109 | >>>         git -C $WORKSPACE/o3de-extras checkout $O3DE_EXTRAS_BRANCH &&\
 110 | >>>         $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/o3de-extras/Gems/ROS2 && \
 111 | >>>         git clone --recursive $LOFT_GEM_REPO && \
 112 | >>>         git -C $WORKSPACE/loft-arch-vis-sample checkout $LOFT_GEM_BRANCH &&\
 113 | >>>         git -C $WORKSPACE/loft-arch-vis-sample lfs install && \
 114 | >>>         git -C $WORKSPACE/loft-arch-vis-sample lfs pull && \
 115 | >>>         $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/loft-arch-vis-sample/Gems/ArchVis/ && \
 116 | >>>         git clone --recursive $ROBOT_VAC_SAMPLE_REPO && \
 117 | >>>         git -C $WORKSPACE/RobotVacuumSample checkout $ROBOT_VAC_SAMPLE_BRANCH &&\
 118 | >>>         git -C $WORKSPACE/RobotVacuumSample lfs install && \
 119 | >>>         git -C $WORKSPACE/RobotVacuumSample lfs pull && \
 120 | >>>         $WORKSPACE/o3de/scripts/o3de.sh register -pp $WORKSPACE/RobotVacuumSample/  && \
 121 | >>>         . /opt/ros/${ROS_VERSION}/setup.sh && \
 122 | >>>         cmake -B $WORKSPACE/RobotVacuumSample/build/linux -S $WORKSPACE/RobotVacuumSample -G "Ninja Multi-Config" -DLY_STRIP_DEBUG_SYMBOLS=TRUE -DLY_DISABLE_TEST_MODULES=ON && \
 123 | >>>         cmake --build $WORKSPACE/RobotVacuumSample/build/linux --config profile --target AssetProcessorBatch RobotVacuumSample.GameLauncher RobotVacuumSample.Assets -j $CMAKE_JOBS && \
 124 | >>>         $WORKSPACE/cleanup.bash; \
 125 | >>>     elif [  "${IMAGE_TYPE}" = "navstack" ]; then \
 126 | >>>         apt-get install -y --no-install-recommends ros-${ROS_DISTRO}-desktop && \
 127 | >>>         cd $WORKSPACE && \
 128 | >>>         git clone --recursive $ROBOT_VAC_SAMPLE_REPO && \
 129 | >>>         git -C $WORKSPACE/RobotVacuumSample checkout $ROBOT_VAC_SAMPLE_BRANCH; \
 130 | >>>     else \
 131 | >>>         echo "Unsupported IMAGE_TYPE: ${IMAGE_TYPE}" && exit 1; \
 132 | >>>     fi
 133 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c if [ \"${IMAGE_TYPE}\" = \"simulation\" ]; then         apt-get install -y --no-install-recommends ros-${ROS_DISTRO}-desktop &&         cd $WORKSPACE &&         git clone --recursive $O3DE_REPO &&         git -C $WORKSPACE/o3de checkout $O3DE_BRANCH &&        git -C $WORKSPACE/o3de lfs install &&         git -C $WORKSPACE/o3de lfs pull &&         $WORKSPACE/o3de/python/get_python.sh &&         $WORKSPACE/o3de/scripts/o3de.sh register -ep $WORKSPACE/o3de &&         git clone $O3DE_EXTRAS_REPO &&         git -C $WORKSPACE/o3de-extras checkout $O3DE_EXTRAS_BRANCH &&        $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/o3de-extras/Gems/ROS2 &&         git clone --recursive $LOFT_GEM_REPO &&         git -C $WORKSPACE/loft-arch-vis-sample checkout $LOFT_GEM_BRANCH &&        git -C $WORKSPACE/loft-arch-vis-sample lfs install &&         git -C $WORKSPACE/loft-arch-vis-sample lfs pull &&         $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/loft-arch-vis-sample/Gems/ArchVis/ &&         git clone --recursive $ROBOT_VAC_SAMPLE_REPO &&         git -C $WORKSPACE/RobotVacuumSample checkout $ROBOT_VAC_SAMPLE_BRANCH &&        git -C $WORKSPACE/RobotVacuumSample lfs install &&         git -C $WORKSPACE/RobotVacuumSample lfs pull &&         $WORKSPACE/o3de/scripts/o3de.sh register -pp $WORKSPACE/RobotVacuumSample/  &&         . /opt/ros/${ROS_VERSION}/setup.sh &&         cmake -B $WORKSPACE/RobotVacuumSample/build/linux -S $WORKSPACE/RobotVacuumSample -G \"Ninja Multi-Config\" -DLY_STRIP_DEBUG_SYMBOLS=TRUE -DLY_DISABLE_TEST_MODULES=ON &&         cmake --build $WORKSPACE/RobotVacuumSample/build/linux --config profile --target AssetProcessorBatch RobotVacuumSample.GameLauncher RobotVacuumSample.Assets -j $CMAKE_JOBS &&         $WORKSPACE/cleanup.bash;     elif [  \"${IMAGE_TYPE}\" = \"navstack\" ]; then         apt-get install -y --no-install-recommends ros-${ROS_DISTRO}-desktop &&         cd $WORKSPACE &&         git clone --recursive $ROBOT_VAC_SAMPLE_REPO &&         git -C $WORKSPACE/RobotVacuumSample checkout $ROBOT_VAC_SAMPLE_BRANCH;     else         echo \"Unsupported IMAGE_TYPE: ${IMAGE_TYPE}\" && exit 1;     fi" did not complete successfully: exit code: 1

Steps to reproduce

  1. Follow steps listed on the https://github.com/o3de/RobotVacuumSample/blob/main/Docker/README.md page.

Expected behavior docker build -t o3de_robot_vacuum_simulation:latest . finishes, generating Docker image.

Actual behavior docker build -t o3de_robot_vacuum_simulation:latest . fails near the end of the step when O3DE engine is build, preventing Docker image from being generated.

Full Terminal log and PC hardinfo file DockerImageBuild.txt hardinfo_report-GPC-800.txt

Found in Branch main(77a88b3)

Commit ID from o3de/RobotVacuumSample Repository 77a88b343f20c1a36f82db18e1e19c505bbda4f1

Desktop

spham-amzn commented 1 year ago

There were updates to the ROS packages in general that the original git tags in the docker script did not handle. The default tags need to be updated and this process re-tested.

LB-ArturZieba commented 1 year ago

I was unable to verify this fully on main(191cd03de57c5cfc604df329649ec16ecc9ef72a) build, as when reaching [1075/1076] build progress (AssetProcessorBatch) I was simply logged out of the Ubuntu account. This causes the Terminal to get closed and as the Docker image build step (Step 8 includes o3de clone, configuration and build) was not finished, rerunning the build will cause that whole step to be redone from the start. I ran the Docker image build twice and both times this occurred.

Should this be reported as a separate issue, or is there something I could do to prevent this from happening?