forked from epfl-lasa/modulo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add prebuilt modulo image akin to other internal ones (#36)
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
1 parent
ff52cb5
commit 62676e2
Showing
9 changed files
with
106 additions
and
6 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,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 }} |
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,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 |
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 |
---|---|---|
@@ -1 +1 @@ | ||
2.2.7 | ||
2.2.8 |
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
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
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