Skip to content

Commit

Permalink
Test transfer fresh docker image
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed Feb 11, 2025
1 parent e15aca6 commit e880852
Show file tree
Hide file tree
Showing 6 changed files with 933 additions and 95 deletions.
14 changes: 12 additions & 2 deletions .github/docker/free-fleet-examples/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
ARG ROS_DISTRO=jazzy
FROM docker.io/ros:$ROS_DISTRO-ros-base
ARG FREE_FLEET_BRANCH=main
ARG ZENOH_VERSION=1.1.0

RUN apt update && apt install -y curl ros-$ROS_DISTRO-rmw-cyclonedds-cpp
RUN apt update && apt install -y curl ros-$ROS_DISTRO-rmw-cyclonedds-cpp python3-pip

RUN pip3 install eclipse-zenoh==$ZENOH_VERSION pycdr2 rosbags nudged --break-system-packages

# fetch sources
RUN mkdir -p /ff && cd /ff \
Expand All @@ -22,4 +25,11 @@ RUN rm -rf \
/dist

ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
ENTRYPOINT ["bash", "-c", ". /opt/ff/setup.bash && bash"]

# Environment setup
RUN echo '#!/usr/bin/env bash' > /ff_entrypoint.sh
RUN echo 'source /opt/ff/setup.bash' >> /ff_entrypoint.sh
RUN echo 'exec "$@"' >> /ff_entrypoint.sh
RUN chmod +x /ff_entrypoint.sh

ENTRYPOINT ["/ff_entrypoint.sh"]
28 changes: 19 additions & 9 deletions .github/docker/integration-tests/nav2-docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,22 @@ services:
environment:
- RUST_LOG=debug

rmf-common:
image: ghcr.io/open-rmf/free_fleet/free-fleet-examples:jazzy-latest
stop_signal: SIGINT
network_mode: host
stdin_open: true
tty: true
environment:
- ROS_DOMAIN_ID=42
command: bash -c "ros2 launch free_fleet_examples turtlebot3_world_rmf_common.launch.xml"
# rmf-common:
# image: ghcr.io/open-rmf/free_fleet/free-fleet-examples:jazzy-latest
# stop_signal: SIGINT
# network_mode: host
# stdin_open: true
# tty: true
# environment:
# - ROS_DOMAIN_ID=0
# command: bash -c "ros2 launch free_fleet_examples turtlebot3_world_rmf_common.launch.xml"

# free-fleet-adapter:
# image: ghcr.io/open-rmf/free_fleet/free-fleet-examples:jazzy-latest
# stop_signal: SIGINT
# network_mode: host
# stdin_open: true
# tty: true
# environment:
# - ROS_DOMAIN_ID=0
# command: bash -c "ros2 launch free_fleet_examples nav2_tb3_simulation_fleet_adapter.launch.xml"
67 changes: 66 additions & 1 deletion .github/workflows/nav2-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,42 @@ name: nav2-integration-tests
on: push

jobs:
build-free-fleet-docker-image:
name: Build free fleet image
runs-on: ubuntu-latest
strategy:
matrix:
ros_distribution: [jazzy]
steps:
- uses: actions/checkout@v4

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and export free-fleet-examples
uses: docker/build-push-action@v5
with:
push: false
build-args: |
ROS_DISTRO=${{ matrix.ros_distribution }}
FREE_FLEET_BRANCH=${{ steps.extract_branch.outputs.branch }}
tags: ghcr.io/${{ github.repository }}/free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }}
context: .github/docker/free-fleet-examples
outputs: type=docker,dest=${{ runner.temp }}/free-fleet-examples.tar

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: free-fleet-examples
path: ${{ runner.temp }}/free-fleet-examples.tar

integration-tests:
needs: [build-free-fleet-docker-image]
timeout-minutes: 10
runs-on: ubuntu-latest
container:
Expand All @@ -15,7 +50,23 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: free-fleet-examples
path: ${{ runner.temp }}

- name: Load image
run: |
docker load --input ${{ runner.temp }}/free-fleet-examples.tar
docker image ls -a
- name: Install docker-compose
run: |
Expand All @@ -24,6 +75,20 @@ jobs:
- name: Start test fixture containers
run: docker-compose -f ".github/docker/integration-tests/nav2-docker-compose.yaml" up -d --build

- name: Start the RMF common nodes
run: |
docker run --network=host -d \
-e ROS_DOMAIN_ID=0 \
ghcr.io/${{ github.repository }}/free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }} \
bash -c "ros2 launch free_fleet_examples turtlebot3_world_rmf_common.launch.xml"
- name: Start the free fleet adapter
run: |
docker run --network=host -d \
-e ROS_DOMAIN_ID=0 \
ghcr.io/${{ github.repository }}/free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }} \
bash -c "ros2 launch free_fleet_examples nav2_tb3_simulation_fleet_adapter.launch.xml"
- name: build-and-test
uses: ./.github/actions/build-and-test
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
- cron: '0 18 * * *'

jobs:
build-free-fleet-docker-images:
name: Push free fleet images to GitHub Packages
build-free-fleet-docker-image:
name: Push free fleet image to GitHub Packages
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
context: .github/docker/minimal-zenoh-bridge-ros1

nav1-integration-tests:
needs: [build-free-fleet-docker-images, build-minimal-nav1-docker-images]
needs: [build-free-fleet-docker-image, build-minimal-nav1-docker-images]
timeout-minutes: 10
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
run: docker-compose -f ".github/docker/integration-tests/nav1-docker-compose.yaml" down

nav2-integration-tests:
needs: [build-free-fleet-docker-images, build-minimal-nav2-docker-images]
needs: [build-free-fleet-docker-image, build-minimal-nav2-docker-images]
timeout-minutes: 10
runs-on: ubuntu-latest
container:
Expand Down
2 changes: 1 addition & 1 deletion free_fleet_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if(BUILD_TESTING)
set(_pytest_tests
tests/integration/test_nav2_tf_handler.py
tests/integration/test_nav2_robot_adapter.py
tests/integration/test_nav2_free_fleet_adapter.py
# tests/integration/test_nav2_free_fleet_adapter.py
)
foreach(_test_path ${_pytest_tests})
get_filename_component(_test_name ${_test_path} NAME_WE)
Expand Down
Loading

0 comments on commit e880852

Please sign in to comment.