From 1c98122111e0c064cbe1775d34f6c684dbb4738b Mon Sep 17 00:00:00 2001 From: Tristan Laurent <tristan.laurent@cs-soprasteria.com> Date: Wed, 26 Mar 2025 15:26:12 +0100 Subject: [PATCH 1/2] CI: update issues template, add DOR and DOD template --- .../definition_of_done_definition_of_ready.md | 26 +++++++++++++++++++ .gitlab/issue_templates/release.md | 8 +++--- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .gitlab/issue_templates/definition_of_done_definition_of_ready.md diff --git a/.gitlab/issue_templates/definition_of_done_definition_of_ready.md b/.gitlab/issue_templates/definition_of_done_definition_of_ready.md new file mode 100644 index 0000000000..6668acd322 --- /dev/null +++ b/.gitlab/issue_templates/definition_of_done_definition_of_ready.md @@ -0,0 +1,26 @@ +# Description +<!-- Quick issue description --> + +# Definition of Ready + +## Generic: + +* [ ] If this issue is consequent, it is splitted in subtask with priority and complexity evaluated. Theses subtasks should be linked to this issue. +* [ ] Issue complexity evaluated +* [ ] Priority of issue evaluated +* [ ] If there is specific test data needed, it should be detailled and available +* [ ] If there is specific documentation/specification need, it should be available to the development team +* [ ] Time during the sprint to realise this issue +* [ ] Blocking elements resolved (check if non applicable, detail otherwise the resolved elements) + +## Specific: + +# Definition of Done + +## Generic: +* [ ] No test regression on CI +* [ ] Code reviewed by pairs +* [ ] Code cleaned, no "debug" traces or "TODO" comment kept. +* [ ] New code documented + +## Specific: diff --git a/.gitlab/issue_templates/release.md b/.gitlab/issue_templates/release.md index 6baa4a87dd..9ade3a4e1d 100644 --- a/.gitlab/issue_templates/release.md +++ b/.gitlab/issue_templates/release.md @@ -15,13 +15,12 @@ We are ready to release OTB version MAJOR.MINOR.PATCH. The following steps need * [ ] Check [SonarQube](https://sonar.orfeo-toolbox.org/dashboard?id=orfeotoolbox-otb) * [ ] Run Debian [spelling](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#spelling-check) checker * [ ] Run shellcheck script from [OTB-Devutils/Scripts/](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-devutils/blob/master/Scripts/run_shellcheck.sh) -* [ ] [Update translation](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#translation-for-monteverdi-mapla) for Monteverdi and Mapla * [ ] [Sanity check the binary packages](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#standalone-packages-sanity-check) * [ ] Windows * [ ] Linux * [ ] QGIS plugin -### 3. Actual release +### 3. Actual release candidate Once all blocking issues are closed, and the previous steps are done: * [ ] [Tag the release candidate](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#release-tag) @@ -35,6 +34,7 @@ Once all blocking issues are closed, and the previous steps are done: * [ ] Doxygen * [ ] [Update the SuperBuild archive](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#superbuild-archive) * [ ] Release Candidate announcement on the forum +* [ ] Add the new release to TRex https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Help-for-release-actions#update-otb-on-trex-cluster ## Release @@ -50,7 +50,6 @@ Once all blocking issues are closed, and the previous steps are done: * [ ] Check [SonarQube](https://sonar.orfeo-toolbox.org/dashboard?id=orfeotoolbox-otb) * [ ] Run Debian [spelling](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#spelling-check) checker * [ ] Run shellcheck script from [OTB-Devutils/Scripts/](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-devutils/blob/master/Scripts/run_shellcheck.sh) -* [ ] [Update translation](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#translation-for-monteverdi-mapla) for Monteverdi and Mapla * [ ] [Sanity check the binary packages](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#standalone-packages-sanity-check) * [ ] Windows * [ ] Linux @@ -71,7 +70,7 @@ Once all blocking issues are closed, and the previous steps are done: * [ ] [Update documentation](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#update-documentation) * [ ] Cookbook * [ ] Doxygen - * [ ] WordPress page "Home" and "Download" pages + * [ ] WordPress page ["Home"](https://www.orfeo-toolbox.org/) and ["Download"](https://www.orfeo-toolbox.org/download/) pages * [ ] Add the release to "Releases" page of the project * [ ] [Update the SuperBuild archive](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#superbuild-archive) * [ ] Upload OTB source archive to [Zenodo](https://zenodo.org/) to create a unique Digital Object Identifier (DOI) @@ -81,5 +80,6 @@ Once all blocking issues are closed, and the previous steps are done: * [ ] Update the Wikipedia page with the version number and release date (https://en.wikipedia.org/wiki/Orfeo_toolbox) * [ ] Forward announcement to news_item@osgeo.org ([OSGeo news](https://www.osgeo.org/foundation-news/)) * [ ] Remove public branches related to MR or bugfix merged before the release +* [ ] Add the new release to TRex https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Help-for-release-actions#update-otb-on-trex-cluster /label ~story -- GitLab From 7db303adc2d26da022d754466eb79c593d5821d2 Mon Sep 17 00:00:00 2001 From: Tristan Laurent <tristan.laurent@cs-soprasteria.com> Date: Wed, 26 Mar 2025 15:45:08 +0100 Subject: [PATCH 2/2] CI: use py312 for rhel jobs, give version number for release-docker job Correct hardcoded python path to copy data on redhat. --- .gitlab-ci.yml | 12 ++++-- ...definition_of_ready_definition_of_done.md} | 2 +- CMakeLists.txt | 43 +++++++++++-------- Packaging/Files/post_install.sh.in | 2 +- 4 files changed, 35 insertions(+), 24 deletions(-) rename .gitlab/issue_templates/{definition_of_done_definition_of_ready.md => definition_of_ready_definition_of_done.md} (77%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4070bc159b..b119d0fa4c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -211,13 +211,13 @@ python3.12-gdal-bindings: ## RedHat superbuild redhat-prepare: extends: .common-prepare - image: $BUILD_IMAGE_REGISTRY/otb-redhat-superbuild-base:8 + image: $BUILD_IMAGE_REGISTRY/otb-redhat-superbuild-base-py312:8 script: - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=redhat-8-gcc -DOTB_FULL_BUILD:BOOL=ON redhat-build: extends: .common-build - image: $BUILD_IMAGE_REGISTRY/otb-redhat-superbuild-base:8 + image: $BUILD_IMAGE_REGISTRY/otb-redhat-superbuild-base-py312:8 script: - ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=redhat-8-gcc - ctest -V -S CI/superbuild_packaging.cmake -DIMAGE_NAME:string=redhat-8-gcc -DPACKAGE_BY_MODULE:BOOL=ON @@ -436,8 +436,14 @@ release-docker: # /kaniko/.docker/config.json - mkdir -p /kaniko/.docker || true - echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"$(printf "%s:%s" "${DOCKER_HUB_USER}" "${DOCKER_HUB_PWD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json + # get the package version from archive name + - | + PACKAGE_OTB_VERSION=$(ls -1 OTB-*.tar.gz | + head -n 1 | + egrep -o "([0-9]+\.){2}[0-9]+") - /kaniko/executor --cleanup --verbosity warn --context $CI_PROJECT_DIR + --build-arg "OTB_RELEASE=$PACKAGE_OTB_VERSION" --dockerfile $CI_PROJECT_DIR/Docker/Dockerfile_CI - --destination orfeotoolbox/otb:$CI_COMMIT_TAG + --destination orfeotoolbox/otb:$CI_COMMIT_TAG diff --git a/.gitlab/issue_templates/definition_of_done_definition_of_ready.md b/.gitlab/issue_templates/definition_of_ready_definition_of_done.md similarity index 77% rename from .gitlab/issue_templates/definition_of_done_definition_of_ready.md rename to .gitlab/issue_templates/definition_of_ready_definition_of_done.md index 6668acd322..c7339f7066 100644 --- a/.gitlab/issue_templates/definition_of_done_definition_of_ready.md +++ b/.gitlab/issue_templates/definition_of_ready_definition_of_done.md @@ -5,7 +5,7 @@ ## Generic: -* [ ] If this issue is consequent, it is splitted in subtask with priority and complexity evaluated. Theses subtasks should be linked to this issue. +* [ ] If this issue is consequent, it is splitted in subtasks with priority and complexity evaluated. Theses subtasks should be linked to this issue. (To do on gitlab interface after writting this issue) * [ ] Issue complexity evaluated * [ ] Priority of issue evaluated * [ ] If there is specific test data needed, it should be detailled and available diff --git a/CMakeLists.txt b/CMakeLists.txt index 98c6cfed6c..dbdc6cf694 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,6 +358,28 @@ install(FILES ${OTB_BINARY_DIR}/CMakeFiles/OTBConfig.cmake DESTINATION ${OTB_INSTALL_PACKAGE_DIR} COMPONENT Core) +set(__PYTHON_VERSION_MAJOR "3") +set(__PYTHON_VERSION_MINOR "10") + +if (UNIX) + # output of python3 --version is "Python XX.XX.XX", notice the space that + # is used in regex + execute_process( + COMMAND python3 --version + RESULT_VARIABLE CMD_RES + OUTPUT_VARIABLE __PYTHON_VERSION_DURING_BUILD + ) + # Get the first two digit and concatenate them + string(REGEX MATCH " ([0-9]+)\.([0-9]+)" TMP_VAR "${__PYTHON_VERSION_DURING_BUILD}") + + if (${CMAKE_MATCH_COUNT} EQUAL 2) + # CMAKE_MATCH_0 is the entire match + # See https://cmake.org/cmake/help/latest/variable/CMAKE_MATCH_n.html + set(__PYTHON_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(__PYTHON_VERSION_MINOR "${CMAKE_MATCH_2}") + endif() +endif() + if(XDK_INSTALL_PATH) # In order to package the external libraries built by the SuperBuild, we have to "unpack" this xdk in the current build directory and tell # Cmake it is here @@ -368,7 +390,7 @@ if(XDK_INSTALL_PATH) COMPONENT Dependencies) # Redhat8 case : the bindings are installed by default in lib64/python3.8 if( EXISTS ${XDK_INSTALL_PATH}/lib64) - install(DIRECTORY ${XDK_INSTALL_PATH}/lib64/python3.8 + install(DIRECTORY "${XDK_INSTALL_PATH}/lib64/python${__PYTHON_VERSION_MAJOR}.${__PYTHON_VERSION_MINOR}" DESTINATION ./lib USE_SOURCE_PERMISSIONS COMPONENT Dependencies) @@ -436,25 +458,8 @@ if(UNIX) DESTINATION . COMPONENT Core ) - # output of python3 --version is "Python XX.XX.XX", notice the space that - # is used - execute_process( - COMMAND python3 --version - RESULT_VARIABLE CMD_RES - OUTPUT_VARIABLE PYTHON_VERSION_DURING_BUILD - ) - # Get the first two digit and concatenate them - string(REGEX MATCH " ([0-9]+)\.([0-9]+)" TMP_VAR "${PYTHON_VERSION_DURING_BUILD}") - if (${CMAKE_MATCH_COUNT} EQUAL 2) - # CMAKE_MATCH_0 is the entire match - # See https://cmake.org/cmake/help/latest/variable/CMAKE_MATCH_n.html - set(PYTHON_VERSION_DURING_BUILD "${CMAKE_MATCH_1}${CMAKE_MATCH_2}") - else() - # set default version - set(PYTHON_VERSION_DURING_BUILD "310") - endif() - + # the file need __PYTHON_VERSION_MAJOR and __PYTHON_VERSION_MINOR vars configure_file(${OTB_SOURCE_DIR}/Packaging/Files/post_install.sh.in ${CMAKE_BINARY_DIR}/post_install.sh @ONLY) install( PROGRAMS diff --git a/Packaging/Files/post_install.sh.in b/Packaging/Files/post_install.sh.in index 7e935214d0..20172e5d55 100644 --- a/Packaging/Files/post_install.sh.in +++ b/Packaging/Files/post_install.sh.in @@ -39,7 +39,7 @@ if [ "$ostype" != "RedHatEnterprise" ] ; then concatpyversion="$(python3 -V 2>&1 | sed 's/.* \([0-9]\).\([0-9]*\).*/\1\2/')" # Compare the concat version with the version used to build this OTB package # The python build version is filled by cmake - if [ "$concatpyversion" -ne "@PYTHON_VERSION_DURING_BUILD@" ]; then + if [ "$concatpyversion" -ne "@__PYTHON_VERSION_MAJOR@@__PYTHON_VERSION_MINOR@" ]; then sh "$OTB_INSTALL_DIR"/recompile_bindings.sh fi # Check python version, if python 3.12 (ubuntu 24 and debian > 12) download -- GitLab