Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • orfeotoolbox/otb
  • gpasero/otb
  • jinglada/otb
  • cs-si/otb
  • tardyb/otb
  • jmichel/otb
  • pedrojoclar/otb
  • derksend/otb
  • ussegliog/otb
  • SebastienPeillet/otb
  • waynedou/otb
  • lhermitte/otb
  • ArthurV/otb
  • sebastic/otb
  • gpernot/otb
  • super7ramp/otb
  • camiot/otb
  • ctraizet/otb
  • dyoussef/otb
  • bradh/otb
  • troopa81/otb
  • sdinot/otb
  • julienosman/otb
  • vidlb/otb
  • Feishi/otb
  • IlDordollano/otb
  • pty_/otb
27 results
Show changes
Commits on Source (15544)
Showing
with 1443 additions and 42 deletions
---
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BreakBeforeBraces: Allman
ColumnLimit: 160
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
IndentWidth: 2
Language: Cpp
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
PointerAlignment: Left
SortIncludes: false
Standard: Cpp11
TabWidth: 2
UseTab: Never
...
# http://EditorConfig.org
# top-most EditorConfig file
root = true
# Apply to all code files
[*]
# A newline ending every file
insert_final_newline = true
# Set default charset
charset = utf-8
# 4 space indentation
indent_style = space
indent_size = 2
# Various options
trim_trailing_whitespace = true
Data/**/*.[0-9][0-9][0-9] filter=lfs diff=lfs merge=lfs -text
Data/**/*.BIL filter=lfs diff=lfs merge=lfs -text
Data/**/*.bsq filter=lfs diff=lfs merge=lfs -text
Data/**/*.c[0-9] filter=lfs diff=lfs merge=lfs -text
Data/**/*.c[0-9][0-9] filter=lfs diff=lfs merge=lfs -text
Data/**/*.ci4 filter=lfs diff=lfs merge=lfs -text
Data/**/*.cr4 filter=lfs diff=lfs merge=lfs -text
Data/**/*.dat filter=lfs diff=lfs merge=lfs -text
Data/**/*.dbf filter=lfs diff=lfs merge=lfs -text
Data/**/*.grd filter=lfs diff=lfs merge=lfs -text
Data/**/*.hdf filter=lfs diff=lfs merge=lfs -text
Data/**/*.he5 filter=lfs diff=lfs merge=lfs -text
Data/**/*.hgt filter=lfs diff=lfs merge=lfs -text
Data/**/*.id filter=lfs diff=lfs merge=lfs -text
Data/**/*.idx filter=lfs diff=lfs merge=lfs -text
Data/**/*.ima filter=lfs diff=lfs merge=lfs -text
Data/**/*.img filter=lfs diff=lfs merge=lfs -text
Data/**/*.index filter=lfs diff=lfs merge=lfs -text
Data/**/*.j2k filter=lfs diff=lfs merge=lfs -text
Data/**/*.jp2 filter=lfs diff=lfs merge=lfs -text
Data/**/*.jpeg filter=lfs diff=lfs merge=lfs -text
Data/**/*.jpg filter=lfs diff=lfs merge=lfs -text
Data/**/*.kmz filter=lfs diff=lfs merge=lfs -text
Data/**/*.las filter=lfs diff=lfs merge=lfs -text
Data/**/*.lum filter=lfs diff=lfs merge=lfs -text
Data/**/*.map filter=lfs diff=lfs merge=lfs -text
Data/**/*.mw filter=lfs diff=lfs merge=lfs -text
Data/**/*.pack filter=lfs diff=lfs merge=lfs -text
Data/**/*.pix filter=lfs diff=lfs merge=lfs -text
Data/**/*.png filter=lfs diff=lfs merge=lfs -text
Data/**/*.raw filter=lfs diff=lfs merge=lfs -text
Data/**/*.shp filter=lfs diff=lfs merge=lfs -text
Data/**/*.shx filter=lfs diff=lfs merge=lfs -text
Data/**/*.sqlite filter=lfs diff=lfs merge=lfs -text
# Data/**/*.tar filter=lfs diff=lfs merge=lfs -text
Data/**/*.tif filter=lfs diff=lfs merge=lfs -text
Data/**/*.TIF filter=lfs diff=lfs merge=lfs -text
Data/**/*.tiff filter=lfs diff=lfs merge=lfs -text
Data/**/*.tts filter=lfs diff=lfs merge=lfs -text
......@@ -8,3 +8,11 @@ syntax: glob
tags
*vim*
*.template
archives*
.vscode*
CMakeLists.txt.user
.directory*
build_packages*
build
install
log
#
# Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# WARNING!
# OTB uses Git-LFS to store the (large) tests data.
# Git-LFS is mostly transparent for the user and recent versions
# are able to use Git-LFS quite efficiently.
# But Git fails to manage efficiently numerous LFS data.
# We have to use directly git-lfs wrapping commands to have an
# efficient cloning step.
# Furthermore, Git-LFS and Gitlab sufer a bug preventing usage of
# GIT_STRATEGY=fetch (https://gitlab.com/gitlab-org/gitlab-runner/issues/3318)
variables:
BUILD_IMAGE_REGISTRY: $CI_REGISTRY/orfeotoolbox/otb-build-env
GIT_CLONE_PATH: $CI_BUILDS_DIR/otb
DOCKER_DRIVER: overlay2
GIT_DEPTH: "3"
# Disable automatic checkout to let us fetch LFS before
GIT_CHECKOUT: "false"
# The fetch strategy fails with LFS and GitLab
GIT_STRATEGY: "clone"
PACKAGE_OTB_VERSION: "latest"
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
stages:
- precheck
- prepare
- build
- report
- deploy
- docker
.general:
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
.common:
extends: .general
before_script:
# Provision efficiently the local LFS cache before checkout
- git lfs fetch origin $CI_COMMIT_SHA
- git checkout -f -q $CI_COMMIT_SHA
after_script:
- python3 -u CI/cdash_handler.py
.common-build:
extends: .common
only:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
stage: build
artifacts:
when: always
expire_in: 24 hrs
paths:
- build/*/*.log #CMake log
- log/*.txt # Others
- CookBook-*-html.tar.gz
- CookBook-*.pdf
- OTB-Doxygen-*.tar.bz2
- OTB-*.tar.gz
- OTB-*.zip
- build/compile_commands.json
- build/ctest_report.xml
- build/cppcheck_report.xml
- build/coverage_report.xml
- build/Testing/Temporary/*.txt #DEBUG
- Docker/Dockerfile_CI
- Docker/system-dependencies.txt
.common-prepare:
extends: .general
only:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
stage: prepare
before_script:
- export GIT_LFS_SKIP_SMUDGE=1
- git checkout -f -q $CI_COMMIT_SHA
- export GIT_LFS_SKIP_SMUDGE=0
artifacts:
expire_in: 24 hrs
when: always
paths:
- sb_branch.txt # Needed to checkout correct branch in build step
- build/*/*/*/*.log # Superbuild log
- build/*/*/*/*.cmake
#-------------------------- precheck job ---------------------------------------
fast-build:
extends: .common
only:
- merge_requests
- branches
stage: precheck
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native-itk5:22.04
before_script:
- export GIT_LFS_SKIP_SMUDGE=1
- git checkout -f -q $CI_COMMIT_SHA
# pull data needed by the two convolution test
- |
git lfs pull --include Data/Baseline/OTB/Images/bfTvConvolutionImageFilter.tif
git lfs pull --include Data/Input/QB_Suburb.png
git lfs pull --include Data/Input/QB_PAN_ROI_1000_100.tif
script:
- ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-22.04-fast
- ctest -VV -S CI/FFTW_tests.cmake -DIMAGE_NAME:string=ubuntu-22.04-fast
- ccache -s
legal-check:
extends: .common
only:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
stage: precheck
image: $BUILD_IMAGE_REGISTRY/otb-alpine:3.7
variables:
GIT_DEPTH: ""
allow_failure: true
script:
- ./CI/contributors_check.sh
- ./CI/headers_check.py
after_script: []
#------------------------- prepare & build jobs --------------------------------
## Ubuntu superbuild
ubuntu-22-prepare:
extends: .common-prepare
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:22.04
script:
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=ubuntu-22.04-llvm-full -DOTB_FULL_BUILD:BOOL=ON
ubuntu-24-prepare:
extends: .common-prepare
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:24.04
script:
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=ubuntu-24.04-llvm-full
artifacts:
untracked: false
when: on_success
access: all
expire_in: 24hrs
paths:
- xdk/lib/python3/*
ubuntu-22-build:
extends: .common-build
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:22.04
script:
- ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=ubuntu-22.04-llvm-xdk-full
- mv build/CookBook-*-html.tar.gz . || true
- mv build/Documentation/Cookbook/latex/CookBook-*.pdf . || true
- mv build/Documentation/Doxygen/OTB-Doxygen-*.tar.bz2 . || true
- ctest -V -S CI/superbuild_packaging.cmake -DIMAGE_NAME:string=ubuntu-22.04-llvm-xdk-full -DPACKAGE_BY_MODULE:BOOL=ON
- ctest -V -S CI/superbuild_packaging.cmake -DIMAGE_NAME:string=ubuntu-22.04-llvm-xdk-full -DPACKAGE_BY_MODULE:BOOL=OFF
- mv build_packages/OTB-*.tar.gz . || true
needs:
- job: ubuntu-22-prepare
artifacts: true
# Ubuntu 24 build needed for gdal bindings with python 3.12. We package the compiled bindings for python 3.12, this package will be downloaded and extracted automatically when
# a user lauches the otbenv profile after unpacking the official archive for the first time (which contains bindings for ubuntu 20 and python 3.8 initially)
python3.12-gdal-bindings:
extends: .common-build
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:24.04
only:
refs:
- /^release-[0-9]+\.[0-9]+$/
script:
- |
MAJOR_VERSION=$(egrep "set\(OTB_VERSION_MAJOR" < CMakeLists.txt | egrep -o "[0-9]+")
MINOR_VERSION=$(egrep "set\(OTB_VERSION_MINOR" < CMakeLists.txt | egrep -o "[0-9]+")
PATCH_VERSION=$(egrep "set\(OTB_VERSION_PATCH" < CMakeLists.txt | egrep -o "[0-9]+")
PACKAGE_OTB_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
- find xdk/lib/python3/dist-packages/osgeo/ -type f -name "*.so" -printf "%P\n" | tar -czf OTB-$PACKAGE_OTB_VERSION-GDAL-bindings-py312.tar.gz --no-recursion -C xdk/lib/python3/dist-packages/osgeo -T -
needs:
- job: ubuntu-24-prepare
artifacts: true
## RedHat superbuild
redhat-prepare:
extends: .common-prepare
image: $BUILD_IMAGE_REGISTRY/otb-redhat-superbuild-base: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
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
- ctest -V -S CI/superbuild_packaging.cmake -DIMAGE_NAME:string=redhat-8-gcc -DPACKAGE_BY_MODULE:BOOL=OFF
# change package names to RedHat
- |
# use "find" to select only packages that matters
rh_packages=$(find build_packages -type f -name "OTB*Linux*.tar.gz")
for pkg in $rh_packages
do
new_name=$(sed "s/-Linux/-Linux_RedHat/g" <<< "$pkg")
mv $pkg $new_name
done
- mv build_packages/OTB-*.tar.gz . || true
needs:
- job: redhat-prepare
artifacts: true
## Windows
.windows-prepare:
extends: .common-prepare
before_script:
# This override the previous before_script
- set GIT_LFS_SKIP_SMUDGE=1
- git checkout -f -q $CI_COMMIT_SHA
- set GIT_LFS_SKIP_SMUDGE=0
.windows-build:
extends: .common-build
before_script:
- git lfs fetch origin $CI_COMMIT_SHA
- git checkout -f -q $CI_COMMIT_SHA
# Obviously Windows does not use same executable name as linux...
after_script:
# need to setup path to be able to use python
- .\CI\setup_python.ps1 x64
- python -u CI/cdash_handler.py
# - Win10
windows-10-prepare:
extends: .windows-prepare
tags:
- windows10
script:
- .\CI\dev_env.ps1 x64 xdk 10
- buildcache.exe -s
- ctest -C Release -VV -S CI/prepare_superbuild.cmake -DOTB_FULL_BUILD:BOOL=ON -DPython_ROOT_DIR:STRING="C:/tools/Python310-x64"
- buildcache.exe -s
windows-10-build:
extends: .windows-build
tags:
- windows10
script:
- .\CI\dev_env.ps1 x64 otb 10
- buildcache.exe -s
- ctest -V -S CI/main_superbuild.cmake -DPython_ROOT_DIR:STRING="C:/tools/Python310-x64"
- buildcache.exe -s
- .\CI\copy_boost_dlls.ps1
- ctest -V -S CI/superbuild_packaging.cmake -DPACKAGE_BY_MODULE:BOOL=OFF
- move "build_packages\OTB-*.zip" . || dir build_packages
needs:
- job: windows-10-prepare
artifacts: true
#------------------------- QA related jobs -------------------------------------
ubuntu-qa-code-coverage:
extends: .common-build
only:
refs:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
variables:
- $SONAR_OTB_TOKEN
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-qa:22.04
script:
- ctest -V -S CI/main_qa.cmake
-DIMAGE_NAME:string=ubuntu-22.04-llvm-qa
-DQA:BOOL=ON
- ./CI/otb_coverage.sh
- saxon-xslt -o build/ctest_report.xml
build/Testing/`head -n 1 build/Testing/TAG`/Test.xml
CI/ctest2junit.xsl
needs:
- job: ubuntu-22-prepare
artifacts: true
ubuntu-qa-static-analysis:
extends: .common-build
only:
refs:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
variables:
- $SONAR_OTB_TOKEN
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-qa:22.04
script:
- find Modules -type f -regextype posix-extended -regex '.*\.(h|hxx)$' -exec dirname '{}' \; |
grep -vE '^Modules/ThirdParty/' |
sort -u > header_directories
- cppcheck -j 8 -q --xml --xml-version=2 --enable=all
--language=c++ --std=c++14 --platform=unix64
--includes-file=header_directories
-i Modules/ThirdParty Modules
2> build/cppcheck_report.xml
after_script: []
needs:
- job: ubuntu-22-prepare
artifacts: true
ubuntu-sonar-report:
extends: .common
variables:
GIT_DEPTH: ""
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-qa:22.04
stage: report
only:
refs:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
variables:
- $SONAR_OTB_TOKEN
script:
- sonar-scanner -Dproject.settings=sonar-project.properties
-Dsonar.host.url=https://sonar.orfeo-toolbox.org
-Dsonar.login=$SONAR_OTB_TOKEN
-Dsonar.projectKey=$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME
`test -z "$CI_COMMIT_TAG" || echo "-Dsonar.projectVersion=$CI_COMMIT_TAG"`
-Dsonar.branch.name=$CI_COMMIT_REF_NAME
after_script: []
needs:
- job: ubuntu-qa-code-coverage
artifacts: true
- job: ubuntu-qa-static-analysis
artifacts: true
#---------------------------- Deploy job ---------------------------------------
deploy:
tags:
- deploy
image: $BUILD_IMAGE_REGISTRY/otb-alpine:3.7
stage: deploy
extends: .general
only:
- develop@orfeotoolbox/otb
- /^release-[0-9]+\.[0-9]+$/
before_script:
# Provision efficiently the local LFS cache before checkout
- git lfs fetch origin $CI_COMMIT_SHA
- git checkout -f -q $CI_COMMIT_SHA
script:
- ./CI/deploy.sh $CI_COMMIT_REF_NAME $RC_NUMBER
needs:
- job: ubuntu-22-build
artifacts: true
- job: windows-10-build
artifacts: true
- job: redhat-build
artifacts: true
update-archive:
tags:
- deploy
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:22.04
stage: deploy
extends: .general
only:
- develop
- /^release-[0-9]+\.[0-9]+$/@orfeotoolbox/otb
before_script:
# Provision efficiently the local LFS cache before checkout
- git lfs fetch origin $CI_COMMIT_SHA
- git checkout -f -q $CI_COMMIT_SHA
script:
- ./CI/SuperbuildDownloadList.sh download build_archive
- ./CI/deploy-archive.sh build_archive
needs:
# don't push the archive if Superbuild was not successful
- job: ubuntu-22-prepare
artifacts: false
# release-container:
# image: $BUILD_IMAGE_REGISTRY/otb-alpine:3.7
# stage: deploy
# extends: .general
# only:
# refs:
# - tags@orfeotoolbox/otb
# variables:
# - $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/
# script:
# - curl --request POST
# --form token=$K8S_SECRET_RELEASE
# --form ref=master
# --form variables[OTB_TAG]=$CI_COMMIT_TAG
# https://gitlab.orfeo-toolbox.org/api/v4/projects/126/trigger/pipeline
release-docker:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
stage: docker
only:
refs:
- /^release-[0-9]+\.[0-9]+$/
needs:
- job: ubuntu-22-build
artifacts: true
script:
# to authenticate in docker hub, kaniko needs a config file located at
# /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
- /kaniko/executor --cleanup
--verbosity warn
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Docker/Dockerfile_CI
--destination orfeotoolbox/otb:$CI_COMMIT_TAG
### Description
Describe what happens and why you think it is a bug
### Steps to reproduce
Describe as precisely as possible how to reproduce the bug. Try to isolate a minimal number of steps. Also describe reproducibility (always, random ...).
### Configuration information
OS, OTB version or tag, information related to build (binaries, superbuild, system libs ...)
/label ~bug
### Target documentation resources
Can be a combination of CookBook, doxygen, blog, applications doc, websites
### Change requested
Describe precisely the changes that are required.
/label ~documentation
Short summary of the requested feature
/label ~feature
We are ready to release OTB version MAJOR.MINOR.PATCH. The following steps need to be done:
## Release Candidate
### 1. Branches
* [ ] **(if major or minor release)** Feature freeze: [create the new release branch](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#create-release-branch)
* [ ] **(if patch release)** Work on the already existing branch `release-MAJOR-MINOR`
* [ ] Make sure the version number in `CMakeLists.txt` is MAJOR.MINOR.PATCH
### 2. Housekeeping
* [ ] In this story, make a list of blocking issues for the release (if any)
* [ ] Update release notes (walk the GitLab MR merged history and log all improvements)
* [ ] Update the date in RELEASE_NOTES.txt
* [ ] 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
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)
* [ ] Update GIT_TAG for all official remote modules (if needed)
### 4. Publish and plan next release
* [ ] [Prepare and upload source packages](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#prepare-and-upload-source-packages)
* [ ] [Promote staging packages](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#promote-staging-packages)
* [ ] [Update documentation](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#update-documentation)
* [ ] Cookbook
* [ ] 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
## Release
### 1. Branches
* [ ] Make sure the version number in `CMakeLists.txt` is MAJOR.MINOR.PATCH
### 2. Housekeeping
* [ ] In this story, make a list of blocking issues for the release (if any)
* [ ] Fix compilation warnings on CI
* [ ] Update release notes (walk the GitLab MR merged history and log all improvements)
* [ ] Update the date in RELEASE_NOTES.txt
* [ ] 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
Once all blocking issues are closed, and the previous steps are done:
* [ ] [Tag the release](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#release-tag)
* [ ] **(if major or minor release)**: Merge the release into develop
* [ ] **(if it's the latest release)**: Merge the release into master
* [ ] **(if patch release)**: Backport fixes
* [ ] Update GIT_TAG for all official remote modules (if needed)
### 4. Publish and plan next release
* [ ] [Prepare and upload source packages](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#prepare-and-upload-source-packages)
* [ ] [Promote staging packages](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#promote-staging-packages)
* [ ] [Update documentation](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/wikis/Help-for-release-actions#update-documentation)
* [ ] Cookbook
* [ ] Doxygen
* [ ] WordPress page "Home" and "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)
* [ ] Release announcement
* [ ] On the [forum](https://forum.orfeo-toolbox.org/)
* [ ] On the [blog](https://www.orfeo-toolbox.org/blog/)
* [ ] 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
/label ~story
### What changes will be made and why they would make a better Orfeo ToolBox?
#### High level description
#### Risks and benefits
#### Alternatives for implementations
### Who will be developing the proposed changes?
#### Summary
Gives a short summary of the changes.
#### Rationale
Explain the rationale for the changes (possible link to a Request For Comments or to an issue).
#### Implementation Details
<!---
##### Classes and files
Give an overview of the implementation: main changes made to classes, files and modules. Do not paste complete diff, as it is available in the merge request already.
-->
<!---
##### Applications
Describe any changes made to existing applications, or new applications that have been added.
-->
<!---
##### Tests
Describe the testing strategy for new features.
- [ ] validated through ... unitary test
-->
<!---
##### Documentation
List or link documentation modifications that were made (doxygen, example, Software Guide, application documentation, CookBook).
-->
#### Additional notes
<!--- List remaining open issues if any, and additional notes. -->
#### Copyright
The copyright owner is *COPYRIGHT OWNER (OR OWNER'S AGENT)* and has signed the ORFEO ToolBox Contributor License Agreement.
<hr>
***Check before merging:***
- All discussions are resolved
- At least 2 :thumbsup: votes from core developers, no :thumbsdown: vote.
- The feature branch is (reasonably) up-to-date with the base branch
- Dashboard is green
- Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
- Optionally, run `git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i` on latest changes and commit
syntax: glob
*~
.*.swp
*.orig
*.pyc
.\#*
\#*\#
tags
*vim*
*.template
68eebc1b170a636794feda66523e6c0135ebfef2 0 iEYEABECAAYFAkmvX3cACgkQwRJnCg+r8KFSCgCfVYSnx2ev+hIlpbM/arxzLVf3KvsAn3nqaJXaj62RcNUIjv+qcNWlJ5WG
e0fdaae06d33190d9b17356c5d51f878fd8fa0b6 0 iEYEABECAAYFAkoNOJEACgkQwRJnCg+r8KHMrACeJMcezNBgXjfx57UNdd/WfXw8kf8An1VEqFVTeG/wUd6QiiVy2icgfLGl
c07af3906a803b43018e1a7e15db5c11f54d14b4 0 iEYEABECAAYFAkw68W0ACgkQwRJnCg+r8KGhjgCfR4LL9xW8xYGFXWEpbxSSRsCFVhIAn2nPMTqZvUW0cQvU6pkJD1+eENNj
Alexia Mondot <alexia.mondot@c-s.fr>
Amit Kulkarni <amitkulz@gmail.com>
Angelos Tzotsos <tzotsos@gmail.com>
Antoine Regimbeau <antoine.regimbeau@c-s.fr>
Antoine Regimbeau <antoine.regimbeau@c-s.fr> aregimbe <antoine.regimbeau@c-s.fr>
Antoine Regimbeau <antoine.regimbeau@c-s.fr> aregimbeau <antoine.regimbeau@c-s.fr>
Arnaud Jaen <arnaud.jaen@c-s.fr>
Arthur Vincent <arthur.vincent@c-s.fr>
Arthur Vincent <arthur.vincent@c-s.fr> Arthur Vincent <vincenta@cesbio.cnes.fr>
Aurelien Bricier <aurelien.bricier@c-s.fr>
Aurélie Emilien <aurelie.emilien@c-s.fr>
Aurélie Emilien <aurelie.emilien@c-s.fr> Aurelie Emilien <aurelie.emilien@c-s.fr>
Bas Couwenberg <sebastic@debian.org>
Bas Couwenberg <sebastic@debian.org> Bas Couwenberg <sebastic@xs4all.nl>
Brad Hards <bradh@frogmouth.net>
Carole Amiot <carole.amiot@cnes.fr>
Carole Amiot <carole.amiot@cnes.fr> Carole Amiot <carole.amiot@thales-services.fr>
Caroline Ruffel <caroline.ruffel@c-s.fr>
Charles Peyrega <charles.peyrega@c-s.fr>
Chia Aik Song <crscas@nus.edu.sg>
Christophe Palmann <christophe.palmann@c-s.fr>
Conrad Bielski <conrad.bielski@yahoo.com>
Cyrille Valladeau <cyrille.valladeau@c-s.fr>
Cédric Traizet <cedric.traizet@c-s.fr> Cedric <cedric.traizet@c-s.fr>
Cédric Traizet <cedric.traizet@c-s.fr> Cédric Traizet <cedric.traizet@csgroup.eu>
Cédric Traizet <cedric.traizet@c-s.fr> Cédric Traizet <traizetc@cesbio.cnes.fr>
Cédric Traizet <cedric.traizet@c-s.fr> Traizet Cedric <cedric.traizet@cesbio.cnes.fr>
Cédric Traizet <cedric.traizet@c-s.fr> ctraizet <cedric.traizet@c-s.fr>
Daniel McInerney <daniel.o.mcinerney@gmail.com>
Daniel McInerney <daniel.o.mcinerney@gmail.com> dmci <daniel.o.mcinerney@gmail.com>
Daphne Deleflie <daphne.deleflie@thalesgroup.com>
David Youssefi <david.youssefi@cnes.fr>
Emmanuel Christophe <emmanuel.christophe@gmail.com>
Emmanuel Christophe <emmanuel.christophe@gmail.com> Emmanuel Christophe <emmanuel.christophe@nus.edu.sg>
Emmanuel Christophe <emmanuel.christophe@gmail.com> Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org>
Emmanuelle Sarrazin <emmanuelle.sarrazin@cnes.fr>
Emmanuelle Sarrazin <emmanuelle.sarrazin@cnes.fr> esarrazin <emmanuelle.sarrazin@cnes.fr>
Emmanuelle Sarrazin <emmanuelle.sarrazin@cnes.fr> sarrazin <emmanuelle.sarrazin@cnes.fr>
Etienne Bougoin <etienne.bougoin@c-s.fr>
Gaëlle Usseglio <gaelle.usseglio@cnes.fr> Gaëlle USSEGLIO <gaelle.usseglio@cnes.fr>
Grégoire Mercier <gregoire.mercier@telecom-bretagne.eu> Gregoire Mercier <gregoire.mercier@telecom-bretagne.eu>
Guilhem Bonnefille <guilhem.bonnefille@c-s.fr>
Guillaume Borrut <guillaume.borrut@c-s.fr>
Guillaume Pasero <guillaume.pasero@c-s.fr>
Guillaume Pernot <guillaume.pernot@c-s.fr>
Guillaume Pernot <guillaume.pernot@c-s.fr> gpernot <guillaume.pernot@c-s.fr>
janestar <janestar92@163.com>
Jee Roen <jeroen.staab@posteo.de>
Jonathan Guinet <jonathan.guinet@c-s.fr>
Jordi Inglada <jordi.inglada@cesbio.eu>
Jordi Inglada <jordi.inglada@cesbio.eu> Jordi Inglada <jordi.inglada@cesbio.cnes.fr>
Jordi Inglada <jordi.inglada@cesbio.eu> Jordi Inglada <jordi.inglada@orfeo-toolbox.org>
Julie Brossard <julie.brossard@c-s.fr>
Julien Malik <julien.malik@c-s.fr>
Julien Malik <julien.malik@c-s.fr> Julien Malik <julien.malik@gmail.com>
Julien Malik <julien.malik@c-s.fr> Julien Malik <julien.malik@orfeo-toolbox.org>
Julien Michel <julien.michel@cnes.fr>
Julien Michel <julien.michel@cnes.fr> Julien Michel <julien.michel@c-s.fr>
Julien Michel <julien.michel@cnes.fr> Julien Michel <julien.michel@orfeo-toolbox.org>
Julien Osman <julien.osman@csgroup.eu> Julien Osman <julien.osman@c-s.fr>
Laurențiu Nicola <lnicola@dend.ro> Laurentiu Nicola <lnicola@dend.ro>
Laurențiu Nicola <lnicola@dend.ro> Laurențiu Nicola <grayshade@gmail.com>
Luc Hermitte <luc.hermitte@csgroup.eu> Luc Hermitte <luc.hermitte@cnes.fr>
Luc Hermitte <luc.hermitte@csgroup.eu> Luc Hermitte <luc.hermitte@c-s.fr>
Luc Hermitte <luc.hermitte@csgroup.eu> Luc Hermitte <9-lhermitte@users.noreply.gitlab.orfeo-toolbox.org>
Ludovic Hussonnois <ludovic.hussonnois@c-s.fr>
Manuel Grizonnet <manuel.grizonnet@cnes.fr>
Manuel Grizonnet <manuel.grizonnet@cnes.fr> Grizonnet Manuel <manuel.grizonnet@cnes.fr>
Manuel Grizonnet <manuel.grizonnet@cnes.fr> Manuel Grizonnet <manuel.grizonnet@gmail.com>
Manuel Grizonnet <manuel.grizonnet@cnes.fr> Manuel Grizonnet <manuel.grizonnet@orfeo-toolbox.org>
Marina Bertolino <marina.bertolino@c-s.fr>
Mathieu Deltorre <mathieu.deltorre@c-s.fr>
Mickaël Savinaud <mickael.savinaud@c-s.fr>
Mickaël Savinaud <mickael.savinaud@c-s.fr> Mickael Savinaud <mickael.savinaud@c-s.fr>
Mickaël Savinaud <mickael.savinaud@c-s.fr> msavinaud <mickael.savinaud@c-s.fr>
OTB Bot <otbbot@orfeo-toolbox.org>
Otmane Lahlou <otmane.lahlou@c-s.fr>
Patrick Imbo <patrick.imbo@c-s.fr>
Rashad Kanavath <rashad.kanavath@c-s.fr>
Rashad Kanavath <rashad.kanavath@c-s.fr> Rashad Kanavath <mohammed.rashad-km@cnes.fr>
Rashad Kanavath <rashad.kanavath@c-s.fr> Rashad Kanavath <mohammedrashadkm@gmail.com>
Rashad Kanavath <rashad.kanavath@c-s.fr> Rashad Kanavath <rashad.kanavath.email.com>
Rashad Kanavath <rashad.kanavath@c-s.fr> Rashad Kanavath <rashad.kanvath@c-s.fr>
Rashad Kanavath <rashad.kanavath@c-s.fr> Rashad M <rashad.kanavath@c-s.fr>
Romain Garrigues <romain.garrigues@c-s.fr>
Rosa Ruiloba <rosario.ruiloba@c-s.fr>
Rémi Cresson <remi.cresson@irstea.fr> Remi Cresson <remi.cresson@irstea.fr>
Rémi Cresson <remi.cresson@irstea.fr> Rémi <remi.cresson@teledetection.fr>
Rémi Cresson <remi.cresson@irstea.fr> remi <remi.cresson@irstea.fr>
Rémi Cresson <remi.cresson@irstea.fr> remi cresson <remi.cresson@teledetection.fr>
Rémi Cresson <remi.cresson@irstea.fr> remicres <remi.cresson@teledetection.fr>
Rémi Cresson <remi.cresson@irstea.fr> remi cresson <remi.cresson@inrae.fr>
Rémi Cresson <remi.cresson@irstea.fr> Rémi <remi.cresson@inrae.fr>
Sebastien Harasse <sebastien.harasse@c-s.fr>
Stephane Albert <stephane.albert@c-s.fr>
Stephane Albert <stephane.albert@c-s.fr> Stephane ALBERT <stephane.albert@c-s.fr>
Stephane Albert <stephane.albert@c-s.fr> Stephane Albert <salbert@dora.si.c-s.fr>
Sylvain Poulain <kikislater@users.noreply.github.com> Sylvain POULAIN <kikislater@users.noreply.github.com>
Sébastien Dinot <sebastien.dinot@c-s.fr>
Sébastien Dinot <sebastien.dinot@c-s.fr> Achille Talon <atalon@dinot.net>
Sébastien Dinot <sebastien.dinot@c-s.fr> Sebastien Dinot <sebastien.dinot@c-s.fr>
Thomas Feuvrier <thomas.feuvrier@c-s.fr>
Tishampati Dhar <devnull@localhost>
Victor Poughon <victor.poughon@cnes.fr>
Vincent Poulain <vincent.poulain@thalesgroup.com>
Yannick Tanguy <yannick.tanguy@cnes.fr> Yannick TANGUY <tanguyy@visu01.sis.cnes.fr>
Yannick Tanguy <yannick.tanguy@cnes.fr> Yannick TANGUY <yannick.tanguy@cnes.fr>
Yannick Tanguy <yannick.tanguy@cnes.fr> ytanguy <yannick.tanguy@cnes.fr>
Yin Tiangang <crsyt@nus.edu.sg>
Thibaut ROMAIN <thibaut.romain@csgroup.eu>
Tristan Laurent <tristan.laurent@csgroup.eu>
language: cpp
sudo: false
compiler:
- clang
addons:
apt:
packages:
- libqt4-dev
- libqtcore4
- libqtgui4
before_script:
- export SOURCE_DIR=$PWD
- cd /tmp
- wget https://cmake.org/files/v3.4/cmake-3.4.0-rc3-Linux-x86_64.tar.gz --no-check-certificate
- tar -xzf cmake-3.4.0-rc3-Linux-x86_64.tar.gz
- wget https://github.com/martine/ninja/releases/download/v1.6.0/ninja-linux.zip --no-check-certificate
- unzip ninja-linux.zip
- wget https://www.orfeo-toolbox.org/packages/xdk/OTB-xdk-Linux64.run --no-check-certificate
- chmod +x /tmp/OTB-xdk-Linux64.run
- /tmp/OTB-xdk-Linux64.run
- cd $SOURCE_DIR/../
- mkdir build
- cd build
script: /tmp/cmake-3.4.0-rc3-Linux-x86_64/bin/cmake -DCMAKE_MAKE_PROGRAM=/tmp/ninja -DCMAKE_CXX_FLAGS="-Wno-gnu -Wno-unused-parameter -Wno-overloaded-virtual -Wno-\\#warnings" -DCMAKE_PREFIX_PATH=/tmp/OTB-xdk-Linux64 -DCMAKE_INSTALL_PREFIX=../install -G "Ninja" $SOURCE_DIR && /tmp/ninja
\ No newline at end of file
#
# Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
get_filename_component(OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
set (ENV{LANG} "C") # Only ascii output
# Build Configuration : Release, Debug..
if(ci_build_type)
set (CTEST_BUILD_CONFIGURATION ${ci_build_type})
else()
set (CTEST_BUILD_CONFIGURATION "Release")
endif()
set (CTEST_CMAKE_GENERATOR "Ninja")
# detect short sha
if(NOT DEFINED ENV{CI_COMMIT_SHORT_SHA})
execute_process(COMMAND git log -1 --pretty=format:%h
WORKING_DIRECTORY ${OTB_SOURCE_DIR}
OUTPUT_VARIABLE ci_short_sha)
else()
set(ci_short_sha "$ENV{CI_COMMIT_SHORT_SHA}")
endif()
# Find the build name and CI profile. Customize it with FFTW
set_dash_build_name()
set (CTEST_BUILD_NAME "FFTW Tests ${ci_ref_name} P-${ci_pipeline_id}")
# Detect site
if(NOT DEFINED IMAGE_NAME)
if(DEFINED ENV{IMAGE_NAME})
set(IMAGE_NAME $ENV{IMAGE_NAME})
endif()
endif()
set (CTEST_SITE "${IMAGE_NAME}")
# Directory variable
set (CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}")
if(BUILD_DIR)
set (CTEST_BINARY_DIRECTORY "${BUILD_DIR}")
else()
set (CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build/")
endif()
set (CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install/")
set (PROJECT_SOURCE_DIR "${OTB_SOURCE_DIR}")
# Ctest command value
set (CMAKE_COMMAND "cmake")
message(STATUS "CI profile : ${ci_profile}")
# Sources are already checked out : do nothing for update
set(CTEST_GIT_UPDATE_CUSTOM "${CMAKE_COMMAND}" "-E" "echo" "No update")
# Look for a GIT command-line client.
find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
ctest_start (Experimental TRACK CI_Build)
ctest_update()
# Run only onverlapSave tests
ctest_test(PARALLEL_LEVEL 8
RETURN_VALUE _test_rv
CAPTURE_CMAKE_ERROR _test_error
INCLUDE "OverlapSave"
)
# Test log
file ( WRITE
"${OTB_SOURCE_DIR}/log/test_return_value_log.txt" "${_test_rv}")
file ( WRITE
"${OTB_SOURCE_DIR}/log/test_cmake_error_log.txt" "${_test_error}")
if ( NOT _test_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_test.")
endif()
ctest_submit()
#requires -version 5.0
# File takes from https://github.com/Wintellect/WintellectPowerShell/blob/master/Code/Invoke-CmdScript.ps1
# it invoke a CMD script and transfer env variables from cmd to pwsh
# Currently used to setup M$ compilation toolset as M$ does not provide
# powershell script...
###############################################################################
# WintellectPowerShell Module
# Copyright (c) 2010-2017 - John Robbins/Wintellect
#
# Do whatever you want with this module, but please do give credit.
###############################################################################
# Always make sure all variables are defined and all best practices are
# followed.
Set-StrictMode -version Latest
function Invoke-CmdScript
{
<#
.SYNOPSIS
Executes the specified command script and imports the environment into current
PowerShell instance.
.DESCRIPTION
Running development tools at the command line in PowerShell can be a hassle since
they rely on environment variables and those are set through batch files. This
cmdlet runs those batch files and imports any set environment variables into
the running PowerShell instance.
.PARAMETER script
The required batch file to run.
.PARAMETER parameters
The optional parameters to pass to the batch file.
.NOTES
The original script is by Lee Holmes. I updated the script to make removing environment variables
work.
.LINK
http://www.leeholmes.com/blog/2006/05/11/nothing-solves-everything-%e2%80%93-powershell-and-other-technologies/
https://github.com/Wintellect/WintellectPowerShell
#>
param
(
[Parameter(Mandatory=$true,
Position=0,
HelpMessage="Please specify the command script to execute.")]
[string] $script,
[Parameter(Position=1)]
[string] $parameters=""
)
# Save off the current environment variables in case there's an issue
$oldVars = $(Get-ChildItem -Path env:\)
$tempFile = [IO.Path]::GetTempFileName()
try
{
## Store the output of cmd.exe. We also ask cmd.exe to output
## the environment table after the batch file completes
cmd /c " `"$script`" $parameters && set > `"$tempFile`" "
if ($LASTEXITCODE -ne 0)
{
throw "Error executing CMD.EXE: $LASTEXITCODE"
}
# Before we delete the environment variables get the output into a string
# array.
$vars = Get-Content -Path $tempFile
# Clear out all current environment variables in PowerShell.
Get-ChildItem -Path env:\ | Foreach-Object {
set-item -force -path "ENV:\$($_.Name)" -value ""
}
## Go through the environment variables in the temp file.
## For each of them, set the variable in our local environment.
$vars | Foreach-Object {
if($_ -match "^(.*?)=(.*)$")
{
Set-Content -Path "env:\$($matches[1])" -Value $matches[2]
}
}
}
catch
{
"ERROR: $_"
# Any problems, restore the old environment variables.
$oldVars | ForEach-Object { Set-Item -Force -Path "ENV:\$($_.Name)" -value $_.Value }
}
finally
{
Remove-Item -Path $tempFile -Force -ErrorAction SilentlyContinue
}
}
# CI
This folder contains files for the continuous integration.
## Docker files
The docker files are:
* Dockerfile.nat: native environment to test OTB. Shark is not on this one as the version OTB is using is not packaged (since 6.7)
* Dockerfile.shark.1.3.4: native environment and Shark version 3.1.4.
## CMake files
The docker files are:
* main_ci.cmake: main script that will launch configure, build and soon test. It aims at configuring Ctest before running the different jobs (site name, build command...)
* configure_option.cmake: script that gathers all options needed by OTB.
## Yaml file
The last file needed for the CI is the *.gitlab-ci.yml* it aims at interfacing with GitLab. Here is the basic structure:
```
Job-name:
stage: job-type
image: docker_image_that_will_be_used
script:
- script that will be launch inside the docker
```
# CDash interaction
Results of build can be seen in CDash on the track "Experimental". The site is the image docker that run the build, and the build name should be the branch name that is tested.
\ No newline at end of file
#!/usr/bin/env bash
#
# Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
if [ $# -lt 2 ]; then
echo "Usage: $0 <download_directory> <archive_output_directory>"
exit 1
fi
export LC_ALL=C
DOWNLOAD_DIR=$(readlink -f "$1")
OUTPUT_DIR=$(readlink -f "$2")
WGET=$(which wget)
CUR_DIR="$( cd "$( dirname "$0" )" && pwd )"
SB_CMAKE_DIR_REL=$CUR_DIR/../SuperBuild/CMake
SB_CMAKE_DIR=$(readlink -f "${SB_CMAKE_DIR_REL}")
cd "$CUR_DIR/../" || echo "cannot cd to CUR_DIR/../"
GIT_BRANCH=$(git name-rev --name-only "${GIT_HASH}")
# the version is the branch name for develop and release-X.Y branches and the commit short hash for other branches
if [[ ${CI_COMMIT_REF_NAME} =~ develop|release-+[0-9]+\.[0-9] ]] ; then
VERSION=${CI_COMMIT_REF_NAME}
else
GIT_HASH=$(git rev-parse --short HEAD)
VERSION=${GIT_HASH}
fi
CMAKE_FILES=$(find "${SB_CMAKE_DIR}" -maxdepth 1 -type f -name "External_*")
DOWNLOAD_NAMES=
mkdir -p "${DOWNLOAD_DIR}"
cd "${DOWNLOAD_DIR}" || echo "cannot cd to DOWNLOAD_DIR"
echo "Downloading files to ${DOWNLOAD_DIR}/"
for cmake in ${CMAKE_FILES}; do
download_links=$(grep -h -E '^[^#]*\"(ftp|http|https)://.*(\.tar\.gz|\.tar\.bz2|\.tgz|\.tar\.xz|\.zip|export=download).*\"' "${cmake}" |
grep -o -E '(ftp|http|https)://[^\"]*' | sort | uniq)
for url in ${download_links}; do
file_name=$(echo "${url}" | grep -o -E '[^\/]+$')
if [ -z "$file_name" ]; then
echo "invalid filename for url=${url}" && exit 1;
fi
download_name=$(grep -E -A 3 -B 3 "(ftp|http|https).+$file_name" "${cmake}" | grep -E -o 'DOWNLOAD_NAME .+' | cut -d ' ' -f 2-)
$WGET -N "${url}"
ret="$?"
if [ $ret -gt 0 ] && [ $ret -ne 8 ]; then
echo "Download failed for URL: '${url}'. wget finished with exit status '$ret'."
exit 1;
fi
if [ -n "$download_name" ]; then
mv "${file_name}" "${download_name}"
file_name=$download_name
fi
DOWNLOAD_NAMES="${DOWNLOAD_NAMES} ${file_name}"
done
done
ARCHIVE_NAME="SuperBuild-archives-$VERSION"
echo "Creating archive ${OUTPUT_DIR}/$ARCHIVE_NAME.tar.bz2"
mkdir -p "${OUTPUT_DIR}"
cd "${OUTPUT_DIR}" || echo "cannot cd to ${OUTPUT_DIR}"
touch "${DOWNLOAD_DIR}/OTBSuperBuild.readme"
tar -cjf "$ARCHIVE_NAME.tar.bz2" -C "${DOWNLOAD_DIR}" .
echo "Saving md5sum to ${OUTPUT_DIR}/$ARCHIVE_NAME.md5"
md5sum "$ARCHIVE_NAME.tar.bz2" > "$ARCHIVE_NAME.md5"
#
# Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import os
import os.path
import urllib.request
import urllib.parse
import requests # to get the body of 400 error, not possible with urllib
import glob
import re
import unittest
import sys
import json
import time
import xml.etree.ElementTree as ET
trace = True
"""
Check needed environment parameters
"""
def CheckEnvParameters(params, verbose=True):
for p in params:
if not p in os.environ.keys():
if verbose:
print("Missing environment variable '"+p+"'")
return False
return True
class CDashException(Exception):
pass
"""
Handler class to retrieve build information
"""
class Handler:
def __init__ (self):
self.build_dir = ""
self.configure_path = ""
self.url = "https://cdash.orfeo-toolbox.org"
self.project = "OTB"
self.site = ""
self.stamp = ""
self.name = ""
self.buildid = ""
def GetConfigureFile (self , build_dir = "" ):
if build_dir == "":
build_dir = self.build_dir
build_dir = os.path.normpath(build_dir)
test_path = os.path.join( build_dir , "Testing/")
list_folder = os.listdir(test_path)
if trace:
print(list_folder)
configure_xml = ""
for folder in list_folder:
if folder == "Temporary" or folder == "TAG":
pass
configure_xml = os.path.join( test_path , folder , "Configure.xml" )
if os.path.exists( configure_xml ):
break
if os.path.exists( configure_xml ):
if trace:
print ( configure_xml )
self.configure_path = configure_xml
return self.configure_path
raise CDashException("Could not find the Configure.xml produced by ctest")
def ParseConfigureFile(self):
"""
Parse the configuration file to get Name, Site and BuildStamp
"""
configure_file = open( self.configure_path, "r" )
content = configure_file.read()
configure_file.close()
# strip the Log section as it can mess up the XML parser
startLog=content.find('<Log>')
endLog=content.rfind('</Log>')
if startLog > 0 and endLog > startLog:
content = content[:(startLog+5)]+content[endLog:]
# parse XML
root = ET.fromstring(content)
if trace:
print( root.attrib )
if not 'Name' in root.keys():
raise CDashException("Can't find site name in Configure.XML")
if not 'BuildName' in root.keys():
raise CDashException("Can't find build name in Configure.XML")
if not 'BuildStamp' in root.keys():
raise CDashException("Can't find build stamp in Configure.XML")
self.site = root.get('Name')
self.name = root.get('BuildName')
self.stamp = root.get('BuildStamp')
def GetBuildId (self, **kwargs):
"""
This function is returning the buildid. Dict can be passed with the
different information
"""
site = self.site
stamp = self.stamp
name = self.name
project = self.project
for key , value in kwargs.items():
if key == "site":
site = value
if key == "stamp":
stamp = value
if key == "name":
name = value
if key == "project":
project = value
if ( site == "" or stamp == "" or name == "" or project == ""):
raise CDashException("Missing argument for buildid request site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".")
elif trace:
print( "Argument for buildid request site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".")
buildid_api = "/api/v1/getbuildid.php?"
buildid_params = urllib.parse.urlencode({'project': project, 'site': site, 'stamp': stamp , 'name': name})
full_url = self.url + buildid_api + buildid_params
if trace:
print("full_url: "+full_url)
max_retry = 11
nb_try = max_retry
build_id_regex = re.compile( "<buildid>([0-9]+)</buildid>" )
while nb_try:
response = requests.get(full_url).text
if trace:
print ( "response: " + response )
buildid = build_id_regex.search( response )
nb_try -= 1
if buildid or (nb_try == 0):
break
print("No build id, retry "+str(max_retry-nb_try)+"/"+str(max_retry)+" ...")
time.sleep(30)
if buildid:
self.buildid = buildid.group(1)
if trace:
print ( "build id is ", self.buildid)
return buildid.group(1)
else:
raise CDashException("Error in recovering buildid")
def GetBuildUrl (self , buildid = "" ):
"""
This function is returning the build url. It can be called only when
everything is set
"""
if ( buildid == "" ):
buildid = self.buildid
if ( buildid == "" ):
print( "Missing argument to build url")
return
build_url = self.url
build_url +="/buildSummary.php?"
build_url += "buildid=" + buildid
return build_url
def GetBuildStatus(self, buildid = "" ):
"""
This function returns the status of a build id as a pair 'state' + 'errors'
"""
if ( buildid == "" ):
buildid = self.buildid
if ( buildid == "" ):
print( "Missing argument to build Status")
return
full_url = self.url + "/api/buildSummary.php?buildid=" + buildid
response = urllib.request.urlopen(full_url).read().decode()
full_status = json.loads(response)
state = "success"
if full_status["configure"]["nerrors"] or full_status["build"]["nerrors"] \
or full_status["test"]["nerrors"] or full_status["test"]["nfailed"]:
state = 'failed'
errors = ""
if full_status["configure"]["nerrors"]:
errors = "Errors occur during configure"
elif full_status["build"]["nerrors"]:
errors = "Errors occur during build"
elif full_status["test"]["nerrors"] or full_status["test"]["nfailed"]:
errors = "Errors occur during tests"
return ( state , errors)
def GetReturnValue(self, logfile):
fd = open(logfile)
content = fd.readlines()[0]
fd.close()
return int(content.strip("\n"))
def GetLogStatus(self, logdir):
"""
This function returns the log status of a build as a pair 'state' + 'errors'
"""
configure_rv = os.path.join(logdir, "configure_return_value_log.txt")
build_rv = os.path.join(logdir, "build_return_value_log.txt")
test_rv = os.path.join(logdir, "test_return_value_log.txt")
if os.path.exists( configure_rv ):
if (self.GetReturnValue(configure_rv) != 0):
return ( 'failed' , 'Configure failed')
else:
return ( 'failed' , 'Configure not run')
if os.path.exists( build_rv ):
if (self.GetReturnValue(build_rv) != 0):
return ( 'failed' , 'Build failed')
else:
return ( 'failed' , 'Build not run')
if os.path.exists( test_rv ):
if (self.GetReturnValue(test_rv) != 0):
return ( 'failed' , 'Tests failed')
return ('success', '')
"""
This script aims only at recovering the build url
It uses environment variables setup by Gitlab Runner as default:
CI_COMMIT_SHA -> Commit SHA1
CI_PROJECT_ID -> Project ID
CI_PROJECT_DIR -> Project source directory
K8S_SECRET_API_TOKEN -> Token for Gitlab API
CI_MERGE_REQUEST_REF_PATH -> Ref name to push the status (only for merge request pipeline)
CI_COMMIT_REF_NAME -> Ref name to push the status
They can be overridden by a full command line :
cdash_handler.py commit_sha1 project_id project_directory token ref_name
"""
if __name__ == "__main__":
if trace:
print(sys.argv)
if ( len(sys.argv) < 6 and len(sys.argv) > 1 ):
print("Usage : "+sys.argv[0]+" commit_sha1 project_id project_directory token ref_name")
sys.exit(1)
if os.environ.get('CI_SKIP_CDASH', False):
sys.exit(0)
allow_failure = os.environ.get('CI_ALLOW_FAILURE', False)
if ( len(sys.argv) >= 6):
sha1 = sys.argv[1]
proj = sys.argv[2]
pdir = sys.argv[3]
token = sys.argv[4]
refn = sys.argv[5]
else:
if not CheckEnvParameters(['CI_COMMIT_SHA', 'CI_PROJECT_ID', 'CI_PROJECT_DIR', 'CI_COMMIT_REF_NAME']):
sys.exit(1)
sha1 = os.environ['CI_COMMIT_SHA']
refn = os.environ['CI_COMMIT_REF_NAME']
proj = os.environ['CI_PROJECT_ID']
pdir = os.environ['CI_PROJECT_DIR']
if CheckEnvParameters(['CI_MERGE_REQUEST_REF_PATH', 'CI_MERGE_REQUEST_PROJECT_ID'], verbose=False):
targetProj = os.environ['CI_MERGE_REQUEST_PROJECT_ID']
if proj == targetProj:
refn = os.environ['CI_MERGE_REQUEST_REF_PATH']
if CheckEnvParameters(['K8S_SECRET_API_TOKEN']):
token = os.environ['K8S_SECRET_API_TOKEN']
else:
token = None
handler = Handler()
build_dir = os.path.join( pdir , "build/")
if trace:
print("build_dir is: " + build_dir)
handler.build_dir = build_dir
try:
handler.GetConfigureFile()
handler.ParseConfigureFile()
if handler.GetBuildId() is None:
cdash_url = "https://cdash.orfeo-toolbox.org"
state = 'failed'
error = "Failed to get build id"
else:
cdash_url = handler.GetBuildUrl()
( state , error ) = handler.GetLogStatus( os.path.join( pdir , "log") )
print("CDash build URL : "+cdash_url)
if token is None:
sys.exit(0)
gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/"
gitlab_url += proj + "/statuses/" + sha1
except CDashException as e:
if allow_failure:
state = 'success'
else:
print(e)
sys.exit(1)
params = urllib.parse.urlencode({'name':'cdash:' + handler.site , 'state': state ,\
'target_url' : cdash_url , 'description' : error , 'ref' : refn })
gitlab_request = urllib.request.Request(gitlab_url)
gitlab_request.add_header('PRIVATE-TOKEN' , token )
if trace:
print ("gitlab_request.url: " + gitlab_request.full_url)
res = urllib.request.urlopen(gitlab_request, data=params.encode('ascii'))
if trace:
print ("gitlab_request.text: " + res.read().decode())