Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker image to humble #165

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
15 changes: 5 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build rmf image and push to gh registry
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: ${{ github.repository }}/rmf_demos
# update registry only during push to main and nightly build
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
tags: latest
- name: build rmf_demos image
run: ./build-docker.sh
- name: push to gh registry
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
run: docker push ghcr.io/open-rmf/rmf/rmf_demos
12 changes: 8 additions & 4 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ on:
jobs:
build_and_test:
name: Nightly build and test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: deps
uses: ros-tooling/setup-ros@v0.2
uses: ros-tooling/setup-ros@v0.3
with:
required-ros-distributions: galactic
required-ros-distributions: humble
- name: setup clang
run: |
sudo apt update && sudo apt install -y clang lldb lld
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
- uses: actions/checkout@v2
- name: build_and_test
uses: ros-tooling/[email protected]
env:
QT_QPA_PLATFORM: offscreen
with:
target-ros2-distro: galactic
target-ros2-distro: humble
# build all packages listed in the meta package
package-name: |
rmf_utils
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/rmf_deployment_template/
72 changes: 2 additions & 70 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,74 +1,6 @@
#-----------------------
# Stage 1 - Dependencies
#-----------------------
FROM ghcr.io/open-rmf/rmf_deployment_template/builder-rmf

FROM ros:galactic AS builder

RUN apt-get update \
&& apt-get install -y \
cmake \
curl \
git \
python3-colcon-common-extensions \
python3-vcstool \
qt5-default \
wget \
python3-pip \
&& pip3 install flask-socketio \
&& rm -rf /var/lib/apt/lists/*

# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD83DB69272AFE98867170598AF249743

# setup sources.list
RUN . /etc/os-release \
&& echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list

RUN mkdir $HOME/rmf_demos_ws
WORKDIR $HOME/rmf_demos_ws
RUN mkdir src
RUN rosdep update --rosdistro $ROS_DISTRO

# This replaces: wget https://raw.githubusercontent.com/open-rmf/rmf/main/rmf.repos
ENV DEBIAN_FRONTEND=noninteractive
COPY rmf.repos rmf.repos
RUN vcs import src < rmf.repos \
&& apt-get update \
&& apt-get upgrade -y \
&& rosdep update \
&& rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -yr \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install -y ignition-edifice \
&& rm -rf /var/lib/apt/lists/*

#-----------------
# Stage 2 - build
#-----------------

# compile rmf_demo_panel gui
# use wget
# RUN npm install --prefix src/demonstrations/rmf_demos/rmf_demos_panel/rmf_demos_panel/static/ \
# && npm run build --prefix src/demonstrations/rmf_demos/rmf_demos_panel/rmf_demos_panel/static/

# colcon compilation
RUN . /opt/ros/$ROS_DISTRO/setup.sh \
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

#----------
# Stage 3
#----------

# TODO: rosdep doesn't support installing only exec dependencies (https://github.com/ros-infrastructure/rosdep/pull/727)
# When the PR is merged, we can do a multi-stage build and include only whats needed at runtime.
# FROM ros:foxy
# COPY --from=0 /root/rmf/install /opt/rmf
# RUN rosdep ...
# COPY --from=builder /root/rmf/install /opt/rmf

# cleanup
RUN rm -rf build devel src \
&& sed -i '$isource "/rmf_demos_ws/install/setup.bash"' /ros_entrypoint.sh
RUN sed -i '$isource "/opt/rmf/install/setup.bash"' /ros_entrypoint.sh

ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
The OpenRMF platform for multi-fleet robot management.

---
## Install ROS 2 Galactic
## Install ROS 2 Humble

First, please follow the installation instructions for ROS 2 Galactic.
If you are on an Ubuntu 20.04 LTS machine (as recommended), [here is the binary install page for ROS 2 Galactic on Ubuntu 20.04](https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html).
First, please follow the installation instructions for ROS 2 Humble.
If you are on an Ubuntu 22.04 LTS machine (as recommended), [here is the binary install page for ROS 2 Humble on Ubuntu 22.04](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html).

## Setup Gazebo repositories

Expand All @@ -26,18 +26,18 @@ wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -

## Binary install

OpenRMF binary packages are available for Ubuntu Focal 20.04 for the `Foxy`, `Galactic` and `Rolling` releases of ROS 2. Most OpenRMF packages have the prefix `rmf` on their name, therefore, you can find them by them by searching for the pattern `ros-<ro2distro>-rmf`, e.g., for galatic it would be:
Latest OpenRMF binary packages are available for Ubuntu Jammy 22.04 for the `Humble` and `Rolling` releases of ROS 2. Older releases are also available on Ubuntu Focal 20.04 for `Foxy` and `Galactic`. Most OpenRMF packages have the prefix `rmf` on their name, therefore, you can find them by them by searching for the pattern `ros-<ro2distro>-rmf`, e.g., for galatic it would be:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, for galatic -> for humble


```bash
apt-cache search ros-galactic-rmf
apt-cache search ros-humble-rmf
```

### RMF Demos

A good way to install the `rmf` set of packages in one go is to install the one of the main [RMF Demos](https://github.com/open-rmf/rmf_demos) packages. This will pull all the rest of the OpenRMF packages as a dependency. The core of RMF demos is contained on the `rmf_demos` package. However, if you want to install it with simulation support, you should install the `rmf_demos_gz` or `rmf_demos_ign` package which come with gazebo or ignition support respectively. As an example, to install the ROS 2 Galactic release with gazebo support package, you would run:
A good way to install the `rmf` set of packages in one go is to install the one of the main [RMF Demos](https://github.com/open-rmf/rmf_demos) packages. This will pull all the rest of the OpenRMF packages as a dependency. The core of RMF demos is contained on the `rmf_demos` package. However, if you want to install it with simulation support, you should install the `rmf_demos_gz` or `rmf_demos_ign` package which come with gazebo or ignition support respectively. As an example, to install the ROS 2 Humble release with gazebo support package, you would run:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once it is finalized (i.e. this is merged) we should probably update this to the Gazebo renaming (ign -> gz and gz -> gz_classic)


```bash
sudo apt install ros-galactic-rmf-demos-gz
sudo apt install ros-humble-rmf-demos-gz
```

## Building from sources
Expand Down Expand Up @@ -76,24 +76,37 @@ mkdir -p ~/rmf_ws/src
cd ~/rmf_ws
wget https://raw.githubusercontent.com/open-rmf/rmf/main/rmf.repos
vcs import src < rmf.repos
wget https://raw.githubusercontent.com/open-rmf/rmf/main/rmf-simulation.repos
vcs import src < rmf-simulation.repos
```

Ensure all ROS 2 prerequisites are fulfilled,
```
cd ~/rmf_ws
rosdep install --from-paths src --ignore-src --rosdistro galactic -y
rosdep install --from-paths src --ignore-src --rosdistro humble -y
```

### Compiling Instructions

> NOTE: Due to newer changes in the source build, there might be conflicts and compilation errors with older header files installed by the binaries. Please remove the binary installations before building from source, using `sudo apt remove ros-galactic-rmf*`.
> NOTE: Due to newer changes in the source build, there might be conflicts and compilation errors with older header files installed by the binaries. Please remove the binary installations before building from source, using `sudo apt remove ros-humble-rmf*`.

Compiling on `Ubuntu 20.04`:
Compiling on `Ubuntu 22.04`:

Install clang

```bash
sudo apt update
sudo apt install clang lldb lld
```

**NOTE: RMF does not support building on gcc.**

Compile using clang

```bash
cd ~/rmf_ws
source /opt/ros/galactic/setup.bash
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
source /opt/ros/humble/setup.bash
CXX=clang++ LDFLAGS='-fuse-ld=lld' colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
```

> NOTE: The first time the build occurs, many simulation models will be downloaded from Ignition Fuel to populate the scene when the simulation is run.
Expand All @@ -106,18 +119,8 @@ Demonstrations of OpenRMF are shown in [rmf_demos](https://github.com/open-rmf/r
### Docker Containers
Alternatively, you can run RMF Demos by using [docker](https://docs.docker.com/engine/install/ubuntu/).

Pull docker image from `open-rmf/rmf` github registry (setup refer [here](https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-with-a-personal-access-token)).

```bash
docker pull ghcr.io/open-rmf/rmf/rmf_demos:latest
docker tag ghcr.io/open-rmf/rmf/rmf_demos:latest rmf:latest
```

Run it!

```bash

docker run -it --network host rmf:latest bash -c "export ROS_DOMAIN_ID=9; ros2 launch rmf_demos_gz office.launch.xml headless:=1"
docker run -it --network host ghcr.io/open-rmf/rmf/rmf_demos:latest bash -c "export ROS_DOMAIN_ID=9; ros2 launch rmf_demos_gz office.launch.xml headless:=1"
```
This will run `rmf_demos` in headless mode. Open [this link](https://open-rmf.github.io/rmf-panel-js/) with a browser to start a task.

Expand Down
12 changes: 12 additions & 0 deletions build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

cd "$(dirname $0)"

git clone --depth 1 -b build/rmf https://github.com/open-rmf/rmf_deployment_template.git
pushd rmf_deployment_template
docker build -t ghcr.io/open-rmf/rmf_deployment_template/builder-rosdep -f rmf/builder-rosdep.Dockerfile .
docker build -t ghcr.io/open-rmf/rmf_deployment_template/builder-rmf -f rmf/builder-rmf.Dockerfile .
popd

docker build -t ghcr.io/open-rmf/rmf/rmf_demos - < Dockerfile
15 changes: 15 additions & 0 deletions rmf-simulation.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repositories:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we should keep the .repos file here or use the ones in the deployment repo, for example for simulation and main rmf.
From what I understand they are going to be the same, so we can avoid maintaining them in both repos?
Removing them would reduce duplication but would cause quite some trouble since all downstream actions would have to change the url of their vcs file, so I can see arguments both ways

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the repos file should not be the same. These repos file here tracks the branch which makes it very problematic for reproducible builds and deployments. That does mean we will have to maintain multiple copies of each repos file 😞 .

rmf/rmf_simulation:
type: git
url: https://github.com/open-rmf/rmf_simulation.git
version: main
rmf/rmf_internal_msgs:
type: git
url: https://github.com/open-rmf/rmf_internal_msgs.git
version: main
rmf/rmf_building_map_msgs:
type: git
url: https://github.com/open-rmf/rmf_building_map_msgs.git
thirdparty/menge_vendor:
type: git
url: https://github.com/open-rmf/menge_vendor.git
4 changes: 0 additions & 4 deletions rmf.repos
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,3 @@ repositories:
type: git
url: https://github.com/open-rmf/pybind11_json_vendor.git
version: main
thirdparty/ros_ign:
type: git
url: https://github.com/ignitionrobotics/ros_ign.git
version: galactic
Comment on lines -70 to -73
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are going for a split of rmf.repos into deployment and simulation files we should probably remove rmf_simulation, menge_vendor and rmf_demos from this file.