-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alberto Tudela <[email protected]>
- Loading branch information
Showing
7 changed files
with
212 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
################################################################################ | ||
# Repo | ||
|
||
.git/ | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: ["Build"] | ||
types: | ||
- completed | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
dsr-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
id: extract_branch | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: grupoavispa/scitos2 | ||
tags: | | ||
type=ref, suffix=latest, event=branch | ||
type=sha | ||
- name: Docker Setup Buildx | ||
uses: docker/[email protected] | ||
id: scitos2-builder | ||
|
||
- name: Cache Docker layers | ||
uses: actions/[email protected] | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to Docker Hub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build against scitos2-builder | ||
uses: docker/[email protected] | ||
with: | ||
builder: ${{ steps.scitos2-builder.outputs.name }} | ||
context: docker | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
ARG BASE_IMAGE="humble-ros-core-jammy" | ||
ARG MIRA_WS=/opt/mira | ||
ARG OVERLAY_WS=/opt/overlay_ws | ||
ARG SYSTEM=ubuntu-2204lts-x64 | ||
|
||
# Install MIRA | ||
FROM ubuntu:22.04 AS mira-base | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG MIRA_WS | ||
ARG SYSTEM | ||
RUN apt update && apt install --no-install-recommends -y \ | ||
ca-certificates cmake curl doxygen g++ git subversion unzip wget \ | ||
libxml2-dev libssl-dev \ | ||
libsqlite3-dev libboost-all-dev \ | ||
libogre-1.9-dev libsvn-dev \ | ||
libopencv-dev binutils-dev \ | ||
libiberty-dev libcurl4-gnutls-dev libprocps-dev \ | ||
libqwt-qt5-dev libqt5webkit5-dev libqwtmathml-qt5-dev \ | ||
libqt5opengl5-dev libqt5svg5-dev qt*5-dev qttools5-dev-tools && \ | ||
rm -rf /var/lib/apt/lists/* | ||
RUN curl -o mira-installer-binary.sh https://www.mira-project.org/downloads/mira-installer-binary.sh | ||
RUN chmod +x mira-installer-binary.sh | ||
RUN ./mira-installer-binary.sh -s ${SYSTEM} -d ${MIRA_WS} | ||
# Setup MIRA environment variables | ||
ENV MIRA_PATH=${MIRA_WS} | ||
ENV PATH=$PATH:${MIRA_WS}/bin | ||
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MIRA_WS}/lib | ||
# Install SCITOS and Tory Configs | ||
RUN mirapackage --addurl ftp://ftp.metralabs-service.com/repos/MIRA-commercial/${SYSTEM}/MIRA-commercial.repo | ||
RUN mirapackage -R | ||
RUN mirapackage --noninteractive -I CANDriver SCITOS SCITOSConfigs ToryConfig | ||
|
||
# Build Scitos2 | ||
FROM ros:${BASE_IMAGE} AS scitos2-base | ||
ARG MIRA_WS | ||
ARG OVERLAY_WS | ||
ENV MIRA_PATH=${MIRA_WS} | ||
COPY --from=mira-base ${MIRA_WS} ${MIRA_WS} | ||
WORKDIR $OVERLAY_WS | ||
RUN mkdir -p src | ||
COPY . ./src/scitos2 | ||
|
||
# Install MIRA and ROS2 dependencies | ||
RUN apt update && apt install --no-install-recommends -y \ | ||
libopencv-dev libprocps-dev \ | ||
python3-pip \ | ||
ros-dev-tools \ | ||
python3-vcstool \ | ||
python3-colcon-clean \ | ||
ros-$ROS_DISTRO-rmw-cyclonedds-cpp | ||
RUN vcs import src < src/scitos2/.github/repos.repos | ||
RUN rosdep init && rosdep update | ||
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \ | ||
rosdep install -q -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO && \ | ||
rm -rf /var/lib/apt/lists/* | ||
RUN . /opt/ros/$ROS_DISTRO/setup.sh && colcon build | ||
RUN colcon clean workspace --base-select build -y | ||
|
||
FROM scitos2-base AS final | ||
ARG MIRA_WS | ||
ARG OVERLAY_WS | ||
ENV MIRA_WS=${MIRA_WS} | ||
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MIRA_WS}/lib | ||
ENV OVERLAY_WS=${OVERLAY_WS} | ||
|
||
WORKDIR $OVERLAY_WS/src/scitos2 | ||
COPY ./docker/ros_entrypoint.sh / | ||
RUN chmod +x /ros_entrypoint.sh | ||
COPY ./docker/cyclonedds.xml / | ||
ENTRYPOINT ["/ros_entrypoint.sh"] | ||
CMD ["ros2", "launch", "scitos2_mira", "mira.launch.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
services: | ||
scitos: | ||
container_name: scitos2 | ||
image: grupoavispa/scitos2:latest | ||
build: . | ||
network_mode: host | ||
ipc: host | ||
pid: host | ||
mac_address: XX:XX:XX:XX:XX:XX | ||
environment: | ||
- ROS_DOMAIN_ID=${ROS_DOMAIN_ID} | ||
- NET_INTERFACE=XXXXX | ||
devices: | ||
- /dev/ttyUSB2:/dev/USB_MLCAN | ||
privileged: true | ||
restart: unless-stopped | ||
volumes: | ||
- /opt/MIRA-licenses:/opt/MIRA-licenses | ||
- /opt/SCITOS:/opt/SCITOS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<CycloneDDS xmlns="https://cdds.io/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd"> | ||
<Domain id='any'> | ||
<General> | ||
<Interfaces> | ||
<NetworkInterface name="${NET_INTERFACE}"/> | ||
</Interfaces> | ||
</General> | ||
</Domain> | ||
</CycloneDDS> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
######### ROS ######### | ||
source /opt/ros/${ROS_DISTRO}/setup.bash | ||
source ${OVERLAY_WS}/install/local_setup.bash | ||
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp | ||
export CYCLONEDDS_URI=/cyclonedds.xml | ||
|
||
######### MIRA ######### | ||
export MIRA_PATH=${MIRA_WS} | ||
export PATH=$PATH:${MIRA_WS}/bin | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MIRA_WS}/lib | ||
source ${MIRA_WS}/scripts/mirabash | ||
|
||
exec "$@" |