-
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.
Imported upstream version '1.2.1' of 'upstream'
- Loading branch information
Showing
45 changed files
with
1,756 additions
and
612 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,4 @@ | ||
.dockerignore | ||
Dockerfile | ||
|
||
.github |
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,65 @@ | ||
# Uses gcc8 for glibc 2.28 | ||
ARG FROM=conanio/gcc10:latest | ||
FROM ${FROM} AS lanelet2_conan_deps | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# install requirements for python installation | ||
RUN sudo -E apt-get update \ | ||
&& sudo -E apt-get install -y libssl-dev zlib1g-dev \ | ||
libbz2-dev libreadline-dev libsqlite3-dev curl \ | ||
libncursesw5-dev xz-utils libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev | ||
|
||
# setup python environment | ||
ARG PY_VERSION=3.8 | ||
RUN pyenv install -s $PY_VERSION \ | ||
&& pyenv global $PY_VERSION | ||
RUN pip install "conan==1.59.0" catkin_pkg numpy wheel auditwheel cmake | ||
|
||
# install patchelf | ||
RUN wget https://github.com/NixOS/patchelf/releases/download/0.17.2/patchelf-0.17.2-x86_64.tar.gz \ | ||
&& tar -xzf patchelf-0.17.2-x86_64.tar.gz \ | ||
&& sudo -E ln -s $HOME/bin/patchelf /bin/patchelf \ | ||
&& patchelf --version | ||
|
||
# setup conan for python dependencies via bincrafters remote | ||
RUN conan remote add bincrafters https://bincrafters.jfrog.io/artifactory/api/conan/public-conan \ | ||
&& conan config set general.revisions_enabled=1 | ||
|
||
|
||
FROM lanelet2_conan_deps as lanelet2_conan_src | ||
|
||
# checkout code | ||
RUN mkdir src | ||
WORKDIR /home/conan/src | ||
COPY --chown=1000:1001 . lanelet2/ | ||
|
||
FROM lanelet2_conan_src as lanelet2_conan | ||
|
||
# compile | ||
ARG CONAN_ARGS="" | ||
WORKDIR /home/conan/src/lanelet2 | ||
RUN conan create . lanelet2/stable --build=missing ${CONAN_ARGS} \ | ||
&& export LANELET2_VERSION=$(conan inspect . --raw version) \ | ||
&& echo "Lanelet2 version: $LANELET2_VERSION" \ | ||
&& conan install lanelet2/$LANELET2_VERSION@lanelet2/stable --build=missing -g virtualenv | ||
FROM lanelet2_conan as lanelet2_conan_with_pip_wheel | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
WORKDIR /home/conan | ||
RUN source /home/conan/src/lanelet2/activate.sh \ | ||
&& LANELET2_PACKAGE_DIR=$(python -c "import lanelet2; from pathlib import Path; print(Path(lanelet2.__file__).parent)") \ | ||
&& cp -r $LANELET2_PACKAGE_DIR . | ||
RUN export LANELET2_VERSION=$(conan inspect ./src/lanelet2 --raw version) \ | ||
&& echo "Lanelet2 version: $LANELET2_VERSION" \ | ||
&& sed 's/{{ version }}/'"$LANELET2_VERSION"'/' /home/conan/src/lanelet2/lanelet2_python/setup.py.template > /home/conan/setup.py | ||
|
||
ARG PLATFORM="manylinux_2_31_x86_64" | ||
RUN source /home/conan/src/lanelet2/activate.sh \ | ||
&& pip wheel -w broken-dist/ . \ | ||
&& auditwheel repair -w dist/ --plat ${PLATFORM} broken-dist/*.whl | ||
|
||
# to extract the wheel manually run: | ||
# $ docker run -it -v /path/to/some/local/folder:/dist <image> /bin/bash | ||
# then inside the container: | ||
# $ sudo cp dist/lanelet2-<...>.whl /dist/. |
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,124 @@ | ||
name: Lanelet2 CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
# this should be kept in sync with ci.yaml | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
include: | ||
- python-version: "3.8" | ||
boost-version: "1.75.0" | ||
platform-version: manylinux_2_27_x86_64 | ||
image-version: conanio/gcc7:latest | ||
- python-version: "3.9" | ||
boost-version: "1.75.0" | ||
platform-version: manylinux_2_27_x86_64 | ||
image-version: conanio/gcc7:latest | ||
- python-version: "3.10" | ||
boost-version: "1.81.0" | ||
platform-version: manylinux_2_31_x86_64 | ||
image-version: conanio/gcc10:latest | ||
- python-version: "3.11" | ||
boost-version: "1.81.0" | ||
platform-version: manylinux_2_31_x86_64 | ||
image-version: conanio/gcc10:latest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup docker buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Create build container | ||
uses: docker/build-push-action@v3 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
file: .github/conan_dockerfile/Dockerfile | ||
tags: lanelet2_conan_with_pip_wheel | ||
load: true | ||
target: lanelet2_conan_with_pip_wheel | ||
build-args: | | ||
FROM=${{ matrix.image-version }} | ||
PY_VERSION=${{ matrix.python-version }} | ||
PLATFORM=${{ matrix.platform-version }} | ||
CONAN_ARGS=--require-override=boost/${{ matrix.boost-version }} | ||
- name: Create output directory | ||
run: mkdir -p ${{ github.workspace }}/output | ||
|
||
- name: Package lanelet2 in build container | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: lanelet2_conan_with_pip_wheel | ||
shell: bash | ||
options: -v ${{ github.workspace }}/dist:/dist | ||
run: | | ||
set -e | ||
# set env variables | ||
export HOME=/home/conan | ||
# copy wheel to dist directory | ||
sudo cp -r $HOME/dist/* /dist | ||
- name: Store wheel | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
||
test: | ||
needs: build | ||
strategy: | ||
matrix: | ||
# test only on currently supported version | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
os: ["ubuntu-22.04", "ubuntu-20.04"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Restore wheel | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist/ | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install wheel | ||
# use dist/ directory as package source instead of pypi.org | ||
run: pip install lanelet2 --no-index --find-links dist/ | ||
- name: Test wheel | ||
run: python -c "import lanelet2; assert lanelet2.core.Point2d(0, 0, 0) is not None" | ||
|
||
publish: | ||
if: contains(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
needs: [build, test] | ||
steps: | ||
- name: Restore wheel | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: dist/* | ||
|
||
- name: Publish package to PyPI | ||
if: github.repository == 'fzi-forschungszentrum-informatik/Lanelet2' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_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
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
Oops, something went wrong.