-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathDockerfile
121 lines (107 loc) · 4.14 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
# Define image with OpenMDAO/Dymos/Aviary and OpenVSP support
FROM ubuntu:24.04
SHELL ["/bin/bash", "-c"]
ARG DEBIAN_FRONTEND=noninteractive
# Install updates
RUN apt-get update -y && apt-get install \
python3-dev python3-sphinx vim unzip wget file desktop-file-utils git sudo make cmake swig g++ gfortran doxygen graphviz texlive-latex-base \
libblas-dev liblapack-dev libxml2-dev libfltk1.3-dev libcpptest-dev libjpeg-dev libglm-dev libeigen3-dev libcminpack-dev libglew-dev -y
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb ;\
apt-get install -y ./google-chrome-stable_current_amd64.deb
# 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
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 -y
# Modify .bashrc
RUN echo "## Always activate mdaowork environment on startup ##" >> ~/.bashrc ;\
echo "conda activate mdaowork" >> ~/.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 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 ../../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 \
../../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 -y ;\
conda install mpi4py petsc4py=3.20 -y ;\
python -m pip install pyparsing psutil objgraph plotly pyxdsm pydot ;\
#
# Install pyoptsparse
#
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
#
conda install wxPython ;\
cd $HOME/OpenVSP/build/vsp/python_pseudo ;\
pip install -r requirements-dev.txt
# Set up a work directory that can be shared with the host operating system
WORKDIR /home/${USER}/work
ENTRYPOINT ["tail", "-f", "/dev/null"]