From df2d289a048f3f2893cc621abee43db8bc4f42a2 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Thu, 2 Jul 2020 11:13:02 +0200 Subject: [PATCH 1/7] FIXED cleanup gitlab ci configuration --- .gitlab/gitlab-ci.yml | 64 ++++--------------------------------------- 1 file changed, 5 insertions(+), 59 deletions(-) diff --git a/.gitlab/gitlab-ci.yml b/.gitlab/gitlab-ci.yml index 4da0c074..d4911bc9 100644 --- a/.gitlab/gitlab-ci.yml +++ b/.gitlab/gitlab-ci.yml @@ -154,14 +154,14 @@ stages: paths: - ${PROJECT_LOG_DIR}/configure.log when: always - expire_in: 7 days # 5 mins # see https://docs.gitlab.com/ce/ci/yaml/README.html#artifacts-expire_in + expire_in: 15 days .define_config: &build_artifacts artifacts: paths: - ${PROJECT_LOG_DIR}/build.log when: always - expire_in: 7 days + expire_in: 15 days .define_config: &test_artifacts artifacts: @@ -170,7 +170,7 @@ stages: - ${PROJECT_LOG_DIR}/ci-test.log - ${PROJECT_LOG_DIR}/rerun-test.log when: always - expire_in: 7 days + expire_in: 15 days .define_config: &coverage_artifacts artifacts: @@ -178,7 +178,7 @@ stages: - ${PROJECT_LOG_DIR}/coverage.log - ${PROJECT_LOG_DIR}/camitk-ce-test-coverage/ when: always - expire_in: 7 days + expire_in: 15 days # ------------------------------------- # debian stable jobs @@ -287,66 +287,12 @@ ubuntu_lts_coverage: # on Ubuntu: coverage: '/ Percentage Coverage: \d+\.\d+/' -# ------------------------------------- -# debian oldstable jobs -# ------------------------------------- - -.define_os: &debian_oldstable_image - # The default image "debian:oldstable" from docker.io does not have all the build toolchain and dependencies - # → use custom build local image: camitk/debian:oldstable-camitk - image: camitk/debian:oldstable-camitk - variables: - # OS Id - OS: "debian-oldstable" - # the name of the current machine - CDASH_SITE: "[Gitlab Runner] Debian old stable" - # compiler-arch-buildtype string - COMPILER_CONFIG: "GCC-64bits-Debug" - # path to the intended build directory - PROJECT_BUILD_DIR: "/opt/build/${OS}-${CI_COMMIT_REF_SLUG}" - # path to the intended log directory (cannot be an absolute path) - PROJECT_LOG_DIR: "${OS}-${CI_COMMIT_REF_SLUG}/log" - tags: - - debian:oldstable - -debian_oldstable_check: - <<: *debian_oldstable_image - <<: *default_job_config - <<: *check_pipeline_script - -debian_oldstable_configure: - <<: *debian_oldstable_image - <<: *default_job_config - <<: *configure_artifacts - <<: *configure_script - -debian_oldstable_build: - <<: *debian_oldstable_image - <<: *default_job_config - <<: *build_artifacts - <<: *build_script - -debian_oldstable_test: - <<: *debian_oldstable_image - <<: *default_job_config - <<: *test_artifacts - <<: *test_script - -debian_oldstable_coverage: - <<: *debian_oldstable_image - <<: *default_job_config - <<: *coverage_artifacts - <<: *coverage_script - coverage: '/ lines......: \d+\.\d+/' - - # ------------------------------------- # win10 jobs # ------------------------------------- .define_os: &win10_config # on windows the executor is a docker - image: gricad-registry.univ-grenoble-alpes.fr/camitk/camitk/win10-msvc2019-2020-06-19-v0 variables: # OS Id OS: "win10" @@ -385,7 +331,7 @@ win10_test: <<: *test_script # ----------------------------------------------------- -# debian unstable jobs (for packaging) +# packaging on debian unstable jobs # ----------------------------------------------------- debian_unstable_packaging: # Use the default image "debian:unstable" from docker.io -- GitLab From 80b589b67cbba23971602fe59e2631784f6ce368 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Fri, 3 Jul 2020 10:29:45 +0200 Subject: [PATCH 2/7] NEW updated Linux CI --- .gitlab/gitlab-ci.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.gitlab/gitlab-ci.yml b/.gitlab/gitlab-ci.yml index d4911bc9..040a9010 100644 --- a/.gitlab/gitlab-ci.yml +++ b/.gitlab/gitlab-ci.yml @@ -185,9 +185,6 @@ stages: # ------------------------------------- .define_os: &debian_stable_image - # The default image "debian:stable" from docker.io does not have all the build toolchain and dependencies - # → use custom build local image: camitk/debian:stable-camitk - image: camitk/debian:stable-camitk variables: # OS Id OS: "debian-stable" @@ -196,11 +193,11 @@ stages: # compiler-arch-buildtype string COMPILER_CONFIG: "GCC-64bits-Debug" # path to the intended build directory - PROJECT_BUILD_DIR: "/opt/build/${OS}-${CI_COMMIT_REF_SLUG}" + PROJECT_BUILD_DIR: "/opt/builds/${OS}-${CI_COMMIT_REF_SLUG}" # path to the intended log directory (cannot be an absolute path) PROJECT_LOG_DIR: "${OS}-${CI_COMMIT_REF_SLUG}/log" tags: - - debian:stable + - stable debian_stable_check: <<: *debian_stable_image @@ -237,9 +234,6 @@ debian_stable_coverage: # ubuntu LTS jobs # ------------------------------------- .define_os: &ubuntu_lts_image - # The default image "ubuntu:latest" from docker.io does not have all the build toolchain and dependencies - # → use custom build local image: camitk/ubuntu:lts-camitk - image: camitk/ubuntu:lts-camitk variables: # OS Id OS: "ubuntu-lts" @@ -248,13 +242,13 @@ debian_stable_coverage: # compiler-arch-buildtype string COMPILER_CONFIG: "GCC-64bits-Debug" # path to the intended build directory - PROJECT_BUILD_DIR: "/opt/build/${OS}-${CI_COMMIT_REF_SLUG}" + PROJECT_BUILD_DIR: "/opt/builds/${OS}-${CI_COMMIT_REF_SLUG}" # path to the intended log directory (cannot be an absolute path) PROJECT_LOG_DIR: "${OS}-${CI_COMMIT_REF_SLUG}/log" # debug for now #CI_DEBUG_TRACE: "true" tags: - - ubuntu:lts + - lts ubuntu_lts_check: <<: *ubuntu_lts_image @@ -292,7 +286,6 @@ ubuntu_lts_coverage: # ------------------------------------- .define_os: &win10_config - # on windows the executor is a docker variables: # OS Id OS: "win10" -- GitLab From 52756848710190a4524eaa994295be8e7fba8432 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Fri, 3 Jul 2020 11:37:23 +0200 Subject: [PATCH 3/7] NEW acyclic pipeline for independent plateform CI --- .gitlab/gitlab-ci.yml | 68 +++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/.gitlab/gitlab-ci.yml b/.gitlab/gitlab-ci.yml index 040a9010..987b225a 100644 --- a/.gitlab/gitlab-ci.yml +++ b/.gitlab/gitlab-ci.yml @@ -184,7 +184,7 @@ stages: # debian stable jobs # ------------------------------------- -.define_os: &debian_stable_image +.define_os: &stable_config variables: # OS Id OS: "debian-stable" @@ -199,41 +199,44 @@ stages: tags: - stable -debian_stable_check: - <<: *debian_stable_image +stable:check: + <<: *stable_config <<: *default_job_config <<: *check_pipeline_script -debian_stable_configure: - <<: *debian_stable_image +stable:configure: + <<: *stable_config <<: *default_job_config <<: *configure_artifacts <<: *configure_script + needs: ["stable:check"] -debian_stable_build: - <<: *debian_stable_image +stable:build: + <<: *stable_config <<: *default_job_config <<: *build_artifacts <<: *build_script + needs: ["stable:configure"] -debian_stable_test: - <<: *debian_stable_image +stable:test: + <<: *stable_config <<: *default_job_config <<: *test_artifacts <<: *test_script + needs: ["stable:build"] -debian_stable_coverage: - <<: *debian_stable_image +stable:coverage: + <<: *stable_config <<: *default_job_config <<: *coverage_artifacts <<: *coverage_script coverage: '/ lines......: \d+\.\d+/' - + needs: ["stable:test"] # ------------------------------------- # ubuntu LTS jobs # ------------------------------------- -.define_os: &ubuntu_lts_image +.define_os: <s_config variables: # OS Id OS: "ubuntu-lts" @@ -250,36 +253,40 @@ debian_stable_coverage: tags: - lts -ubuntu_lts_check: - <<: *ubuntu_lts_image +lts:check: + <<: *lts_config <<: *default_job_config <<: *check_pipeline_script -ubuntu_lts_configure: - <<: *ubuntu_lts_image +lts:configure: + <<: *lts_config <<: *default_job_config <<: *configure_artifacts <<: *configure_script + needs: ["lts:check"] -ubuntu_lts_build: - <<: *ubuntu_lts_image +lts:build: + <<: *lts_config <<: *default_job_config <<: *build_artifacts <<: *build_script + needs: ["lts:configure"] -ubuntu_lts_test: - <<: *ubuntu_lts_image +lts:test: + <<: *lts_config <<: *default_job_config <<: *test_artifacts <<: *test_script + needs: ["lts:build"] -ubuntu_lts_coverage: - <<: *ubuntu_lts_image +lts:coverage: + <<: *lts_config <<: *default_job_config <<: *coverage_artifacts <<: *coverage_script # on Ubuntu: coverage: '/ Percentage Coverage: \d+\.\d+/' + needs: ["lts:test"] # ------------------------------------- # win10 jobs @@ -300,33 +307,36 @@ ubuntu_lts_coverage: tags: - win10 -win10_check: +win10:check: <<: *win10_config <<: *default_job_config <<: *check_pipeline_script -win10_configure: +win10:configure: <<: *win10_config <<: *default_job_config <<: *configure_artifacts <<: *configure_script + needs: ["win10:check"] -win10_build: +win10:build: <<: *win10_config <<: *default_job_config <<: *build_artifacts <<: *build_script + needs: ["win10:configure"] -win10_test: +win10:test: <<: *win10_config <<: *default_job_config <<: *test_artifacts <<: *test_script + needs: ["win10:build"] # ----------------------------------------------------- # packaging on debian unstable jobs # ----------------------------------------------------- -debian_unstable_packaging: +unstable:packaging: # Use the default image "debian:unstable" from docker.io # And then build everything from scratch image: debian:sid @@ -343,7 +353,7 @@ debian_unstable_packaging: PROJECT_LOG_DIR: "packaging-${OS}-${CI_COMMIT_REF_SLUG}/log" tags: # packaging unstable image has its own VM + gitlab runner on the debian:packaging runner (using a debian stable host) - - debian:packaging + - unstable:packaging stage: package script: # use the specific script -- GitLab From 75f977c7165b0c4a87968eac92817204452a6c0c Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Sun, 5 Jul 2020 10:07:36 +0200 Subject: [PATCH 4/7] FIXED remove this test if msvc not equals to 14.0 --- .gitlab/gitlab-ci.yml | 2 +- sdk/applications/cepgenerator/CMakeLists.txt | 24 +++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.gitlab/gitlab-ci.yml b/.gitlab/gitlab-ci.yml index 987b225a..b2850d59 100644 --- a/.gitlab/gitlab-ci.yml +++ b/.gitlab/gitlab-ci.yml @@ -47,7 +47,7 @@ # ".define_script" is used to define specific script parts for a job and can be reused for different OS # ".define_config" is used to define other specific parts for a job and can be reused for different job and different OS # -# Nightly build clear the build/ directory automatically. +# Nightly build clear the builds/ directory automatically. # variables: # project name diff --git a/sdk/applications/cepgenerator/CMakeLists.txt b/sdk/applications/cepgenerator/CMakeLists.txt index 046d43ae..d2ee3fd9 100644 --- a/sdk/applications/cepgenerator/CMakeLists.txt +++ b/sdk/applications/cepgenerator/CMakeLists.txt @@ -16,15 +16,23 @@ camitk_add_test(PROJECT_NAME ${TEST_BASENAME} TEST_SUFFIX "-") camitk_add_test(EXECUTABLE_ARGS "--help" PROJECT_NAME ${TEST_BASENAME} TEST_SUFFIX "-") camitk_add_test(EXECUTABLE_ARGS "-h" PROJECT_NAME ${TEST_BASENAME} TEST_SUFFIX "-") +# test #4 # should pass because invoking cepgenerator with a faulty arguments results in printing # an "Argument error" message (and exit failure) -# But on msvc with dependencies installed using the CamiTK developer package, there is a segfault generating at exit -# when freeing the xsdcxx cli_options_map (probably due to the fact the CamiTK developer package -# was compiled using an older version of MSVC2015 than the currently installed version -if (NOT MSVC_VERSION MATCHES "1900") # see https://cmake.org/cmake/help/v3.11/variable/MSVC_VERSION.html - camitk_add_test(EXECUTABLE_ARGS "-badarg" - PASS_REGULAR_EXPRESSION "unknown option '-badarg'" - PROJECT_NAME ${TEST_BASENAME} TEST_SUFFIX "-") +camitk_add_test(EXECUTABLE_ARGS "-badarg" + PASS_REGULAR_EXPRESSION "unknown option '-badarg'" + PROJECT_NAME ${TEST_BASENAME} TEST_SUFFIX "-") + +if (WIN32) # needed as there is no "AND" operator in camitk_tests_requirement REQUIRES argument + # see https://cmake.org/cmake/help/v3.11/variable/MSVC_VERSION.html for the list of version + camitk_tests_requirement(TESTS application-cepgenerator-4 + REQUIRES "${MSVC_VERSION} VERSION_EQUAL 1900" + REASON "xsdcxx compiled with a differt version of MSVC + XSDCXX was compiled with MSVC 14.0. + The MSVC mismatch version of std C++ library generates a segfault during exit + when freeing the xsdcxx cli_options_map. + Therefore if the MSVC version is different than version 14.0, this test will unconditionnaly fail." + ) endif() camitk_add_test(EXECUTABLE_ARGS "-f missingdir" @@ -60,4 +68,4 @@ if(BASH_PROGRAM) ) # add test to this subproject set_tests_properties(${APPLICATION_TARGET_NAME}-bash-test PROPERTIES LABELS ${APPLICATION_TARGET_NAME}) -endif(BASH_PROGRAM) +endif() -- GitLab From 19502107ce8f41ac1beb8747f46e7bb2f1760632 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Sun, 5 Jul 2020 10:17:02 +0200 Subject: [PATCH 5/7] NEW printing out processor number This is to check cmake capability of detecting the correct number of processor from inside a docker on windows --- sdk/applications/cepgenerator/CMakeLists.txt | 2 +- sdk/cmake/ctest/ci-setup.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/applications/cepgenerator/CMakeLists.txt b/sdk/applications/cepgenerator/CMakeLists.txt index d2ee3fd9..c3317bbb 100644 --- a/sdk/applications/cepgenerator/CMakeLists.txt +++ b/sdk/applications/cepgenerator/CMakeLists.txt @@ -27,7 +27,7 @@ if (WIN32) # needed as there is no "AND" operator in camitk_tests_requirement RE # see https://cmake.org/cmake/help/v3.11/variable/MSVC_VERSION.html for the list of version camitk_tests_requirement(TESTS application-cepgenerator-4 REQUIRES "${MSVC_VERSION} VERSION_EQUAL 1900" - REASON "xsdcxx compiled with a differt version of MSVC + REASON "xsdcxx compiled with a different version of MSVC XSDCXX was compiled with MSVC 14.0. The MSVC mismatch version of std C++ library generates a segfault during exit when freeing the xsdcxx cli_options_map. diff --git a/sdk/cmake/ctest/ci-setup.cmake b/sdk/cmake/ctest/ci-setup.cmake index e42ce1e2..2920b2b9 100644 --- a/sdk/cmake/ctest/ci-setup.cmake +++ b/sdk/cmake/ctest/ci-setup.cmake @@ -117,6 +117,7 @@ endif() # parallelize ci scripts if possible include(ProcessorCount) ProcessorCount(NUMBER_OF_PROC) +message(STATUS "Dectected ${NUMBER_OF_PROC} processors") # remove some to avoid processor overload MATH(EXPR NUMBER_OF_PROC "${NUMBER_OF_PROC}-2") if(NUMBER_OF_PROC GREATER 0) -- GitLab From 176aebd3d201ef6404a12eac0ee387a2b9ad17a6 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Sun, 5 Jul 2020 14:01:15 +0200 Subject: [PATCH 6/7] FIXED Max up number of processors --- sdk/cmake/ctest/ci-setup.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cmake/ctest/ci-setup.cmake b/sdk/cmake/ctest/ci-setup.cmake index 2920b2b9..61d1eba2 100644 --- a/sdk/cmake/ctest/ci-setup.cmake +++ b/sdk/cmake/ctest/ci-setup.cmake @@ -119,7 +119,7 @@ include(ProcessorCount) ProcessorCount(NUMBER_OF_PROC) message(STATUS "Dectected ${NUMBER_OF_PROC} processors") # remove some to avoid processor overload -MATH(EXPR NUMBER_OF_PROC "${NUMBER_OF_PROC}-2") +MATH(EXPR NUMBER_OF_PROC "${NUMBER_OF_PROC}-1") if(NUMBER_OF_PROC GREATER 0) if(COMPILER MATCHES "GCC" OR COMPILER MATCHES "Ninja") set(CTEST_BUILD_FLAGS -j${NUMBER_OF_PROC}) -- GitLab From 36f143f0376a42c1098465b3acb2a7afd6379bbe Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Sun, 5 Jul 2020 15:04:48 +0200 Subject: [PATCH 7/7] FIXED linking using g++ 10 linking with medicalimageviewer dependencies required with g++ 10 (current debian unstable version) --- sdk/applications/actionstatemachine/CMakeLists.txt | 2 +- sdk/applications/imp/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/applications/actionstatemachine/CMakeLists.txt b/sdk/applications/actionstatemachine/CMakeLists.txt index 8de42b80..11055400 100644 --- a/sdk/applications/actionstatemachine/CMakeLists.txt +++ b/sdk/applications/actionstatemachine/CMakeLists.txt @@ -2,7 +2,7 @@ camitk_application(NEEDS_QT_MODULES #we use QtXML ADDITIONAL_SOURCES CommandLineOptions.cxx CommandLineOptions.hxx CommandLineOptions.ixx CEP_NAME SDK - NEEDS_VIEWER_EXTENSION explorer medicalimageviewer + NEEDS_VIEWER_EXTENSION explorer interactivesliceviewer interactivegeometryviewer medicalimageviewer DESCRIPTION "Simple action state machine to pipeline actions from an XML file" ) diff --git a/sdk/applications/imp/CMakeLists.txt b/sdk/applications/imp/CMakeLists.txt index 8dc0fcb7..69efc236 100644 --- a/sdk/applications/imp/CMakeLists.txt +++ b/sdk/applications/imp/CMakeLists.txt @@ -1,6 +1,6 @@ camitk_application( ADDITIONAL_SOURCES CommandLineOptions.cxx CommandLineOptions.hxx CommandLineOptions.ixx CEP_NAME SDK - NEEDS_VIEWER_EXTENSION actionviewer medicalimageviewer explorer frameexplorer propertyexplorer + NEEDS_VIEWER_EXTENSION actionviewer interactivesliceviewer interactivegeometryviewer medicalimageviewer explorer frameexplorer propertyexplorer DESCRIPTION "All-in-one application to load actions and components and interact with them" ) -- GitLab