-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
160 lines (134 loc) · 5.84 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
# Dockerfile to build PBE
# 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 versionPBE=d3.2.0
ARG versionEE=d3.4.0
ARG versionSimCenterCommon=v23.09
ARG versionSimCenterBackend=v23.09
ARG versionOpenSees=v3.5.0
ARG versionNHERI_SIMCENTER=0.9.15
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 PBE frontend, need quazip & updated dmake first
#
RUN source /opt/qt515/bin/qt515-env.sh \
&& sudo apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget \
&& wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - \
&& sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' \
&& sudo apt-get install -y cmake zlib1g-dev \
&& git clone -b v1.4 --single-branch https://github.com/stachenov/quazip.git \
&& cd quazip \
&& mkdir build; cd build; cmake ..; make; make install \
& cd ../.. \
&& git clone -b $versionSimCenterCommon --single-branch https://github.com/NHERI-SimCenter/SimCenterCommon.git \
&& git clone https://github.com/NHERI-SimCenter/QS3hark.git \
&& git clone -b $versionEE --single-branch https://github.com/NHERI-SimCenter/EE-UQ.git \
&& git clone -b $versionPBE --single-branch https://github.com/NHERI-SimCenter/PBE.git \
&& cd PBE \
&& mkdir build \
&& cd build \
&& qmake ../PBE.pro \
&& make \
&& rm -fr .obj *.o *.cpp\
&& 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==$versionNHERI_SIMCENTER
#
# Copy all files into correct locations for running & clean up
#
RUN cd PBE/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