-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds workflow for manylinux wheel creation. #248
Changes from 5 commits
ee1a976
bcc1e5e
7fe6230
484dc24
b1e6716
1287658
8be0add
149f942
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Wheel Generation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
env: | ||
PACKAGE_NAME: maliput_malidrive | ||
COLCON_WS: maliput_ws | ||
PYTHON_VERSION: cp38-cp38 | ||
CMAKE_COMMAND_ENV: /opt/_internal/cpython-3.8.18/bin/cmake | ||
# Cancel previously running PR jobs | ||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
manylinux2014: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/maliput/manylinux2014_maliput:latest | ||
credentials: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ${{ env.COLCON_WS }}/src/${{ env.PACKAGE_NAME }} | ||
# clone public dependencies | ||
- name: git clone maliput | ||
shell: bash | ||
working-directory: ${{ env.COLCON_WS }}/src | ||
run: git clone https://github.com/maliput/maliput | ||
- name: colcon graph | ||
run: /opt/python/${PYTHON_VERSION}/bin/colcon graph | ||
shell: bash | ||
working-directory: ${{ env.COLCON_WS }} | ||
# colcon build | ||
- name: colcon build | ||
shell: bash | ||
working-directory: ${{ env.COLCON_WS }} | ||
run: | | ||
source /colcon_builds/install/setup.bash; | ||
PATH=/opt/python/${PYTHON_VERSION}/bin:$PATH \ | ||
/opt/python/${PYTHON_VERSION}/bin/colcon build --packages-up-to ${PACKAGE_NAME} \ | ||
--cmake-args \ | ||
' -DWHEEL_GENERATION=On' \ | ||
' -DBUILD_TESTING=Off' \ | ||
' -DPython3_EXECUTABLE=/opt/python/${{ env.PYTHON_VERSION }}/bin/python3' \ | ||
--event-handlers=console_direct+ | ||
# List wheel output | ||
- name: list wheel output | ||
shell: bash | ||
working-directory: ${{ env.COLCON_WS }} | ||
run: ls build/${PACKAGE_NAME}/wheel | ||
# Run auditwheel repair | ||
- name: auditwheel repair | ||
shell: bash | ||
working-directory: ${{ env.COLCON_WS }} | ||
run: | | ||
source install/setup.bash; | ||
auditwheel repair \ | ||
--plat manylinux2014_x86_64 \ | ||
--wheel-dir build/${PACKAGE_NAME}/wheel/repaired \ | ||
build/${PACKAGE_NAME}/wheel/*.whl | ||
# List repaired wheel output | ||
- name: list repaired wheel output | ||
shell: bash | ||
working-directory: ${{ env.COLCON_WS }} | ||
run: ls build/${PACKAGE_NAME}/wheel/repaired | ||
# Upload repaired wheel as artifact | ||
- name: upload wheels as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: maliput_malidrive_manylinux2014_x86_64 | ||
path: ${{ env.COLCON_WS }}/build/${{ env.PACKAGE_NAME }}/wheel/repaired | ||
retention-days: 7 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
############################################################################## | ||
|
||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
project(maliput_malidrive LANGUAGES C CXX VERSION 1.0.0) | ||
project(maliput_malidrive LANGUAGES C CXX VERSION 0.1.4) | ||
|
||
############################################################################## | ||
# CMake Support | ||
|
@@ -19,7 +19,6 @@ include(GNUInstallDirs) | |
message(STATUS "\n\n====== Finding 3rd Party Packages ======\n") | ||
|
||
find_package(ament_cmake REQUIRED) | ||
find_package(gflags REQUIRED) | ||
|
||
find_package(maliput REQUIRED) | ||
|
||
|
@@ -76,6 +75,41 @@ else() | |
message(STATUS "Doxygen generation - Disabled") | ||
endif() | ||
|
||
|
||
############################################################################## | ||
# Wheel | ||
############################################################################## | ||
|
||
if (WHEEL_GENERATION) | ||
include(FetchContent) | ||
message(STATUS "Wheel generation - Enabled") | ||
FetchContent_Declare(python-cmake-wheel | ||
GIT_REPOSITORY "https://github.com/maliput/python-cmake-wheel" | ||
GIT_TAG "main" | ||
GIT_SHALLOW ON) | ||
|
||
FetchContent_GetProperties(python-cmake-wheel) | ||
FetchContent_MakeAvailable(python-cmake-wheel) | ||
list(APPEND CMAKE_MODULE_PATH "${python-cmake-wheel_SOURCE_DIR}") | ||
include(python-wheel) | ||
set(WHEEL_DEPLOY_DIRECTORY "${CMAKE_BINARY_DIR}/wheel") | ||
|
||
set(DEPLOY_FILES "${PROJECT_SOURCE_DIR}/maliput_malidrive/__init__.py") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we deploy the sample maps? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
https://github.com/maliput/python-cmake-wheel/blob/main/python-wheel.cmake#L124-L131 I could use We could also extend that feature in order to accept folders. However probably it makes sense to leave it as an enhancement issue on top of this PR. I am also thinking that probably, once that is done, we could add a method in the init file for getting a resource so it is easier to deal with. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the tooling is lacking the ability to add data-files. Perhaps we can add it in the future. I agree with deferring that to a follow up PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
add_wheel(road_network | ||
NAME maliput_malidrive | ||
AUTHOR "Franco Cipollone" | ||
URL "https://github.com/maliput/maliput_malidrive" | ||
VERSION "${PROJECT_VERSION}" | ||
DESCRIPTION "OpenDRIVE-based maliput backend." | ||
LICENSE_PATH "${PROJECT_SOURCE_DIR}/LICENSE" | ||
DEPLOY_FILES ${DEPLOY_FILES} | ||
MALIPUT_PLUGIN_ENTRY_POINT "maliput_malidrive = maliput_malidrive:get_plugin_path" | ||
) | ||
else() | ||
message(STATUS "Wheel generation - Disabled") | ||
endif() | ||
|
||
############################################################################## | ||
# Export | ||
############################################################################## | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import os | ||
|
||
def get_plugin_path(): | ||
# return this location. It is expected to be the plugin located in this same location | ||
return os.path.dirname(os.path.abspath(__file__)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be moved to src/applications/CMakelists.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.