forked from NHERI-SimCenter/HydroUQ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
297 lines (245 loc) · 10.2 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# Dockerfile to build Hydro-UQ
# installing: Qt5.15.2, OpenSees3.5.0, dakota6.15.0, python3.9.6
# written: fmk 08/23
FROM ubuntu:bionic
SHELL ["/bin/bash", "-c"]
ARG versionEE=master
ARG versionSimCenterCommon=v23.09
ARG versionSimCenterBackend=v23.09
ARG versionOpenSees=v3.5.0
WORKDIR /simcenter
#
# Install Qt
# note: utilizes following for Qt: https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.15.2-bionic
#
RUN apt-get update \
&& apt-get install -y sudo \
&& sudo apt install -y software-properties-common cmake \
&& sudo add-apt-repository -y ppa:beineri/opt-qt-5.15.2-bionic \
&& sudo apt update \
&& sudo apt-get install -y build-essential freeglut3-dev python3-pip git \
&& sudo python3 -m pip install -U pip \
&& pip3 install conan==1.60.1 \
&& sudo apt-get install -y qt515base qt5153d qt515charts-no-lgpl qt515webengine
#
# Build the Hydro-UQ frontend & copy tacc config.json
#
RUN source /opt/qt515/bin/qt515-env.sh \
&& git clone -b $versionSimCenterCommon --single-branch https://github.com/NHERI-SimCenter/SimCenterCommon.git \
&& git clone https://github.com/NHERI-SimCenter/HydroUQ.git \
&& cd HydroUQ \
&& mkdir build \
&& cd build \
&& qmake ../Hydro-UQ.pro \
&& make \
&& rm -fr .obj \
&& cp ../tacc/config.json ./ \
&& cd ../..
#
# Build OpenSees
# note: some stuff in there to get latest cmake as 3.10 not doing it
#
RUN sudo apt-get install -y cmake liblapack-dev libomp-dev libssl-dev apt-transport-https ca-certificates wget \
&& wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null \
&& sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" \
&& sudo apt-get update \
&& sudo apt-get install -y cmake gfortran gcc g++ \
&& git clone -b $versionOpenSees --single-branch https://github.com/OpenSees/OpenSees.git \
&& cd OpenSees \
&& mkdir build; cd build \
&& conan install .. --build missing \
&& cmake .. \
&& cmake --build . --config Release \
&& cmake --install . \
&& sudo mv ./lib/* /usr/local/lib \
&& cd ../..; rm -fr OpenSees
#
# Build Dakota
# note: dakota also needed more upto date cmake
RUN wget https://github.com/snl-dakota/dakota/releases/download/v6.15.0/dakota-6.15.0-public-src-cli.tar.gz \
&& sudo apt-get install -y libboost-dev libboost-all-dev libopenmpi-dev openmpi-bin xorg-dev libmotif-dev \
&& tar zxBf dakota-6.15.0-public-src-cli.tar.gz \
&& mv dakota-6.15.0-public-src-cli dakota-6.15.0 \
&& cd dakota-6.15.0 \
&& mkdir build; cd build \
&& cmake .. \
&& cmake --build . --config Release \
&& cmake --install . \
&& cd ../..; rm -fr dakot*
#
# Build SimCenter Backend Applications
# note: need newer gcc, gcc-10 which necessitates removing old conan
#
RUN git clone -b $versionSimCenterBackend https://github.com/NHERI-SimCenter/SimCenterBackendApplications.git \
&& cp ./SimCenterBackendApplications/modules/performUQ/SimCenterUQ/nataf_gsa/CMakeLists.txt.UBUNTU ./SimCenterBackendApplications/modules/performUQ/SimCenterUQ/nataf_gsa/CMakeLists.txt \
&& rm -fr ~/.conan \
&& sudo apt-get install -y liblapack-dev libomp-dev libssl-dev apt-transport-https ca-certificates \
&& sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& sudo apt-get update \
&& sudo apt-get install -y gcc-10 g++-10 gfortran-10 \
&& export CC=gcc-10 \
&& export CXX=g++-10 \
&& export FC=gfortran-10 \
&& conan remote add simcenter https://nherisimcenter.jfrog.io/artifactory/api/conan/simcenter \
&& cd SimCenterBackendApplications \
&& mkdir build \
&& cd build \
&& conan install .. --build missing \
&& cmake .. \
&& cmake --build . --config Release \
&& cmake --install . \
&& cd ../..
#
# Install python3.9
# note: need a later python3 for nheri-simcenter
# which we have to build from source!!!
#
RUN sudo apt-get install -y zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libffi-dev libbz2-dev \
&& wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz \
&& tar -xf Python-3.9.6.tgz \
&& cd Python-3.9.6 \
&& ./configure --enable-optimizations \
&& sudo make install \
&& cd ..; rm -fr python* \
&& pip3 install nheri-simcenter
#
# Copy all files into correct locations for running & clean up
#
RUN cd HydroUQ/build \
&& cp -r ../Examples ./ \
&& cp -r ../../SimCenterBackendApplications/applications . \
&& rm -fr /simcenter/SimCenterBackendApplications \
&& rm -fr /simcenter/SimCenterCommon
#
# add following for the missing lib libQt5Core.so error that is related to running on some versions linux
# with an older kernel, seemingly need kernel >= 3.5 on host .. soln from Sal T. found in an AskUbuntu thread
#
RUN strip --remove-section=.note.ABI-tag /opt/qt515/lib/libQt5Core.so.5
#
# Finally add a new user simcenter as root cannot run the Qt app
#
RUN useradd -ms /bin/bash simcenter
USER simcenter# Dockerfile to build Hydro-UQ
# installing: Qt5.15.2, OpenSees3.5.0, dakota6.15.0, python3.9.6
# written: fmk 08/23
FROM ubuntu:bionic
SHELL ["/bin/bash", "-c"]
ARG versionEE=d3.4.0
ARG versionSimCenterCommon=v23.09
ARG versionSimCenterBackend=v23.09
ARG versionOpenSees=v3.5.0
WORKDIR /simcenter
#
# Install Qt
# note: utilizes following for Qt: https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.15.2-bionic
#
RUN apt-get update \
&& apt-get install -y sudo \
&& sudo apt install -y software-properties-common cmake \
&& sudo add-apt-repository -y ppa:beineri/opt-qt-5.15.2-bionic \
&& sudo apt update \
&& sudo apt-get install -y build-essential freeglut3-dev python3-pip git \
&& sudo python3 -m pip install -U pip \
&& pip3 install conan==1.60.1 \
&& sudo apt-get install -y qt515base qt5153d qt515charts-no-lgpl qt515webengine \
&& sudo apt-get install libcurl4-openssl-dev \
&& sudo apt-get install libz-dev
#
# Build the Hydro-UQ frontend & copy tacc config.json
#
RUN source /opt/qt515/bin/qt515-env.sh \
&& git clone -b $versionSimCenterCommon --single-branch https://github.com/NHERI-SimCenter/SimCenterCommon.git \
&& git clone https://github.com/NHERI-SimCenter/HydroUQ.git \
&& cd HydroUQ \
&& mkdir build \
&& cd build \
&& conan install .. --build missing \
&& qmake ../Hydro-UQ.pro \
&& make \
&& rm -fr .obj \
&& cd ../..
#
# Build OpenSees
# note: some stuff in there to get latest cmake as 3.10 not doing it
#
RUN sudo apt-get install -y cmake liblapack-dev libomp-dev libssl-dev apt-transport-https ca-certificates wget \
&& wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null \
&& sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" \
&& sudo apt-get update \
&& sudo apt-get install -y cmake gfortran gcc g++ \
&& git clone -b $versionOpenSees --single-branch https://github.com/OpenSees/OpenSees.git \
&& cd OpenSees \
&& mkdir build; cd build \
&& conan install .. --build missing \
&& cmake .. \
&& cmake --build . --config Release \
&& cmake --install . \
&& sudo mv ./lib/* /usr/local/lib \
&& cd ../..; rm -fr OpenSees
#
# Build Dakota
# note: dakota also needed more upto date cmake
RUN wget https://github.com/snl-dakota/dakota/releases/download/v6.15.0/dakota-6.15.0-public-src-cli.tar.gz \
&& sudo apt-get install -y libboost-dev libboost-all-dev libopenmpi-dev openmpi-bin xorg-dev libmotif-dev \
&& tar zxBf dakota-6.15.0-public-src-cli.tar.gz \
&& mv dakota-6.15.0-public-src-cli dakota-6.15.0 \
&& cd dakota-6.15.0 \
&& mkdir build; cd build \
&& cmake .. \
&& cmake --build . --config Release \
&& cmake --install . \
&& cd ../..; rm -fr dakot*
#
# Build SimCenter Backend Applications
# note: need newer gcc, gcc-10 which necessitates removing old conan
#
RUN git clone -b $versionSimCenterBackend https://github.com/NHERI-SimCenter/SimCenterBackendApplications.git \
&& cp ./SimCenterBackendApplications/modules/performUQ/SimCenterUQ/nataf_gsa/CMakeLists.txt.UBUNTU ./SimCenterBackendApplications/modules/performUQ/SimCenterUQ/nataf_gsa/CMakeLists.txt \
&& rm -fr ~/.conan \
&& sudo apt-get install -y liblapack-dev libomp-dev libssl-dev apt-transport-https ca-certificates \
&& sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& sudo apt-get update \
&& sudo apt-get install -y gcc-10 g++-10 gfortran-10 \
&& export CC=gcc-10 \
&& export CXX=g++-10 \
&& export FC=gfortran-10 \
&& conan remote add simcenter https://nherisimcenter.jfrog.io/artifactory/api/conan/simcenter \
&& cd SimCenterBackendApplications \
&& mkdir build \
&& cd build \
&& conan install .. --build missing \
&& cmake .. \
&& cmake --build . --config Release \
&& cmake --install . \
&& cd ../..
#
# Install python3.9
# note: need a later python3 for nheri-simcenter
# which we have to build from source!!!
#
RUN sudo apt-get install -y zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libffi-dev libbz2-dev \
&& wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz \
&& tar -xf Python-3.9.6.tgz \
&& cd Python-3.9.6 \
&& ./configure --enable-optimizations \
&& sudo make install \
&& cd ..; rm -fr python* \
&& pip3 install nheri-simcenter
#
# Copy all files into correct locations for running & clean up
#
RUN cd HydroUQ/build \
&& cp -r ../Examples ./ \
&& cp -r ../../SimCenterBackendApplications/applications . \
&& rm -fr /simcenter/SimCenterBackendApplications \
&& rm -fr /simcenter/SimCenterCommon
#
# add following for the missing lib libQt5Core.so error that is related to running on some versions linux
# with an older kernel, seemingly need kernel >= 3.5 on host .. soln from Sal T. found in an AskUbuntu thread
#
RUN strip --remove-section=.note.ABI-tag /opt/qt515/lib/libQt5Core.so.5
#
# Finally add a new user simcenter as root cannot run the Qt app
#
RUN useradd -ms /bin/bash simcenter
USER simcenter