gms_preprocessing_ci.docker 2.8 KB
Newer Older
Daniel Scheffler's avatar
Daniel Scheffler committed
1
2
FROM centos:7
RUN yum update -y && \
3
    yum install -y wget vim bzip2 gcc gcc-c++ make libgl1-mesa-glx mesa-libGL qt5-qtbase-gui git gdb
Daniel Scheffler's avatar
Daniel Scheffler committed
4

Daniel Scheffler's avatar
Daniel Scheffler committed
5
ENV anaconda_dl 'Anaconda3-5.0.0-Linux-x86_64.sh'
Daniel Scheffler's avatar
Daniel Scheffler committed
6
7
8
9
10
RUN /bin/bash -i -c "cd /root; wget https://repo.continuum.io/archive/$anaconda_dl ; \
    bash -i /root/$anaconda_dl -b ; \
    rm -f /root/$anaconda_dl"

# 'conda install --yes -c conda-forge 'icu=58.*' lxml' fixing a bug for conda-forge gdal build, as of 06/2017
11
# holoviews and bokeh is only needed for geoarray because its not installable via pip during geoarray.setup.py
Daniel Scheffler's avatar
Daniel Scheffler committed
12
RUN /bin/bash -i -c "source /root/anaconda3/bin/activate ; \
13
    conda install --yes pyqt numba; \
Daniel Scheffler's avatar
Daniel Scheffler committed
14
    conda install --yes -c conda-forge pyfftw=0.10.4 ; \
15
    conda install --yes -c ioam holoviews bokeh ; \
16
17
    conda install --yes -c conda-forge numpy gdal scikit-image scikit-learn matplotlib pyproj rasterio shapely basemap \
                                       pykrige glymur pygrib pyproj cachetools pyhdf ephem python-fmask scipy ; \
Daniel Scheffler's avatar
Daniel Scheffler committed
18
    conda install --yes -c conda-forge 'icu=58.*' lxml ; \
19
    pip install pandas geopandas dicttoxml jsmin cerberus pyprind pint iso8601 tqdm mpld3 sphinx-argparse dill pytz \
20
21
                spectral>0.16 psycopg2 pyorbital pyinstrument geoalchemy2 sqlalchemy py_tools_ds>=0.9.3 \
                geoarray>=0.6.16 arosics>=0.6.6 flake8 pycodestyle pylint pydocstyle nose nose2 nose-htmloutput \
Daniel Scheffler's avatar
Daniel Scheffler committed
22
                coverage rednose six"   # must include all the requirements needed to build the docs!
Daniel Scheffler's avatar
Daniel Scheffler committed
23
24
25
26
27

# copy some needed stuff to /root
#COPY *.pkl /root/ # EXAMPLE
#COPY *.h5 /root/  # EXAMPLE

28
# copy sicor code to /tmp
Daniel Scheffler's avatar
Daniel Scheffler committed
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
COPY sicor /tmp/sicor

# install git lfs
RUN /bin/bash -i -c "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | bash"

# installing git large file support, see here: https://git-lfs.github.com/ , change version number below for future upgrades
ENV git_lfs_v='2.1.1'
RUN /bin/bash -i -c "wget https://github.com/git-lfs/git-lfs/releases/download/v${git_lfs_v}/git-lfs-linux-amd64-${git_lfs_v}.tar.gz; \
    tar -zxvf git-lfs-linux-amd64-${git_lfs_v}.tar.gz; \
    cd git-lfs-${git_lfs_v}; \
    bash ./install.sh"

# set matplotlib backend to Agg as default, Qt won't work in headless docker containers
RUN bash -i -c 'source /root/anaconda3/bin/activate; \
    sed -i "/backend      : tkagg/c\backend      : Agg" $(python -c "import matplotlib; print(matplotlib.matplotlib_fname())"); \
    sed -i "/backend      : Qt4Agg/c\backend      : Agg" $(python -c "import matplotlib; print(matplotlib.matplotlib_fname())"); \
    sed -i "/backend      : qt5agg/c\backend      : Agg" $(python -c "import matplotlib; print(matplotlib.matplotlib_fname())")'

RUN bash -i -c "source /root/anaconda3/bin/activate; \
48
    cd /tmp/sicor/; make install; \
Daniel Scheffler's avatar
Daniel Scheffler committed
49
    " # TODO move this to setup.py as soon as package is public