diff --git a/create_jenkins_job.py b/create_jenkins_job.py index 47fcc567..f71ea600 100755 --- a/create_jenkins_job.py +++ b/create_jenkins_job.py @@ -146,7 +146,8 @@ def main(argv=None): 'linux-aarch64': { 'label_expression': 'linux_aarch64', 'shell_type': 'Shell', - 'ignore_rmw_default': data['ignore_rmw_default'] | {'rmw_connextdds'}, + 'ignore_rmw_default': data['ignore_rmw_default'], + 'use_connext_debs_default': 'true', 'test_args_default': re.sub(r'(--ctest-args +-LE +)"?([^ "]+)"?', r'\1"(mimick|\2)"', data['test_args_default']), }, 'linux-rhel': { @@ -206,8 +207,6 @@ def create_job(os_name, job_name, template_file, additional_dict): # configure a manual version of the packaging job ignore_rmw_default_packaging = set() - if os_name in ['linux-aarch64']: - ignore_rmw_default_packaging |= {'rmw_connextdds'} create_job(os_name, 'ci_packaging_' + os_name, 'packaging_job.xml.em', { 'cmake_build_type': 'RelWithDebInfo', 'label_expression': packaging_label_expression, diff --git a/linux_docker_resources/Dockerfile b/linux_docker_resources/Dockerfile index 8349cfdc..bfdbd392 100644 --- a/linux_docker_resources/Dockerfile +++ b/linux_docker_resources/Dockerfile @@ -153,18 +153,22 @@ RUN apt-get update && apt-get install --no-install-recommends -y lcov # merged use the fork with the fix. RUN pip3 install -U git+https://github.com/ahcorde/lcov-to-cobertura-xml@master -# Install the Connext binary from the OSRF repositories. if ROS_DISTRO is humble or jazzy -# install rti-connext-dds-6.0.1 else install rti-connext-dds-7.3.0-ros. -RUN if test \( ${PLATFORM} = x86 -a ${INSTALL_CONNEXT_DEBS} = true \); then \ +# Install the Connext binary from the OSRF repositories. if ROS_DISTRO is humble or jazzy and +# PLATFORM is x86, then install rti-connext-dds-6.0.1. Otherwise, install +# rti-connext-dds-7.3.0-ros. +RUN \ +if test ${INSTALL_CONNEXT_DEBS} = true; then \ if test \( ${ROS_DISTRO} = humble -o ${ROS_DISTRO} = jazzy \); then \ - apt-get update && RTI_NC_LICENSE_ACCEPTED=yes apt-get install -y rti-connext-dds-6.0.1; \ + if test ${PLATFORM} = x86; then \ + apt-get update && RTI_NC_LICENSE_ACCEPTED=yes apt-get install -y rti-connext-dds-6.0.1; \ + fi; \ else \ apt-get update && RTI_NC_LICENSE_ACCEPTED=yes apt-get install -y rti-connext-dds-7.3.0-ros; \ fi; \ - fi +fi # Install the RTI dependencies. -RUN if test ${PLATFORM} = x86; then apt-get update && apt-get install --no-install-recommends -y default-jre-headless; fi +RUN apt-get update && apt-get install --no-install-recommends -y default-jre-headless # Install dependencies for RTI web binaries install script. RUN apt-get update && apt-get install --no-install-recommends -y python3-pexpect @@ -181,13 +185,13 @@ RUN if test ${ROS_DISTRO} = jazzy -o ${ROS_DISTRO} = humble; then \ /tmp/rticonnextdds-src/rti_connext_dds-6.0.1.25-pro-target-x64Linux4gcc7.3.0.rtipkg; do \ cat $(echo ${splitpkg}.0?? | sort) > $splitpkg; \ done; \ - else \ +else \ for splitpkg in \ /tmp/rticonnextdds-src/rti_connext_dds-7.3.0-pro-host-x64Linux.run \ /tmp/rticonnextdds-src/rti_connext_dds-7.3.0-pro-target-x64Linux4gcc7.3.0.rtipkg; do \ cat $(echo ${splitpkg}.0?? | sort) > $splitpkg; \ done; \ - fi +fi # Make the RTI Connext installation script executable. For any version of Connext. RUN chmod 755 /tmp/rticonnextdds-src/rti_connext_dds-*-pro-host-x64Linux.run diff --git a/linux_docker_resources/entry_point.sh b/linux_docker_resources/entry_point.sh index 27ac9aa6..24ea3fa3 100755 --- a/linux_docker_resources/entry_point.sh +++ b/linux_docker_resources/entry_point.sh @@ -25,79 +25,107 @@ echo "done." . /etc/os-release VERSION_ID_MAJOR=$(echo $VERSION_ID | sed 's/\..*//') -# We only attempt to install Connext on Ubuntu amd64 -if [ "${ARCH}" = "x86_64" -a "${ID}" = "ubuntu" ]; then - IGNORE_CONNEXTDDS="" +# Function to install Connext DDS. +install_connextdds() { + # We only attempt to install Connext on Ubuntu + if [ "${ID}" != "ubuntu" ]; then + echo "Connext installation is only supported on Ubuntu. Skipping Connext installation." + return 0 + fi + + # Check if the "ignore-rmw" CI argument contains "rmw_connextdds" and exit if it does. ignore_rwm_seen="false" for arg in ${CI_ARGS} ; do case $arg in ("--ignore-rmw") ignore_rmw_seen="true" ;; ("-"*) ignore_rmw_seen="false" ;; - (*) if [ $ignore_rmw_seen = "true" ] ; then [ $arg = "rmw_connextdds" ] && IGNORE_CONNEXTDDS="true" && break ; fi + (*) + if [ $ignore_rmw_seen = "true" ] && [ $arg = "rmw_connextdds" ]; then + echo "Ignoring installation of Connext." + return 0 + fi + ;; esac done - # Install RTI Connext DDS if we didn't find 'rmw_connextdds' within the "ignore-rmw" option strings. - if [ -z "${IGNORE_CONNEXTDDS}" ]; then - echo "Installing Connext..." + echo "Installing Connext..." + export CONNEXT_FULL_VERSION="7.3.0" + export CONNEXT_DISPLAY_VERSION="$CONNEXT_FULL_VERSION" + if [ "${ROS_DISTRO}" = "jazzy" ] || [ "${ROS_DISTRO}" = "humble" ]; then + export CONNEXT_FULL_VERSION="6.0.1.25" + export CONNEXT_DISPLAY_VERSION="${CONNEXT_FULL_VERSION%.*}" + fi - export CONNEXT_FULL_VERSION="7.3.0" - export CONNEXT_DISPLAY_VERSION="$CONNEXT_FULL_VERSION" - if [ "${ROS_DISTRO}" = "jazzy" ] || [ "${ROS_DISTRO}" = "humble" ]; then - export CONNEXT_FULL_VERSION="6.0.1.25" - export CONNEXT_DISPLAY_VERSION="${CONNEXT_FULL_VERSION%.*}" + case "${CI_ARGS}" in + *--connext-debs*) + connext_installation_dir="/opt/rti.com/rti_connext_dds-${CONNEXT_DISPLAY_VERSION}" + setenv_script_dir="${connext_installation_dir}/resource/scripts" + + # Installing Connext through Debian packages is supported on both x86_64 and aarch64 architectures. If we're on an unsupported architecture, skip the installation. + echo "Using Debian package of Connext" + if test -r ${setenv_script_dir}/rtisetenv_x64Linux4gcc7.3.0.sh; then + echo "Sourcing RTI setenv script ${setenv_script_dir}/rtisetenv_x64Linux4gcc7.3.0.sh" + . ${setenv_script_dir}/rtisetenv_x64Linux4gcc7.3.0.sh + elif test -r ${setenv_script_dir}/rtisetenv_armv8Linux4gcc7.3.0.sh; then + echo "Sourcing RTI setenv script ${setenv_script_dir}/rtisetenv_armv8Linux4gcc7.3.0.sh" + . ${setenv_script_dir}/rtisetenv_armv8Linux4gcc7.3.0.sh + else + echo "No Connext installation through Debian packages found. Skipping Connext installation." + return 0 + fi + ;; + *) + # Support for installing Connext through the RTI website installers is only supported on + # x86_64 architecture. If we're on a different architecture, skip the installation. + if [ "${ARCH}" != "x86_64" ]; then + echo "Connext through RTI packages is only supported on amd64 architecture. Skipping Connext installation." + return 0 fi - case "${CI_ARGS}" in - *--connext-debs*) - echo "Using Debian package of Connext" - if test -r /opt/rti.com/rti_connext_dds-${CONNEXT_DISPLAY_VERSION}/resource/scripts/rtisetenv_x64Linux4gcc7.3.0.sh; then - echo "Sourcing RTI setenv script /opt/rti.com/rti_connext_dds-${CONNEXT_DISPLAY_VERSION}/resource/scripts/rtisetenv_x64Linux4gcc7.3.0.sh" - . /opt/rti.com/rti_connext_dds-${CONNEXT_DISPLAY_VERSION}/resource/scripts/rtisetenv_x64Linux4gcc7.3.0.sh - fi - ;; - *) - echo "Installing Connext binaries off RTI website..." - if test -x /tmp/rticonnextdds-src/rti_connext_dds-${CONNEXT_DISPLAY_VERSION}-pro-host-x64Linux.run; then + echo "Installing Connext binaries off RTI website..." + if test -x /tmp/rticonnextdds-src/rti_connext_dds-${CONNEXT_DISPLAY_VERSION}-pro-host-x64Linux.run; then + rtipkg_list="\ + /tmp/rticonnextdds-src/openssl-3.0.12-${CONNEXT_FULL_VERSION}-host-x64Linux.rtipkg \ + /tmp/rticonnextdds-src/openssl-3.0.12-${CONNEXT_FULL_VERSION}-target-x64Linux4gcc7.3.0.rtipkg \ + /tmp/rticonnextdds-src/rti_security_plugins-${CONNEXT_FULL_VERSION}-host-openssl-3.0-x64Linux.rtipkg \ + /tmp/rticonnextdds-src/rti_security_plugins-${CONNEXT_FULL_VERSION}-target-openssl-3.0-x64Linux4gcc7.3.0.rtipkg \ + " + connext_base_architecture="x64Linux3gcc4.8.2" + if [ "${CONNEXT_FULL_VERSION}" = "6.0.1.25" ]; then rtipkg_list="\ - /tmp/rticonnextdds-src/openssl-3.0.12-${CONNEXT_FULL_VERSION}-host-x64Linux.rtipkg \ - /tmp/rticonnextdds-src/openssl-3.0.12-${CONNEXT_FULL_VERSION}-target-x64Linux4gcc7.3.0.rtipkg \ - /tmp/rticonnextdds-src/rti_security_plugins-${CONNEXT_FULL_VERSION}-host-openssl-3.0-x64Linux.rtipkg \ - /tmp/rticonnextdds-src/rti_security_plugins-${CONNEXT_FULL_VERSION}-target-openssl-3.0-x64Linux4gcc7.3.0.rtipkg \ + /tmp/rticonnextdds-src/rti_connext_dds-${CONNEXT_FULL_VERSION}-pro-host-x64Linux.rtipkg \ + /tmp/rticonnextdds-src/openssl-1.1.1k-${CONNEXT_FULL_VERSION}-host-x64Linux.rtipkg \ + /tmp/rticonnextdds-src/rti_security_plugins-${CONNEXT_FULL_VERSION}-host-x64Linux.rtipkg \ + /tmp/rticonnextdds-src/rti_security_plugins-${CONNEXT_FULL_VERSION}-target-x64Linux4gcc7.3.0.rtipkg \ " - connext_base_architecture="x64Linux3gcc4.8.2" - if [ "${CONNEXT_FULL_VERSION}" = "6.0.1.25" ]; then - rtipkg_list="\ - /tmp/rticonnextdds-src/rti_connext_dds-${CONNEXT_FULL_VERSION}-pro-host-x64Linux.rtipkg \ - /tmp/rticonnextdds-src/openssl-1.1.1k-${CONNEXT_FULL_VERSION}-host-x64Linux.rtipkg \ - /tmp/rticonnextdds-src/rti_security_plugins-${CONNEXT_FULL_VERSION}-host-x64Linux.rtipkg \ - /tmp/rticonnextdds-src/rti_security_plugins-${CONNEXT_FULL_VERSION}-target-x64Linux4gcc7.3.0.rtipkg \ - " - connext_base_architecture="x64Linux2.6gcc4.4.5" - fi - python3 -u /tmp/rti_web_binaries_install_script.py /tmp/rticonnextdds-src/rti_connext_dds-${CONNEXT_DISPLAY_VERSION}-pro-host-x64Linux.run \ - /home/rosbuild/rti_connext_dds-${CONNEXT_DISPLAY_VERSION} --rtipkg_paths \ - /tmp/rticonnextdds-src/rti_connext_dds-${CONNEXT_FULL_VERSION}-pro-target-x64Linux4gcc7.3.0.rtipkg \ - $rtipkg_list - if [ $? -ne 0 ]; then - echo "Connext not installed correctly (maybe you're on an ARM machine?)." >&2 - exit 1 - fi - export CONNEXTDDS_DIR=/home/rosbuild/rti_connext_dds-${CONNEXT_DISPLAY_VERSION} - export RTI_OPENSSL_LIBS=$CONNEXTDDS_DIR/resource/app/lib/${connext_base_architecture} - else - echo "No connext installation files found found." >&2 - exit 1 + connext_base_architecture="x64Linux2.6gcc4.4.5" fi - mv /tmp/rti_license.dat /home/rosbuild/rti_license.dat - export RTI_LICENSE_FILE=/home/rosbuild/rti_license.dat - ;; - esac - echo "done." - else - echo "NOT installing Connext." - fi + python3 -u /tmp/rti_web_binaries_install_script.py /tmp/rticonnextdds-src/rti_connext_dds-${CONNEXT_DISPLAY_VERSION}-pro-host-x64Linux.run \ + /home/rosbuild/rti_connext_dds-${CONNEXT_DISPLAY_VERSION} --rtipkg_paths \ + /tmp/rticonnextdds-src/rti_connext_dds-${CONNEXT_FULL_VERSION}-pro-target-x64Linux4gcc7.3.0.rtipkg \ + $rtipkg_list + if [ $? -ne 0 ]; then + echo "Connext not installed correctly (maybe you're on an ARM machine?)." >&2 + return 1 + fi + export CONNEXTDDS_DIR=/home/rosbuild/rti_connext_dds-${CONNEXT_DISPLAY_VERSION} + export RTI_OPENSSL_LIBS=$CONNEXTDDS_DIR/resource/app/lib/${connext_base_architecture} + else + echo "No connext installation files found found." >&2 + return 1 + fi + mv /tmp/rti_license.dat /home/rosbuild/rti_license.dat + export RTI_LICENSE_FILE=/home/rosbuild/rti_license.dat + ;; + esac + return 0 +} + +if ! install_connextdds; then + echo "Connext installation failed. Exiting." >&2 + exit 1 fi +echo "done." echo "Fixing permissions..." sed -i -e "s/:$ORIG_UID:$ORIG_GID:/:$UID:$GID:/" /etc/passwd