From 1ffab03e174e72f410633aeb956744a58c4e7424 Mon Sep 17 00:00:00 2001 From: Pablo Speciale Date: Tue, 6 Feb 2024 22:35:04 +0100 Subject: [PATCH] update with main branch modifications --- Dockerfile | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b9c5469..18c1c9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ ARG UBUNTU_VERSION=22.04 -ARG NVIDIA_CUDA_VERSION=12.3.1 -FROM nvidia/cuda:${NVIDIA_CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} as builder +FROM ubuntu:${UBUNTU_VERSION} as builder ENV QT_XCB_GL_INTEGRATION=xcb_egl @@ -36,7 +35,40 @@ RUN apt-get install -y --no-install-recommends --no-install-suggests wget && \ -DCMAKE_INSTALL_PREFIX=/ceres_installed && \ ninja install RUN cp -r /ceres_installed/* /usr/local/ + # Build pyceres. -ADD . /pyceres +COPY . /pyceres WORKDIR /pyceres -RUN pip install . -vv +RUN pip install --upgrade pip +RUN pip wheel . --no-deps -w dist-wheel -vv && \ + whl_path=$(find dist-wheel/ -name "*.whl") && \ + echo $whl_path >dist-wheel/whl_path.txt + + +# +# Runtime stage. +# +FROM ubuntu:${UBUNTU_VERSION} as runtime + +# Install minimal runtime dependencies. +RUN apt-get update && \ + apt-get install -y --no-install-recommends --no-install-suggests \ + libgoogle-glog0v5 \ + libspqr2 \ + libcxsparse3 \ + libatlas3-base \ + python-is-python3 \ + python3-minimal \ + python3-pip + +# Copy installed library in the builder stage. +COPY --from=builder /ceres_installed/ /usr/local/ + +# Install pyceres. +COPY --from=builder /pyceres/dist-wheel /tmp/dist-wheel +RUN pip install --upgrade pip +RUN cd /tmp && whl_path=$(cat dist-wheel/whl_path.txt) && pip install $whl_path +RUN rm -rfv /tmp/* + +# # Verify if pyceres library is accessible from python. +RUN python -c "import pyceres"