From 687a1de426b4a3980a30ab378433e49d0ead0f5a Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Mon, 13 May 2024 17:33:26 +0000 Subject: [PATCH 01/22] update CIL and CCPi-Regularisation version and reinstate tests --- SuperBuild.cmake | 2 +- SuperBuild/External_CIL.cmake | 4 ++++ version_config.cmake | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SuperBuild.cmake b/SuperBuild.cmake index cee9de0d..f87acce4 100644 --- a/SuperBuild.cmake +++ b/SuperBuild.cmake @@ -325,7 +325,7 @@ if ("${PYTHON_STRATEGY}" STREQUAL "CONDA") set (BUILD_CIL OFF) endif() if (BUILD_CIL) - list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES CIL TomoPhantom) + list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES CIL CCPi-Regularisation-Toolkit TomoPhantom) endif() if (BUILD_ASTRA) list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES astra-python-wrapper) diff --git a/SuperBuild/External_CIL.cmake b/SuperBuild/External_CIL.cmake index f985aae7..a113c000 100644 --- a/SuperBuild/External_CIL.cmake +++ b/SuperBuild/External_CIL.cmake @@ -115,6 +115,9 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr add_test(NAME CIL_FRAMEWORK_TESTS_9 COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_Operator.py WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test) + add_test(NAME CIL_FRAMEWORK_TESTS_10 + COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_PluginsRegularisation.py + WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test) add_test(NAME CIL_FRAMEWORK_TESTS_11 COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_quality_measures.py WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test) @@ -130,6 +133,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr add_test(NAME CIL_FRAMEWORK_TESTS_15 COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_TranslateFunction.py WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test) + # add_test(NAME CIL_FRAMEWORK_TESTS_ALL # COMMAND ${PYTHON_EXECUTABLE} -m unittest discover # WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test) diff --git a/version_config.cmake b/version_config.cmake index f0291ac6..afbe736a 100644 --- a/version_config.cmake +++ b/version_config.cmake @@ -161,10 +161,10 @@ set(DEFAULT_JSON_TAG v3.11.3) # CCPi CIL # minimum supported version of CIL supported is > 22.1.0 or from commit a6062410028c9872c5b355be40b96ed1497fed2a set(DEFAULT_CIL_URL https://github.com/TomographicImaging/CIL) -set(DEFAULT_CIL_TAG db5a2a6cd3bddfbbf53e65f0549ac206096e5b44) # 13 Feb 2024 +set(DEFAULT_CIL_TAG b066d588dc6de0188fd33dafd8e5e669b7434b7e) # 13 May 2024 -set(DEFAULT_CCPi-Regularisation-Toolkit_URL https://github.com/vais-ral/CCPi-Regularisation-Toolkit) -set(DEFAULT_CCPi-Regularisation-Toolkit_TAG "71f8d304d804b54d378f0ed05539f01aaaf13758") +set(DEFAULT_CCPi-Regularisation-Toolkit_URL https://github.com/TomographicImaging/CCPi-Regularisation-Toolkit) +set(DEFAULT_CCPi-Regularisation-Toolkit_TAG "fix_3D_regularisers") # fix_ # CERN ROOT set(DEFAULT_ROOT_URL https://github.com/root-project/root) From e311b869a9b00557dd6415d9089eafde57a10868 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Mon, 13 May 2024 20:06:41 +0000 Subject: [PATCH 02/22] update build command --- SuperBuild/External_CCPi-Regularisation-Toolkit.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SuperBuild/External_CCPi-Regularisation-Toolkit.cmake b/SuperBuild/External_CCPi-Regularisation-Toolkit.cmake index 2124a360..ecbb27fd 100644 --- a/SuperBuild/External_CCPi-Regularisation-Toolkit.cmake +++ b/SuperBuild/External_CCPi-Regularisation-Toolkit.cmake @@ -72,7 +72,8 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr -DPYTHON_DEST_DIR:PATH=${PYTHON_DEST} BUILD_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${${proj}_TAG} ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${${proj}_TAG} ${CMAKE_COMMAND} --build . --target install + INSTALL_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${${proj}_TAG} ${CMAKE_COMMAND} --build . --target install && + ${PYTHON_EXECUTABLE} -m pip install ${${proj}_SOURCE_DIR}/src/Python #TEST_COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -s ${${proj}_SOURCE_DIR}/test/ -p test*.py DEPENDS ${${proj}_DEPENDENCIES} From f13ab947685073f76bfc42c875e360cd67768883 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Mon, 13 May 2024 20:36:40 +0000 Subject: [PATCH 03/22] update SIRF tags --- version_config.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_config.cmake b/version_config.cmake index afbe736a..6680a321 100644 --- a/version_config.cmake +++ b/version_config.cmake @@ -141,7 +141,7 @@ set(DEFAULT_STIR_TAG rel_6.0.0) ## SIRF set(DEFAULT_SIRF_URL https://github.com/SyneRBI/SIRF) -set(DEFAULT_SIRF_TAG v3.6.0) +set(DEFAULT_SIRF_TAG d54c4550d1533132c6a281b6cf2159c8fd22f45c) # #1254 ## pet-rd-tools set(DEFAULT_pet_rd_tools_URL https://github.com/UCL/pet-rd-tools) From 01232568e7f99ca279242a757cfea50fff96bd17 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Mon, 13 May 2024 21:53:51 +0000 Subject: [PATCH 04/22] test if ROOT errors are due to GCC 11 removed added GCC 11 builds From e3d4115bd0c05047cfbbde43029f0c30fec691e8 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Tue, 14 May 2024 10:41:33 +0000 Subject: [PATCH 05/22] update Changelog --- CHANGES.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 47e74393..8929a32d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,9 +1,13 @@ # ChangeLog ## vx.x.x - +- Adds CCPi-Regularisation-Toolkit as prerequisite for CIL and reinstate unit tests - CMake: - only pass through `OpenMP*LIBRARY` variables if set, and add OpenMP_iomp_LIBRARY to the list (for Intel compiler) +- Updated Versions: + - SIRF (master): d54c4550d1533132c6a281b6cf2159c8fd22f45c + - CIL: b066d588dc6de0188fd33dafd8e5e669b7434b7e # 13 May 2024 + - CCPi-Regularisation-Toolkit: fix_3D_regularisers branch ## v3.6.0 - build the STIR native Python interface by default (STIR_BUILD_SWIG_PYTHON=ON). You can still switch this off. From 4b19647af9fef458ca081f85809e85bb09e01734 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Wed, 15 May 2024 08:00:48 +0000 Subject: [PATCH 06/22] install cil from source if BUILD_CIL=ON and not from conda --- docker/user_demos.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docker/user_demos.sh b/docker/user_demos.sh index 3527b887..a1c6edb2 100755 --- a/docker/user_demos.sh +++ b/docker/user_demos.sh @@ -22,7 +22,13 @@ if [ "$PYTHON" = "miniconda" ]; then # delete GPU deps sed -r -e '/^\s*- (astra-toolbox|tigre).*/d' -e '/^\s*- \S+.*#.*GPU/d' environment.yml > environment-sirf.yml fi - conda env update --file environment-sirf.yml + # do not install CIL from conda if BUILD_CIL is set + if test "${BUILD_CIL:-0}" != 0; then + # delete CIL package from the environment file + sed -r -e '/^\s*- (cil).*/d' environment-sirf.yml > tmp + mv tmp environment-sirf.yml + fi + conda env update --file environment-sirf.yml -v else if [ -f requirements.txt ]; then cat requirements.txt From 711ce31c086e22e2bcc468c65f6147f71593e50d Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Wed, 15 May 2024 14:39:35 +0000 Subject: [PATCH 07/22] install CIL via conda if BUILD_CIL=OFF --- Dockerfile | 2 +- docker/user_demos.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0ddea696..c9e35b0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -111,7 +111,7 @@ COPY --from=build --link --chown=${NB_USER} /opt/SIRF-SuperBuild/INSTALL/ /opt/S # install {SIRF-Exercises,CIL-Demos} COPY docker/user_demos.sh /opt/scripts/ -RUN bash /opt/scripts/user_demos.sh \ +RUN BUILD_CIL="${BUILD_CIL}" bash /opt/scripts/user_demos.sh \ && fix-permissions /opt/SIRF-Exercises /opt/CIL-Demos "${CONDA_DIR}" /home/${NB_USER} # docker-stacks notebook diff --git a/docker/user_demos.sh b/docker/user_demos.sh index a1c6edb2..79186563 100755 --- a/docker/user_demos.sh +++ b/docker/user_demos.sh @@ -25,8 +25,7 @@ if [ "$PYTHON" = "miniconda" ]; then # do not install CIL from conda if BUILD_CIL is set if test "${BUILD_CIL:-0}" != 0; then # delete CIL package from the environment file - sed -r -e '/^\s*- (cil).*/d' environment-sirf.yml > tmp - mv tmp environment-sirf.yml + sed -r -i -e '/^\s*- (cil).*/d' environment-sirf.yml fi conda env update --file environment-sirf.yml -v else From 1b886428cca733571bbf20ebe26c03b5e1fa739d Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Wed, 15 May 2024 16:39:17 +0000 Subject: [PATCH 08/22] this works --- docker/user_demos.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/user_demos.sh b/docker/user_demos.sh index 79186563..d6454049 100755 --- a/docker/user_demos.sh +++ b/docker/user_demos.sh @@ -25,7 +25,11 @@ if [ "$PYTHON" = "miniconda" ]; then # do not install CIL from conda if BUILD_CIL is set if test "${BUILD_CIL:-0}" != 0; then # delete CIL package from the environment file + echo "Deleting CIL from the environment file BUILD_CIL is set to >${BUILD_CIL}<" sed -r -i -e '/^\s*- (cil).*/d' environment-sirf.yml + cat environment-sirf.yml + else + echo "Not deleting CIL from the environment file BUILD_CIL is set to >${BUILD_CIL}<" fi conda env update --file environment-sirf.yml -v else From 65e2d7027cc7c064118e5518d21850bf5808443a Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Wed, 15 May 2024 21:57:26 +0000 Subject: [PATCH 09/22] remove CIL if BUILD_CIL=ON --- CHANGES.md | 2 ++ Dockerfile | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 8929a32d..ecb2a956 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,8 @@ ## vx.x.x - Adds CCPi-Regularisation-Toolkit as prerequisite for CIL and reinstate unit tests +- Docker: + - Handle BUILD_CIL correctly and not install CIL from conda if BUILD_CIL=ON - CMake: - only pass through `OpenMP*LIBRARY` variables if set, and add OpenMP_iomp_LIBRARY to the list (for Intel compiler) - Updated Versions: diff --git a/Dockerfile b/Dockerfile index c9e35b0e..d715491c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,12 +21,16 @@ RUN bash /opt/scripts/build_system-ubuntu.sh # SIRF python deps ARG BUILD_GPU=0 +ARG BUILD_CIL="OFF" COPY docker/requirements.yml /opt/scripts/ # https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#conda-environments # https://github.com/TomographicImaging/CIL/blob/master/Dockerfile RUN if test "$BUILD_GPU" != 0; then \ sed -ri 's/^(\s*)#\s*(- \S+.*#.*GPU.*)$/\1\2/' /opt/scripts/requirements.yml; \ fi \ + && if test "$BUILD_CIL" != 0; then \ + sed -r -i -e '/^\s*- (cil).*/d' /opt/scripts/requirements.yml; \ + fi \ && conda config --env --set channel_priority strict \ && for ch in defaults ccpi intel conda-forge; do conda config --env --add channels $ch; done \ && mamba env update -n base -f /opt/scripts/requirements.yml \ @@ -66,7 +70,8 @@ ARG USE_NiftyPET="OFF" ARG BUILD_siemens_to_ismrmrd="ON" ARG BUILD_pet_rd_tools="ON" ARG Gadgetron_USE_CUDA="ON" -ARG BUILD_CIL="OFF" +# BUILD_CIL is defined in the previous stage +ARG BUILD_CIL ARG EXTRA_BUILD_FLAGS="" # build, install in /opt/SIRF-SuperBuild/{INSTALL,sources/SIRF}, test (if RUN_CTEST) @@ -110,6 +115,7 @@ COPY --from=build --link --chown=${NB_USER} /opt/SIRF-SuperBuild/INSTALL/ /opt/S #COPY --from=build --link /opt/conda/ /opt/conda/ # install {SIRF-Exercises,CIL-Demos} +ARG BUILD_CIL COPY docker/user_demos.sh /opt/scripts/ RUN BUILD_CIL="${BUILD_CIL}" bash /opt/scripts/user_demos.sh \ && fix-permissions /opt/SIRF-Exercises /opt/CIL-Demos "${CONDA_DIR}" /home/${NB_USER} From 146641069a5bc1f6c5f921b15f9ee611ae16360c Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Wed, 15 May 2024 22:02:42 +0000 Subject: [PATCH 10/22] removed partial comment --- version_config.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_config.cmake b/version_config.cmake index 6680a321..351089cb 100644 --- a/version_config.cmake +++ b/version_config.cmake @@ -164,7 +164,7 @@ set(DEFAULT_CIL_URL https://github.com/TomographicImaging/CIL) set(DEFAULT_CIL_TAG b066d588dc6de0188fd33dafd8e5e669b7434b7e) # 13 May 2024 set(DEFAULT_CCPi-Regularisation-Toolkit_URL https://github.com/TomographicImaging/CCPi-Regularisation-Toolkit) -set(DEFAULT_CCPi-Regularisation-Toolkit_TAG "fix_3D_regularisers") # fix_ +set(DEFAULT_CCPi-Regularisation-Toolkit_TAG "fix_3D_regularisers") # CERN ROOT set(DEFAULT_ROOT_URL https://github.com/root-project/root) From 6a0bf4b7c397da6cad18d76e36e6a6ea44d1fbfa Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Thu, 16 May 2024 11:40:04 +0100 Subject: [PATCH 11/22] fix BUILD_CIL value handling --- Dockerfile | 2 +- docker/user_demos.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d715491c..dfa780cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ COPY docker/requirements.yml /opt/scripts/ RUN if test "$BUILD_GPU" != 0; then \ sed -ri 's/^(\s*)#\s*(- \S+.*#.*GPU.*)$/\1\2/' /opt/scripts/requirements.yml; \ fi \ - && if test "$BUILD_CIL" != 0; then \ + && if test "$BUILD_CIL" != "OFF"; then \ sed -r -i -e '/^\s*- (cil).*/d' /opt/scripts/requirements.yml; \ fi \ && conda config --env --set channel_priority strict \ diff --git a/docker/user_demos.sh b/docker/user_demos.sh index d6454049..5d757ee7 100755 --- a/docker/user_demos.sh +++ b/docker/user_demos.sh @@ -23,7 +23,7 @@ if [ "$PYTHON" = "miniconda" ]; then sed -r -e '/^\s*- (astra-toolbox|tigre).*/d' -e '/^\s*- \S+.*#.*GPU/d' environment.yml > environment-sirf.yml fi # do not install CIL from conda if BUILD_CIL is set - if test "${BUILD_CIL:-0}" != 0; then + if test "${BUILD_CIL:-OFF}" != "OFF"; then # delete CIL package from the environment file echo "Deleting CIL from the environment file BUILD_CIL is set to >${BUILD_CIL}<" sed -r -i -e '/^\s*- (cil).*/d' environment-sirf.yml From a0e88711c0ea0d40c061815145001cb297886065 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Thu, 16 May 2024 12:27:59 +0000 Subject: [PATCH 12/22] update test to look for OFF --- Dockerfile | 2 +- docker/user_demos.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d715491c..dfa780cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ COPY docker/requirements.yml /opt/scripts/ RUN if test "$BUILD_GPU" != 0; then \ sed -ri 's/^(\s*)#\s*(- \S+.*#.*GPU.*)$/\1\2/' /opt/scripts/requirements.yml; \ fi \ - && if test "$BUILD_CIL" != 0; then \ + && if test "$BUILD_CIL" != "OFF"; then \ sed -r -i -e '/^\s*- (cil).*/d' /opt/scripts/requirements.yml; \ fi \ && conda config --env --set channel_priority strict \ diff --git a/docker/user_demos.sh b/docker/user_demos.sh index d6454049..47906f69 100755 --- a/docker/user_demos.sh +++ b/docker/user_demos.sh @@ -23,7 +23,7 @@ if [ "$PYTHON" = "miniconda" ]; then sed -r -e '/^\s*- (astra-toolbox|tigre).*/d' -e '/^\s*- \S+.*#.*GPU/d' environment.yml > environment-sirf.yml fi # do not install CIL from conda if BUILD_CIL is set - if test "${BUILD_CIL:-0}" != 0; then + if test "${BUILD_CIL:-"OFF"}" != "OFF"; then # delete CIL package from the environment file echo "Deleting CIL from the environment file BUILD_CIL is set to >${BUILD_CIL}<" sed -r -i -e '/^\s*- (cil).*/d' environment-sirf.yml From 0caafd351bb4851b1f726aa43d98a9d30bfc75ee Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Thu, 16 May 2024 17:39:19 +0000 Subject: [PATCH 13/22] updated SIRF and CIL tags --- version_config.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version_config.cmake b/version_config.cmake index 351089cb..1e385122 100644 --- a/version_config.cmake +++ b/version_config.cmake @@ -141,7 +141,7 @@ set(DEFAULT_STIR_TAG rel_6.0.0) ## SIRF set(DEFAULT_SIRF_URL https://github.com/SyneRBI/SIRF) -set(DEFAULT_SIRF_TAG d54c4550d1533132c6a281b6cf2159c8fd22f45c) # #1254 +set(DEFAULT_SIRF_TAG origin/master) ## pet-rd-tools set(DEFAULT_pet_rd_tools_URL https://github.com/UCL/pet-rd-tools) @@ -161,7 +161,7 @@ set(DEFAULT_JSON_TAG v3.11.3) # CCPi CIL # minimum supported version of CIL supported is > 22.1.0 or from commit a6062410028c9872c5b355be40b96ed1497fed2a set(DEFAULT_CIL_URL https://github.com/TomographicImaging/CIL) -set(DEFAULT_CIL_TAG b066d588dc6de0188fd33dafd8e5e669b7434b7e) # 13 May 2024 +set(DEFAULT_CIL_TAG 501726d8f09c16faef19ceb69b85c212db2eeca6) # 16 May 2024 set(DEFAULT_CCPi-Regularisation-Toolkit_URL https://github.com/TomographicImaging/CCPi-Regularisation-Toolkit) set(DEFAULT_CCPi-Regularisation-Toolkit_TAG "fix_3D_regularisers") From f7424c0c217ae3800e07ae4b9ed2d5cd8e420915 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Thu, 16 May 2024 21:54:59 +0000 Subject: [PATCH 14/22] update Changelog --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 2dbe6cf9..6894eda6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,7 @@ - only pass through `OpenMP*LIBRARY` variables if set, and add OpenMP_iomp_LIBRARY to the list (for Intel compiler) - Updated Versions: - SIRF (master): d54c4550d1533132c6a281b6cf2159c8fd22f45c - - CIL: b066d588dc6de0188fd33dafd8e5e669b7434b7e # 13 May 2024 + - CIL: 501726d8f09c16faef19ceb69b85c212db2eeca6 # 16 May 2024 - CCPi-Regularisation-Toolkit: fix_3D_regularisers branch - STIR: v6.1.0 From 6699a8a3713219edc806cf0995447b153c1122f9 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Sun, 19 May 2024 14:05:37 +0000 Subject: [PATCH 15/22] workaround for jupyterhub blasting our .bashrc --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dfa780cf..6575e2a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -104,7 +104,7 @@ RUN apt update -qq && apt install -yq --no-install-recommends \ && mkdir -p /usr/share/X11/xkb \ && test -e /usr/bin/X || ln -s /usr/bin/Xorg /usr/bin/X -RUN echo 'test -z "$OMP_NUM_THREADS" && export OMP_NUM_THREADS=$(python -c "import multiprocessing as mc; print(mc.cpu_count() // 2)")' > /usr/local/bin/before-notebook.d/omp_num_threads.sh +RUN echo 'test -z "$OMP_NUM_THREADS" && export OMP_NUM_THREADS=$(python -c "import multiprocessing as mc; print(mc.cpu_count() - 2)")' > /usr/local/bin/before-notebook.d/omp_num_threads.sh COPY --chown=${NB_USER} --chmod=644 --link docker/.bashrc /home/${NB_USER}/ # RUN sed -i s:PYTHON_INSTALL_DIR:${CONDA_DIR}:g /home/${NB_USER}/.bashrc @@ -132,4 +132,6 @@ ENV GADGETRON_RELAY_HOST="0.0.0.0" # run gadgetron in the background before start-notebook.py COPY --link --chown=${NB_USER} docker/start-gadgetron-notebook.sh /opt/scripts/ +# COPY --from=build --link --chown=${NB_USER} /opt/SIRF-SuperBuild/INSTALL/lib /opt/conda/lib +COPY --from=build --link --chown=${NB_USER} /opt/SIRF-SuperBuild/INSTALL/bin/env_sirf.sh /opt/conda/etc/conda/activate.d CMD ["/opt/scripts/start-gadgetron-notebook.sh"] From da65e19d5daf2452e1af0238ac98dfe3dd41a0bd Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 31 May 2024 11:48:56 +0100 Subject: [PATCH 16/22] bash: source once --- env_sirf.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/env_sirf.sh.in b/env_sirf.sh.in index 6726b1ef..7243b0b0 100755 --- a/env_sirf.sh.in +++ b/env_sirf.sh.in @@ -2,6 +2,7 @@ # Use it like this # source /path/to/whereever/env_ccppetmr.sh # Preferably add this line to your .basrhc, .profile or whatever file is appropriate for your shell +test -n "$SIRF_ENV_SOURCED" && return; SIRF_ENV_SOURCED=1 # pragma once SIRF_PATH=@SIRF_SOURCE_DIR@ export SIRF_PATH From 4f88a989b872cc074810282771f770d9da366442 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Mon, 3 Jun 2024 15:49:48 +0100 Subject: [PATCH 17/22] revert one line --- env_sirf.sh.in | 1 - 1 file changed, 1 deletion(-) diff --git a/env_sirf.sh.in b/env_sirf.sh.in index 7243b0b0..6726b1ef 100755 --- a/env_sirf.sh.in +++ b/env_sirf.sh.in @@ -2,7 +2,6 @@ # Use it like this # source /path/to/whereever/env_ccppetmr.sh # Preferably add this line to your .basrhc, .profile or whatever file is appropriate for your shell -test -n "$SIRF_ENV_SOURCED" && return; SIRF_ENV_SOURCED=1 # pragma once SIRF_PATH=@SIRF_SOURCE_DIR@ export SIRF_PATH From 7a0ac56d637db14fe1b6fd13a59946969f5282fa Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:24:24 +0100 Subject: [PATCH 18/22] update to newest CCPi code versions Co-authored-by: Casper da Costa-Luis --- docker/user_demos.sh | 2 +- version_config.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/user_demos.sh b/docker/user_demos.sh index c54a02e4..7bdef143 100755 --- a/docker/user_demos.sh +++ b/docker/user_demos.sh @@ -31,7 +31,7 @@ if test "${BUILD_CIL:-OFF}" != "OFF"; then else echo "Not deleting CIL from the environment file BUILD_CIL is set to >${BUILD_CIL}<" fi - conda env update --file environment-sirf.yml -v + conda env update --file environment-sirf.yml else if [ -f requirements.txt ]; then cat requirements.txt diff --git a/version_config.cmake b/version_config.cmake index 1bf34878..b806fb94 100644 --- a/version_config.cmake +++ b/version_config.cmake @@ -161,10 +161,10 @@ set(DEFAULT_JSON_TAG v3.11.3) # CCPi CIL # minimum supported version of CIL supported is > 22.1.0 or from commit a6062410028c9872c5b355be40b96ed1497fed2a set(DEFAULT_CIL_URL https://github.com/TomographicImaging/CIL) -set(DEFAULT_CIL_TAG 501726d8f09c16faef19ceb69b85c212db2eeca6) # 16 May 2024 +set(DEFAULT_CIL_TAG ccf17f393ba911d13b74f2327779dde030098fe6) # 28 May 2024 set(DEFAULT_CCPi-Regularisation-Toolkit_URL https://github.com/TomographicImaging/CCPi-Regularisation-Toolkit) -set(DEFAULT_CCPi-Regularisation-Toolkit_TAG "fix_3D_regularisers") +set(DEFAULT_CCPi-Regularisation-Toolkit_TAG "v24.0.1") # CERN ROOT set(DEFAULT_ROOT_URL https://github.com/root-project/root) From 1cb17ad7b106670aef3637f36eae92e6166915fa Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Thu, 6 Jun 2024 12:40:20 +0000 Subject: [PATCH 19/22] add cil requirements as we delete cil if BUILD_CIL=ON --- Dockerfile | 2 +- docker/requirements.yml | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6575e2a3..8376b35c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ RUN if test "$BUILD_GPU" != 0; then \ sed -ri 's/^(\s*)#\s*(- \S+.*#.*GPU.*)$/\1\2/' /opt/scripts/requirements.yml; \ fi \ && if test "$BUILD_CIL" != "OFF"; then \ - sed -r -i -e '/^\s*- (cil).*/d' /opt/scripts/requirements.yml; \ + sed -r -i -e '/^\s*- (cil|ccpi-regulariser).*/d' /opt/scripts/requirements.yml; \ fi \ && conda config --env --set channel_priority strict \ && for ch in defaults ccpi intel conda-forge; do conda config --env --add channels $ch; done \ diff --git a/docker/requirements.yml b/docker/requirements.yml index f359d32c..dd1ddada 100644 --- a/docker/requirements.yml +++ b/docker/requirements.yml @@ -18,9 +18,17 @@ dependencies: - deprecation - nose - pip - - cil # cil - - ccpi-regulariser # cil - - dxchange # cil + - cil # cil + - ccpi-regulariser # cil + - dxchange # cil + - h5py # cil + - pillow # cil + - olefile >=0.46 # cil + - pywavelets # cil + - cil-data >=21.3.0 # cil + - ipp >=2021.10 # cil + - tqdm # cil + - numba # cil # - tigre # cil (GPU) # - astra-toolbox # cil (GPU) - pip: From a73251d54709c133da563cc48f14a7a8bb58230a Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Thu, 6 Jun 2024 22:54:12 +0100 Subject: [PATCH 20/22] update changelog Co-authored-by: Casper da Costa-Luis --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index fbd33668..b5df2e3c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,7 +9,7 @@ - Updated Versions: - SIRF: v3.7.0 - CIL: 501726d8f09c16faef19ceb69b85c212db2eeca6 # 16 May 2024 - - CCPi-Regularisation-Toolkit: fix_3D_regularisers branch + - CCPi-Regularisation-Toolkit: v24.0.1 - STIR: v6.1.0 ## v3.6.0 From bd0f0905b1726c7912c762b9d79939a1708642bc Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 7 Jun 2024 14:30:08 +0100 Subject: [PATCH 21/22] min 1 thread --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8376b35c..40fa6012 100644 --- a/Dockerfile +++ b/Dockerfile @@ -104,7 +104,7 @@ RUN apt update -qq && apt install -yq --no-install-recommends \ && mkdir -p /usr/share/X11/xkb \ && test -e /usr/bin/X || ln -s /usr/bin/Xorg /usr/bin/X -RUN echo 'test -z "$OMP_NUM_THREADS" && export OMP_NUM_THREADS=$(python -c "import multiprocessing as mc; print(mc.cpu_count() - 2)")' > /usr/local/bin/before-notebook.d/omp_num_threads.sh +RUN echo 'test -z "$OMP_NUM_THREADS" && export OMP_NUM_THREADS=$(python -c "import multiprocessing as mc; print(max(1, mc.cpu_count() - 2))")' > /usr/local/bin/before-notebook.d/omp_num_threads.sh COPY --chown=${NB_USER} --chmod=644 --link docker/.bashrc /home/${NB_USER}/ # RUN sed -i s:PYTHON_INSTALL_DIR:${CONDA_DIR}:g /home/${NB_USER}/.bashrc From e89966685a1324ed71714b2aa64f9775ed561cf5 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Mon, 10 Jun 2024 11:06:45 +0100 Subject: [PATCH 22/22] Update CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index b5df2e3c..4804a120 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,7 @@ - only pass through `OpenMP*LIBRARY` variables if set, and add OpenMP_iomp_LIBRARY to the list (for Intel compiler) https://github.com/SyneRBI/SIRF-SuperBuild/pull/879 - Updated Versions: - SIRF: v3.7.0 - - CIL: 501726d8f09c16faef19ceb69b85c212db2eeca6 # 16 May 2024 + - CIL: ccf17f393ba911d13b74f2327779dde030098fe6 # 28 May 2024 - CCPi-Regularisation-Toolkit: v24.0.1 - STIR: v6.1.0