Skip to content
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

Remove debian package python and pybind11 dependency #28

Merged
merged 11 commits into from
Sep 11, 2024

Conversation

paulbourelly999
Copy link
Contributor

@paulbourelly999 paulbourelly999 commented Jul 30, 2024

PR Details

Description

The PR addresses several issues. The most important of which is removing Python and PyBind as a dependency from the debian package we push to our debian package repository. These dependencies were added to facilitate usage of our library by the MMITTS system which has yet to take place. They have the unintended impact that all tools currently consuming this apt package now also need python3 module and pybind11 installed and discoverable by CMake. While the build process to compile this our library into a python consumable module still works, this PR changes our build instructions to by default not include the python bindings. In the future we should consider pushing two separate debian packages (one with python bindings and one without) or determine whether we can wrap and push this as a python module.

The second fix was related to CMake config installation being broken by a recent change of the CMake project from carma-clock to carma_clock. This change was made initially to allow for our package to be python consumable since python does not allow - characters in module names. Changing the package name also had the unexpected result that it broke our CMake config files. After some investigation I discovered the importlib.import_module("") functionality that allowed for importing python modules under different names which resolved the initial issue and allowed use to revert to the original cmake project name.

The last change is to the CI process. Some recent efforts by GitHub to update NodeJS version used by all their runners has the unintended impact that it has some incompatibility with bionic. There is currently as flag that can be set to avoid this issue by allowing the runners to use deprecated versions of nodeJS. Ultimately we will discontinue support for bionic as soon as we remove it from CARMA Streets. I also added manual triggers for workflows and prevented our workflows from pushing debian packages during pull requests.

Related GitHub Issue

Related Jira Key

Motivation and Context

During XIL Cloud Verification testing, when attempting to rebuild CARMA Streets services with a carma-clock dependency it was discovered that updates to this library to provide python bindings had broken build processes for including it in C++ applications already using it.

The first problem was project naming. After renaming the cmake project from carma-clock to carma_clock to avoid invalid - characters for python modules, CMake files that were trying to include this library as carma-clock could not find it. We found a solution using the python importlib to rename the C++ library as a python module and remove invalid characters like - from the resulting name.

The second problem was that the new carma-clock library had a dependency and CMake being able to find Python3 Modules and pybind11. CARMA Streets C++ services did not have these dependencies installed and discoverable for CMake so we have removed these dependencies. Currently we have update documentation to only allow for local building of python bindings and we plan in the future to host separate apt packages for the C++ package and the C++ package with python bindings.

How Has This Been Tested?

CDASim testing

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@paulbourelly999 paulbourelly999 changed the title Add manual trigger for build and scan Remove debian package python and pybind11 dependency Jul 31, 2024
@paulbourelly999 paulbourelly999 self-assigned this Jul 31, 2024
@paulbourelly999 paulbourelly999 marked this pull request as ready for review July 31, 2024 21:15
@@ -1,13 +1,17 @@
name: Build Workflow

on:
workflow_dispatch:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need manual trigger?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is nice to have to be able to retrigger builds on our main branch

Copy link
Contributor

@dan-du-car dan-du-car Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If retrigger a run on existing change, can't we rerun-all-jobs in each workflow? If a new change, then the existing workflow should automatically be triggered. I am not sure I understand fully about the benefit of adding this workflow_dispatch feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repository changes relatively infrequently. When we discover issues with the pushed artifact, we often do not have the logs of the built artifact because they have expired. Having a manual way to retrigger these debian package builds allows us to more easily trace issues with the build as well as ensure that we can build this software after it's dependencies change (carma-builds) without having to make a superfluous change to trigger a build. We can not retrigger builds if nothing in the repo has changed without this manual trigger.


```python
# This path can be added via the sys module or by directly appending the PYTHON_PATH environment variable.
import sys
sys.path.append('/opt/carma/lib/')
sys.path.append('/path/to/library')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which python library? What is the library path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path to the library you build using the new instructions provided.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this path to python library or carma-clock library?

README.md Outdated Show resolved Hide resolved
@@ -6,7 +6,7 @@ set(CMAKE_MODULE_PATH "$ENV{CARMA_OPT_DIR}/cmake")
set(CMAKE_CXX_STANDARD 17)


project(carma_clock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How this break the Cmake config file? Do we have a screenshot or issue report of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did not break the build, it broke the Cmake config so when installed other projects could not find the library even when provided the CMake config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking back at it, it is likely because changing from carma-clock to 'carma_clockalso changes the library name in cmake and so it was looking forcarma-clockConfig.cmakeinstead ofcarma_clockConfig.cmakebut updating that in all the downstream users of this library is definitely unnecessary since we have solved the problem that the-` character raised when installing this as a python module.

@MishkaMN
Copy link
Contributor

MishkaMN commented Aug 1, 2024

Not a blocker to PR. My only comment here is to add the description of what end-user behavior or observation triggered this change. Cause of the issues sound well documented however what symptoms did the user see that helped find these issues.
Such as "During verification testing of xil carma cloud, this tool was not loading up or the logs showed abnormal behavior" etc.
@paulbourelly999

Copy link

sonarcloud bot commented Aug 1, 2024

@paulbourelly999
Copy link
Contributor Author

Not a blocker to PR. My only comment here is to add the description of what end-user behavior or observation triggered this change. Cause of the issues sound well documented however what symptoms did the user see that helped find these issues. Such as "During verification testing of xil carma cloud, this tool was not loading up or the logs showed abnormal behavior" etc. @paulbourelly999

@MishkaMN I added some additional description in the motivation section of this PR. Please take a look and see if that resolves your concern.

@paulbourelly999 paulbourelly999 marked this pull request as draft August 1, 2024 21:24
@paulbourelly999 paulbourelly999 marked this pull request as ready for review August 16, 2024 17:38
@paulbourelly999 paulbourelly999 merged commit c4fac21 into develop Sep 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants