-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathDockerfile.arm
163 lines (148 loc) · 5.91 KB
/
Dockerfile.arm
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
# This Docker File is for use by developers of OpenMDAO, Dymos, and Aviary
FROM arm64v8/ubuntu:noble
SHELL ["/bin/bash", "-c"]
ARG DEBIAN_FRONTEND=noninteractive
# Install updates
RUN apt-get update -y && apt-get install sudo wget git g++ gfortran make cmake libblas-dev liblapack-dev libxml2-dev \
python3-dev python3-sphinx vim unzip file desktop-file-utils swig doxygen graphviz \
# texlive-latex-base \
libfltk1.3-dev libcpptest-dev libjpeg-dev libglm-dev libeigen3-dev libcminpack-dev libglew-dev libgtk-3-dev -y
# install a browser
RUN apt-get update -y && apt-get install firefox --fix-missing -y
# Create user
ENV USER=omdao
RUN adduser --shell /bin/bash --disabled-password ${USER}
RUN adduser ${USER} sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN chmod u+s /usr/bin/sudo
USER ${USER}
WORKDIR /home/${USER}
# Install Miniforge
RUN wget -q -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" ;\
bash Miniforge3.sh -b ;\
rm Miniforge3.sh ;\
export PATH=$HOME/miniforge3/bin:$PATH ;\
conda init bash
# Create conda environment
RUN source $HOME/miniforge3/etc/profile.d/conda.sh ;\
conda create -n mdaowork python=3.11 'numpy<2' scipy cython swig cmake -y
# Modify .bashrc
RUN echo "## Always activate mdaowork environment on startup ##" >> ~/.bashrc ;\
echo "conda activate mdaowork" >> ~/.bashrc ;\
echo "export PYTHONPATH=${PYTHONPATH}:$HOME/vtk/build/lib/python3.11/site-packages:$HOME/OpenVSP/build/vsp/python_pseudo/PyVSP" >> ~/.bashrc ;\
echo "" >> ~/.bashrc ;\
echo "## OpenMPI settings" >> ~/.bashrc ;\
echo "export OMPI_MCA_rmaps_base_oversubscribe=1" >> ~/.bashrc ;\
echo "export OMPI_MCA_btl=^openib" >> ~/.bashrc ;\
echo "" >> ~/.bashrc ;\
echo "## Required for some newer MPI / libfabric instances" >> ~/.bashrc ;\
echo "export RDMAV_FORK_SAFE=true" >> ~/.bashrc ;\
echo "" >> ~/.bashrc
# Build and Install VTK, which is needed by OpenVSP
RUN source $HOME/miniforge3/etc/profile.d/conda.sh ;\
conda activate mdaowork ;\
wget -q https://www.vtk.org/files/release/9.4/VTK-9.4.1.tar.gz ;\
tar -xzpf VTK-9.4.1.tar.gz ;\
rm VTK-9.4.1.tar.gz ;\
mkdir vtk ;\
mv VTK-9.4.1 vtk/source ;\
cd vtk ;\
mkdir build ;\
cd build ;\
ls -l ../source ;\
cmake ../source -DVTK_WRAP_PYTHON=ON;\
make ;\
sudo make install
# Build and Install OpenVSP (based on script from Irian Ordaz @ LARC)
RUN source $HOME/miniforge3/etc/profile.d/conda.sh ;\
conda activate mdaowork ;\
mkdir OpenVSP && cd OpenVSP ;\
git clone https://github.com/OpenVSP/OpenVSP.git repo ;\
cd repo ;\
git checkout tags/OpenVSP_3.41.1 -b OpenVSP_3.41.1 ;\
cd .. ;\
mkdir -p build/Libraries build/vsp ;\
cd build/Libraries ;\
cmake -DCMAKE_BUILD_TYPE=Release -DVSP_NO_GRAPHICS=true \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fPIC" \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" \
../../repo/Libraries ;\
make ;\
cd ../vsp ;\
cmake -DCMAKE_BUILD_TYPE=Release -DVSP_NO_GRAPHICS=true \
-DPYTHON_LIBRARY=$HOME/miniforge3/envs/mdaowork/lib/libpython3.so \
-DPYTHON_INCLUDE_DIR=$HOME/miniforge3/envs/mdaowork/include/python3.11 \
-DVSP_LIBRARY_PATH=$HOME/OpenVSP/build/Libraries \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fPIC" \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" \
../../repo/src ;\
make ;\
cd vsp ;\
make ;\
sudo make install
# Install OpenMDAO/Dymos/Aviary into conda environment
RUN source $HOME/miniforge3/etc/profile.d/conda.sh ;\
conda activate mdaowork ;\
#
# Install OpenMDAO/Dymos/Aviary dependencies and OpenVSP Python API
#
conda install matplotlib graphviz -q -y ;\
conda install mpi4py openmpi petsc4py=3.20 pyoptsparse -q -y ;\
python -m pip install pyparsing psutil objgraph plotly pyxdsm pydot ;\
#
# Install build_pyoptsparse
# (this will allow the user additional options for installing pyoptsparse, beyond the conda install above)
#
python -m pip install git+https://github.com/openmdao/build_pyoptsparse ;\
# build_pyoptsparse -v ;\
#
# Install OpenMDAO
#
git clone https://github.com/OpenMDAO/OpenMDAO.git ;\
python -m pip install -e 'OpenMDAO[all]' ;\
#
# Install Dymos
#
git clone https://github.com/OpenMDAO/dymos.git ;\
python -m pip install -e 'dymos[all]' ;\
#
# Install Aviary
#
git clone https://github.com/OpenMDAO/Aviary.git ;\
python -m pip install -e 'Aviary[all]' ;\
#
# Install MPhys
#
git clone https://github.com/OpenMDAO/MPhys.git ;\
python -m pip install -e 'MPhys[all]' ;\
#
# Install OpenAeroStruct
#
git clone https://github.com/mdolab/OpenAeroStruct.git ;\
python -m pip install -e 'OpenAeroStruct' ;\
#
# Install OpenVSP Python support
#
pip install wxPython ;\
cd $HOME/OpenVSP/build/vsp/python_pseudo ;\
pip install utilities/. ;\
pip install degen_geom/. ;\
pip install openvsp_config/. ;\
pip install openvsp/. ;\
pip install CHARM/. ;\
pip install AvlPy/. ;\
pip install pyPMARC/. ;\
# pip doesn't recognize vtk in PYTHONPATH as satisfying the vtk dependency for PyVSP,
# so we'll just hack this into PYTHONPATH as well.
# pip install PyVSP/.
#
# fix for this warning:
# WARNING 7: VSPAERO Viewer Not Found.
# Expected here: /home/omdao/miniforge3/envs/mdaowork/lib/python3.11/site-packages/openvsp/vspviewer
VSPVIEWER_DIR=$CONDA_PREFIX/lib/python3.11/site-packages/openvsp/vspviewer ;\
mkdir $VSPVIEWER_DIR ;\
cp $CONDA_PREFIX/lib/python3.11/site-packages/openvsp/vspaero $VSPVIEWER_DIR ;\
cp $CONDA_PREFIX/lib/python3.11/site-packages/openvsp/vsploads $VSPVIEWER_DIR
# Set up a work directory that can be shared with the host operating system
WORKDIR /home/${USER}/work
ENTRYPOINT ["tail", "-f", "/dev/null"]