20
20
# Options: [1, 2, 3, 4, 5, 6...]
21
21
#
22
22
# Example builds:
23
- # Building using the defaults (cq_version 2, no neutronics and 1 core compile)
23
+ # Building using the defaults (cq_version 2.1 , no neutronics and 1 core compile)
24
24
# docker build -t ukaea/paramak .
25
25
#
26
26
# Building to include cadquery master, neutronics dependencies and use 8 cores.
40
40
# docker run --rm ukaea/paramak pytest /tests
41
41
# docker run --rm ukaea/paramak /bin/bash -c "cd .. && bash run_tests.sh"
42
42
43
- FROM continuumio/miniconda3:4.9.2
43
+ FROM continuumio/miniconda3:4.9.2 as dependencies
44
44
45
45
# By default this Dockerfile builds with the latest release of CadQuery 2
46
- ARG cq_version=2
46
+ ARG cq_version=2.1
47
47
ARG include_neutronics=false
48
48
ARG compile_cores=1
49
49
@@ -62,12 +62,13 @@ RUN apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev \
62
62
apt-get clean
63
63
64
64
# Installing CadQuery
65
- # jupyter is installed before cadquery to avoid a conflict
66
65
RUN echo installing CadQuery version $cq_version && \
67
- conda install jupyter -y --quiet && \
68
- conda install -c cadquery -c conda-forge cadquery="$cq_version" && \
66
+ conda install -c conda-forge -c python python=3.8 && \
67
+ conda install -c conda-forge -c cadquery cadquery="$cq_version" && \
68
+ pip install jupyter-cadquery==2.1.0 && \
69
69
conda clean -afy
70
70
71
+
71
72
# Install neutronics dependencies from Debian package manager
72
73
RUN if [ "$include_neutronics" = "true" ] ; \
73
74
then echo installing with include_neutronics=true ; \
@@ -88,20 +89,9 @@ RUN if [ "$include_neutronics" = "true" ] ; \
88
89
apt-get --yes install libglfw3-dev ; \
89
90
fi
90
91
91
- # Clone and install NJOY2016
92
- RUN if [ "$include_neutronics" = "true" ] ; \
93
- then git clone --single-branch --branch master https://github.com/njoy/NJOY2016.git /opt/NJOY2016 ; \
94
- cd /opt/NJOY2016 ; \
95
- mkdir build ; \
96
- cd build ; \
97
- cmake -Dstatic=on .. ; \
98
- make 2>/dev/null ; \
99
- make install ; \
100
- fi
101
-
102
92
# Clone and install Embree
103
93
RUN if [ "$include_neutronics" = "true" ] ; \
104
- then git clone --single-branch --branch master https://github.com/embree/embree.git ; \
94
+ then git clone --single-branch --branch v3.12.2 --depth 1 https://github.com/embree/embree.git ; \
105
95
cd embree ; \
106
96
mkdir build ; \
107
97
cd build ; \
@@ -117,7 +107,7 @@ RUN if [ "$include_neutronics" = "true" ] ; \
117
107
mkdir MOAB ; \
118
108
cd MOAB ; \
119
109
mkdir build ; \
120
- git clone --single-branch --branch develop https://bitbucket.org/fathomteam/moab.git ; \
110
+ git clone --single-branch --branch 5.2.1 --depth 1 https://bitbucket.org/fathomteam/moab.git ; \
121
111
cd build ; \
122
112
cmake ../moab -DENABLE_HDF5=ON \
123
113
-DENABLE_NETCDF=ON \
@@ -141,7 +131,6 @@ RUN if [ "$include_neutronics" = "true" ] ; \
141
131
python setup.py install ; \
142
132
fi
143
133
144
-
145
134
# Clone and install Double-Down
146
135
RUN if [ "$include_neutronics" = "true" ] ; \
147
136
then git clone --single-branch --branch main https://github.com/pshriwise/double-down.git ; \
@@ -159,7 +148,7 @@ RUN if [ "$include_neutronics" = "true" ] ; \
159
148
RUN if [ "$include_neutronics" = "true" ] ; \
160
149
then mkdir DAGMC ; \
161
150
cd DAGMC ; \
162
- git clone --single-branch --branch develop https://github.com/svalinn/DAGMC.git ; \
151
+ git clone --single-branch --branch 3.2.0 --depth 1 https://github.com/svalinn/DAGMC.git ; \
163
152
mkdir build ; \
164
153
cd build ; \
165
154
cmake ../DAGMC -DBUILD_TALLY=ON \
@@ -187,23 +176,30 @@ RUN if [ "$include_neutronics" = "true" ] ; \
187
176
make -j"$compile_cores" install ; \
188
177
cd .. ; \
189
178
pip install -e .[test] ; \
190
- /opt/openmc/tools/ci/download-xs.sh ; \
191
179
fi
192
180
193
- ENV OPENMC_CROSS_SECTIONS=/root/nndc_hdf5/cross_sections.xml
194
-
195
181
RUN if [ "$include_neutronics" = "true" ] ; \
196
182
then pip install vtk ; \
197
183
pip install parametric_plasma_source ; \
198
- pip install neutronics_material_maker ; \
184
+ pip install neutronics_material_maker==0.3.2 ; \
185
+ pip install openmc_data_downloader ; \
186
+ openmc_data_downloader -e all -i H3 -l ENDFB-7.1-NNDC TENDL-2019 -p neutron photon ; \
199
187
fi
200
188
201
189
COPY requirements.txt requirements.txt
202
190
RUN pip install -r requirements.txt
203
191
204
- # @pullrequest reviewer, we would like to make the copy optional but don't know
205
- # how. Then we can build a dependency image for use in circle ci.
206
- # Copy over the source code, examples and tests
192
+ ENV OPENMC_CROSS_SECTIONS=/cross_sections.xml
193
+ ENV PATH="/MOAB/build/bin:${PATH}"
194
+ ENV PATH="/DAGMC/bin:${PATH}"
195
+
196
+ RUN mkdir /home/paramak
197
+ EXPOSE 8888
198
+ WORKDIR /home/paramak
199
+
200
+
201
+ FROM dependencies as final
202
+
207
203
COPY run_tests.sh run_tests.sh
208
204
COPY paramak paramak/
209
205
COPY examples examples/
@@ -213,3 +209,7 @@ COPY README.md README.md
213
209
214
210
# using setup.py instead of pip due to https://github.com/pypa/pip/issues/5816
215
211
RUN python setup.py install
212
+
213
+ # this helps prevent the kernal failing
214
+ RUN echo "#!/bin/bash\n\n jupyter lab --notebook-dir=/home/paramak --port=8888 --no-browser --ip=0.0.0.0 --allow-root" >> /home/paramak/docker-cmd.sh
215
+ CMD bash /home/paramak/docker-cmd.sh
0 commit comments