From 9762504afd8d38f0dd8f09fb93b37114494c0e80 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 24 Feb 2022 00:05:05 +0000 Subject: [PATCH 1/4] updated dagmc, openmc, moab and using paramak_develop --- Dockerfile | 58 +++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index 459826d..38b7d5f 100755 --- a/Dockerfile +++ b/Dockerfile @@ -23,12 +23,15 @@ # true false # controls if the Embree is built to use AVX instruction set (true) or not (false). AVX is not supported by all CPUs -# docker build -t fusion-neutronics-workflow --build-arg compile_cores=7 --build-arg build_double_down=OFF . -# docker build -t fusion-neutronics-workflow:embree --build-arg compile_cores=7 --build-arg build_double_down=ON --build-arg include_avx=true . -# docker build -t fusion-neutronics-workflow:embree-avx --build-arg compile_cores=7 --build-arg build_double_down=ON --build-arg include_avx=false . - - -# This can't be done currently as the base images uses conda installs for moab / dagmc which don't compile with OpenMC +# example builds +# simplest quickest build that does not contain the speed benefits of double down +# docker build -t fusion-neutronics-workflow --build-arg compile_cores=7 --build-arg build_double_down=OFF . +# medium level build that contain some of the speed benefits of double down +# docker build -t fusion-neutronics-workflow:embree-avx --build-arg compile_cores=7 --build-arg build_double_down=ON --build-arg include_avx=false . +# performance level build that contain all of the speed benefits of double down +# docker build -t fusion-neutronics-workflow:embree --build-arg compile_cores=7 --build-arg build_double_down=ON --build-arg include_avx=true . + +# base image contains nuclear data FROM ghcr.io/openmc-data-storage/miniconda3_4.9.2_endfb-7.1_nndc_tendl_2019:latest ARG compile_cores=1 @@ -62,13 +65,8 @@ RUN apt-get install -y libgl1-mesa-glx \ RUN pip install cython RUN conda install -c anaconda numpy==1.21.2 -# Installing CadQuery -RUN conda install -c conda-forge -c cadquery cadquery=master && \ - pip install jupyter-cadquery==2.1.0 - -# Installing Gmsh -RUN conda install -c conda-forge gmsh && \ - conda install -c conda-forge python-gmsh +# Installing CadQuery add on +RUN pip install jupyter-cadquery==2.1.0 # Install neutronics dependencies from Debian package manager RUN apt-get install -y \ @@ -122,7 +120,7 @@ RUN if [ "$build_double_down" = "ON" ] ; \ RUN mkdir MOAB && \ cd MOAB && \ mkdir build && \ - git clone --shallow-submodules --single-branch --branch 5.3.0 --depth 1 https://bitbucket.org/fathomteam/moab.git && \ + git clone --shallow-submodules --single-branch --branch 5.3.1 --depth 1 https://bitbucket.org/fathomteam/moab.git && \ cd build && \ cmake ../moab -DENABLE_HDF5=ON \ -DENABLE_NETCDF=ON \ @@ -163,13 +161,7 @@ RUN if [ "$build_double_down" = "ON" ] ; \ # Clone and install DAGMC RUN mkdir DAGMC && \ cd DAGMC && \ - # change to version 3.2.1 when released - # git clone --single-branch --branch 3.2.1 --depth 1 https://github.com/svalinn/DAGMC.git && \ - git clone --single-branch --branch develop https://github.com/svalinn/DAGMC.git && \ - cd DAGMC && \ - # this commit is from this PR https://github.com/svalinn/DAGMC/pull/786 - git checkout fbd0cdbad100a0fd8d80de42321e69d09fdd67f4 && \ - cd .. && \ + git clone --single-branch --branch v3.2.1 --depth 1 https://github.com/svalinn/DAGMC.git && \ mkdir build && \ cd build && \ cmake ../DAGMC -DBUILD_TALLY=ON \ @@ -182,8 +174,7 @@ RUN mkdir DAGMC && \ make -j"$compile_cores" install && \ rm -rf /DAGMC/DAGMC /DAGMC/build -# Clone and install OpenMC with DAGMC -# TODO clone a specific release when the next release containing (PR 1825) is avaialble. +# Clone OpenMC and install OpenMC with DAGMC RUN cd /opt && \ git clone --single-branch --branch v0.13.0 --depth 1 https://github.com/openmc-dev/openmc.git && \ cd openmc && \ @@ -200,16 +191,22 @@ RUN cd /opt && \ pip install -e .[test] +RUN conda install -c fusion-energy -c cadquery -c conda-forge paramak_develop -COPY requirements.txt requirements.txt -RUN pip install -r requirements.txt +# pip installs latest versions of analysis packages +RUN pip install openmc-dagmc-wrapper +RUN pip install openmc-plasma-source +RUN pip install openmc_tally_unit_converter +RUN pip install spectrum_plotter +RUN pip install regular_mesh_plotter +RUN pip install openmc_data_downloader # solves binary incompatabilitiy error RUN pip install numpy --upgrade -# installs python packages and nuclear data (quick as it does not overwrite existing h5 files) -RUN openmc_data_downloader -d nuclear_data -e all -i H3 -l ENDFB-7.1-NNDC TENDL-2019 -p neutron photon --no-overwrite +# # installs python packages and nuclear data (quick as it does not overwrite existing h5 files) +# RUN openmc_data_downloader -d nuclear_data -e all -i H3 -l ENDFB-7.1-NNDC TENDL-2019 -p neutron photon --no-overwrite # solves OSError: libXft.so.2: cannot open shared object file: No such file or directory RUN apt-get install libxft2 @@ -232,3 +229,10 @@ COPY example_01_single_volume_cell_tally examples/example_01_single_volume_cell_ COPY example_02_multi_volume_cell_tally examples/example_02_multi_volume_cell_tally/ COPY example_04_multi_volume_regular_mesh_tally examples/example_04_multi_volume_regular_mesh_tally/ COPY example_05_3D_unstructured_mesh_tally examples/example_05_3D_unstructured_mesh_tally/ + + +#this sets the port, gcr looks for this varible +ENV PORT 8888 + +# could switch to --ip='*' +CMD ["jupyter", "notebook", "--notebook-dir=/tasks", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"] From ae4a292210c6714221e606fe9a112678aa8e1610 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 24 Feb 2022 00:37:36 +0000 Subject: [PATCH 2/4] commented out jupyter line --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 38b7d5f..a5ef7ca 100755 --- a/Dockerfile +++ b/Dockerfile @@ -235,4 +235,4 @@ COPY example_05_3D_unstructured_mesh_tally examples/example_05_3D_unstructured_m ENV PORT 8888 # could switch to --ip='*' -CMD ["jupyter", "notebook", "--notebook-dir=/tasks", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"] +# CMD ["jupyter", "notebook", "--notebook-dir=/tasks", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"] From 9b9e6b3dbb6756ad93ee8258bb96450a4c09d342 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 24 Feb 2022 00:43:07 +0000 Subject: [PATCH 3/4] [skip ci] added etra docker details --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 3cd8a94..504759a 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,8 @@ that is: # Dockerfile +## Quick start + The Dockerfile can build locally or a prebuilt one can be downloaded with ```bash docker pull ghcr.io/fusion-energy/fusion-neutronics-workflow @@ -56,6 +58,17 @@ The docker image can then be run with docker run -it ghcr.io/fusion-energy/fusion-neutronics-workflow ``` +## Sharing files + +To map a local folder to the docker container a volume mount can be used. +The following example mounts the local folder that the command is being run from with the ```/home/fusion-neutronics-workflow/examples``` that is inside the docker +images +```bash +docker run -it -v $PWD:/home/fusion-neutronics-workflow/examples ghcr.io/fusion-energy/fusion-neutronics-workflow +``` + +## Performance builds + There are additional higher performance docker images available if your CPU supports vectorization instructions available Embree. @@ -69,6 +82,7 @@ Download a prebuilt docker image with Embree compiled with AVX instruction set a docker pull ghcr.io/fusion-energy/fusion-neutronics-workflow:embree-avx ``` + # Software Packages included Links to the packages that are utilized by the fusion-neutronics-workflow From 64539a12ecce22ecd19bd9b7c88e5d8adb22c227 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 24 Feb 2022 00:44:57 +0000 Subject: [PATCH 4/4] removed requirements --- .../1_create_cad_and_convert_to_dagmc.py | 1 - requirements.txt | 8 -------- 2 files changed, 9 deletions(-) delete mode 100644 requirements.txt diff --git a/example_02_multi_volume_cell_tally/1_create_cad_and_convert_to_dagmc.py b/example_02_multi_volume_cell_tally/1_create_cad_and_convert_to_dagmc.py index d654ff2..77d19f7 100644 --- a/example_02_multi_volume_cell_tally/1_create_cad_and_convert_to_dagmc.py +++ b/example_02_multi_volume_cell_tally/1_create_cad_and_convert_to_dagmc.py @@ -5,7 +5,6 @@ import paramak import os - my_reactor = paramak.BallReactor( inner_bore_radial_thickness=1, inboard_tf_leg_radial_thickness=30, diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index cf5c812..0000000 --- a/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ - -paramak==0.6.7 -openmc-dagmc-wrapper==0.3.1 -openmc-plasma-source==0.2.6 -openmc_tally_unit_converter==0.3.1 -spectrum_plotter==0.2.2 -regular_mesh_plotter==0.2.2 -openmc_data_downloader==0.5.2