Skip to content

Commit 56f0a89

Browse files
paskinocasperdcl
andauthored
GHA: Update base docker image for docker (#2348)
* docker: drop channel priority * docker: bump image base - fixes #2066 * tests: reduce precision * CIL_FORCE_IPP * set supported TIGRE version --------- Co-authored-by: Casper da Costa-Luis <casper.dcl@physics.org>
1 parent 5d46550 commit 56f0a89

6 files changed

Lines changed: 18 additions & 11 deletions

File tree

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
# - https://github.com/TomographicImaging/CIL#installation-of-cil
44
# consumers:
55
# - harbor.stfc.ac.uk/imaging-tomography/cil
6-
FROM jupyter/tensorflow-notebook:ubuntu-22.04
6+
FROM quay.io/jupyter/tensorflow-notebook:ubuntu-24.04
77
LABEL org.opencontainers.image.source=https://github.com/TomographicImaging/CIL
88
# tigre: BSD-3-Clause, astra-toolbox: GPL-3.0
99
LABEL org.opencontainers.image.licenses="Apache-2.0 AND BSD-3-Clause AND GPL-3.0"
1010

11+
# CUDA-specific packages
12+
ARG CIL_EXTRA_PACKAGES="ccpi::tigre=3.1.3 astra-toolbox::astra-toolbox=2.4"
1113
# build & runtime dependencies
12-
# TODO: sync scripts/create_local_env_for_cil_development.sh, scripts/cil_development.yml, recipe/meta.yaml (e.g. missing libstdcxx-ng _openmp_mutex pip)?
13-
# vis. https://github.com/TomographicImaging/CIL/pull/1590
14+
# TODO: sync scripts/cil_development.yml, recipe.yaml
1415
COPY --chown="${NB_USER}" scripts/cil_development.yml environment.yml
15-
# channel_priority: https://stackoverflow.com/q/58555389
16-
RUN for pkg in 'jupyter-server-proxy>4.1.0' $CIL_EXTRA_PACKAGES; do echo " - $pkg" >> environment.yml; done \
17-
&& conda config --env --set channel_priority strict \
18-
&& for ch in defaults nvidia ccpi astra-toolbox conda-forge; do conda config --env --add channels $ch; done \
19-
&& mamba env update -n base \
16+
RUN sed -ri '/tigre|astra-toolbox| python /d' environment.yml \
17+
&& for pkg in 'jupyter-server-proxy>4.1.0' $CIL_EXTRA_PACKAGES; do echo " - $pkg" >> environment.yml; done \
18+
&& mamba env update -n base -f environment.yml \
2019
&& mamba clean -a -y -f \
2120
&& rm environment.yml \
2221
&& fix-permissions "${CONDA_DIR}" /home/${NB_USER}
@@ -26,5 +25,6 @@ ENV TENSORBOARD_PROXY_URL=/user-redirect/proxy/6006/
2625

2726
# build & install CIL
2827
COPY --chown="${NB_USER}" . src
28+
ENV CIL_FORCE_IPP=ON
2929
RUN pip install ./src && rm -rf src \
3030
&& fix-permissions "${CONDA_DIR}" /home/${NB_USER}

Wrappers/Python/test/test_algorithms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,7 @@ def test_initialization_with_params(self):
19371937
def test_set_up(self):
19381938
lsqr = LSQR(initial=self.initial, operator=self.Aop, data=self.bop, alpha=0.5)
19391939
beta = (self.bop -self.Aop.direct(self.initial)).norm()
1940-
self.assertAlmostEqual(lsqr.beta, beta, 5 )
1940+
self.assertAlmostEqual(lsqr.beta, beta, 4)
19411941
self.assertAlmostEqual(lsqr.phibar, beta, 5 )
19421942
self.assertAlmostEqual(lsqr.normr, beta, 5 )
19431943
alpha = self.Aop.adjoint((self.bop -self.Aop.direct(self.initial))/beta).norm()

Wrappers/Python/test/test_wavelets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def test_wavelet_adjoint(self):
232232
ip1 = c.dot(W.direct(x))
233233
ip2 = x.dot(W.adjoint(c))
234234
M = x.norm() # Normalization
235-
self.assertAlmostEqual(ip1/M, ip2/M, places=5, msg="Periodization convolution should be closest to true adjoint")
235+
self.assertAlmostEqual(ip1/M, ip2/M, 4, msg="Periodization convolution should be closest to true adjoint")
236236

237237
def test_WaveletOperator_norm(self):
238238
n = 64
@@ -336,4 +336,4 @@ def test_L1Sparsity_complex_input(self):
336336

337337

338338
if __name__ == "__main__":
339-
unittest.main()
339+
unittest.main()

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ sdist.include = ["Wrappers/Python/cil/version.py"]
1515
sdist.exclude = ["scripts", "docs", "Wrappers/Python/data", "Wrappers/Python/test", ".*"]
1616
[tool.scikit-build.wheel.packages]
1717
cil = "Wrappers/Python/cil"
18+
[tool.scikit-build.cmake.define]
19+
CIL_FORCE_IPP = {env="CIL_FORCE_IPP", default="OFF"}
1820

1921
[tool.setuptools]
2022
package-dir = {"" = "Wrappers/Python"}

recipe.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ build:
2828
env:
2929
CMAKE_BUILD_TYPE: Release
3030
CMAKE_GENERATOR: Ninja
31+
CIL_FORCE_IPP: ${{ "ON" if x86_64 else "OFF" }}
3132

3233
requirements:
3334
build:

src/Core/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ else()
5151
endif()
5252

5353
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
54+
option(CIL_FORCE_IPP "Force CIL to use IPP" OFF)
5455
find_package(IPP)
56+
if(CIL_FORCE_IPP AND NOT IPP_FOUND)
57+
message(FATAL_ERROR "CIL_FORCE_IPP and NOT IPP_FOUND")
58+
endif()
5559

5660
list(APPEND cilacc_SOURCES utilities.cpp axpby.cpp FiniteDifferenceLibrary.cpp)
5761
list(APPEND cilacc_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include)

0 commit comments

Comments
 (0)