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

Arm64 fixes #28

Open
wants to merge 10 commits into
base: humble
Choose a base branch
from
Open
43 changes: 32 additions & 11 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,31 +89,52 @@ RUN wget -c https://github.com/Neargye/magic_enum/archive/refs/tags/v0.8.0.tar.g
sudo make install &&\
sudo ldconfig &&\
cd ../.. && rm -r magic_enum*
RUN git clone https://github.com/libuvc/libuvc.git &&\
RUN git clone --depth 1 https://github.com/libuvc/libuvc.git &&\
cd libuvc &&\
mkdir build && cd build &&\
cmake .. && make -j4 &&\
sudo make install &&\
sudo ldconfig &&\
cd ../.. && rm -r libuvc*

# install Zenoh
RUN mkdir -p /tmp/zenoh-build && \
cd /tmp/zenoh-build && \
(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y) && \
git clone --depth 1 -b 1.0.4 https://github.com/eclipse-zenoh/zenoh-plugin-ros2dds.git && \
cd /tmp/zenoh-build/zenoh-plugin-ros2dds && \
/bin/bash -c "source '$HOME/.cargo/env'; cargo build --release -p zenoh-bridge-ros2dds" && \
install target/release/zenoh-bridge-ros2dds /usr/local/bin/

RUN mkdir -p /opt/lcas/extensions
WORKDIR /opt/lcas/extensions
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN git clone https://github.com/eclipse-zenoh/zenoh-plugin-ros2dds.git
WORKDIR /opt/lcas/extensions/zenoh-plugin-ros2dds
RUN bash -c "source '$HOME/.cargo/env'; cargo build --release -p zenoh-bridge-ros2dds"
RUN install target/release/zenoh-bridge-ros2dds /usr/local/bin/
WORKDIR /

ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

COPY *repos *.sh /tmp/.devcontainer/
RUN bash /tmp/.devcontainer/install.sh
COPY .devcontainer/*repos .devcontainer/*.sh /tmp/.devcontainer/

ARG TARGETARCH
ENV TARGETARCH=${TARGETARCH}


COPY . /opt/ros/lcas/src/limo
RUN apt update && \
rosdep init && \
rosdep --rosdistro=humble update && \
pip install -U argcomplete

RUN cd /opt/ros/lcas && \
. /opt/ros/humble/setup.sh && \
echo "target: $TARGETARCH" && \
if [ ${TARGETARCH} = "arm64" ]; then \
# no support for gazebo on arm64 (see https://github.com/LCAS/limo_ros2/pull/28)
rm -rvf src/limo/src/limo_gazebosim; \
fi; \
rosdep install --from-paths src/ -i -y && \
colcon build

RUN echo "source /opt/ros/humble/setup.bash" >> /etc/bash.bashrc
RUN echo "source /opt/ros/lcas/install/setup.bash" >> /etc/bash.bashrc

RUN cat /tmp/.devcontainer/setup-router.sh >> /etc/bash.bashrc

23 changes: 0 additions & 23 deletions .devcontainer/install.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .devcontainer/lcas.repos

This file was deleted.

82 changes: 33 additions & 49 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,23 @@ name: Docker Image CI

on:
push:
paths:
- .devcontainer/**
branches: [ humble ]
tags:
- '*'
- 'v*'
pull_request:
branches: [ humble ]
paths:
- .devcontainer/**

jobs:

trigger:
runs-on: ubuntu-latest
# only do this if we don't have a pull request
if: ${{ github.event_name != 'pull_request' }}
steps:
- uses: lasith-kg/dispatch-workflow@v1
id: workflow-dispatch_develop
name: 'Trigger re-build of desktop docker image "develop"'
with:
dispatch-method: workflow_dispatch
repo: kasm-workspaces-core-images
owner: LCAS
ref: refs/heads/develop # or main
workflow: docker-latest.yml # Or Workflow ID
token: ${{ secrets.ORGA_GH_TOKEN }} # GitHub Token With Relevant Permissions
- uses: lasith-kg/dispatch-workflow@v1
id: workflow-dispatch_nvidia_develop
name: 'Trigger re-build of desktop docker image "nvidia_develop"'
with:
dispatch-method: workflow_dispatch
repo: kasm-workspaces-core-images
owner: LCAS
ref: refs/heads/nvidia_develop # or main
workflow: docker-latest.yml # Or Workflow ID
token: ${{ secrets.ORGA_GH_TOKEN }} # GitHub Token With Relevant Permissions

build:
build_amd64:

runs-on: lcas

steps:
- uses: actions/checkout@v3
- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Docker Login LCAS
# don't attempt to login for PRs
if: ${{ github.event_name != 'pull_request' }}
Expand All @@ -61,37 +32,50 @@ jobs:
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}
- name: Docker Login dockerhub

- name: Build and push limo_ros2 for amd64
uses: docker/build-push-action@v5
with:
context: .
file: .devcontainer/Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: lcas.lincoln.ac.uk/lcas/limo_ros_amd64:${{ env.BRANCH }}
build-args: |
BRANCH=${{ env.BRANCH }}

build_arm64:

runs-on: lcas

steps:
- uses: actions/checkout@v3
- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Docker Login LCAS
# don't attempt to login for PRs
if: ${{ github.event_name != 'pull_request' }}
# You may pin to the exact commit or the version.
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v2
with:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: lcas.lincoln.ac.uk
# Username used to log against the Docker registry
username: ${{ secrets.DOCKERHUB_USER }}
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.DOCKERHUB_TOKEN }}
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build and push limo_ros2 for arm64
# only build for arm if not PR to speed things up
if: ${{ github.event_name != 'pull_request' }}
uses: docker/build-push-action@v5
with:
context: .devcontainer
context: .
file: .devcontainer/Dockerfile
platforms: linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: lcas.lincoln.ac.uk/lcas/limo_ros_arm64:${{ env.BRANCH }}
build-args: |
BRANCH=${{ env.BRANCH }}
- name: Build and push limo_ros2 for amd64
uses: docker/build-push-action@v5
with:
context: .devcontainer
file: .devcontainer/Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: lcas.lincoln.ac.uk/lcas/limo_ros_amd64:${{ env.BRANCH }}
build-args: |
BRANCH=${{ env.BRANCH }}

6 changes: 6 additions & 0 deletions src/limo_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
<depend>tf2</depend>
<depend>tf2_ros</depend>

<exec_depend>limo_base</exec_depend>
<exec_depend>limo_description</exec_depend>
<exec_depend>limo_navigation</exec_depend>
<exec_depend>astra_camera</exec_depend>
<exec_depend>ydlidar_ros2_driver</exec_depend>

<exec_depend>nav2_amcl</exec_depend>
<exec_depend>nav2_lifecycle_manager</exec_depend>
<exec_depend>nav2_map_server</exec_depend>
Expand Down
Loading