Skip to content

Commit

Permalink
feat(ci): add prebuilt modulo image akin to other internal ones (#36)
Browse files Browse the repository at this point in the history
Co-authored-by: Enrico Eberhard <32450951+eeberhard@users.noreply.github.com>
Co-authored-by: Dominic Reber <71256590+domire8@users.noreply.github.com>
  • Loading branch information
3 people committed Jul 25, 2023
1 parent ff52cb5 commit 62676e2
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 6 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Push Multi-Arch Images

on:
push:
branches:
- develop
- main
tags:
- "v*.*.*"

jobs:
get-tag:
runs-on: ubuntu-latest
name: Get tag
outputs:
tag: ${{ steps.parse-tag.outputs.tag }}
steps:
- uses: actions/checkout@v3
- uses: aica-technology/.github/.github/actions/docker-tag-from-git@v0.6.1
id: parse-tag

build:
needs: [get-tag]
strategy:
matrix:
arch: [amd64, arm64]
include:
# FIXME (#33): high memory usage during build
- image: ubuntu-latest
- image: buildjet-8vcpu-ubuntu-2204-arm
arch: arm64

runs-on: ${{ matrix.image }}
name: Build and publish (${{ matrix.arch }})
steps:
- uses: actions/checkout@v3

- uses: aica-technology/.github/.github/actions/list-add-suffixes@v0.6.0
id: merge-tags
with:
list: ${{ needs.get-tag.outputs.tag }}
suffixes: ${{ matrix.arch }}
glue_separator: "-"

- uses: aica-technology/.github/.github/actions/ghcr-build@v0.6.1
with:
image_name: aica-technology/modulo
image_tags: ${{ steps.merge-tags.outputs.list }}
dockerfile_path: Dockerfile.ci
token: ${{ secrets.GITHUB_TOKEN }}

multi-arch:
runs-on: ubuntu-latest
name: Merge into a multi-arch image
needs: [get-tag, build]
steps:
- uses: aica-technology/.github/.github/actions/ghcr-manifest-merge@v0.6.1
with:
image_name: aica-technology/modulo
image_tags: ${{ needs.get-tag.outputs.tag }}
archs: amd64,arm64
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Release Versions:

## Upcoming changes (in development)

- feat(ci): add prebuilt modulo image akin to other internal ones (#36)
- Add and install component descriptions (#31)
- Apply AICA C++ style guide (#30)
- Add option to publish outputs manually instead of periodically (#23)
Expand Down
37 changes: 37 additions & 0 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#syntax=docker/dockerfile:1.4.0
ARG CL_VERSION=v7.1.0
ARG ROS2_VERSION=humble
FROM ghcr.io/aica-technology/control-libraries:${CL_VERSION} as cl
FROM ghcr.io/aica-technology/ros2-ws:${ROS2_VERSION} as base
# setup the environment
USER ${USER}
ENV WORKSPACE ${HOME}/ws
WORKDIR ${WORKSPACE}
SHELL ["/bin/bash", "-l", "-c"]

# create a workspace
RUN source ${HOME}/ros2_ws/install/setup.bash && colcon build
# source the new workspace on login
RUN echo "source ${WORKSPACE}/install/setup.bash" | cat - ${HOME}/.bashrc > tmp && mv tmp ${HOME}/.bashrc
# install deps
COPY --from=cl / /
# install sources
COPY --chown=${USER}:${USER} ./source ${WORKSPACE}/src

FROM base as development

FROM base as build
ARG TARGETPLATFORM
RUN --mount=type=cache,target=./build,id=${TARGETPLATFORM},uid=1000 \
sudo apt-get update && rosdep update \
&& rosdep install --from-paths src --ignore-src -r -y \
--skip-keys "ros2_control ros2_controllers controller_interface hardware_interface controller_manager" \
&& sudo rm -rf /var/lib/apt/lists/* \
&& colcon build

FROM build as test
ARG TARGETPLATFORM
RUN --mount=type=cache,target=./build,id=${TARGETPLATFORM},uid=1000 colcon test

FROM scratch as production
COPY --from=build /home/ros2/ws/install /colcon
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.7
2.2.8
2 changes: 1 addition & 1 deletion doxygen/doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Modulo"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 2.2.7
PROJECT_NUMBER = 2.2.8

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion source/modulo_component_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>modulo_component_interfaces</name>
<version>2.2.7</version>
<version>2.2.8</version>
<description>Interface package for communicating with modulo components through the ROS framework</description>
<maintainer email="enrico@aica.tech">Enrico Eberhard</maintainer>
<license>GPLv3</license>
Expand Down
2 changes: 1 addition & 1 deletion source/modulo_components/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>modulo_components</name>
<version>2.2.7</version>
<version>2.2.8</version>
<description>Modulo base classes that wrap ROS2 Nodes as modular components for the AICA application framework</description>
<maintainer email="baptiste@aica.tech">Baptiste Busch</maintainer>
<maintainer email="enrico@aica.tech">Enrico Eberhard</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion source/modulo_core/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>modulo_core</name>
<version>2.2.7</version>
<version>2.2.8</version>
<description>Modulo Core communication and translation utilities for interoperability with AICA Control Libraries</description>
<maintainer email="baptiste@aica.tech">Baptiste Busch</maintainer>
<maintainer email="enrico@aica.tech">Enrico Eberhard</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion source/modulo_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>modulo_utils</name>
<version>2.2.7</version>
<version>2.2.8</version>
<description>Modulo utils package for shared test fixtures</description>
<maintainer email="dominic@aica.tech">Dominic Reber</maintainer>
<license>GPLv3</license>
Expand Down

0 comments on commit 62676e2

Please sign in to comment.