-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds manylinux-based docker image for maliput wheel creation (#315)
Signed-off-by: Franco Cipollone <[email protected]>
- Loading branch information
1 parent
3a3f582
commit 570471a
Showing
5 changed files
with
134 additions
and
0 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
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,26 @@ | ||
name: manylinux-maliput image | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [labeled] | ||
|
||
jobs: | ||
build_and_push: | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'do-manylinux-image-build') || github.event_name == 'workflow_dispatch'}} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin | ||
|
||
- name: Build and tag Docker image | ||
working-directory: wheel_generation/ | ||
run: | | ||
docker build -t ghcr.io/${{ github.repository_owner }}/manylinux2014_maliput:latest . | ||
- name: Push Docker image to GHCR | ||
run: docker push ghcr.io/${{ github.repository_owner }}/manylinux2014_maliput:latest |
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,69 @@ | ||
FROM quay.io/pypa/manylinux2014_x86_64 | ||
|
||
########################################################################## | ||
# General setup | ||
########################################################################## | ||
RUN echo "export PATH=/opt/python/cp38-cp38/bin:\$PATH" >> /root/.bashrc | ||
RUN export PATH=/opt/python/cp38-cp38/bin:$PATH | ||
|
||
########################################################################## | ||
# Install prerequisites. | ||
########################################################################## | ||
|
||
# colcon. | ||
RUN /opt/python/cp38-cp38/bin/pip install colcon-common-extensions | ||
RUN /opt/python/cp38-cp38/bin/pip install python-dev-tools | ||
|
||
########################################################################## | ||
# Install CMake dependencies | ||
########################################################################## | ||
|
||
# yaml-cpp | ||
WORKDIR /source_builds/ | ||
RUN git clone -b yaml-cpp-0.7.0 https://github.com/jbeder/yaml-cpp.git yaml-cpp | ||
WORKDIR /source_builds/yaml-cpp/build | ||
RUN cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release .. && make -j$(nproc) && make install | ||
|
||
# tinyxml2 | ||
WORKDIR /source_builds/ | ||
RUN git clone -b 7.1.0 https://github.com/leethomason/tinyxml2.git tinyxml2 | ||
WORKDIR /source_builds/tinyxml2/build | ||
RUN cmake -DCMAKE_BUILD_TYPE=Release .. && make -j$(nproc) && make install | ||
|
||
# pybind11 | ||
# See https://pybind11.readthedocs.io/en/stable/installing.html#include-with-pypi | ||
# pybind11 (global) for pybind11 available directly in your environment root, e.g. /usr/local | ||
# This brings a different version as the one used in ROS Foxy (2.4.3) however the global version isn't provided | ||
# in the latter. | ||
RUN /opt/python/cp38-cp38/bin/pip install "pybind11[global]==2.11.1" | ||
|
||
########################################################################## | ||
# Install Colcon packages | ||
########################################################################## | ||
|
||
WORKDIR /colcon_builds/src/ | ||
|
||
# ament_cmake | ||
RUN git clone -b foxy https://github.com/ament/ament_cmake.git | ||
|
||
# ament_package | ||
RUN git clone -b foxy https://github.com/ament/ament_package.git | ||
|
||
# eigen3_cmake_module | ||
RUN yum install eigen3 -y | ||
RUN git clone -b foxy https://github.com/ros2/eigen3_cmake_module.git | ||
|
||
# Build colcon packages | ||
WORKDIR /colcon_builds/ | ||
RUN PATH=/opt/python/cp38-cp38/bin:$PATH /opt/python/cp38-cp38/bin/colcon build --cmake-args " -DBUILD_TESTING=Off" | ||
RUN source /colcon_builds/install/setup.bash | ||
RUN echo "source /colcon_builds/install/setup.bash" >> /root/.bashrc | ||
|
||
########################################################################## | ||
# Final config | ||
########################################################################## | ||
|
||
RUN mkdir -p /ws/src | ||
WORKDIR /ws | ||
|
||
CMD ["/bin/bash"] |
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,23 @@ | ||
## Wheel generation | ||
|
||
### Summary | ||
|
||
A dockerfile is provided for creating a [manylinux](https://github.com/pypa/manylinux)-compatible wheels of maliput packages. | ||
|
||
|
||
It is based on the `quay.io/pypa/manylinux2014_x86_64` image (See [manylinux#docker_images](https://github.com/pypa/manylinux#docker-images)) and adds the corresponding dependencies to build `maliput` packages. | ||
|
||
It is verified for the following packages: | ||
- maliput | ||
- maliput_py | ||
- maliput_malidrive | ||
|
||
### Usage | ||
|
||
``` | ||
docker build -t maliput_manylinux2014 . | ||
``` | ||
|
||
``` | ||
docker run --rm -it maliput_manylinux2014 bash | ||
``` |