From 27bc2c87986c2f3170fa6acdf9d5f9f160d32622 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Mon, 8 Jan 2024 16:02:32 -0500 Subject: [PATCH 01/14] docs: move contributing instructions to the `doc/contributing directory` [NMO-442] - move contributing instructions to a contributing_instructions.md file - move commit_msg_reference.md to `doc/contributing directory` - change remaining ethz-asl domain reference to norlab-ulaval - main `README.MD` - move the summary up, under the top banner - add missing installer script instructions - add docker image usage instructions --- .github/pull_request_template.md | 22 +-- .github/workflows/build-python.yaml | 3 +- README.md | 148 ++++++------------ build_system/README.md | 3 +- ...m_install_dependencies_libnabo_ubuntu.bash | 4 +- doc/CompilationMac.md | 8 +- doc/CompilationUbuntu.md | 6 +- doc/CompilationWindows.md | 4 +- .../contributing/commit_msg_reference.md | 0 doc/contributing/contributing_instructions.md | 135 ++++++++++++++++ doc/index.md | 6 + 11 files changed, 204 insertions(+), 135 deletions(-) rename commit_msg_reference.md => doc/contributing/commit_msg_reference.md (100%) create mode 100644 doc/contributing/contributing_instructions.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 01feac1f..ae9141b3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -19,7 +19,7 @@ - [ ] I have commented hard-to-understand code - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] All tests pass locally with my changes - (Check [README.md #Contributing](https://github.com/norlab-ulaval/libpointmatcher/tree/develop#contributing) + (Check [contributing_instructions.md](doc/contributing/contributing_instructions.md) for local testing procedure using _libpointmatcher-build-system_) ### PR creation related @@ -33,22 +33,8 @@ - [ ] I have included a quick summary of the changes - [ ] I have indicated the related issue's id with `# ` if changes are of type `fix` -- [ ] I have included a high-level list of changes and their corresponding type - - Types: `feat` `fix` `docs` `style` `refactor` `perf` `test` `build` `ci` `chore` `revert` - - Breaking changes: `!` - - Reference: - see [commit_msg_reference.md](https://github.com/norlab-ulaval/libpointmatcher/blob/develop/commit_msg_reference.md) - in the repository root for details +- [ ] I have included a high-level list of changes and their corresponding types + (See [commit_msg_reference.md](doc/contributing/commit_msg_reference.md) + for details) --- - -## Note for repository admins - -### Release PR related - -- Only repository admins have the privilege to `push/merge` on the default branch (ie: `master`) - and the `release` branch. -- Keep PR in `draft` mode until all the release reviewers are ready to push the release. -- Once a PR from `release` -> `master` branch is created (not in draft mode), - - it triggers the _build-system_ test - - (in-progress) and it triggers the _semantic release automation_ diff --git a/.github/workflows/build-python.yaml b/.github/workflows/build-python.yaml index 74883f69..d6d033e6 100644 --- a/.github/workflows/build-python.yaml +++ b/.github/workflows/build-python.yaml @@ -192,7 +192,7 @@ jobs: if: steps.cache-libnabo.outputs.cache-hit != 'true' working-directory: ${{ env.LIBNABO_SRC_DIR }} run: | - git clone -b ${{ env.LIBNABO_VERSION }} --single-branch https://github.com/ethz-asl/libnabo.git + git clone -b ${{ env.LIBNABO_VERSION }} --single-branch https://github.com/norlab-ulaval/libnabo.git - name: Install libnabo ${{ env.LIBNABO_VERSION }} on Windows if: ${{ steps.cache-libnabo.outputs.cache-hit != 'true' && runner.os == 'Windows' }} @@ -319,4 +319,3 @@ jobs: prerelease: true allowUpdates: true generateReleaseNotes: true - \ No newline at end of file diff --git a/README.md b/README.md index f26ac4f4..466d355b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,15 @@ ![banner](doc/images/banner_light.jpeg) +[//]: # ( ==== Description =========================================== ) +**_libpointmatcher_ is a modular library implementing the Iterative Closest Point (ICP) algorithm
+for aligning point clouds. It has applications in robotics and computer vision.** +
+The library is written in C++ for effeciency +with [bindings in Python](doc/index.md#python-). +
+
+ [//]: # (====Awesome badges=======================================================================) [![Mentioned in Awesome LIDAR](https://awesome.re/mentioned-badge.svg)](https://github.com/szenergy/awesome-lidar#basic-matching-algorithms) @@ -34,20 +43,21 @@ [//]: # (====Supported OS and aarch===============================================================) -`libpointmatcher` is tested on our build system under the following architecture and OS: -- x86 and arm64/v8 +### Supported OS And Architecture +_libpointmatcher_ is tested on our build system under the following architecture and OS: - Ubuntu bionic (18.04) and focal (20.04) +- x86 and arm64/v8 Note: - support for Ubuntu jammy (22.04) comming soon -- `libpointmatcher` reportedly works on MacOs OsX (latest) and Windows (latest) +- _libpointmatcher_ reportedly works on MacOs OsX (latest) and Windows (latest) --- [//]: # (====Release note=========================================================================) -### ★ Version `1.4.0` release note (important) +### ★ Version `1.4.0` Release Note This release of _libpointmatcher_ introduces the integration of [norlab-build-system (NBS)](https://github.com/norlab-ulaval/norlab-build-system) as a _git submodule_ for codebase development and testing. Execute the following to clone the repository with its submodule: @@ -59,11 +69,14 @@ If _libpointmatcher_ was previously cloned, execute the following to fetch its n git submodule update --remote --recursive --init ``` +### ★ Contributing Instructions +See [contributing_instructions.md](doc/contributing/contributing_instructions.md) +for instructions related to bug reporting, code contribution and for setting up the `libpointmatcher-build-system` +on your workstation to speed up your local development workflow. + + [//]: # (====Body=================================================================================) # Documentation and Tutorials - -libpointmatcher is a modular library implementing the Iterative Closest Point (ICP) algorithm for aligning point clouds. It has applications in robotics and computer vision. -The library is written in C++ for effeciency with [bindings in Python](https://github.com/norlab-ulaval/libpointmatcher/blob/master/doc/index.md#python-). **Quick link for the tutorial pages: [Tutorials](doc/index.md)** (also available on [readthedocs.org](http://libpointmatcher.readthedocs.org/) but might not be up-to-date). @@ -93,9 +106,32 @@ and was compiled on: * Mac OS X ([see how](/doc/CompilationMac.md)) * Windows ([see how](/doc/CompilationWindows.md) - partially supported) +### Docker images + +Run the following commands to pull and run libnabo in a docker container + +```shell +docker pull norlabulaval/libpointmatcher:latest-ubuntu-focal + +docker run -it --rm norlabulaval/libpointmatcher:latest-ubuntu-focal +``` + +See +available [libpointmatcher image tags](https://hub.docker.com/repository/docker/norlabulaval/libpointmatcher/) +on dockerhub. + ### Compilation & Installation For beginner users unfamiliar with compiling and installing a library in Linux, go [here](doc/CompilationUbuntu.md) for detailed instructions on compiling libpointmatcher from the source code. + +For conveniences, you can use the provided installer script for ubuntu +```shell +bash libpointmatcher_dependencies_installer.bash + +# Use the --help flag to see the list of optional flag +bash libpointmatcher_installer.bash [] +``` + If you are comfortable with Linux and CMake and have already installed the prerequisites above, the following commands should install libpointmatcher on your system. ```bash @@ -105,6 +141,7 @@ make sudo make install ``` + ### Testing Libpointmatcher ships with a version of the Google testing framework [GTest](https://github.com/google/googletest). Unit tests are located in the `utest/` directory and are compiled with libpointmatcher (CMake variable `BUILD_TESTS` must be set to `TRUE` before compiling). To run the tests and make sure that your compiled version is working correctly, run the test executable in your build directory: @@ -133,101 +170,6 @@ tutorial [Importing and Exporting Point Clouds](doc/ImportExport.md). Example ex those file formats from the command line can be found in the `/examples` directory and are described [here](doc/ICPIntro.md) in more detail. ---- - -# Contributing - -## Bug reporting - -Please use our [github's issue tracker](http://github.com/ethz-asl/libpointmatcher/issues) to report bugs. If you are running the library on Ubuntu, copy-paste the output of the script [listVersionsUbuntu.sh](https://github.com/norlab-ulaval/libpointmatcher/blob/master/utest/listVersionsUbuntu.sh) to simplify the search of an answer. - -## Codebase development - -Libpointmatcher codebase now integrate [norlab-build-system (NBS)](https://github.com/norlab-ulaval/norlab-build-system) and [norlab-shell-script-tools (N2ST)](https://github.com/norlab-ulaval/norlab-shell-script-tools). -`NBS` is a build-infrastructure-agnostic build system custom-made to meet our needs in robotic software engineering at NorLab and `N2ST` is a library of shell script functions as well as a shell testing tools leveraging _**bats-core**_ and _**docker**_ . -`N2ST` purpose is to speed up shell script development and improve reliability. - -`NBS` is deployed on our [TeamCity](https://www.jetbrains.com/teamcity/) continuous integration/deployment server and oversees protected branches of the [libpointmatcher](https://github.com/norlab-ulaval/libpointmatcher) GitHub repository: - -- The `develop` branch can only be merged through a pull-request from any `` branches. Any contributor can submit a pull request to the `develop` branch; -- the `release` branch is a revision and preparation branch where we can freeze the codebase in a given state without stalling to `develop` branch progression; -- The `master` branch can only be merged through a pull-request from the `release` branch. Only repository admin can submit a PR to the `master` branch. - -In any cases, submitting a pull request to `develop` or `master` will trigger a build/test configuration on our build system and the pull request will be granted if the build/test run succeed. - -**Current build matrix:** -`[latest] x [x86, arm64] x [ubuntu] x [bionic, focal] x [Release, RelWithDebInfo, MinSizeRel]` - -### Development workflow - -To speed up the development process, you can run the build system localy on your workstation and have access to stacktrace and build log. -It support multi-OS and multi-architecture through docker container. - -#### Install _libpointmatcher-build-system_ dependencies -```shell -cd - -# If libpointmatcher is already cloned, fetch the NBS and N2ST submodule -git submodule update --remote --recursive --init - -cd ./build_system/lpm_utility_script - -# Execute docker tools install script i.e. docker daemon, docker compose, docker buildx -bash lpm_install_docker_tools.bash - -# Configure a multi-architecture docker builder -bash lpm_create_multiarch_docker_builder.bash -``` - -#### libpointmatcher development › to execute build/test step locally -```shell -cd /build_system - -# Run the build matrix as specified in ".env.build_matrix.libpointmatcher" -# on native architecture using "ci_PR" service -bash lpm_crawl_libpointmatcher_build_matrix.bash --fail-fast -- build ci_PR - -# Run a specific case using build flags with multi-architecture -# virtualization using "ci_PR_amd64" and "ci_PR_arm64v8" services -bash lpm_crawl_libpointmatcher_build_matrix.bash \ - --repository-version-build-matrix-override latest \ - --os-name-build-matrix-override ubuntu \ - --cmake-build-type-build-matrix-override RelWithDebInfo \ - --ubuntu-version-build-matrix-override focal \ - --fail-fast \ - -- build ci_PR_amd64 ci_PR_arm64v8 - -# Read the help for details -bash lpm_crawl_libpointmatcher_build_matrix.bash --help -``` -Note: To assess the state of the codebase, even for cases that are known the break the build, -execute `lpm_crawl_libpointmatcher_build_matrix.bleeding.bash` with build matrix `.env.build_matrix.libpointmatcher.bleeding`. -The stable build matrix used for release is `.env.build_matrix.libpointmatcher`. - - -#### Build system development -```shell -cd /build_system/tests/ - -# To execute docker dryrun and configuration tests -bash run_all_docker_dryrun_and_config_tests.bash - -# To execute shell script tests -bash run_bats_core_test_in_n2st.bash - -# To spin a container in interactive mode with the codebase cloned but not compiled -cd ./tests_docker_interactive/ -bash build_and_run_IamBuildSystemTester.bash bash -``` - -#### Build system notes: -- `lpm_crawl_dependencies_build_matrix.bash` execute the build matrix for the libpointmatcher dependencies. - It's not required to build them locally as they are pre-build by our TeamCity server periodically push to dockerhub. - When executing `lpm_crawl_libpointmatcher_build_matrix.bash`, the `libpointmatcher-dependencies` docker images are pull and used as base image for the `libpointmatcher-[ci_PR_test|release]` images. -- About `libpointmatcher/.github/workflow/` vs `libpointmatcher/build_system/` logic: Those are separate build logic. - `.github/workflow/` was community contributed and as the responsibilities of building python-binding and pushing packages. - For this reason, it run a one-dimension build matrix: multiple python version, single OS version, single arch (x86) and - single compile flag which GitHub action computing resources can handle just fine. --- @@ -301,7 +243,7 @@ libpointmatcher is released under a permissive BSD license. Enjoy! [CMake documentation]: https://cmake.org/cmake/help/v3.10/ [git]: http://git-scm.com [Eigen]: http://eigen.tuxfamily.org -[libnabo]: http://github.com/ethz-asl/libnabo +[libnabo]: https://github.com/norlab-ulaval/libnabo [ROS]: http://www.ros.org/ [Paraview]: http://www.paraview.org/ [yaml-cpp]: https://github.com/jbeder/yaml-cpp diff --git a/build_system/README.md b/build_system/README.md index 58514a98..25a0912b 100644 --- a/build_system/README.md +++ b/build_system/README.md @@ -1 +1,2 @@ -See [README.md #Contributing](https://github.com/norlab-ulaval/libpointmatcher/tree/master#contributing) for instructions on how integrate the `libpointmatcher-build-system` to your local development workflow (on your workstation). +See [contributing_instructions.md](doc/contributing/contributing_instructions.md) +for instructions related to bug reporting, code contribution and for setting up the `libpointmatcher-build-system` on your workstation to speed up your local development workflow. diff --git a/build_system/ubuntu/lpm_install_dependencies_libnabo_ubuntu.bash b/build_system/ubuntu/lpm_install_dependencies_libnabo_ubuntu.bash index 3ce185d1..3c3f2922 100644 --- a/build_system/ubuntu/lpm_install_dependencies_libnabo_ubuntu.bash +++ b/build_system/ubuntu/lpm_install_dependencies_libnabo_ubuntu.bash @@ -78,7 +78,7 @@ CMAKE_FLAGS=( -D CMAKE_BUILD_TYPE=RelWithDebInfo "${APPEND_TO_CMAKE_FLAG[@]}" ) # ................................................................................................. teamcity_service_msg_blockOpened "Install Libpointmatcher dependencies › Libnabo" -# https://github.com/ethz-asl/libnabo +# https://github.com/norlab-ulaval/libnabo ## Note: # - ANN is not mentioned in doc because it's only required for `make test` benchmarks @@ -112,7 +112,7 @@ print_msg "Create required dir structure" mkdir -p "${NBS_LIB_INSTALL_PATH}" cd "${NBS_LIB_INSTALL_PATH}" -git clone https://github.com/ethz-asl/libnabo.git && +git clone https://github.com/norlab-ulaval/libnabo.git && cd libnabo && mkdir build && cd build diff --git a/doc/CompilationMac.md b/doc/CompilationMac.md index 7f3a631f..eb207b98 100644 --- a/doc/CompilationMac.md +++ b/doc/CompilationMac.md @@ -21,7 +21,7 @@ If you are used to development project, here is what you need: |boost | 1.57.0 | |eigen | 3.2.4 | |yaml-cpp | 0.5+ | -|libnabo | [from source](https://github.com/ethz-asl/libnabo) | +|libnabo | [from source](https://github.com/norlab-ulaval/libnabo) | __Note:__ Other versions will most probably work but you'll have to try yourself to know for sure. @@ -138,11 +138,11 @@ sudo make install ### 3. Installing libnabo -libnabo is a library for performing fast nearest-neighbor searches in low-dimensional spaces. It can be found [here](https://github.com/ethz-asl/libnabo). Clone the source repository into a local directory of your choice. +libnabo is a library for performing fast nearest-neighbor searches in low-dimensional spaces. It can be found [here](https://github.com/norlab-ulaval/libnabo). Clone the source repository into a local directory of your choice. ```bash cd ~/Libraries -git clone git://github.com/ethz-asl/libnabo.git +git clone git://github.com/norlab-ulaval/libnabo.git cd libnabo ``` @@ -310,4 +310,4 @@ Doxygen: ```bash brew info doxygen -``` \ No newline at end of file +``` diff --git a/doc/CompilationUbuntu.md b/doc/CompilationUbuntu.md index 96f18723..7964cc8b 100644 --- a/doc/CompilationUbuntu.md +++ b/doc/CompilationUbuntu.md @@ -20,7 +20,7 @@ If you are used to development projects, here is what you need: | boost | 1.65.1 | latest | | eigen | 3.3.4-4 | latest | | yaml-cpp | 0.5+ | latest | -| libnabo | [from source](https://github.com/ethz-asl/libnabo) | [from source](https://github.com/ethz-asl/libnabo) | +| libnabo | [from source](https://github.com/norlab-ulaval/libnabo) | [from source](https://github.com/norlab-ulaval/libnabo) | __Note:__ we only support 64-bit systems because of some issues with Eigen. Other versions will most probably work but you'll have to try yourself to know for sure. @@ -98,12 +98,12 @@ sudo apt-get install libyaml-cpp-dev ### 3. Installing libnabo -libnabo is a library for performing fast nearest-neighbor searches in low-dimensional spaces. It can be found [here](https://github.com/ethz-asl/libnabo). Clone the source repository into a local directory of your choice. +libnabo is a library for performing fast nearest-neighbor searches in low-dimensional spaces. It can be found [here](https://github.com/norlab-ulaval/libnabo). Clone the source repository into a local directory of your choice. ```bash mkdir ~/Libraries/ cd ~/Libraries -git clone git://github.com/ethz-asl/libnabo.git +git clone git://github.com/norlab-ulaval/libnabo.git cd libnabo ``` diff --git a/doc/CompilationWindows.md b/doc/CompilationWindows.md index 20746532..237426d0 100644 --- a/doc/CompilationWindows.md +++ b/doc/CompilationWindows.md @@ -34,7 +34,7 @@ This tutorial is divided up like this: | Boost | | 1.75.0 | | Eigen3 | | 3.3.9 | | grep | | 2.5.4 | -| libnabo | | Commit 16250bf | +| libnabo | | Commit 16250bf | | libpointmatcher | | Commit e9a832d | ### Notes @@ -94,7 +94,7 @@ This tutorial is divided up like this: 1. Do the following commands ```bash - git clone https://github.com/ethz-asl/libnabo + git clone https://github.com/norlab-ulaval/libnabo mkdir .\libnabo\build cd .\libnabo\build\ cmake-gui .. diff --git a/commit_msg_reference.md b/doc/contributing/commit_msg_reference.md similarity index 100% rename from commit_msg_reference.md rename to doc/contributing/commit_msg_reference.md diff --git a/doc/contributing/contributing_instructions.md b/doc/contributing/contributing_instructions.md new file mode 100644 index 00000000..de0c1c59 --- /dev/null +++ b/doc/contributing/contributing_instructions.md @@ -0,0 +1,135 @@ +# Contributing to _libpointmatcher_ + +## Bug Reporting + +Please use our [github's issue tracker](http://github.com/norlab-ulaval/libpointmatcher/issues) to +report bugs. If you are running the library on Ubuntu, copy-paste the output of the +script [listVersionsUbuntu.sh](https://github.com/norlab-ulaval/libpointmatcher/blob/master/utest/listVersionsUbuntu.sh) +to simplify the search of an answer. + +## Code Contributions + +Libpointmatcher codebase now +integrate [norlab-build-system (NBS)](https://github.com/norlab-ulaval/norlab-build-system) +and [norlab-shell-script-tools (N2ST)](https://github.com/norlab-ulaval/norlab-shell-script-tools). +`NBS` is a build-infrastructure-agnostic build system custom-made to meet our needs in robotic +software engineering at NorLab and `N2ST` is a library of shell script functions as well as a shell +testing tools leveraging _**bats-core**_ and _**docker**_ . +`N2ST` purpose is to speed up shell script development and improve reliability. + +`NBS` is deployed on our [TeamCity](https://www.jetbrains.com/teamcity/) continuous +integration/deployment server and oversees protected branches of +the [libpointmatcher](https://github.com/norlab-ulaval/libpointmatcher) GitHub repository: + +- The `develop` branch can only be merged through a pull-request from any `` branches. Any + contributor can submit a pull request to the `develop` branch; +- the `release` branch is a revision and preparation branch where we can freeze the codebase in a + given state without stalling to `develop` branch progression; +- The `master` branch can only be merged through a pull-request from the `release` branch. Only + repository admin can submit a PR to the `master` branch. + +In any cases, submitting a pull request to `develop` or `master` will trigger a build/test +configuration on our build system and the pull request will be granted if the build/test run +succeed. + +**Current build matrix:** +`[latest] x [x86, arm64] x [ubuntu] x [bionic, focal] x [Release, RelWithDebInfo, MinSizeRel]` + +### Development Workflow + +To speed up the development process, you can run the build system localy on your workstation and +have access to stacktrace and build log. +It support multi-OS and multi-architecture through docker container. + +#### Install _libpointmatcher-build-system_ Dependencies + +```shell +cd + +# If libpointmatcher is already cloned, fetch the NBS and N2ST submodule +git submodule update --remote --recursive --init + +cd ./build_system/lpm_utility_script + +# Execute docker tools install script i.e. docker daemon, docker compose, docker buildx +bash lpm_install_docker_tools.bash + +# Configure a multi-architecture docker builder +bash lpm_create_multiarch_docker_builder.bash +``` + +#### _libpointmatcher_ Development › To Execute Build/Test Step Locally + +```shell +cd /build_system + +# Run the build matrix as specified in ".env.build_matrix.libpointmatcher" +# on native architecture using "ci_PR" service +bash lpm_crawl_libpointmatcher_build_matrix.bash --fail-fast -- build ci_PR + +# Run a specific case using build flags with multi-architecture +# virtualization using "ci_PR_amd64" and "ci_PR_arm64v8" services +bash lpm_crawl_libpointmatcher_build_matrix.bash \ + --repository-version-build-matrix-override latest \ + --os-name-build-matrix-override ubuntu \ + --cmake-build-type-build-matrix-override RelWithDebInfo \ + --ubuntu-version-build-matrix-override focal \ + --fail-fast \ + -- build ci_PR_amd64 ci_PR_arm64v8 + +# Read the help for details +bash lpm_crawl_libpointmatcher_build_matrix.bash --help +``` + +Note: To assess the state of the codebase, even for cases that are known the break the build, +execute `lpm_crawl_libpointmatcher_build_matrix.bleeding.bash` with build +matrix `.env.build_matrix.libpointmatcher.bleeding`. +The stable build matrix used for release is `.env.build_matrix.libpointmatcher`. + +#### Build System Development + +```shell +cd /build_system/tests/ + +# To execute docker dryrun and configuration tests +bash run_all_docker_dryrun_and_config_tests.bash + +# To execute shell script tests +bash run_bats_core_test_in_n2st.bash + +# To spin a container in interactive mode with the codebase cloned but not compiled +cd ./tests_docker_interactive/ +bash build_and_run_IamBuildSystemTester.bash bash +``` + +#### Build System Notes + +- `lpm_crawl_dependencies_build_matrix.bash` execute the build matrix for the libpointmatcher + dependencies. + It's not required to build them locally as they are pre-build by our TeamCity server periodically + push to dockerhub. + When executing `lpm_crawl_libpointmatcher_build_matrix.bash`, the `libpointmatcher-dependencies` + docker images are pull and used as base image for the `libpointmatcher-[ci_PR_test|release]` + images. +- About `libpointmatcher/.github/workflow/` vs `libpointmatcher/build_system/` logic: Those are + separate build logic. + `.github/workflow/` was community contributed and as the responsibilities of building + python-binding and pushing packages. + For this reason, it run a one-dimension build matrix: multiple python version, single OS version, + single arch (x86) and + single compile flag which GitHub action computing resources can handle just fine. + +## Commit Messages +This is optional for now but will eventually move our release workflow to semantic-versioning. +See [Commit Message References](commit_msg_reference.md) for details. + +## Note For Repository Admins + +### About Release Branch And Pull Request To Master Branch + +- Only repository admins have the privilege to `push/merge` on the default branch (ie: `master`) + and the `release` branch. +- Keep PR in `draft` mode until all the release reviewers are ready to push the release. +- Once a PR from `release` -> `master` branch is created (not in draft mode), + - it triggers the _build-system_ test + - (in-progress) and it triggers the _semantic release automation_ diff --git a/doc/index.md b/doc/index.md index a69c5812..66a5450d 100644 --- a/doc/index.md +++ b/doc/index.md @@ -45,6 +45,12 @@ This page lists the available tutorials for libpointmatcher. The [Beginner](#beg - [Creating a DataPointsFilter](DataPointsFilterDev.md) - [Creating a Transformation](TransformationDev.md) - [Creating unit tests](UnitTestDev.md) +- [Contributing Instructions](contributing/contributing_instructions.md) + - instructions for setting up the `libpointmatcher-build-system` on your workstation to speed up your local development + - bug reporting + - code contribution + workflow +- [Commit Message References](contributing/commit_msg_reference.md) (**Note:** this is optional for now but will eventually move our release workflow to semantic-versioning) ## Python From 0a9b0ff128d288f6ff832309fc07c41ea015cb36 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Mon, 8 Jan 2024 16:58:34 -0500 Subject: [PATCH 02/14] ci: add dockerhub release logic [NMO-469] and fix doc hyperlinks --- .github/pull_request_template.md | 5 ++-- README.md | 9 +++++++ build_system/README.md | 2 +- .../Dockerfile.libpointmatcher.hub_release | 25 +++++++++++-------- ..._test_libpointmatcher_checkout_branch.bash | 0 ...build_libpointmatcher_checkout_branch.bash | 0 ...nt_execute_lpm_unittest_conditionally.bash | 0 7 files changed, 27 insertions(+), 14 deletions(-) rename build_system/ubuntu/{ => entrypoint_special_cases}/entrypoint_build_and_test_libpointmatcher_checkout_branch.bash (100%) rename build_system/ubuntu/{ => entrypoint_special_cases}/entrypoint_build_libpointmatcher_checkout_branch.bash (100%) rename build_system/ubuntu/{ => entrypoint_special_cases}/entrypoint_execute_lpm_unittest_conditionally.bash (100%) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ae9141b3..3aec9a41 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,6 +2,7 @@ ### Summary: + ### Changes and type of changes (quick overview): - @@ -19,7 +20,7 @@ - [ ] I have commented hard-to-understand code - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] All tests pass locally with my changes - (Check [contributing_instructions.md](doc/contributing/contributing_instructions.md) + (Check [contributing_instructions.md](https://github.com/norlab-ulaval/libnabo/tree/develop/doc/contributing/contributing_instructions.md) for local testing procedure using _libpointmatcher-build-system_) ### PR creation related @@ -34,7 +35,7 @@ - [ ] I have included a quick summary of the changes - [ ] I have indicated the related issue's id with `# ` if changes are of type `fix` - [ ] I have included a high-level list of changes and their corresponding types - (See [commit_msg_reference.md](doc/contributing/commit_msg_reference.md) + (See [commit_msg_reference.md](https://github.com/norlab-ulaval/libnabo/tree/develop/doc/contributing/commit_msg_reference.md) for details) --- diff --git a/README.md b/README.md index 466d355b..ff9637d3 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,15 @@ See available [libpointmatcher image tags](https://hub.docker.com/repository/docker/norlabulaval/libpointmatcher/) on dockerhub. +To install docker related dependencies on ubuntu, execute the following +```shell +cd ./build_system/lpm_utility_script + +# Execute docker tools install script i.e. docker daemon, docker compose, docker buildx +bash lpm_install_docker_tools.bash +``` + + ### Compilation & Installation For beginner users unfamiliar with compiling and installing a library in Linux, go [here](doc/CompilationUbuntu.md) for detailed instructions on compiling libpointmatcher from the source code. diff --git a/build_system/README.md b/build_system/README.md index 25a0912b..41b3846c 100644 --- a/build_system/README.md +++ b/build_system/README.md @@ -1,2 +1,2 @@ -See [contributing_instructions.md](doc/contributing/contributing_instructions.md) +See [contributing_instructions.md](https://github.com/norlab-ulaval/libnabo/tree/develop/doc/contributing/contributing_instructions.md) for instructions related to bug reporting, code contribution and for setting up the `libpointmatcher-build-system` on your workstation to speed up your local development workflow. diff --git a/build_system/ubuntu/Dockerfile.libpointmatcher.hub_release b/build_system/ubuntu/Dockerfile.libpointmatcher.hub_release index 93dae963..ee3c261e 100644 --- a/build_system/ubuntu/Dockerfile.libpointmatcher.hub_release +++ b/build_system/ubuntu/Dockerfile.libpointmatcher.hub_release @@ -1,7 +1,7 @@ ARG PROJECT_HUB=norlabulaval ARG BASE_IMAGE=libpointmatcher-dependencies-doc ARG BASE_IMAGE_TAG -FROM ${PROJECT_HUB}/${BASE_IMAGE}:${BASE_IMAGE_TAG:?err} AS libpointmatcher-dependencies +FROM ${PROJECT_HUB}/${BASE_IMAGE}:${BASE_IMAGE_TAG:?err} AS libpointmatcher-install LABEL org.opencontainers.image.authors="luc.coupal.1@ulaval.ca" @@ -28,34 +28,37 @@ SHELL ["/bin/bash", "-c"] ARG DEBIAN_FRONTEND=noninteractive # ====Build system related setup=================================================================== -WORKDIR "${NBS_LIB_INSTALL_PATH}/${NBS_REPOSITORY_NAME}-CICD/" +WORKDIR "${NBS_LIB_INSTALL_PATH}/${NBS_REPOSITORY_NAME}/release-prep/" # Copy only the build system file for running the install and test scripts # Note: Logic to copy files from the checkout branch is handle by 'lpm_install_libpointmatcher_ubuntu.bash' script COPY ./build_system/ ./build_system/ +COPY ./.git/ ./.git/ # ==== Build libpointmatcher checkout branch ====================================================== WORKDIR ./build_system/ubuntu RUN chmod +x lpm_install_libpointmatcher_ubuntu.bash -RUN chmod +x entrypoint_execute_lpm_unittest_conditionally.bash -RUN chmod +x entrypoint.bash # ====Install Libpointmatcher====================================================================== RUN bash lpm_install_libpointmatcher_ubuntu.bash \ + --install-path ${NBS_LIB_INSTALL_PATH} \ --repository-version ${REPOSITORY_VERSION} \ --cmake-build-type ${CMAKE_BUILD_TYPE} \ ${INSTALL_SCRIPT_FLAG} -# ==== Execute libpointmatcher unit-test=========================================================== -# Conditional execution if build/utest/ directory is present -RUN source entrypoint_execute_lpm_unittest_conditionally.bash - +RUN rm -rf "${NBS_LIB_INSTALL_PATH}/release-prep/" # ====End========================================================================================== -FROM libpointmatcher-dependencies AS libpointmatcher-release +FROM libpointmatcher-install AS libpointmatcher-release + +WORKDIR "${NBS_LIB_INSTALL_PATH}/${NBS_REPOSITORY_NAME}" + +COPY ./build_system/ubuntu/entrypoint.bash ./build_system/ubuntu/entrypoint.bash +COPY ./build_system/.env ./build_system/.env -WORKDIR "${NBS_LIB_INSTALL_PATH}/${NBS_REPOSITORY_NAME}-CICD/build_system/ubuntu" +RUN chmod +x ./build_system/ubuntu/entrypoint.bash +RUN chmod +x ./build_system/.env -ENTRYPOINT [ "./entrypoint.bash" ] +ENTRYPOINT [ "./build_system/ubuntu/entrypoint.bash" ] CMD [ "bash" ] diff --git a/build_system/ubuntu/entrypoint_build_and_test_libpointmatcher_checkout_branch.bash b/build_system/ubuntu/entrypoint_special_cases/entrypoint_build_and_test_libpointmatcher_checkout_branch.bash similarity index 100% rename from build_system/ubuntu/entrypoint_build_and_test_libpointmatcher_checkout_branch.bash rename to build_system/ubuntu/entrypoint_special_cases/entrypoint_build_and_test_libpointmatcher_checkout_branch.bash diff --git a/build_system/ubuntu/entrypoint_build_libpointmatcher_checkout_branch.bash b/build_system/ubuntu/entrypoint_special_cases/entrypoint_build_libpointmatcher_checkout_branch.bash similarity index 100% rename from build_system/ubuntu/entrypoint_build_libpointmatcher_checkout_branch.bash rename to build_system/ubuntu/entrypoint_special_cases/entrypoint_build_libpointmatcher_checkout_branch.bash diff --git a/build_system/ubuntu/entrypoint_execute_lpm_unittest_conditionally.bash b/build_system/ubuntu/entrypoint_special_cases/entrypoint_execute_lpm_unittest_conditionally.bash similarity index 100% rename from build_system/ubuntu/entrypoint_execute_lpm_unittest_conditionally.bash rename to build_system/ubuntu/entrypoint_special_cases/entrypoint_execute_lpm_unittest_conditionally.bash From 97ea9befaa337862c475660d5f84fbd24355ac0a Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Mon, 8 Jan 2024 17:05:42 -0500 Subject: [PATCH 03/14] build: update NBS submodule to latest --- build_system/utilities/norlab-build-system | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_system/utilities/norlab-build-system b/build_system/utilities/norlab-build-system index 617d4471..646df879 160000 --- a/build_system/utilities/norlab-build-system +++ b/build_system/utilities/norlab-build-system @@ -1 +1 @@ -Subproject commit 617d447151d1438aadfd2ba44d12fabbb95d772b +Subproject commit 646df879394547c33e590558017e2ef224fdffa4 From bd2f28b6a9c5eec9921699419d805095586505f7 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Mon, 8 Jan 2024 17:45:15 -0500 Subject: [PATCH 04/14] build: update repo version logic --- build_system/.env.build_matrix.dependencies | 2 +- build_system/.env.build_matrix.libpointmatcher | 2 +- build_system/.env.build_matrix.libpointmatcher.bleeding | 2 +- .../tests_installer/test_build_system_lpm_installer.bats | 6 +++--- .../ubuntu/lpm_install_libpointmatcher_ubuntu.bash | 7 ++++--- libpointmatcher_installer.bash | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/build_system/.env.build_matrix.dependencies b/build_system/.env.build_matrix.dependencies index aa046715..14cfa109 100644 --- a/build_system/.env.build_matrix.dependencies +++ b/build_system/.env.build_matrix.dependencies @@ -11,7 +11,7 @@ NBS_EXECUTE_BUILD_MATRIX_OVER_COMPOSE_FILE=docker-compose.dependencies.yaml # Libpointmatcher version # # 'latest' is the latest push to the libpointmatcher master branch -#NBS_MATRIX_REPOSITORY_VERSIONS=( 'v1.3.1' 'latest' 'v2.0.test' ) +#NBS_MATRIX_REPOSITORY_VERSIONS=( '1.4.0' 'latest' ) NBS_MATRIX_REPOSITORY_VERSIONS=( 'latest' ) # diff --git a/build_system/.env.build_matrix.libpointmatcher b/build_system/.env.build_matrix.libpointmatcher index 641b44a2..3fb3597c 100644 --- a/build_system/.env.build_matrix.libpointmatcher +++ b/build_system/.env.build_matrix.libpointmatcher @@ -11,7 +11,7 @@ NBS_EXECUTE_BUILD_MATRIX_OVER_COMPOSE_FILE=docker-compose.libpointmatcher.yaml # Libpointmatcher version # # 'latest' is the latest push to the libpointmatcher master branch -#NBS_MATRIX_REPOSITORY_VERSIONS=( 'v1.3.1' 'latest' 'v2.0.test' ) +#NBS_MATRIX_REPOSITORY_VERSIONS=( '1.4.0' 'latest' ) NBS_MATRIX_REPOSITORY_VERSIONS=( 'latest' ) # diff --git a/build_system/.env.build_matrix.libpointmatcher.bleeding b/build_system/.env.build_matrix.libpointmatcher.bleeding index 23de9f20..461c7793 100644 --- a/build_system/.env.build_matrix.libpointmatcher.bleeding +++ b/build_system/.env.build_matrix.libpointmatcher.bleeding @@ -11,7 +11,7 @@ NBS_EXECUTE_BUILD_MATRIX_OVER_COMPOSE_FILE=docker-compose.libpointmatcher.yaml # Libpointmatcher version # # 'latest' is the latest push to the libpointmatcher master branch -#NBS_MATRIX_REPOSITORY_VERSIONS=( 'v1.3.1' 'latest' 'v2.0.test' ) +#NBS_MATRIX_REPOSITORY_VERSIONS=( '1.4.0' 'latest' ) NBS_MATRIX_REPOSITORY_VERSIONS=( 'latest' ) # diff --git a/build_system/tests/tests_bats/tests_installer/test_build_system_lpm_installer.bats b/build_system/tests/tests_bats/tests_installer/test_build_system_lpm_installer.bats index 3ba6d709..96928fb2 100644 --- a/build_system/tests/tests_bats/tests_installer/test_build_system_lpm_installer.bats +++ b/build_system/tests/tests_bats/tests_installer/test_build_system_lpm_installer.bats @@ -141,7 +141,7 @@ teardown() { run bash "./${TESTED_FILE_PATH3}/$TESTED_FILE4" --test-run \ --install-path /opt/test_dir \ - --repository-version 1.3.1 \ + --repository-version 1.4.0 \ --compile-test \ --generate-doc \ --cmake-build-type Release @@ -149,9 +149,9 @@ teardown() { assert_success assert_output --regexp .*"\[".*"LPM".*"\]".*"Install libpointmatcher" - assert_output --partial "switching to 'tags/1.3.1'." + assert_output --partial "switching to 'tags/1.4.0'." - assert_output --regexp .*"\[".*"LPM".*"\]".*"Repository checkout at tag 1.3.1" + assert_output --regexp .*"\[".*"LPM".*"\]".*"Repository checkout at tag 1.4.0" assert_output --regexp .*"\[".*"LPM".*"\]".*"Execute".*"cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_TESTS=TRUE -D GENERATE_API_DOC=TRUE /opt/test_dir/libpointmatcher" refute_output --regexp .*"\[".*"LPM".*"\]".*"Execute".*"cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D BUILD_TESTS=FALSE -D GENERATE_API_DOC=FALSE /opt/percep3d_libraries/libpointmatcher" diff --git a/build_system/ubuntu/lpm_install_libpointmatcher_ubuntu.bash b/build_system/ubuntu/lpm_install_libpointmatcher_ubuntu.bash index 1c2d8ae8..f8220668 100644 --- a/build_system/ubuntu/lpm_install_libpointmatcher_ubuntu.bash +++ b/build_system/ubuntu/lpm_install_libpointmatcher_ubuntu.bash @@ -9,7 +9,7 @@ # Arguments: # --install-path The directory where to install libpointmatcher (absolute path) # (default location defined in the .env) -# --repository-version v1.3.1 Install libpointmatcher release tag version (default to master branch latest) +# --repository-version 1.4.0 Install libpointmatcher release tag version (default to master branch latest) # --compile-test Compile the libpointmatcher unit-test # --generate-doc Generate the libpointmatcher doxygen documentation # in /usr/local/share/doc/libpointmatcher/api/html/index.html @@ -74,7 +74,7 @@ function print_help_in_terminal() { \033[1m:\033[0m --install-path The directory where to install (absolute path) (default location ${MSG_DIMMED_FORMAT}${NBS_LIB_INSTALL_PATH:?err}${MSG_END_FORMAT}) - --repository-version v1.3.1 Install release tag version (default to master branch latest) + --repository-version 1.4.0 Install release tag version (default to master branch latest) --compile-test Compile the unit-test in ${MSG_DIMMED_FORMAT}${NBS_LIB_INSTALL_PATH}/${NBS_REPOSITORY_NAME:?err}/build${MSG_END_FORMAT} --generate-doc Generate the libpointmatcher doxygen documentation @@ -194,7 +194,8 @@ if [[ ${BUILD_SYSTEM_CI_INSTALL} == FALSE ]]; then git tag --list # Remove prefix 'v' from version tag - GITHUB_TAG="${REPOSITORY_VERSION/v/}" +# GITHUB_TAG="${REPOSITORY_VERSION/v/}" + GITHUB_TAG="${REPOSITORY_VERSION}" git checkout tags/"${GITHUB_TAG}" diff --git a/libpointmatcher_installer.bash b/libpointmatcher_installer.bash index 5c879622..c229f31b 100644 --- a/libpointmatcher_installer.bash +++ b/libpointmatcher_installer.bash @@ -9,7 +9,7 @@ # Arguments: # --install-path The directory where to install libpointmatcher (absolute path) # (default location defined in the .env) -# --repository-version v1.3.1 Install libpointmatcher release tag version (default to master branch latest) +# --repository-version 1.4.0 Install libpointmatcher release tag version (default to master branch latest) # --compile-test Compile the libpointmatcher unit-test # --generate-doc Generate the libpointmatcher doxygen documentation # in /usr/local/share/doc/libpointmatcher/api/html/index.html From 6510742250e2e6a07bf98706a951037d4ab1adf4 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Mon, 8 Jan 2024 17:45:57 -0500 Subject: [PATCH 05/14] doc(readme): update header --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ff9637d3..aecee3eb 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,16 @@ with [bindings in Python](doc/index.md#python-).

+[//]: # (====GitHub badges========================================================================) + +GitHub Repo stars +GitHub forks +GitHub License +GitHub release (with filter) + +
+
+ [//]: # (====Awesome badges=======================================================================) [![Mentioned in Awesome LIDAR](https://awesome.re/mentioned-badge.svg)](https://github.com/szenergy/awesome-lidar#basic-matching-algorithms) @@ -28,19 +38,10 @@ with [bindings in Python](doc/index.md#python-). Robotics Libraries - -[//]: # (====GitHub badges========================================================================) - -GitHub Repo stars -GitHub forks -GitHub License -GitHub release (with filter) - -
-
+ [//]: # (====Supported OS and aarch===============================================================) ### Supported OS And Architecture From 1685b85639148f531388cbcec831499315c25c65 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Mon, 8 Jan 2024 19:18:48 -0500 Subject: [PATCH 06/14] build: add release crawler script and .env file --- build_system/.env.build_matrix.dependencies | 3 +- .../.env.build_matrix.libpointmatcher.release | 38 +++++++++++++++++ ..._libpointmatcher_build_matrix.release.bash | 41 +++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 build_system/.env.build_matrix.libpointmatcher.release create mode 100644 build_system/lpm_crawl_libpointmatcher_build_matrix.release.bash diff --git a/build_system/.env.build_matrix.dependencies b/build_system/.env.build_matrix.dependencies index 14cfa109..957d0cfd 100644 --- a/build_system/.env.build_matrix.dependencies +++ b/build_system/.env.build_matrix.dependencies @@ -11,8 +11,7 @@ NBS_EXECUTE_BUILD_MATRIX_OVER_COMPOSE_FILE=docker-compose.dependencies.yaml # Libpointmatcher version # # 'latest' is the latest push to the libpointmatcher master branch -#NBS_MATRIX_REPOSITORY_VERSIONS=( '1.4.0' 'latest' ) -NBS_MATRIX_REPOSITORY_VERSIONS=( 'latest' ) +NBS_MATRIX_REPOSITORY_VERSIONS=( '1.4.0' 'latest' ) # # Libpointmatcher dependencies CMAKE_BUILD_TYPE diff --git a/build_system/.env.build_matrix.libpointmatcher.release b/build_system/.env.build_matrix.libpointmatcher.release new file mode 100644 index 00000000..1064c50d --- /dev/null +++ b/build_system/.env.build_matrix.libpointmatcher.release @@ -0,0 +1,38 @@ +# +# Build matrix variables +# + +# +# The compose file on which the build matrix will be crawled +# +NBS_EXECUTE_BUILD_MATRIX_OVER_COMPOSE_FILE=docker-compose.libpointmatcher.yaml + +# +# Libpointmatcher version +# +# 'latest' is the latest push to the libpointmatcher master branch +NBS_MATRIX_REPOSITORY_VERSIONS=( '1.4.0' 'latest' ) + +# +# Libpointmatcher CMAKE_BUILD_TYPE +# +NBS_MATRIX_CMAKE_BUILD_TYPE=( 'Release' ) + +# +# LIBPOINTMATCHER supported OS +# +# ToDo: implement OsX support for arm64-Darwin (ref task NMO-213) +#NBS_MATRIX_SUPPORTED_OS=( 'ubuntu' 'l4t' 'osx' ) +NBS_MATRIX_SUPPORTED_OS=( 'ubuntu' ) + +# +# ubuntu supported versions +# +# Ubuntu release: https://ubuntu.com/about/release-cycle +# bionic=18.04 focal=20.04 jammy=22.04 +NBS_MATRIX_UBUNTU_SUPPORTED_VERSIONS=( 'bionic' 'focal' ) +# +# iceboxed: implement other OS support (ref task NMO-213 OsX arm64-Darwin and NMO-210 OsX x86 CD components) +#NBS_MATRIX_OSX_SUPPORTED_VERSIONS=( 'monterey' 'ventura' ) +NBS_MATRIX_OSX_SUPPORTED_VERSIONS=( ) + diff --git a/build_system/lpm_crawl_libpointmatcher_build_matrix.release.bash b/build_system/lpm_crawl_libpointmatcher_build_matrix.release.bash new file mode 100644 index 00000000..a4f8d96b --- /dev/null +++ b/build_system/lpm_crawl_libpointmatcher_build_matrix.release.bash @@ -0,0 +1,41 @@ +#!/bin/bash +# ================================================================================================= +# +# Execute build matrix specified in .env.build_matrix.libpointmatcher +# +# Redirect the execution to 'nbs_execute_compose_over_build_matrix.bash' from the norlab-build-system library +# +# Usage: +# $ bash lpm_crawl_libpointmatcher_build_matrix.bash [] [-- ] +# +# $ bash lpm_crawl_libpointmatcher_build_matrix.bash -- build --dry-run +# +# Run script with the '--help' flag for details +# +# ================================================================================================= +PARAMS="${@:-"--fail-fast -- build --push release"}" + + +# ....path resolution logic........................................................................ +LPM_ROOT="$(dirname "$(realpath "$0")")/.." +LPM_BUILD_SYSTEM_PATH="${LPM_ROOT}/build_system" +NBS_PATH="${LPM_BUILD_SYSTEM_PATH}/utilities/norlab-build-system" +N2ST_PATH="${LPM_BUILD_SYSTEM_PATH}/utilities/norlab-shell-script-tools" + +# ....Load environment variables from file......................................................... +cd "${LPM_BUILD_SYSTEM_PATH}" || exit 1 +set -o allexport && source .env && set +o allexport + +# ....Source NBS dependencies...................................................................... +cd "${NBS_PATH}" || exit 1 +source import_norlab_build_system_lib.bash + +# ====begin======================================================================================== +cd "${NBS_PATH}/src/utility_scripts" || exit 1 + +DOTENV_BUILD_MATRIX_REALPATH=${LPM_BUILD_SYSTEM_PATH}/.env.build_matrix.libpointmatcher.release + +# Note: do not double quote PARAMS or threat it as a array otherwise it will cause error +# shellcheck disable=SC2086 +source nbs_execute_compose_over_build_matrix.bash "${DOTENV_BUILD_MATRIX_REALPATH}" $PARAMS + From d7ceb3254957c065a641aaac8e4d7da74732abfe Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Mon, 8 Jan 2024 19:33:32 -0500 Subject: [PATCH 07/14] test: add release crawler script bats test --- ..._libpointmatcher_build_matrix.release.bats | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 build_system/tests/tests_bats/tests_crawler/test_lpm_crawl_libpointmatcher_build_matrix.release.bats diff --git a/build_system/tests/tests_bats/tests_crawler/test_lpm_crawl_libpointmatcher_build_matrix.release.bats b/build_system/tests/tests_bats/tests_crawler/test_lpm_crawl_libpointmatcher_build_matrix.release.bats new file mode 100644 index 00000000..801cc6f4 --- /dev/null +++ b/build_system/tests/tests_bats/tests_crawler/test_lpm_crawl_libpointmatcher_build_matrix.release.bats @@ -0,0 +1,101 @@ +#!/usr/bin/env bats +# +# Usage in docker container +# $ REPO_ROOT=$(pwd) && RUN_TESTS_IN_DIR='tests' +# $ docker run -it --rm -v "$REPO_ROOT:/code" bats/bats:latest "$RUN_TESTS_IN_DIR" +# +# Note: "/code" is the working directory in the bats official image +# +# bats-core ref: +# - https://bats-core.readthedocs.io/en/stable/tutorial.html +# - https://bats-core.readthedocs.io/en/stable/writing-tests.html +# - https://opensource.com/article/19/2/testing-bash-bats +# ↳ https://github.com/dmlond/how_to_bats/blob/master/test/build.bats +# +# Helper library: +# - https://github.com/bats-core/bats-assert +# - https://github.com/bats-core/bats-support +# - https://github.com/bats-core/bats-file +# + +BATS_HELPER_PATH=/usr/lib/bats +if [[ -d ${BATS_HELPER_PATH} ]]; then + load "${BATS_HELPER_PATH}/bats-support/load" + load "${BATS_HELPER_PATH}/bats-assert/load" + load "${BATS_HELPER_PATH}/bats-file/load" + load "${SRC_CODE_PATH}/${N2ST_BATS_TESTING_TOOLS_RELATIVE_PATH}/bats_helper_functions" + load "${SRC_CODE_PATH}/build_system/tests/tests_bats/bats_helper_functions" + #load "${BATS_HELPER_PATH}/bats-detik/load" # << Kubernetes support +else + echo -e "\n[\033[1;31mERROR\033[0m] $0 path to bats-core helper library unreachable at \"${BATS_HELPER_PATH}\"!" 1>&2 + echo '(press any key to exit)' + read -r -n 1 + exit 1 +fi + +# ====Setup======================================================================================== + +TESTED_FILE="lpm_crawl_libpointmatcher_build_matrix.release.bash" +TESTED_FILE_PATH="./build_system/" +COMPOSE_FILE="docker-compose.libpointmatcher.yaml" +DOTENV_BUILD_MATRIX="${SRC_CODE_PATH}"/build_system/.env.build_matrix.libpointmatcher.release +DOTENV_BUILD_MATRIX_NAME=$( basename "${DOTENV_BUILD_MATRIX}" ) + +# executed once before starting the first test (valide for all test in that file) +setup_file() { + BATS_DOCKER_WORKDIR=$(pwd) && export BATS_DOCKER_WORKDIR + + ## Uncomment the following for debug, the ">&3" is for printing bats msg to stdin +# pwd >&3 && tree -L 1 -a -hug >&3 +# printenv >&3 +} + +# executed before each test +setup() { + cd "$TESTED_FILE_PATH" || exit 1 +} + +# ====Teardown===================================================================================== + +# executed after each test +teardown() { + bats_print_run_env_variable_on_error +} + +## executed once after finishing the last test (valide for all test in that file) +#teardown_file() { +#} + +# ====Test casses================================================================================== + +@test "${TESTED_FILE} › docker image › execute ok › expect pass" { +# skip "tmp mute" # ToDo: on task end >> delete this line ← + + run bash "${TESTED_FILE}" "${DOTENV_BUILD_MATRIX}" --fail-fast -- build +# OPTIONS=( "${DOTENV_BUILD_MATRIX}" "--ubuntu-version-build-matrix-override jammy" "--fail-fast" "--" "config --quiet" ) +# run bash "${TESTED_FILE}" "${OPTIONS[@]}" + + assert_success + assert_output --regexp .*"Starting".*"${TESTED_FILE}".*"\[NBS\]".*"Build images specified in".*"'${COMPOSE_FILE}'".*"following".*"${DOTENV_BUILD_MATRIX_NAME}" + assert_output --regexp .*"\[NBS done\]".*"FINAL › Build matrix completed with command".*"\$".*"docker compose -f ${COMPOSE_FILE}" +# build --dry-run + assert_output --regexp "Status of tag crawled:".*"Pass".*"› latest".*"Completed".*"${TESTED_FILE}".* +} + +# ....Test --help flag related logic............................................................... + +@test "${TESTED_FILE} › --help as first argument › execute ok › expect pass" { +# skip "tmp dev" # ToDo: on task end >> delete this line ← + run bash "${TESTED_FILE}" --help + test_generic_help_flag_logic +} + +@test "${TESTED_FILE} › second arg: --help › execute ok › expect pass" { +# skip "tmp dev" # ToDo: on task end >> delete this line ← + + run bash "${TESTED_FILE}" --fail-fast --help + test_generic_help_flag_logic +} + +## ToDo: implement >> test for IS_TEAMCITY_RUN==true casses +## (NICE TO HAVE) ToDo: implement >> test for python intsall casses with regard to distribution From 84284661ee2fc7df1d3d533b85e9592e145d7cf4 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Tue, 9 Jan 2024 00:41:21 -0500 Subject: [PATCH 08/14] fix: boost download issue >> Move from jfrog artifactory to archives.boost.io - see [boost issue #6775](https://github.com/triton-inference-server/server/pull/6775) --- .github/workflows/build-python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-python.yaml b/.github/workflows/build-python.yaml index d6d033e6..b12c5d27 100644 --- a/.github/workflows/build-python.yaml +++ b/.github/workflows/build-python.yaml @@ -177,7 +177,7 @@ jobs: if: ${{ steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' }} working-directory: ${{ env.BOOST_SRC_DIR }} run: | - wget --no-verbose https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_VERSION }}/source/${{ env.BOOST_ARCHIVE_NAME }} + wget --no-verbose https://archives.boost.io/release/${{ env.BOOST_VERSION }}/source/${{ env.BOOST_ARCHIVE_NAME }} 7z -y x ${{ env.BOOST_ARCHIVE_NAME }} rm ${{ env.BOOST_ARCHIVE_NAME }} From 1ec3256b3427be0b4e2da0cd481d6808b2d17bdb Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Tue, 9 Jan 2024 10:18:15 -0500 Subject: [PATCH 09/14] ci: minor fix to the release docker image directory structure. - Also muted the generate doc flag until UseDoxygen.cmake line 112 is fixed --- ... build dependencies_arm64v8 ci_PR_arm64v8 _popup_.run.xml" | 2 +- build_system/docker-compose.libpointmatcher.yaml | 3 ++- build_system/ubuntu/Dockerfile.libpointmatcher.hub_release | 2 +- build_system/ubuntu/lpm_install_libpointmatcher_ubuntu.bash | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git "a/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies_arm64v8 ci_PR_arm64v8 _popup_.run.xml" "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies_arm64v8 ci_PR_arm64v8 _popup_.run.xml" index fd730d73..1e381aae 100644 --- "a/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies_arm64v8 ci_PR_arm64v8 _popup_.run.xml" +++ "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies_arm64v8 ci_PR_arm64v8 _popup_.run.xml" @@ -1,6 +1,6 @@ -