diff --git a/Dockerfile b/Dockerfile index 1e1316f8c2878784166da7e81d34d8093bc6dca0..d9e7a52a72ceab7efbf517956da7fc7f0b3f4f88 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,13 @@ ARG REGISTRY_URL FROM ${REGISTRY_URL}ubuntu:20.04 as builder -# Note : DOCKER_BUILDKIT=1 required # Reference : https://github.com/opencontainers/image-spec/blob/main/annotations.md -LABEL org.opencontainers.image.authors="aurore.dupuis@cnes.fr vincent.gaudissart@csgroup.eu" +LABEL org.opencontainers.image.authors="aurore.dupuis@cnes.fr vincent.gaudissart@csgroup.eu celine.raille@thalesgroup.com" LABEL org.opencontainers.image.description="LIS Build container" # Montage du volume temporaire et utilisation pour apt le site du cnes RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi && \ - apt-get update -y && \ + apt-get update -y && \ apt-get install -y ca-certificates #Ajout des certificats @@ -17,13 +16,15 @@ RUN update-ca-certificates # Install required packages RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi && \ - apt-get update -y --quiet && \ + apt-get update -y --quiet && \ + DEBIAN_FRONTEND=noninteractive apt-get install --quiet --yes --no-install-recommends software-properties-common && \ + add-apt-repository ppa:ubuntugis/ppa --yes && \ + apt-get update -y --quiet && \ DEBIAN_FRONTEND=noninteractive apt-get install --quiet --yes --no-install-recommends \ # basic system installs build-essential \ python3 \ wget \ - ca-certificates \ unzip \ # packages needed for compilation cmake \ @@ -31,15 +32,8 @@ RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /ka ninja-build \ python3-dev \ git\ + pkg-config \ python3-numpy \ - libgdal-dev \ - freeglut3-dev \ - libboost-date-time-dev \ - libboost-filesystem-dev \ - libboost-graph-dev \ - libboost-program-options-dev \ - libboost-system-dev \ - libboost-thread-dev \ libinsighttoolkit4-dev \ libopenthreads-dev \ libossim-dev \ @@ -49,11 +43,26 @@ RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /ka libfftw3-dev \ libgsl-dev \ libgtk-3-dev \ + mono-runtime-common \ + # GDAL \ + libgdal-dev \ + python3-gdal \ + gdal-bin \ && \ + DEBIAN_FRONTEND=noninteractive apt-get install --quiet --yes --no-install-recommends \ + # optional packages for OTB compilation + python3-vtkgdcm \ + libvtkgdcm-cil \ + libvtkgdcm-java \ + libgdcm-tools \ + && \ rm -rf /var/lib/apt/lists/* # Build OTB RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi && \ + ln -s /usr/lib/cli/vtkgdcm-sharp-3.0/libvtkgdcmsharpglue.so /usr/lib/x86_64-linux-gnu/libvtkgdcmsharpglue.so && \ + mkdir -p /usr/lib/python/dist-packages && \ + ln -s /usr/lib/python3/dist-packages/vtkgdcmPython.cpython-38-x86_64-linux-gnu.so /usr/lib/python/dist-packages/vtkgdcmPython.so && \ mkdir -p /root/otb-build/build && \ cd /root/otb-build && \ wget -q --ca-certificate=/usr/local/share/ca-certificates/ca-bundle.crt https://www.orfeo-toolbox.org/packages/archives/OTB/OTB-7.4.1.zip -O /tmp/OTB.zip && \ @@ -81,7 +90,7 @@ RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /ka # Build wxWidgets RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi && \ - mkdir -p /root/wxwidgets-build/ && \ + mkdir -p /root/wxwidgets-build/ && \ cd /root/wxwidgets-build && \ git clone --branch v3.2.2 https://github.com/wxWidgets/wxWidgets.git && \ cd wxWidgets && \ @@ -93,13 +102,13 @@ RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /ka # Build saga-gis RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi && \ - mkdir -p /root/saga-gis-build/ && \ + mkdir -p /root/saga-gis-build/ && \ cd /root/saga-gis-build && \ git clone --branch saga-8.4.2 https://github.com/saga-gis/saga-gis.git && \ mkdir saga-gis/build && cd saga-gis/build && \ cmake -DCMAKE_INSTALL_PREFIX=/install/saga -DCMAKE_PREFIX_PATH=/install/wxWidgets ../saga-gis && \ make install -j4 - + # Build LIS ADD . /LIS_src/ RUN ln -s /usr/bin/python3 /usr/bin/python && \ @@ -113,7 +122,7 @@ RUN ln -s /usr/bin/python3 /usr/bin/python && \ # Build DANS-GDAL scripts RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi && \ - mkdir -p /root/dans-build && \ + mkdir -p /root/dans-build && \ cd /root/dans-build && \ wget -q --ca-certificate=/usr/local/share/ca-certificates/ca-bundle.crt https://github.com/gina-alaska/dans-gdal-scripts/archive/refs/heads/master.zip -O /tmp/dans.zip && \ unzip /tmp/dans.zip && \ @@ -124,41 +133,48 @@ RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /ka make install && \ rm -rf /root/dans-build /tmp/dans.zip +# Keep GDAL dependencies from ppa +RUN mkdir -p /install/gdal/bin/ && \ + cp /usr/bin/gdal* /install/gdal/bin/ && \ + cp /usr/bin/ogr2ogr /install/gdal/bin/ && \ + mkdir -p /install/gdal/lib/x86_64-linux-gnu/ && \ + cp /usr/lib/libgdal* /install/gdal/lib/ && \ + cp /usr/lib/x86_64-linux-gnu/libodbc* /install/gdal/lib/x86_64-linux-gnu/ && \ + cp /usr/lib/x86_64-linux-gnu/libproj* /install/gdal/lib/x86_64-linux-gnu/ && \ + cp /usr/lib/x86_64-linux-gnu/libspatialite* /install/gdal/lib/x86_64-linux-gnu/ && \ + cp /usr/lib/x86_64-linux-gnu/*geotiff* /install/gdal/lib/x86_64-linux-gnu/ && \ + mkdir -p /install/gdal/lib/python3/dist-packages/ && \ + cp -r /usr/lib/python3/dist-packages/osgeo /install/gdal/lib/python3/dist-packages/ && \ + cp -r /usr/lib/python3/dist-packages/osgeo_utils /install/gdal/lib/python3/dist-packages/ ############################## #ARG REGISTRY_URL FROM ${REGISTRY_URL}ubuntu:20.04 -LABEL org.opencontainers.image.authors="aurore.dupuis@cnes.fr vincent.gaudissart@csgroup.eu" +LABEL org.opencontainers.image.authors="aurore.dupuis@cnes.fr vincent.gaudissart@csgroup.eu celine.raille@thalesgroup.com" LABEL org.opencontainers.image.description="LIS + OTB 7.4 Container" # system packages +COPY ./docker/packages.txt /tmp/packages.txt RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi && \ - apt-get update --quiet && \ - apt-get -y upgrade --quiet && \ + apt-get update -y --quiet && \ + apt-get upgrade -y --quiet && \ DEBIAN_FRONTEND=noninteractive apt-get install --quiet --yes --no-install-recommends \ python3 \ python-is-python3 \ python3-pip \ - python3-gdal \ python3-lxml \ - python3-numpy \ - gdal-bin \ file \ libpython3.8 \ - libinsighttoolkit4.13 \ - libopenthreads21 \ - libossim1 \ - libtinyxml2.6.2v5 \ - libmuparser2v5 \ - libmuparserx4.0.7 \ - libfftw3-3 \ - libgsl23 \ - libgslcblas0 \ - libgtk-3-0 \ - libpcre2-32-0 \ && \ + # dependencies packages + grep -e '^[^#]' /tmp/packages.txt | DEBIAN_FRONTEND=noninteractive xargs -d '\n' apt-get install --quiet --yes --no-install-recommends && \ rm -rf /var/lib/apt/lists/* + +# install GDAL from builder +COPY --from=builder /install/gdal/bin /usr/bin +COPY --from=builder /install/gdal/lib /usr/lib +COPY --from=builder /usr/share/proj /usr/share/proj # install OTB from builder COPY --from=builder /install/otb /usr/local @@ -172,7 +188,7 @@ COPY --from=builder /install/wxWidgets /usr/local # install saga-gis from builder COPY --from=builder /install/saga /usr/local -copy --from=builder /root/saga-gis-build/saga-gis/build/src/saga_core/saga_api/saga_api_python /usr/local/lib/python3.8/site-packages/ +COPY --from=builder /root/saga-gis-build/saga-gis/build/src/saga_core/saga_api/saga_api_python /usr/local/lib/python3.8/site-packages/ # install LIS from builder COPY --from=builder /install/lis /usr/local @@ -183,7 +199,7 @@ COPY --from=builder /install/dans /usr/local # Add additionnal dependancies RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi && \ - pip3 install \ + pip3 install \ --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org \ --no-cache-dir \ numpy \ diff --git a/docker/packages.txt b/docker/packages.txt new file mode 100644 index 0000000000000000000000000000000000000000..a4345748157e03f2942b96cce72294ad2f0b1e64 --- /dev/null +++ b/docker/packages.txt @@ -0,0 +1,39 @@ +# for OTB +libinsighttoolkit4.13 +libopenthreads21 +libossim1 +libtinyxml2.6.2v5 +libmuparser2v5 +libmuparserx4.0.7 +libfftw3-3 +libgsl23 +libgslcblas0 + +# for sagagis +libgtk-3-0 +libpcre2-32-0 + +# for gdal +libarmadillo9 +libheif1 +libpoppler97 +libjson-c4 +libfreexl1 +libqhull7 +libgeos-c1v5 +libkmlbase1 +libkmldom1 +libkmlengine1 +libxerces-c3.2 +libnetcdf15 +libhdf4-0-alt +libogdi4.1 +libgif7 +libcharls2 +libcfitsio8 +libpq5 +libdeflate0 +libfyba0 +libmysqlclient21 +libltdl7 +librttopo1 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2117556bcb505cadf7988fa04a0fc17366458881..b32c6529573aff009e00cb475ddb45fef3355881 100755 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -426,7 +426,7 @@ add_test(NAME snow_synthesis_compare_smod_test ) set_tests_properties(snow_synthesis_compare_smod_test PROPERTIES DEPENDS snow_synthesis_test) -if(NOT JENKINS_BUILD MATCHES "true") +if(NOT GITLAB_CI_BUILD MATCHES "true") add_test(NAME snow_synthesis_muscate_test COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/app/let_it_snow_synthesis.py -t T31TDJ @@ -455,7 +455,7 @@ add_test(NAME snow_synthesis_without_densification_test ) -if(NOT JENKINS_BUILD MATCHES "true") +if(NOT GITLAB_CI_BUILD MATCHES "true") # ---------------------------------- # Synthesis from 1.7 snow product # ----------------------------------