Skip to content

Commit

Permalink
Merge pull request #311 from epfl-lasa/release/v6.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eeberhard authored Sep 21, 2022
2 parents 7a31637 + e33b141 commit b7f6263
Show file tree
Hide file tree
Showing 27 changed files with 335 additions and 301 deletions.
43 changes: 43 additions & 0 deletions .github/actions/build-push/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Build and Push'
description: 'Build the Docker image and push to GitHub Container Registry'
inputs:
image:
description: 'The image to build.'
required: true
options:
- 'Development dependencies'
- 'Protocol dependencies'
secret:
description: 'GitHub Container Registry secret'
required: true

runs:
using: "composite"
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Checkout repository
uses: actions/checkout@v2

- name: Login to GitHub Package Registry
run: echo "${{ inputs.secret }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
shell: bash

- name: Build and push image
run: |
if [ "${{ inputs.image }}" = "Development dependencies" ]; then
DOCKERFILE=Dockerfile.base
IMAGE_NAME=${{ github.repository }}/development-dependencies:latest
else
DOCKERFILE=Dockerfile.proto
IMAGE_NAME=${{ github.repository }}/proto-dependencies
fi
docker buildx build --file "${DOCKERFILE}" \
--platform=linux/arm64,linux/amd64 \
--push --tag ghcr.io/${IMAGE_NAME} \
.
shell: bash
1 change: 0 additions & 1 deletion .github/actions/build-test-python/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ bash /github/workspace/protocol/install.sh --auto || exit 1
echo ">>> Building Python bindings..."

export OSQP_INCLUDE_DIR='/usr/local/include/osqp'
export OPENROBOTS_INCLUDE_DIR='/opt/openrobots/include'
pip3 install /github/workspace/python || (echo ">>> [ERROR] Build stage failed!" && exit 2) || exit $?

echo ">>> Running all test stages..."
Expand Down
37 changes: 10 additions & 27 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,18 @@ on:
workflow_dispatch:

jobs:

build-publish-proto-dependencies:
runs-on: ubuntu-latest
name: Build and publish proto dependencies image
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Build image
run: |
docker build . --file ./Dockerfile.proto --tag proto-dependencies
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_NAME=${{ github.repository }}/proto-dependencies:latest
IMAGE_NAME=${IMAGE_NAME/_/-}
docker tag proto-dependencies ghcr.io/${IMAGE_NAME}
docker push ghcr.io/${IMAGE_NAME}
- name: Build and Push
uses: ./.github/actions/build-push
with:
image: "Protocol dependencies"
secret: ${{ secrets.GITHUB_TOKEN }}

build-publish-development-dependencies:
needs: build-publish-proto-dependencies
Expand All @@ -38,16 +29,8 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Build image
run: |
docker build . --file ./Dockerfile.base --tag development-dependencies
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_NAME=${{ github.repository }}/development-dependencies:latest
IMAGE_NAME=${IMAGE_NAME/_/-}
docker tag development-dependencies ghcr.io/${IMAGE_NAME}
docker push ghcr.io/${IMAGE_NAME}
- name: Build and Push
uses: ./.github/actions/build-push
with:
image: "Development dependencies"
secret: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CHANGELOG

Release Versions:
- [6.2.0](#620)
- [6.1.0](#610)
- [6.0.0](#600)
- [5.2.0](#520)
Expand All @@ -13,6 +14,34 @@ Release Versions:
- [2.0.0](#200)
- [1.0.0](#100)

## 6.2.0

Version 6.2.0 contains minor changes to the Python bindings and robot model installation dependencies.

### Features and improvements

- Refactor frame_name parameters (#309)
- Support ARM64 (#310)
- Remove openrobots directives (#312)

An inconsistency in nomenclature was resolved; see [issue #308](https://github.com/epfl-lasa/control-libraries/issues/308)
and [PR #309](https://github.com/epfl-lasa/control-libraries/pull/309) for more details.

Behind the scenes, the docker images for
[development dependencies](https://github.com/orgs/epfl-lasa/packages/container/package/control-libraries%2Fdevelopment-dependencies)
and [proto dependencies](https://github.com/epfl-lasa/control-libraries/pkgs/container/control-libraries%2Fproto-dependencies)
are now built for multiple architectures: `linux/amd64` and `linux/arm64`.

At the time of release, no pre-built arm64 binaries existed for Pinocchio, a dependency of the **robot_model** library.
For this reason, the installation script is revised to install Pinocchio from source, which has the side effect of
simplifying the CMake configuration; the path inclusion of `/opt/openrobots` is no longer required.

### Upgrade notes

The core C++ API is unchanged, and therefore this release is not marked by a major version change. However, some
unintended usages of the Python bindings may be affected as noted in issue #308. Additionally, it may be necessary
to redo the installation steps for the revised dependencies if using the robot model library on a local installation.

## 6.1.0

Version 6.1.0 contains a few small new features as well as several fixes, mainly in
Expand Down
120 changes: 59 additions & 61 deletions Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -10,69 +10,90 @@ RUN apt-get update && apt-get install -y \
curl \
g++ \
gcc \
gnupg2 \
make \
git \
wget \
gnupg2 \
libtool \
lsb-release \
make \
pkg-config \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*


FROM core-build-dependencies as google-dependencies

RUN apt-get update && apt-get install -y \
libgtest-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# install gtest
WORKDIR /tmp
RUN mkdir gtest_build && cd gtest_build && cmake /usr/src/gtest && make -j \
&& cp lib/* /usr/local/lib || cp *.a /usr/local/lib

FROM core-build-dependencies as project-dependencies
ARG OSQP_TAG=v0.6.2
ARG OSQP_EIGEN_TAG=v0.6.4
RUN rm -rf /tmp/* && ldconfig

# add pinocchio to package list
RUN echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg" \
| tee /etc/apt/sources.list.d/robotpkg.list \
&& curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key \
| apt-key add -

RUN wget -c https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz -O - | tar -xz
RUN cd eigen-3.4.0 && mkdir build && cd build && cmake .. && make install
RUN rm -r eigen-3.4.0
FROM core-build-dependencies as robot-model-dependencies

# install dependencies for building the libraries
RUN apt-get update && apt-get install -y \
robotpkg-pinocchio \
libboost-all-dev \
liburdfdom-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# install osqp and eigen wrapper
WORKDIR /tmp/osqp_build
RUN git clone --depth 1 -b ${OSQP_TAG} --recursive https://github.com/oxfordcontrol/osqp \
&& cd osqp && mkdir build && cd build && cmake -G "Unix Makefiles" .. && cmake --build . --target install
WORKDIR /tmp
ARG EIGEN_TAG=3.4.0
RUN wget -c https://gitlab.com/libeigen/eigen/-/archive/${EIGEN_TAG}/eigen-${EIGEN_TAG}.tar.gz -O - | tar -xz \
&& cd eigen-${EIGEN_TAG} && mkdir build && cd build && cmake .. && make install \
&& cd ../.. && rm -r eigen-${EIGEN_TAG} || exit 1

RUN git clone --depth 1 -b ${OSQP_EIGEN_TAG} https://github.com/robotology/osqp-eigen.git \
&& cd osqp-eigen && mkdir build && cd build && cmake .. && make -j && make install
ARG OSQP_TAG=0.6.2
RUN git clone --depth 1 -b v${OSQP_TAG} --recursive https://github.com/oxfordcontrol/osqp \
&& cd osqp && mkdir build && cd build && cmake -G "Unix Makefiles" .. && cmake --build . --target install \
&& cd ../.. && rm -r osqp || exit 1

ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/opt/openrobots/lib/
ARG OSQP_EIGEN_TAG=0.6.4
RUN git clone --depth 1 -b v${OSQP_EIGEN_TAG} https://github.com/robotology/osqp-eigen.git \
&& cd osqp-eigen && mkdir build && cd build && cmake .. && make -j && make install \
&& cd ../.. && rm -r osqp-eigen || exit 1

WORKDIR /home
RUN rm -rf /tmp/*
ARG PINOCCHIO_TAG=2.6.9
RUN git clone --depth 1 -b v${PINOCCHIO_TAG} --recursive https://github.com/stack-of-tasks/pinocchio \
&& cd pinocchio && mkdir build && cd build \
&& cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_PYTHON_INTERFACE=OFF \
&& make -j1 && make install && cd ../.. && rm -r pinocchio || exit 1

RUN ldconfig

FROM core-build-dependencies as google-dependencies

FROM robot-model-dependencies as development-dependencies
RUN apt-get update && apt-get install -y \
libgtest-dev \
clang \
gdb \
python3 \
python3-dev \
python3-pip \
tar \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# install gtest
WORKDIR /tmp/gtest_build
RUN cmake /usr/src/gtest \
&& make \
&& cp lib/* /usr/local/lib || cp *.a /usr/local/lib

WORKDIR /home
RUN rm -rf /tmp/*
# install python requirements
RUN pip3 install numpy setuptools pybind11

# install google dependencies
COPY --from=google-dependencies /usr/include/gtest /usr/include/gtest
COPY --from=google-dependencies /usr/local/lib/libgtest* /usr/local/lib/
COPY --from=ghcr.io/epfl-lasa/control-libraries/proto-dependencies /usr/local/include/google /usr/local/include/google
COPY --from=ghcr.io/epfl-lasa/control-libraries/proto-dependencies /usr/local/lib/libproto* /usr/local/lib/
COPY --from=ghcr.io/epfl-lasa/control-libraries/proto-dependencies /usr/local/bin/protoc /usr/local/bin
RUN ldconfig

FROM project-dependencies as ssh-configuration

FROM development-dependencies as ssh-configuration
RUN apt-get update && apt-get install -y \
sudo \
libssl-dev \
Expand All @@ -93,7 +114,7 @@ RUN ( \
ENV USER developer
ENV HOME /home/${USER}

# create amd configure a new user
# create and configure a new user
ARG UID=1000
ARG GID=1000
RUN addgroup --gid ${GID} ${USER}
Expand All @@ -112,27 +133,4 @@ RUN mkdir /root/.ssh/ && ssh-keyscan github.com | tee -a /root/.ssh/known_hosts

RUN echo "session required pam_limits.so" | tee --append /etc/pam.d/common-session > /dev/null


FROM ssh-configuration as development-dependencies

RUN apt-get update && apt-get install -y \
clang \
gdb \
python3 \
python3-dev \
python3-pip \
tar \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# install python requirements
RUN pip3 install numpy setuptools pybind11

# install google dependencies
COPY --from=google-dependencies /usr/include/gtest /usr/include/gtest
COPY --from=ghcr.io/epfl-lasa/control-libraries/proto-dependencies /usr/local/include/google /usr/local/include/google
COPY --from=google-dependencies /usr/local/lib/libgtest* /usr/local/lib/
COPY --from=ghcr.io/epfl-lasa/control-libraries/proto-dependencies /usr/local/lib/libproto* /usr/local/lib/
COPY --from=ghcr.io/epfl-lasa/control-libraries/proto-dependencies /usr/local/bin/protoc /usr/local/bin
RUN ldconfig
WORKDIR ${HOME}
8 changes: 4 additions & 4 deletions Dockerfile.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM ubuntu:20.04 as build-stage
ARG PROTOBUF_VERSION=3.17.0
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
Expand All @@ -14,19 +13,20 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
ARG PROTOBUF_VERSION=21.0
RUN wget -O protobuf-cpp-"${PROTOBUF_VERSION}".tar.gz \
https://github.com/protocolbuffers/protobuf/releases/download/v"${PROTOBUF_VERSION}"/protobuf-cpp-"${PROTOBUF_VERSION}".tar.gz \
https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-cpp-3.${PROTOBUF_VERSION}.tar.gz \
&& tar -xzf protobuf-cpp-"${PROTOBUF_VERSION}".tar.gz \
&& rm protobuf-cpp-"${PROTOBUF_VERSION}".tar.gz
WORKDIR /tmp/protobuf-"${PROTOBUF_VERSION}"
WORKDIR /tmp/protobuf-3."${PROTOBUF_VERSION}"
RUN ./autogen.sh \
&& ./configure \
&& make \
&& make install
FROM ubuntu:20.04 as google-dependencies
FROM ubuntu:22.04 as google-dependencies
COPY --from=build-stage /usr/local/include/google /usr/local/include/google
COPY --from=build-stage /usr/local/lib/libproto* /usr/local/lib/
COPY --from=build-stage /usr/local/bin/protoc /usr/local/bin
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.0
6.2.0
5 changes: 1 addition & 4 deletions demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

list(APPEND CMAKE_PREFIX_PATH /opt/openrobots)
include_directories(/opt/openrobots/include)

find_package(control_libraries 6.1.0 CONFIG REQUIRED)
find_package(control_libraries 6.2.0 CONFIG REQUIRED)

set(DEMOS_SCRIPTS
task_space_control_loop
Expand Down
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 = "Control Libraries"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 6.1.0
PROJECT_NUMBER = 6.2.0

# 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 protocol/clproto_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)

project(clproto VERSION 6.1.0)
project(clproto VERSION 6.2.0)

# Default to C99
if(NOT CMAKE_C_STANDARD)
Expand Down
1 change: 0 additions & 1 deletion python/Dockerfile.python
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ COPY include control-libraries/python/include
COPY source control-libraries/python/source
COPY pyproject.toml setup.py control-libraries/python/
ENV OSQP_INCLUDE_DIR /usr/local/include/osqp
ENV OPENROBOTS_INCLUDE_DIR /opt/openrobots/include
RUN pip3 install control-libraries/python


Expand Down
3 changes: 1 addition & 2 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ pip3 install control-libraries/python
```

If the installation fails, it may be because of non-default installation directories for some dependencies.
In this case, the include path for OSQP and OpenRobots can be set through environment variables before the pip install.
In this case, the include path for OSQP can be set through environment variables before the pip install.
```shell
export OSQP_INCLUDE_DIR='/path/to/include/osqp' # default /usr/local/include/osqp
export OPENROBOTS_INCLUDE_DIR='/path/to/openrobots/include' # default /opt/openrobots/include
pip3 install control-libraries/python
```

Expand Down
Loading

0 comments on commit b7f6263

Please sign in to comment.