diff --git a/TimeSeries/s2planetary.py b/TimeSeries/s2planetary.py index 800a80a559653128a8dcb110917a35f80315e225..a0de40366d7655da645181a4762821b2376245fa 100644 --- a/TimeSeries/s2planetary.py +++ b/TimeSeries/s2planetary.py @@ -7,7 +7,7 @@ import rasterio import rasterio.mask from osgeo import ogr from pyproj import Transformer as T -from shapely import Polygon +from shapely.geometry import Polygon import tqdm def fetch(shp, dt, output_fld, band_list=None): diff --git a/docker/dockerfile.otb b/docker/dockerfile similarity index 83% rename from docker/dockerfile.otb rename to docker/dockerfile index 36ce85bd8a3b8a68ac5054e40dde27f41efb5f2a..cb1850284e5c9d25bfb3dec09b9e28c38a34a7de 100644 --- a/docker/dockerfile.otb +++ b/docker/dockerfile @@ -1,12 +1,11 @@ ARG BASE_IMG=ubuntu:20.04 # Base image can be either focal (20.04) or bionic (18.04) and descendants FROM $BASE_IMG -LABEL description="A base image with OTB and remote modules for the MORINGAv2 platform, CIRAD/UMR TETIS" +LABEL description="An image for the MORINGAv2 platform including a specific OTB build, CIRAD/UMR TETIS" +LABEL maintainer="Raffaele GAETANO" WORKDIR /tmp -ARG DEPS_INSTALL_PREFIX=/opt/otb - # Install build dependencies RUN apt-get update \ && export DEBIAN_FRONTEND=noninteractive \ @@ -47,18 +46,16 @@ RUN mkdir /tmp/SuperBuild-archives /tmp/build /opt/otb \ && cd SuperBuild-archives \ && OTB_VERSION=$(head -n1 /tmp/otb/RELEASE_NOTES.txt | sed -r 's/OTB-v ([0-9].[0-9]).[0-9] -.*/\1/') \ && curl -s "https://www.orfeo-toolbox.org/packages/archives/OTB/SuperBuild-archives-$OTB_VERSION.tar.bz2" \ - | tar -xjv --exclude 'q*' --exclude '*gl*' - -RUN cd /tmp/build \ + | tar -xjv --exclude 'q*' --exclude '*gl*' \ + && cd /tmp/build \ && OTB_CMAKE_FLAGS=$(cat "../build-flags-otb.txt") \ && cmake /tmp/otb/SuperBuild \ $OTB_CMAKE_FLAGS \ -DCMAKE_BUILD_TYPE="Release" \ -DDOWNLOAD_LOCATION=/tmp/SuperBuild-archives \ -DCMAKE_INSTALL_PREFIX=/opt/otb \ - && make OTB_DEPENDS -j20 - -RUN cd /tmp/otb/Modules/Remote \ + && make OTB_DEPENDS -j7 \ + && cd /tmp/otb/Modules/Remote \ && rm -f otbGRM.remote.cmake \ && git clone "https://gitlab.irstea.fr/remi.cresson/GRM.git" \ && git clone -b disassembled "https://gitlab.irstea.fr/remi.cresson/LSGRM.git" \ @@ -89,12 +86,11 @@ RUN cd /tmp/otb/Modules/Remote \ -DModule_SertitObject=OFF \ -DOTB_WRAP_PYTHON=ON \ -DPYTHON_EXECUTABLE=/usr/bin/python3 \ - -DCMAKE_INSTALL_PREFIX=/opt/otb - -RUN sed -i 's/SetDocName/\/\/SetDocName/g' /tmp/otb/Modules/Remote/OTBPhenology/app/otbSigmoFitting.cxx \ + -DCMAKE_INSTALL_PREFIX=/opt/otb \ + && sed -i 's/SetDocName/\/\/SetDocName/g' /tmp/otb/Modules/Remote/OTBPhenology/app/otbSigmoFitting.cxx \ && sed -i 's/SetDocName/\/\/SetDocName/g' /tmp/otb/Modules/Remote/otb-slic/app/otbSLIC.cxx \ && cd /tmp/build \ - && make -j20 \ + && make -j7 \ && rm -rf /tmp/* /root/.cache /opt/otb/bin/otbgui_* # Persistent environment variables @@ -104,3 +100,19 @@ ENV LD_LIBRARY_PATH="/opt/otb/lib:$LD_LIBRARY_PATH" ENV OTB_APPLICATION_PATH="/opt/otb/lib/otb/applications" ENV PROJ_LIB="$DEPS_INSTALL_PREFIX/share/proj" ENV GDAL_DATA="$DEPS_INSTALL_PREFIX/share/gdal" + +RUN useradd -s /bin/bash -m ubuntu +USER ubuntu +WORKDIR /home/ubuntu + +RUN pip install gdal==3.4.2 \ + rasterio \ + geopandas \ + scikit-learn \ + scikit-image \ + psutil \ + planetary_computer \ + theia_picker + +RUN mkdir moringav2 +COPY --chown=ubuntu . /home/ubuntu/moringav2 \ No newline at end of file diff --git a/docker/dockerfile.moringa b/docker/dockerfile.moringa deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000