-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_XAI
134 lines (116 loc) · 4.61 KB
/
Dockerfile_XAI
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
ARG image=tensorflow/tensorflow
ARG tag=1.13.1-gpu-py3
# Base image
FROM ${image}:${tag}
# Set default shell to /bin/bash
SHELL ["/bin/bash", "-cu"]
# Install some essentials
RUN apt-get update && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \
build-essential=\* \
cmake=\* \
g++-4.8=\* \
git=\* \
curl=\* \
wget=\* \
ca-certificates=\* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install R from r-project repos
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
software-properties-common=\* \
apt-transport-https=\* \
ca-certificates=\* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/' && \
apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
r-base=\* \
r-base-dev=\* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Configure Java and R
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' && \
apt-get update -y && \
apt-get install -y --no-install-recommends \
libgit2-dev=\* \
libcurl4-gnutls-dev=\* \
libicu-dev=\* \
libbz2-dev=\* \
libnetcdf-dev=\* \
libnetcdff-dev=\* \
libssl-dev=\* \
libssh2-1-dev=\* \
libxml2-dev=\* \
libgit2-dev=\* && \
R -e "install.packages('devtools')" && \
apt-get install -y --no-install-recommends \
default-jre=\* \
default-jdk=\* && \
R CMD javareconf && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /root/.cache/pip/* && \
rm -rf /tmp/*
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl repo.data.kit.edu/key.pgp | apt-key add - && \
add-apt-repository "deb http://repo.data.kit.edu/ubuntu/$(lsb_release -sr) ./" && \
apt-get install -y --no-install-recommends \
liblzma-dev=\* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install virtual framebuffer X11 server
RUN apt-get update -y && apt-get install -y --no-install-recommends \
xvfb=\* \
xauth=\* \
xfonts-base=\* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install climate4R
RUN R -e "library('devtools'); install_github('SantanderMetGroup/loadeR.java')"
RUN R -e "library('devtools'); install_github('SantanderMetGroup/climate4R.UDG')"
RUN R -e "library('devtools'); install_github('SantanderMetGroup/loadeR')"
RUN R -e "library('devtools'); install_github('SantanderMetGroup/transformeR')"
RUN R -e "library('devtools'); install_github('SantanderMetGroup/downscaleR')"
RUN R -e "library('devtools'); install_github('SantanderMetGroup/VALUE')"
RUN R -e "library('devtools'); install_github('SantanderMetGRoup/climate4R.value')"
RUN R -e "library('devtools'); install_github('SantanderMetGRoup/downscaleR.keras@devel')"
RUN R -e "library('devtools'); install_github('SantanderMetGroup/loadeR.2nc')"
RUN R -e "install.packages(c('Matrix', 'RcppEigen', 'spam'))"
# Install geprocessoR and gdal, rgdal and proj dependencies
RUN apt-get update -y && apt-get install -y --no-install-recommends \
gdal-bin=\* \
proj-bin=\* \
libgdal-dev=\* \
libproj-dev=\* \
libudunits2-dev=\* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN R -e "install.packages('rgdal')"
RUN R -e "library('devtools'); install_github('SantanderMetGroup/geoprocessoR')"
RUN R -e "install.packages('udunits2')"
RUN R -e "library('devtools'); install_github('SantanderMetGroup/convertR')"
RUN R -e "library('devtools'); install_github('SantanderMetGroup/climate4R.indices')"
# Install Keras and Tensorflow on R
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN R -e "install.packages('keras')"
RUN R -e "reticulate::use_python('/usr/bin/python', required = TRUE)"
# Install graphical packages
RUN R -e "install.packages('gridExtra')"
RUN R -e "install.packages('RColorBrewer')"
RUN R -e "library('devtools'); install_github('SantanderMetGroup/visualizeR')"
# Install python libraries
RUN pip install innvestigate
RUN pip install keras
RUN apt-get update -y && apt-get install -y --no-install-recommends \
libffi6=\* \
libffi-dev=\* && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN pip install rpy2==3.0.0 matplotlib netCDF4
RUN pip install xarray
RUN pip install tqdm
WORKDIR "/experiment/"