From 4e869ea35e9366b15bfd8a376c332c2ea01acd41 Mon Sep 17 00:00:00 2001 From: Jordan Alexis Caraballo-Vega Date: Mon, 30 Sep 2024 11:39:45 -0400 Subject: [PATCH] Update Dockerfile.cpu --- requirements/Dockerfile.cpu | 91 ++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/requirements/Dockerfile.cpu b/requirements/Dockerfile.cpu index f4ab88c..fa1fc74 100644 --- a/requirements/Dockerfile.cpu +++ b/requirements/Dockerfile.cpu @@ -1,6 +1,12 @@ -# Import RAPIDS container as the BASE Image (cuda base image) +# vhr-toolkit combined container FROM ghcr.io/osgeo/gdal:ubuntu-full-3.9.1 +# Arguments to pass to the image +ARG VERSION=latest +ARG FROM_IMAGE=nasanccs/vhr-cloudmask +ARG STEREO_URL="https://github.com/NeoGeographyToolkit/StereoPipeline/releases/download/2.7.0/StereoPipeline-2.7.0-2020-07-29-x86_64-Linux.tar.bz2" +ARG PROJECT_PATH="/usr/local/ilab" + # Environment ENV PYTHONPATH="$PYTHONPATH:/usr/local/ilab" # why is this?????? really bad practice @@ -9,6 +15,50 @@ ENV REDIS_PORT="6379" ENV REDIS_FILE="/etc/profile.d/redis_server.sh" ENV REDIS_PORTS=$REDIS_PORT +# Ubuntu needs noninteractive to be forced +ENV DEBIAN_FRONTEND=noninteractive +ENV CPLUS_INCLUDE_PATH="/usr/include/gdal" +ENV C_INCLUDE_PATH="/usr/include/gdal" +ENV PROJ_LIB="/usr/share/proj" +ENV PROJ_DATA="/usr/share/proj" +ENV SM_FRAMEWORK="tf.keras" +ENV PYTHONPATH="/usr/local/lib/python3.8/dist-packages" +ENV PYTHONPATH="$PYTHONPATH:/usr/local/ilab" + +# 7/19/24 - Combine PYTHONPATH for all 3 apps +ENV PYTHONPATH="$PYTHONPATH:/usr/local/ilab/vhr-cloudmask:/usr/local/ilab/evhr:/usr/local/ilab/core:/usr/local/ilab/srlite/srlite:/usr/local/ilab/srlite" +ENV PYTHONPATH="$PYTHONPATH:/opt/DgStereo/pygeotools:/opt/DgStereo/dgtools" +ENV PYTHONPATH="$PYTHONPATH:/opt/DgStereo/pygeotools:/opt/DgStereo/dgtools" +ENV PATH="$PATH:/opt/DgStereo/dgtools:/opt/DgStereo/pygeotools:/opt/DgStereo/dgtools/dgtools:/opt/StereoPipeline/bin:/opt/DgStereo/evhr" +ENV REDIS_PORT="6379" + +# System dependencies +RUN apt-get update && apt-get -y dist-upgrade && \ + apt-get -y install \ + build-essential \ + # EVHR system dependencies + parallel \ + libdatetime-perl \ + gawk \ + util-linux \ + bc \ + # SRLite system dependencies + python3-tk \ + tk-dev \ + libgdbm-dev \ + libc6-dev \ + libbz2-dev \ + libffi-dev \ + zlib1g-dev \ + liblzma-dev \ + libgirepository1.0-dev \ + libcairo2-dev \ + pkg-config \ + python3-dev \ + gir1.2-gtk-3.0 && \ + apt-get -y autoremove && \ + rm -rf /var/cache/apt /var/lib/apt/lists/* + RUN PROJECT_PATH="/usr/local/ilab" && \ REDIS_FILE="/etc/profile.d/redis_server.sh" && \ echo $PROJECT_PATH && \ @@ -85,7 +135,41 @@ RUN export pyVer=`python --version | awk -F' ' '{print $2}' | awk -F'.' '{print echo "redis-server --daemonize yes --port \$REDIS_PORT" >> $REDIS_FILE; && \ echo "export SINGULARITYENV_REDIS_PORTS=\$REDIS_PORT" >> $REDIS_FILE; && \ chmod +x $REDIS_FILE; - + +RUN mkdir -p "/usr/local/ilab" /opt/DgStereo && \ + # EVHR System Dependencies + wget "https://github.com/NeoGeographyToolkit/StereoPipeline/releases/download/2.7.0/StereoPipeline-2.7.0-2020-07-29-x86_64-Linux.tar.bz2" -O /opt/StereoPipeline.tar.bz2 && \ + cd /opt && \ + tar -jxf StereoPipeline.tar.bz2 && \ + rm /opt/StereoPipeline.tar.bz2 && \ + mv /opt/StereoPipeline* /opt/StereoPipeline && \ + pip install redis && \ + pip install celery[redis] && \ + # EVHR DEM Dependencies + git clone https://github.com/nasa-nccs-hpda/evhr-dgtools.git /opt/DgStereo/dgtools && \ + git clone https://github.com/nasa-nccs-hpda/evhr-imview.git /opt/DgStereo/imview && \ + git clone https://github.com/nasa-nccs-hpda/evhr-pygeotools.git /opt/DgStereo/pygeotools && \ + git clone https://github.com/nasa-nccs-hpda/evhr-dem.git /opt/DgStereo/evhr && \ + printf "crane103\ncrane104\ncrane105\ncrane106\n\n" > /opt/DgStereo/nodeList.txt && \ + chmod 755 -R /opt/* && \ + pip install 2to3 psycopg2-binary && \ + 2to3 -w /opt/DgStereo && \ + chmod +wx /lib/x86_64-linux-gnu/libc.so.6 && \ + git clone --single-branch --branch main https://github.com/nasa-nccs-hpda/core.git \ + /usr/local/ilab/core && \ + git clone --single-branch --branch main https://github.com/nasa-nccs-hpda/evhr.git \ + /usr/local/ilab/evhr && \ + chmod a+rwx -R /usr/local/ilab/* && \ + # SR-Lite Git Dependencies + pip install plotnine==0.10.1 && \ + pip install --upgrade pylr2 && \ + git clone --single-branch --branch main https://github.com/nasa-nccs-hpda/srlite.git \ + /usr/local/ilab/srlite && \ + chmod a+rwx -R /usr/local/ilab/* && \ + # CCDC System Dependencies + git clone --single-branch --branch main https://github.com/nasa-nccs-hpda/pyCCDC.git \ + /usr/local/ilab/pyCCDC + #%runscript # /bin/bash -c "source /etc/profile.d/redis_server.sh" # exec "$@" @@ -98,3 +182,6 @@ RUN export pyVer=`python --version | awk -F' ' '{print $2}' | awk -F'.' '{print # # -------------------------------------------------------------------------- # +HEALTHCHECK NONE +ENTRYPOINT [] +CMD ["/bin/bash"]