-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
143 lines (116 loc) · 4.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
FROM ubuntu:focal
LABEL maintainer="Arnaud Becheler" \
description="Having quetzal-CoalTL, quetzal-EGGS and quetzal-CRUMBS work, compatible with Open Science Grid with Singularity" \
version="0.0.1"
ARG DEBIAN_FRONTEND=noninteractive
### QUETZAL-EGGS
RUN apt-get update -y
RUN apt-get install -y --no-install-recommends\
vim \
git \
gcc-9 \
g++ \
build-essential \
libboost-all-dev \
cmake \
unzip \
tar \
ca-certificates \
doxygen \
graphviz
# Install GDAL dependencies
RUN apt-get install -y libgdal-dev g++ --no-install-recommends && \
apt-get clean -y
# Update C env vars so compiler can find gdal - once EGGS compiled we don't care anymore if singularity finds it or not
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
ENV C_INCLUDE_PATH=/usr/include/gdal
# Install Quetzal-EGGS
RUN git clone --recurse-submodules https://github.com/Becheler/quetzal-EGGS \
&& cd quetzal-EGGS \
&& mkdir Release \
&& cd Release \
&& cmake .. -DCMAKE_INSTALL_PREFIX="/usr/local/quetzal-EGGS" \
&& cmake --build . --config Release --target install
### QUETZAL-CRUMBS
RUN set -xe \
apt-get update && apt-get install -y \
python3-pip \
--no-install-recommends
RUN pip3 install --upgrade pip
# for crumbs package publishing
RUN pip3 install build twine pipenv numpy
# for crumbs geospatial & parallelism
RUN pip3 install rasterio && \
pip3 install matplotlib && \
pip3 install imageio && \
pip3 install imageio-ffmpeg && \
pip3 install pyproj && \
pip3 install shapely && \
pip3 install fiona && \
pip3 install "dask[complete]" && \
pip3 install xarray && \
pip3 install rioxarray
# For crumbs.get_chelsa and crumbs.sdm
RUN pip3 install git+https://github.com/perrygeo/pyimpute.git@1371e5bf1f5ef35bd88ea5c2d57d2cbedf4f5d1d && \
pip3 install xgboost && \
pip3 install lightgbm && \
pip3 install scikit-learn && \
pip3 install geopandas
# crumbs.get_gbif weird dependencies
RUN pip3 install appdirs && \
pip3 install geojson_rewind && \
pip3 install geomet && \
pip3 install requests_cache && \
pip3 install git+https://github.com/sckott/pygbif.git#egg=pygbif
## Visualizations with crumbs and MAYAVI
# PyVirtualDisplay and its dependencies
RUN pip3 install pyvirtualdisplay pillow EasyProcess
# install all dependencies and backends on Ubuntu 20.04:
RUN apt-get update -y && apt-get install -y \
xvfb \
xserver-xephyr \
tigervnc-standalone-server \
x11-utils \
gnumeric \
&& apt-get clean -y
# Qt platform plugin xcb for mayavi
RUN apt-get update -y && apt-get install -y \
xvfb \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
&& apt-get clean -y
# Solving a mysterious xcfb error
RUN apt-get update -y && apt-get install -y \
qt5-default \
&& apt-get clean -y
# avoid _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
RUN mkdir /tmp/.X11-unix && \
chmod 1777 /tmp/.X11-unix && \
chown root /tmp/.X11-unix/
# probably not required during image build
RUN Xvfb :99 &
ENV DISPLAY :99
# avoid matplotlib warning
ENV MPLCONFIGDIR="/tmp"
# avoid QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-'
ENV XDG_RUNTIME_DIR="/tmp/runtime-"
# The Visualization Toolkit
RUN python3 -m pip install vtk
# Tool for image processing
RUN apt-get update && apt-get install -y \
python3-opencv \
&& apt-get clean -y
RUN pip3 install opencv-python
RUN pip3 install PyVirtualDisplay
RUN pip3 install mayavi PyQt5
RUN pip3 install GDAL==$(gdal-config --version) pyvolve==1.0.3 quetzal-crumbs==1.0.17
# Clean to make image smaller
RUN apt-get autoclean && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*