Dockerfile 3.73 KB
Newer Older
1
FROM centos:7 as centos-mambaforge
Marco Kurzynski's avatar
Marco Kurzynski committed
2
3
RUN touch /etc/sysconfig/64bit_strstr_via_64bit_strstr_sse2_unaligned
RUN yum -y update
Marco Kurzynski's avatar
Marco Kurzynski committed
4
5
RUN curl -L -O https://github.com/conda-forge/miniforge/releases/download/4.10.3-5/Mambaforge-4.10.3-5-Linux-x86_64.sh
RUN bash Mambaforge-4.10.3-5-Linux-x86_64.sh -b
6
ENV PATH="/root/mambaforge/bin:${PATH}"
Marco Kurzynski's avatar
Marco Kurzynski committed
7
8

# setup image
9
FROM centos-mambaforge as setup
Denny Hackel's avatar
Denny Hackel committed
10
11
12
MAINTAINER Denny Hackel (denny.hackel@ssec.wisc.edu)

# Install dependencies
William Roberts's avatar
William Roberts committed
13
RUN yum -y update
14
15
RUN yum -y install epel-release \
 && yum -y install netcdf-fortran-devel
16
17
18
RUN yum -y install glibc-devel
RUN yum -y install make glibc-static
RUN yum -y install libgfortran-static libquadmath-static
William Roberts's avatar
William Roberts committed
19
RUN yum -y install python36 gcc-gfortran
20
21
RUN yum -y install swig gcc-c++ glibc-headers python3-devel
RUN yum -y install libstdc++-devel git unzip
22
RUN mamba install -y -c conda-forge python=3.8 conda-pack netCDF4
23
24

# Add ssh keys and known hosts
Marco Kurzynski's avatar
Marco Kurzynski committed
25
COPY .ssh /root/.ssh
26
RUN ssh-keyscan gitlab.ssec.wisc.edu > /root/.ssh/known_hosts
27
# This is needed on some systems due to security measures.
28
RUN chmod -R 700 /root/.ssh
29
30

# Get source code.
William Roberts's avatar
William Roberts committed
31
RUN git clone --depth 1 -b m64_r20200617 git@gitlab.ssec.wisc.edu:aeri/ifg_ret.git
32
RUN git clone --depth 1 -b m64_r20210721 git@gitlab.ssec.wisc.edu:aeri/ifg_tools.git
33
RUN git clone --depth 1 -b m64_r20211123 git@gitlab.ssec.wisc.edu:cphillips/aeri_quality_control.git
34
RUN git clone --depth 1 -b m64_r20200630 git@gitlab.ssec.wisc.edu:cphillips/aeri_tools.git
35
RUN git clone --depth 1 -b m64_r20211123 git@gitlab.ssec.wisc.edu:aeri/ifg_aeri.git
36

37
# The following directories just need to be in the same directory.
Marco Kurzynski's avatar
Marco Kurzynski committed
38
RUN mv /ifg_aeri/py/nli /root/nli
39
40
41
42
RUN mv /ifg_tools/dev/libutil /root/libutil
RUN mv /ifg_tools/dev/ohwhio /root/ohwhio
RUN mv /ifg_tools/dev/dmv /root/dmv
RUN mv /ifg_ret/AERI/dev/maerisst /root/maerisst
43
44
RUN mv /ifg_tools/dev/ohwhiopp /root/ohwhiopp
RUN mv /ifg_tools/dev/dmv-ncdf /root/dmv-ncdf
Denny Hackel's avatar
Denny Hackel committed
45

46
# Build maerisst source code.
47
RUN cd /root/ohwhio; make -f makefile
Marco Kurzynski's avatar
Marco Kurzynski committed
48
# dmv needs to be in the same directory as ohwhio in order to make.
49
RUN cd /root/libutil; make -f makefile
50
# Only need maerisst.exe.
Marco Kurzynski's avatar
Marco Kurzynski committed
51
RUN cd /root/maerisst; make -f makefile
52

53
54
55
56
# Build dmv-ncdf as a dynamic executable
RUN cd /root/ohwhiopp; make libohwhiopp.a
RUN cd /root/dmv-ncdf; make 

57
58
59
# dmv needs to be in the same directory as ohwhio in order to make.
RUN cd /root/dmv; make python3

Marco Kurzynski's avatar
Marco Kurzynski committed
60
61
62
63
# Install dependencies.
RUN cd /root/dmv; pip install .
RUN cd /root/nli; pip install .
RUN cd /aeri_tools; pip install .
64
65
66
RUN cd /aeri_quality_control; pip install .

COPY cal_val /root/cal_val
Marco Kurzynski's avatar
Marco Kurzynski committed
67
RUN cd /root/cal_val; pip install .
68
69

COPY utils /root/utils
70
RUN cd /root/utils; pip install .
71
72

COPY tests/test_suite.sh /root/test_suite.sh
Marco Kurzynski's avatar
Marco Kurzynski committed
73
74
75

# Credit: https://pythonspeed.com/articles/conda-docker-image-size
# tarball conda environment to reduce size and increase portability
76
77
78
RUN conda-pack -o /root/aeri_armory_env.tar && \
  mkdir /root/aeri_armory_env && cd /root/aeri_armory_env && tar xf /root/aeri_armory_env.tar
RUN /root/aeri_armory_env/bin/conda-unpack
Marco Kurzynski's avatar
Marco Kurzynski committed
79
80

# deployment image
William Roberts's avatar
William Roberts committed
81
FROM centos:7
82
MAINTAINER Denny Hackel (denny.hackel@ssec.wisc.edu)
William Roberts's avatar
William Roberts committed
83
ARG AERI_ARMORY_VERSION
Marco Kurzynski's avatar
Marco Kurzynski committed
84
RUN touch /etc/sysconfig/64bit_strstr_via_64bit_strstr_sse2_unaligned
Denny Hackel's avatar
Denny Hackel committed
85

Marco Kurzynski's avatar
Marco Kurzynski committed
86
87
88
# setup python env
ENV VIRTUAL_ENV="/aeri_armory_env"
ENV PATH="$VIRTUAL_ENV/bin:${PATH}"
89
ENV PYTHONWARNINGS=ignore
William Roberts's avatar
William Roberts committed
90
91
# Must be in vX.X format to get an image made.
ENV AERI_ARMORY_VERSION="${AERI_ARMORY_VERSION}"
Denny Hackel's avatar
Denny Hackel committed
92

William Roberts's avatar
William Roberts committed
93
94
95
RUN yum -y update
RUN yum -y install epel-release
RUN yum -y install seq nano vim libgfortran netcdf-fortran-devel
96

97
# Get all files from setup stage.
98
COPY --from=setup /root/dmv-ncdf/dmv-ncdf /bin
99
COPY --from=setup /root/maerisst/maerisst.exe /bin
100
101
COPY --from=setup /root/test_suite.sh /bin
COPY --from=setup /root/aeri_armory_env /aeri_armory_env
Denny Hackel's avatar
Denny Hackel committed
102

103
RUN chmod -R +x /bin
104
105

COPY README.md /README.md