-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
165 lines (154 loc) · 5.32 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
FROM ubuntu:23.04
MAINTAINER Tristan CAREL <tristan.carel@epfl.ch>
ARG DEBIAN_FRONTEND=noninteractive
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV SHELL=/bin/bash
ENV TZ=Europe/Geneva
RUN apt-get --yes -qq update \
&& apt-get --yes -qq upgrade \
&& apt-get --yes -qq install \
bzip2 \
cmake \
cpio \
curl \
g++ \
gcc \
gfortran \
git \
graphviz \
htop \
libeigen3-dev \
libboost-dev \
libgl1 \
libglu1 \
libmetis-dev \
librdmacm-dev \
libxcursor1 \
libxft2 \
libxinerama1 \
pandoc \
pkg-config \
vim \
wget \
zlib1g-dev \
&& apt-get --yes -qq clean \
&& rm -rf /var/lib/apt/lists/*
ENV GOSU_VERSION 1.17
RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
&& chmod +x /usr/local/bin/gosu \
# verify that the binary works
&& gosu nobody true
ARG MINICONDA_VERSION=3-py312_24.4.0-0
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& minicondaArch="$(case $dpkgArch in amd64) echo x86_64 ;; arm64) echo aarch64 ;; *) echo Unexpected arch: $dpkgArch; false ;; esac)" \
&& wget --quiet https://repo.continuum.io/miniconda/Miniconda${MINICONDA_VERSION}-Linux-${minicondaArch}.sh -O ~/miniconda.sh \
&& /bin/bash ~/miniconda.sh -b -p /opt/conda \
&& rm ~/miniconda.sh \
&& /opt/conda/bin/conda install -c conda-forge \
build \
"h5py[version='>=2.9',build=mpi*]" \
cython \
jupyter \
jupyterlab \
nose \
petsc \
petsc4py \
python-libsbml \
scipy \
&& /opt/conda/bin/pip install matplotlib \
&& /opt/conda/bin/conda install --solver=classic \
conda-forge::conda-libmamba-solver \
conda-forge::libarchive \
conda-forge::libmamba \
conda-forge::libmambapy
ENV PATH "/opt/conda/bin:$PATH"
ENV CMAKE_PREFIX_PATH=/opt/conda
ARG GMSH_VERSION=4.12.2
RUN wget https://gmsh.info/src/gmsh-${GMSH_VERSION}-source.tgz \
&& tar zxf gmsh-${GMSH_VERSION}-source.tgz \
&& cd gmsh-${GMSH_VERSION}-source \
&& cmake \
-DCMAKE_INSTALL_PREFIX=/opt/gmsh-${GMSH_VERSION} \
-DENABLE_BUILD_SHARED:BOOL=True \
-DENABLE_BUILD_DYNAMIC:BOOL=True \
-DENABLE_FLTK:BOOL=FALSE . \
&& make -j 4 \
&& make install \
&& cd .. \
&& rm -rf gmsh-${GMSH_VERSION}-source gmsh-${GMSH_VERSION}-source.tgz
ENV PATH "/opt/gmsh-${GMSH_VERSION}/bin:$PATH"
ENV CMAKE_PREFIX_PATH="/opt/gmsh-${GMSH_VERSION}:${CMAKE_PREFIX_PATH}"
ARG BUILD_OMEGA_H=true
ARG OMEGA_H_VERSION=v9.34.13
RUN if [ "x$BUILD_OMEGA_H" = xtrue ] ; then ( \
git clone \
--single-branch -b "$OMEGA_H_VERSION" \
https://github.com/sandialabs/omega_h.git \
/var/src/omega_h \
&& mkdir /var/src/omega_h/_build \
&& cd /var/src/omega_h/_build \
&& cmake \
-DOmega_h_USE_Gmsh:BOOL=TRUE \
-DOmega_h_USE_MPI:BOOL=TRUE \
.. \
&& make -j 4 install \
&& ldconfig \
&& rm -rf /var/src/omega_h \
) fi
ADD overlap-arm64.patch /var/src/
ARG STEPS_VERSION=5.0.2
ARG STEPS_UT=false
ARG STEPS_UT_KEEP_GOING=true
ENV CTEST_OUTPUT_ON_FAILURE=1
ARG STEPS_REPOSITORY=STEPS
ARG STEPS_ACCESS_TOKEN=
ARG STEPS_NATIVE_ARCH=False
RUN chmod +x /root \
&& git clone --recursive \
https://${STEPS_ACCESS_TOKEN}github.com/CNS-OIST/${STEPS_REPOSITORY}.git /var/src/STEPS \
&& cd /var/src/STEPS \
&& git checkout "$STEPS_VERSION" \
&& git submodule update --init --recursive \
&& patch -p1 < /var/src/overlap-arm64.patch \
&& mkdir build \
&& cd build \
&& python -c "import os,sysconfig; os.makedirs(sysconfig.get_path('platlib', f'{os.name}_user'), exist_ok=True)" \
&& cmake \
-DTARGET_NATIVE_ARCH:BOOL="$STEPS_NATIVE_ARCH" \
-DUSE_BUNDLE_SUNDIALS:BOOL=TRUE \
-DUSE_BUNDLE_OMEGA_H:BOOL=FALSE \
-DUSE_MPI:BOOL=ON \
-DSTEPS_USE_DIST_MESH:BOOL=TRUE \
-DSTEPS_INSTALL_PYTHON_DEPS:BOOL=FALSE \
.. \
&& make -j 4 all \
&& ([ "$STEPS_UT" = false ] || \
if [ "x$STEPS_UT_KEEP_GOING" = xtrue ] ; then \
( make test || true ) ; else \
make test ; \
fi \
) \
&& make install \
&& rm -rf /var/src/STEPS
RUN git clone https://github.com/CNS-OIST/STEPS_Example.git /var/src/STEPS_Example \
&& mv /var/src/STEPS_Example/user_manual/source /var/src/user_manual \
&& rm -rf /var/src/STEPS_Example
ARG EXAMPLE_NOTEBOOKS_TO_REBUILD="diffusion_boundary diffusion getting_started ip3 memb_pot sbml_importer surface_diffusion_boundary surface_diffusion well_mixed"
# https://nbconvert.readthedocs.io/en/latest/usage.html#convert-notebook
RUN cd /var/src/user_manual \
&& jupyter nbconvert \
--to notebook \
--execute \
--inplace \
--ExecutePreprocessor.timeout=3600 \
$EXAMPLE_NOTEBOOKS_TO_REBUILD
ADD entrypoint /usr/bin/
CMD [ \
"jupyter", "lab", \
"--no-browser", "--allow-root", \
"--ip=0.0.0.0", \
"--notebook-dir=/opt/src/notebooks" \
]