Switch dockerfile over from hysds image to ubuntu 20.04

LT1AB
Ryan Burns 2022-02-16 10:05:12 -08:00
parent a7ea79807d
commit b59c53f4df
2 changed files with 50 additions and 99 deletions

View File

@ -24,7 +24,7 @@ jobs:
mkdir config build install mkdir config build install
. /opt/conda/bin/activate root . /opt/conda/bin/activate root
conda install -y cython gdal h5py libgdal pytest numpy fftw scipy scons hdf4 hdf5 libgcc libstdcxx-ng cmake astropy pybind11 conda install -y cython gdal h5py libgdal pytest numpy fftw scipy scons hdf4 hdf5 libgcc libstdcxx-ng cmake astropy pybind11
yum install -y x11-devel motif-devel jq gcc-gfortran opencv opencv-devel opencv-python yum install -y libX11-devel motif-devel jq gcc-gfortran opencv-core
- run: - run:
name: Build and Install ISCE name: Build and Install ISCE
@ -82,7 +82,7 @@ jobs:
mkdir config build install mkdir config build install
. /opt/conda/bin/activate root . /opt/conda/bin/activate root
conda install --yes cython gdal h5py libgdal pytest numpy fftw scipy scons hdf4 hdf5 libgcc libstdcxx-ng cmake astropy pybind11 conda install --yes cython gdal h5py libgdal pytest numpy fftw scipy scons hdf4 hdf5 libgcc libstdcxx-ng cmake astropy pybind11
yum install -y uuid-devel x11-devel motif-devel jq gcc-gfortran opencv opencv-devel opencv-python yum install -y libuuid-devel libX11-devel motif-devel jq gcc-gfortran opencv-core
ln -s /opt/conda/bin/cython /opt/conda/bin/cython3 ln -s /opt/conda/bin/cython /opt/conda/bin/cython3
cd /opt/conda/lib cd /opt/conda/lib
unlink libuuid.so unlink libuuid.so

View File

@ -1,115 +1,66 @@
FROM hysds/dev:latest FROM ubuntu:20.04 as builder
# Set an encoding to make things work smoothly. # Set an encoding to make things work smoothly.
ENV LANG en_US.UTF-8 ENV LANG en_US.UTF-8
ENV TZ US/Pacific
ARG DEBIAN_FRONTEND=noninteractive
# Set ISCE repo
ENV ISCE_ORG isce-framework
# set to root user
USER root
# install tools for RPM generation
RUN set -ex \ RUN set -ex \
&& yum update -y \ && apt-get update \
&& yum groupinstall -y "development tools" \ && apt-get install -y \
&& yum install -y \ cmake \
make ruby-devel rpm-build rubygems \ cython3 \
&& gem install ffi -v 1.12.2 \ git \
&& gem install --no-ri --no-rdoc fpm -v 1.11.0 libfftw3-dev \
libgdal-dev \
# install isce requirements libhdf4-alt-dev \
RUN set -ex \ libhdf5-dev \
&& . /opt/conda/bin/activate root \ libopencv-dev \
&& conda install --yes \ ninja-build \
cython \ python3-gdal \
gdal \ python3-h5py \
git \ python3-numpy \
h5py \ python3-scipy \
libgdal \ && echo done
pytest \
numpy \
fftw \
scipy \
scons \
hdf4 \
hdf5 \
libgcc \
libstdcxx-ng \
cmake \
&& yum install -y uuid-devel x11-devel motif-devel jq \
opencv opencv-devel opencv-python \
&& ln -sf /opt/conda/bin/cython /opt/conda/bin/cython3 \
&& mkdir -p /opt/isce2/src
# override system libuuid into conda env to link in libXm and libXt
RUN set -ex \
&& cd /opt/conda/lib \
&& unlink libuuid.so \
&& unlink libuuid.so.1 \
&& ln -s /lib64/libuuid.so.1.3.0 libuuid.so \
&& ln -s /lib64/libuuid.so.1.3.0 libuuid.so.1
# install libgfortran.so.3 and create missing link
RUN set -ex \
&& yum install -y gcc-gfortran \
&& cd /lib64 \
&& ( test -f libgfortran.so || ln -sv libgfortran.so.*.* libgfortran.so )
# copy repo # copy repo
COPY . /opt/isce2/src/isce2 COPY . /opt/isce2/src/isce2
# build ISCE # build ISCE
RUN set -ex \ RUN set -ex \
&& . /opt/conda/bin/activate root \
&& cd /opt/isce2/src/isce2 \ && cd /opt/isce2/src/isce2 \
&& source docker/build_env.sh \ && mkdir build && cd build \
&& mkdir -p $BUILD_DIR \ && cmake .. \
&& cp docker/SConfigISCE configuration/SConfigISCE \ -DPYTHON_MODULE_DIR="$(python3 -c 'import site; print(site.getsitepackages()[-1])')" \
&& scons install \ -DCMAKE_INSTALL_PREFIX=install \
&& cp docker/isce_env.sh $ISCE_INSTALL_ROOT \ && make -j8 install \
&& cd /tmp \ && cpack -G DEB \
&& mkdir -p /tmp/rpm-build/opt \ && cp isce*.deb /tmp/
&& mv $ISCE_INSTALL_ROOT /tmp/rpm-build/opt \
&& curl -s https://api.github.com/repos/$ISCE_ORG/isce2/git/refs/heads/main \
> /tmp/rpm-build/opt/isce2/version.json \
&& hash=$(cat /tmp/rpm-build/opt/isce2/version.json | jq -r .object.sha) \
&& short_hash=$(echo $hash | cut -c1-5) \
&& fpm -s dir -t rpm -C /tmp/rpm-build --name isce \
--prefix=/ --version=2.3 --provides=isce \
--maintainer=piyush.agram@jpl.nasa.gov \
--description="InSAR Scientific Computing Environment v2 (${hash})"
FROM hysds/pge-base:latest FROM ubuntu:20.04
# Set an encoding to make things work smoothly. # Set an encoding to make things work smoothly.
ENV LANG en_US.UTF-8 ENV LANG en_US.UTF-8
ENV TZ US/Pacific
ARG DEBIAN_FRONTEND=noninteractive
# install ISCE from RPM
COPY --from=0 /tmp/isce-2.3-1.x86_64.rpm /tmp/isce-2.3-1.x86_64.rpm
# install isce and its minimal requirements
RUN set -ex \ RUN set -ex \
&& sudo /opt/conda/bin/conda install --yes \ && apt-get update \
gdal \ && apt-get install -y \
h5py \ libfftw3-3 \
libgdal \ libgdal26 \
pytest \ libhdf4-0 \
numpy \ libhdf5-103 \
fftw \ libopencv-core4.2 \
scipy \ libopencv-highgui4.2 \
hdf4 \ libopencv-imgproc4.2 \
hdf5 \ python3-gdal \
&& sudo yum update -y \ python3-h5py \
&& sudo yum install -y uuid-devel x11-devel motif-devel gcc-gfortran \ python3-numpy \
&& cd /opt/conda/lib \ python3-scipy \
&& sudo unlink libuuid.so \ && echo done
&& sudo unlink libuuid.so.1 \
&& sudo ln -s /lib64/libuuid.so.1.3.0 libuuid.so \ # install ISCE from DEB
&& sudo ln -s /lib64/libuuid.so.1.3.0 libuuid.so.1 \ COPY --from=builder /tmp/isce*.deb /tmp/isce2.deb
&& cd /lib64 \
&& ( test -f libgfortran.so || sudo ln -sv libgfortran.so.*.* libgfortran.so ) \ RUN dpkg -i /tmp/isce2.deb
&& sudo yum install -y /tmp/isce-2.3-1.x86_64.rpm \
&& sudo yum clean all \
&& sudo rm -rf /var/cache/yum \
&& sudo rm /tmp/isce-2.3-1.x86_64.rpm