From 62eb22ae4accf200467b6077e2eb774a264b394b Mon Sep 17 00:00:00 2001 From: carter Date: Mon, 23 Oct 2023 10:32:37 -0600 Subject: [PATCH 1/3] Add iron CI --- .github/workflows/iron.yml | 37 ++++++++++++++++++++++++++++++++++++ README.md | 1 + docker/galactic/Dockerfile | 5 ----- docker/humble/Dockerfile | 5 ----- docker/humble/README.md | 10 +++++----- docker/iron/Dockerfile | 17 +++++++++++++++++ docker/iron/README.md | 10 ++++++++++ docker/iron/entrypoint.sh | 2 ++ docker/iron_compose.yaml | 7 +++++++ docker/noetic/Dockerfile | 4 ---- docker/noetic_cpp/Dockerfile | 4 ---- 11 files changed, 79 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/iron.yml create mode 100644 docker/iron/Dockerfile create mode 100644 docker/iron/README.md create mode 100644 docker/iron/entrypoint.sh create mode 100644 docker/iron_compose.yaml diff --git a/.github/workflows/iron.yml b/.github/workflows/iron.yml new file mode 100644 index 00000000..95705087 --- /dev/null +++ b/.github/workflows/iron.yml @@ -0,0 +1,37 @@ +name: Iron + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + HOME: /root + +jobs: + humble: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + container: carter12s/roslibrust-ci-iron:latest + timeout-minutes: 20 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + submodules: 'true' + - name: Lint + run: source /root/.cargo/env; cargo fmt --all -- --check + - name: Build Main Lib + run: source /root/.cargo/env; cargo build + # This step is required to confirm feature combinations work, the main workspace build does all features + - name: Build Proc Macro + run: source /root/.cargo/env; cargo build -p roslibrust_codegen_macro + - name: Unit Tests + run: source /root/.cargo/env; cargo test + - name: Start rosbridge + run: source /opt/ros/humble/setup.bash; ros2 launch rosbridge_server rosbridge_websocket_launch.xml & disown; ros2 run rosapi rosapi_node & sleep 1 + - name: Integration Tests + run: source /root/.cargo/env; cargo test --features ros2_test -- --test-threads 1 \ No newline at end of file diff --git a/README.md b/README.md index 54523d19..f606040f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Noetic](https://github.com/Carter12s/roslibrust/actions/workflows/noetic.yml/badge.svg)](https://github.com/Carter12s/roslibrust/actions/workflows/noetic.yml) [![Galactic](https://github.com/Carter12s/roslibrust/actions/workflows/galactic.yml/badge.svg)](https://github.com/Carter12s/roslibrust/actions/workflows/galactic.yml) [![Humble](https://github.com/Carter12s/roslibrust/actions/workflows/humble.yml/badge.svg)](https://github.com/Carter12s/roslibrust/actions/workflows/humble.yml) +[![Iron](https://github.com/Carter12s/roslibrust/actions/workflows/iron.yml/badge.svg)](https://github.com/Carter12s/roslibrust/actions/workflows/iron.yml) [![License:MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) This package aims to provide a convenient intermediary between ROS1's rosbridge and Rust similar to roslibpy and roslibjs. diff --git a/docker/galactic/Dockerfile b/docker/galactic/Dockerfile index bfb9ecab..7efd9e2a 100644 --- a/docker/galactic/Dockerfile +++ b/docker/galactic/Dockerfile @@ -4,7 +4,6 @@ LABEL maintainer="Carter Schultz " # Required by github CI for submodule support RUN apt update && apt install -y git -# Adapted from https://github.com/JoaquinGimenez1/docker-noetic-rosbridge/blob/main/Dockerfile RUN apt update && apt install -y ros-galactic-rosbridge-suite # Curl required to install rust, build-essential required to build quote & proc-macro2 @@ -12,10 +11,6 @@ RUN apt update && apt install -y --fix-missing curl build-essential # Install latest stable rust RUN curl https://sh.rustup.rs -sSf | sh -s -- -y -# Update Cargo Registry -# See this for why we do it so wierd https://github.com/rust-lang/cargo/issues/3377 -RUN /root/.cargo/bin/cargo install lazy_static; exit 0 - WORKDIR / COPY entrypoint.sh . RUN chmod +x entrypoint.sh diff --git a/docker/humble/Dockerfile b/docker/humble/Dockerfile index d52a0835..586e7551 100644 --- a/docker/humble/Dockerfile +++ b/docker/humble/Dockerfile @@ -4,7 +4,6 @@ LABEL maintainer="Carter Schultz " # Required by github CI for submodule support RUN apt update && apt install -y git -# Adapted from https://github.com/JoaquinGimenez1/docker-noetic-rosbridge/blob/main/Dockerfile RUN apt update && apt install -y ros-humble-rosbridge-suite # Curl required to install rust, build-essential required to build quote & proc-macro2 @@ -12,10 +11,6 @@ RUN apt update && apt install -y --fix-missing curl build-essential # Install latest stable rust RUN curl https://sh.rustup.rs -sSf | sh -s -- -y -# Update Cargo Registry -# See this for why we do it so wierd https://github.com/rust-lang/cargo/issues/3377 -RUN /root/.cargo/bin/cargo install lazy_static; exit 0 - WORKDIR / COPY entrypoint.sh . RUN chmod +x entrypoint.sh diff --git a/docker/humble/README.md b/docker/humble/README.md index ce8abbad..04044364 100644 --- a/docker/humble/README.md +++ b/docker/humble/README.md @@ -1,10 +1,10 @@ -# Galactic CI Docker Image -Produces a docker image including both galactic rosbridge and needed rust. +# Humble CI Docker Image +Produces a docker image including both humble rosbridge and needed rust. # Building / Publishing (currently only carter has access, need to fix) -- docker build -t carter12s/roslibrust-ci-galactic:latest . +- docker build -t carter12s/roslibrust-ci-humble:latest . - Maybe needed: docker login -- docker push carter12s/roslibrust-ci-galactic:latest +- docker push carter12s/roslibrust-ci-humble:latest For debug: -docker run -it carter12s/roslibrust-ci-galactic /bin/bash \ No newline at end of file +docker run -it carter12s/roslibrust-ci-humble /bin/bash \ No newline at end of file diff --git a/docker/iron/Dockerfile b/docker/iron/Dockerfile new file mode 100644 index 00000000..be37d179 --- /dev/null +++ b/docker/iron/Dockerfile @@ -0,0 +1,17 @@ +FROM ros:iron-ros-core +LABEL maintainer="Carter Schultz " + +# Required by github CI for submodule support +RUN apt update && apt install -y git + +RUN apt update && apt install -y ros-iron-rosbridge-suite + +# Curl required to install rust, build-essential required to build quote & proc-macro2 +RUN apt update && apt install -y --fix-missing curl build-essential +# Install latest stable rust +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y + +WORKDIR / +COPY entrypoint.sh . +RUN chmod +x entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker/iron/README.md b/docker/iron/README.md new file mode 100644 index 00000000..f15bd5c8 --- /dev/null +++ b/docker/iron/README.md @@ -0,0 +1,10 @@ +# Iron CI Docker Image +Produces a docker image including both iron rosbridge and needed rust. + +# Building / Publishing (currently only carter has access, need to fix) +- docker build -t carter12s/roslibrust-ci-iron:latest . +- Maybe needed: docker login +- docker push carter12s/roslibrust-ci-iron:latest + +For debug: +docker run -it carter12s/roslibrust-ci-iron /bin/bash diff --git a/docker/iron/entrypoint.sh b/docker/iron/entrypoint.sh new file mode 100644 index 00000000..9d8ad4d3 --- /dev/null +++ b/docker/iron/entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exec "$@" diff --git a/docker/iron_compose.yaml b/docker/iron_compose.yaml new file mode 100644 index 00000000..45eb17ce --- /dev/null +++ b/docker/iron_compose.yaml @@ -0,0 +1,7 @@ +version: "3.9" +services: + rosbridge: + image: carter12s/roslibrust-ci-iron:latest + ports: + - "9090:9090" + command: bash -c "source /opt/ros/humble/setup.bash; ros2 launch rosbridge_server rosbridge_websocket_launch.xml & disown; ros2 run rosapi rosapi_node --ros-args --log-level debug" \ No newline at end of file diff --git a/docker/noetic/Dockerfile b/docker/noetic/Dockerfile index c2ff582c..b570c5c9 100644 --- a/docker/noetic/Dockerfile +++ b/docker/noetic/Dockerfile @@ -9,10 +9,6 @@ RUN apt update && apt install -y --fix-missing curl build-essential # Install latest stable rust RUN curl https://sh.rustup.rs -sSf | sh -s -- -y -# Update Cargo Registry -# See this for why we do it so wierd https://github.com/rust-lang/cargo/issues/3377 -RUN /root/.cargo/bin/cargo install lazy_static; exit 0 - WORKDIR / COPY entrypoint.sh . RUN chmod +x entrypoint.sh diff --git a/docker/noetic_cpp/Dockerfile b/docker/noetic_cpp/Dockerfile index 24b69cbc..00212510 100644 --- a/docker/noetic_cpp/Dockerfile +++ b/docker/noetic_cpp/Dockerfile @@ -16,10 +16,6 @@ RUN apt update && apt install -y ros-noetic-ros-base # Install latest stable rust RUN curl https://sh.rustup.rs -sSf | sh -s -- -y -# Update Cargo Registry -# See this for why we do it so weird https://github.com/rust-lang/cargo/issues/3377 -RUN /root/.cargo/bin/cargo install lazy_static; exit 0 - WORKDIR / COPY entrypoint.sh . RUN chmod +x entrypoint.sh From 17951ea9c331aa1eb14c185d0321c96cfbd9d9a2 Mon Sep 17 00:00:00 2001 From: carter Date: Mon, 23 Oct 2023 10:38:59 -0600 Subject: [PATCH 2/3] Fix iron ci --- .github/workflows/iron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/iron.yml b/.github/workflows/iron.yml index 95705087..e13488d6 100644 --- a/.github/workflows/iron.yml +++ b/.github/workflows/iron.yml @@ -32,6 +32,6 @@ jobs: - name: Unit Tests run: source /root/.cargo/env; cargo test - name: Start rosbridge - run: source /opt/ros/humble/setup.bash; ros2 launch rosbridge_server rosbridge_websocket_launch.xml & disown; ros2 run rosapi rosapi_node & sleep 1 + run: source /opt/ros/iron/setup.bash; ros2 launch rosbridge_server rosbridge_websocket_launch.xml & disown; ros2 run rosapi rosapi_node & sleep 1 - name: Integration Tests run: source /root/.cargo/env; cargo test --features ros2_test -- --test-threads 1 \ No newline at end of file From 925435242e7a81fad7b50a11405f0088dda6ff02 Mon Sep 17 00:00:00 2001 From: carter Date: Mon, 23 Oct 2023 19:56:59 -0600 Subject: [PATCH 3/3] Add in rust_log from #147 --- .github/workflows/iron.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/iron.yml b/.github/workflows/iron.yml index e13488d6..db003954 100644 --- a/.github/workflows/iron.yml +++ b/.github/workflows/iron.yml @@ -8,6 +8,8 @@ on: env: HOME: /root + # Coupled with our use of the test_log crate this should give us good CI output on failure + RUST_LOG: debug jobs: humble: