Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update CIL and CCPi-Regularisation version and reinstate tests #897

Merged
merged 25 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
687a1de
update CIL and CCPi-Regularisation version and reinstate tests
paskino May 13, 2024
e311b86
update build command
paskino May 13, 2024
f13ab94
update SIRF tags
paskino May 13, 2024
0123256
test if ROOT errors are due to GCC 11
paskino May 13, 2024
e3d4115
update Changelog
paskino May 14, 2024
4b19647
install cil from source if BUILD_CIL=ON and not from conda
paskino May 15, 2024
711ce31
install CIL via conda if BUILD_CIL=OFF
paskino May 15, 2024
1b88642
this works
paskino May 15, 2024
65e2d70
remove CIL if BUILD_CIL=ON
paskino May 15, 2024
1466410
removed partial comment
paskino May 15, 2024
6a0bf4b
fix BUILD_CIL value handling
casperdcl May 16, 2024
a0e8871
update test to look for OFF
paskino May 16, 2024
d6ab950
Merge branch 'bump_cil_modules' of github.com:SyneRBI/SIRF-SuperBuild…
paskino May 16, 2024
0caafd3
updated SIRF and CIL tags
paskino May 16, 2024
e6a0c65
Merge remote-tracking branch 'origin' into bump_cil_modules
paskino May 16, 2024
f7424c0
update Changelog
paskino May 16, 2024
6699a8a
workaround for jupyterhub blasting our .bashrc
paskino May 19, 2024
c8f6e65
Merge branch 'master' into bump_cil_modules
KrisThielemans May 31, 2024
da65e19
bash: source once
casperdcl May 31, 2024
4f88a98
revert one line
casperdcl Jun 3, 2024
7a0ac56
update to newest CCPi code versions
paskino Jun 6, 2024
1cb17ad
add cil requirements as we delete cil if BUILD_CIL=ON
paskino Jun 6, 2024
a73251d
update changelog
paskino Jun 6, 2024
bd0f090
min 1 thread
casperdcl Jun 7, 2024
e899666
Update CHANGES.md
casperdcl Jun 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# ChangeLog

## v3.7.0

- 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) https://github.com/SyneRBI/SIRF-SuperBuild/pull/879
- updated versions:
- Updated Versions:
- SIRF: v3.7.0
- CIL: 501726d8f09c16faef19ceb69b85c212db2eeca6 # 16 May 2024
casperdcl marked this conversation as resolved.
Show resolved Hide resolved
- CCPi-Regularisation-Toolkit: fix_3D_regularisers branch
paskino marked this conversation as resolved.
Show resolved Hide resolved
- STIR: v6.1.0

## v3.6.0
Expand Down
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" != "OFF"; 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 \
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -99,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
casperdcl marked this conversation as resolved.
Show resolved Hide resolved

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
Expand All @@ -110,8 +115,9 @@ 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 bash /opt/scripts/user_demos.sh \
RUN BUILD_CIL="${BUILD_CIL}" bash /opt/scripts/user_demos.sh \
casperdcl marked this conversation as resolved.
Show resolved Hide resolved
&& fix-permissions /opt/SIRF-Exercises /opt/CIL-Demos "${CONDA_DIR}" /home/${NB_USER}

# docker-stacks notebook
Expand All @@ -126,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
casperdcl marked this conversation as resolved.
Show resolved Hide resolved
CMD ["/opt/scripts/start-gadgetron-notebook.sh"]
2 changes: 1 addition & 1 deletion SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion SuperBuild/External_CCPi-Regularisation-Toolkit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions SuperBuild/External_CIL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
11 changes: 10 additions & 1 deletion docker/user_demos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ 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:-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
casperdcl marked this conversation as resolved.
Show resolved Hide resolved
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
paskino marked this conversation as resolved.
Show resolved Hide resolved
else
if [ -f requirements.txt ]; then
cat requirements.txt
Expand Down
6 changes: 3 additions & 3 deletions version_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 501726d8f09c16faef19ceb69b85c212db2eeca6) # 16 May 2024
paskino marked this conversation as resolved.
Show resolved Hide resolved

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")
paskino marked this conversation as resolved.
Show resolved Hide resolved

# CERN ROOT
set(DEFAULT_ROOT_URL https://github.com/root-project/root)
Expand Down
Loading