From 1b6414c74ec842acf044c446169d0acb78cb8e8c Mon Sep 17 00:00:00 2001 From: Marina Moreira Date: Tue, 14 Feb 2023 13:09:46 -0800 Subject: [PATCH 1/4] adding humble CI --- .github/workflows/ci_pr_ros2.yml | 4 +-- scripts/docker/build.sh | 16 +++++++++- scripts/docker/ros2/ros2_astrobee.Dockerfile | 3 +- .../docker/ros2/ros2_humble_deb.Dockerfile | 30 +++++++++++++++++++ 4 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 scripts/docker/ros2/ros2_humble_deb.Dockerfile diff --git a/.github/workflows/ci_pr_ros2.yml b/.github/workflows/ci_pr_ros2.yml index b5442a2048..7d1022aa9c 100644 --- a/.github/workflows/ci_pr_ros2.yml +++ b/.github/workflows/ci_pr_ros2.yml @@ -1,4 +1,4 @@ -name: Build and Test CI for Pull Requests +name: Build and Test CI for Pull Requests in ROS2 on: pull_request: @@ -20,4 +20,4 @@ jobs: run: git submodule update --init --depth 1 description/media - name: Build, test - run: ./scripts/docker/build.sh --focal --remote rolling astrobee_ros2 + run: ./scripts/docker/build.sh --focal --remote rolling humble diff --git a/scripts/docker/build.sh b/scripts/docker/build.sh index 10e1a351a6..96a81a62d4 100755 --- a/scripts/docker/build.sh +++ b/scripts/docker/build.sh @@ -272,12 +272,26 @@ if [ "$astrobee_quick" = "true" ]; then build astrobee_quick "${revision}-" "quick-" fi +if [ "$rolling_base" = "true" ] | [ "$remote" = "false" ] & [ "$rolling" = "true" ]; then + ROS_VERSION=rolling + build ros2/ros2_base "${revision}-" "rolling_base-" + build ros2/ros2_rolling_deb "${revision}-" "rolling-" +fi + if [ "$rolling" = "true" ]; then + ROS_VERSION=rolling build ros2/ros2_base "${revision}-" "rolling_base-" build ros2/ros2_rolling_deb "${revision}-" "rolling-" + build ros2/ros2_astrobee "${revision}-" "ros2-" +fi + +if [ "$humble_base" = "true" ] | [ "$remote" = "false" ] & [ "$humble" = "true" ]; then + ROS_VERSION=humble + build ros2/ros2_humble_deb "${revision}-" "humble-" fi -if [ "$build_astrobee_ros2" = "true" ]; then +if [ "$humble" = "true" ]; then + ROS_VERSION=humble build ros2/ros2_astrobee "${revision}-" "ros2-" fi diff --git a/scripts/docker/ros2/ros2_astrobee.Dockerfile b/scripts/docker/ros2/ros2_astrobee.Dockerfile index 1f7a522a09..365c09fb52 100644 --- a/scripts/docker/ros2/ros2_astrobee.Dockerfile +++ b/scripts/docker/ros2/ros2_astrobee.Dockerfile @@ -1,9 +1,8 @@ ARG UBUNTU_VERSION=20.04 ARG REMOTE=astrobee -FROM ${REMOTE}/astrobee:latest-rolling-ubuntu${UBUNTU_VERSION} - ARG ROS_DISTRO=rolling +FROM ${REMOTE}/astrobee:latest-${ROS_DISTRO}-ubuntu${UBUNTU_VERSION} COPY . /src/astrobee/src/ RUN . /opt/ros/${ROS_DISTRO}/setup.sh \ diff --git a/scripts/docker/ros2/ros2_humble_deb.Dockerfile b/scripts/docker/ros2/ros2_humble_deb.Dockerfile new file mode 100644 index 0000000000..52a7b375ec --- /dev/null +++ b/scripts/docker/ros2/ros2_humble_deb.Dockerfile @@ -0,0 +1,30 @@ + +ARG UBUNTU_VERSION=20.04 +ARG REMOTE=astrobee +FROM osrf/ros:humble-desktop + +# install gazebo and dependencies +RUN apt-get update && apt-get install -q -y --fix-missing \ + binutils \ + mesa-utils \ + x-window-system \ + libgoogle-glog-dev libgflags-dev libgtest-dev \ + libluajit-5.1-dev \ + ros-humble-gazebo-ros-pkgs \ + ros-humble-xacro \ + ros-humble-ros-testing \ + ros-humble-launch-pytest \ + && rm -rf /var/lib/apt/lists/* + +# Install Astrobee---------------------------------------------------------------- +COPY ./scripts/setup/debians /setup/astrobee/debians + +RUN apt-get update \ + && /bin/bash /setup/astrobee/debians/build_install_debians.sh \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /setup/astrobee/debians + +# COPY ./scripts/setup/packages_*.lst /setup/astrobee/ +# note apt-get update is run within the following shell script +# RUN /setup/astrobee/install_desktop_packages.sh \ +# && rm -rf /var/lib/apt/lists/* From c798e2012a1b8d4b538865c2f23f86fa7146ecd9 Mon Sep 17 00:00:00 2001 From: Marina Moreira Date: Tue, 14 Feb 2023 13:15:11 -0800 Subject: [PATCH 2/4] update build script --- .github/workflows/ci_pr_ros2.yml | 19 +++++++++++++++++-- scripts/docker/build.sh | 20 ++++++++++++++++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_pr_ros2.yml b/.github/workflows/ci_pr_ros2.yml index 7d1022aa9c..5739f34bfa 100644 --- a/.github/workflows/ci_pr_ros2.yml +++ b/.github/workflows/ci_pr_ros2.yml @@ -7,7 +7,7 @@ on: jobs: - build-focal: + build-rolling: runs-on: ubuntu-20.04 @@ -20,4 +20,19 @@ jobs: run: git submodule update --init --depth 1 description/media - name: Build, test - run: ./scripts/docker/build.sh --focal --remote rolling humble + run: ./scripts/docker/build.sh --focal --remote rolling + + build-humble: + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Checkout submodule + run: git submodule update --init --depth 1 description/media + + - name: Build, test + run: ./scripts/docker/build.sh --focal --remote humble diff --git a/scripts/docker/build.sh b/scripts/docker/build.sh index 96a81a62d4..7db4ac41b4 100755 --- a/scripts/docker/build.sh +++ b/scripts/docker/build.sh @@ -76,10 +76,14 @@ os=`cat /etc/os-release | grep -oP "(?<=VERSION_CODENAME=).*"` build_astrobee_base="false" build_astrobee="false" build_test_astrobee="false" +rolling_base="false" +humble_base="false" rolling="false" +humble="false" push_astrobee_base="false" push_astrobee="false" push_rolling="false" +push_humble="false" remote="false" owner="nasa" @@ -138,6 +142,10 @@ while [ "$1" != "" ]; do ;; rolling ) rolling="true" ;; + humble_base ) humble_base="true" + ;; + humble ) humble="true" + ;; push_astrobee_base ) push_astrobee_base="true" ;; push_astrobee ) push_astrobee="true" @@ -146,6 +154,10 @@ while [ "$1" != "" ]; do ;; push_rolling ) push_rolling="true" ;; + push_rolling_base ) push_humble_base="true" + ;; + push_rolling ) push_humble="true" + ;; push_astrobee_ros2 ) push_astrobee_ros2="true" ;; * ) echo "unknown target '$1'" @@ -282,7 +294,7 @@ if [ "$rolling" = "true" ]; then ROS_VERSION=rolling build ros2/ros2_base "${revision}-" "rolling_base-" build ros2/ros2_rolling_deb "${revision}-" "rolling-" - build ros2/ros2_astrobee "${revision}-" "ros2-" + build ros2/ros2_astrobee "${revision}-" "ros2-rolling-" fi if [ "$humble_base" = "true" ] | [ "$remote" = "false" ] & [ "$humble" = "true" ]; then @@ -292,7 +304,7 @@ fi if [ "$humble" = "true" ]; then ROS_VERSION=humble - build ros2/ros2_astrobee "${revision}-" "ros2-" + build ros2/ros2_astrobee "${revision}-" "ros2-humble-" fi if [ "$push_astrobee_base" = "true" ]; then @@ -308,6 +320,10 @@ if [ "$push_rolling" = "true" ]; then push rolling "${revision}-" "rolling-" fi +if [ "$push_rolling" = "true" ]; then + push [ "$remote" = "false" ] & "${revision}-" "humble-" +fi + if [ "$push_astrobee_ros2" = "true" ]; then push astrobee "${revision}-" "ros2-" fi \ No newline at end of file From 70db40448c36d971882d332801b70b34cccd55ca Mon Sep 17 00:00:00 2001 From: Marina Moreira Date: Tue, 14 Feb 2023 16:16:59 -0800 Subject: [PATCH 3/4] need to repeat ros_version cmd --- scripts/docker/ros2/ros2_astrobee.Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/docker/ros2/ros2_astrobee.Dockerfile b/scripts/docker/ros2/ros2_astrobee.Dockerfile index 365c09fb52..6969df35c8 100644 --- a/scripts/docker/ros2/ros2_astrobee.Dockerfile +++ b/scripts/docker/ros2/ros2_astrobee.Dockerfile @@ -4,6 +4,8 @@ ARG REMOTE=astrobee ARG ROS_DISTRO=rolling FROM ${REMOTE}/astrobee:latest-${ROS_DISTRO}-ubuntu${UBUNTU_VERSION} +ARG ROS_DISTRO=rolling + COPY . /src/astrobee/src/ RUN . /opt/ros/${ROS_DISTRO}/setup.sh \ && cd /src/astrobee \ From 5ffe0edc7b9d7fe1768376d4ec2f807208c89adc Mon Sep 17 00:00:00 2001 From: Marina Moreira Date: Mon, 20 Feb 2023 12:14:28 -0800 Subject: [PATCH 4/4] set up timezone --- scripts/docker/ros2/ros2_humble_deb.Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/docker/ros2/ros2_humble_deb.Dockerfile b/scripts/docker/ros2/ros2_humble_deb.Dockerfile index 52a7b375ec..4f1f29321b 100644 --- a/scripts/docker/ros2/ros2_humble_deb.Dockerfile +++ b/scripts/docker/ros2/ros2_humble_deb.Dockerfile @@ -3,6 +3,13 @@ ARG UBUNTU_VERSION=20.04 ARG REMOTE=astrobee FROM osrf/ros:humble-desktop +# setup timezone +RUN echo 'Etc/UTC' > /etc/timezone \ + ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime \ + && apt-get update \ + && apt-get install -q -y --no-install-recommends tzdata \ + && rm -rf /var/lib/apt/lists/* + # install gazebo and dependencies RUN apt-get update && apt-get install -q -y --fix-missing \ binutils \