Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding dockerfile for pyne vs Python/moab5.0/dagmc #4

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# CNERG Dockerfiles

A set of dockerfiles to be shared among CNERG users for our mutual benefit and convenience.

ubuntu:
-u.18.04.py.2.7: ubuntu 18.04 + python 2.7
-u.18.04.py.3.6: ubuntu 18.04 + python 3.6

moab:
- u.18.04_py.2.7_moab.5.1.0: moab 5.1.0 against ubuntu 18.04 + python 2.7
- u.18.04_py.3.6_moab.5.1.0: moab 5.1.0 against ubuntu 18.04 + python 3.6

dagmc:
- u.18.04_py.2.7_moab.5.1.0_dagmc.dev: dagmc develop against ubuntu 18.04 + python 2.7 + moab 5.1.0
- u.18.04_py.3.6_moab.5.1.0_dagmc.dev: dagmc develop against ubuntu 18.04 + python 3.6 + moab 5.1.0

pyne:
- u.18.04_py.2.7_moab.5.1.0_dagmc.dev_pyne.dev: pyne develop against ubuntu 18.04 + python 2.7 + moab 5.1.0 + dagmc develop
- u.18.04_py.3.6_moab.5.1.0_dagmc.dev_pyne.dev: pyne develop against ubuntu 18.04 + python 3.6 + moab 5.1.0 + dagmc develop
16 changes: 16 additions & 0 deletions dagmc/u.18.04_py.2.7_moab.5.1.0_dagmc.dev.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ubuntu.18.04_python.2.7_moab:5.1.0

ENV INSTALL_PATH=$HOME/opt/dagmc
RUN cd /root \\
&& git clone https://github.com/svalinn/DAGMC.git \
&& cd DAGMC \
&& git checkout develop \
&& mkdir bld \
&& cd bld \
&& cmake .. -DMOAB_DIR=$HOME/opt/moab \
-DCMAKE_INSTALL_PREFIX=$INSTALL_PATH \
&& make \
&& make install

# Define default command
CMD ["/bin/bash"]
16 changes: 16 additions & 0 deletions dagmc/u.18.04_py.3.6_moab.5.1.0_dagmc.dev.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ubuntu.18.04_python.3.6_moab:5.1.0

ENV INSTALL_PATH=$HOME/opt/dagmc
RUN cd /root \\
&& git clone https://github.com/svalinn/DAGMC.git \
&& cd DAGMC \
&& git checkout develop \
&& mkdir bld \
&& cd bld \
&& cmake .. -DMOAB_DIR=$HOME/opt/moab \
-DCMAKE_INSTALL_PREFIX=$INSTALL_PATH \
&& make \
&& make install

# Define default command
CMD ["/bin/bash"]
File renamed without changes.
43 changes: 43 additions & 0 deletions moab/u.18.04_py.2.7_moab.5.1.0.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM ubuntu.18.04_py:2.7

# make starting directory
RUN mkdir -p $HOME/opt
RUN echo "export PATH=$HOME/.local/bin:\$PATH" >> ~/.bashrc \
&& echo "alias build_pyne='python setup.py install --user -j 3 -DMOAB_LIBRARY=\$HOME/opt/moab/lib -DMOAB_INCLUDE_DIR=\$HOME/opt/moab/include'" >> ~/.bashrc \
&& echo "alias python=python" >> ~/.bashrc \
&& echo "alias nosetests=nosetests3" >> ~/.bashrc

RUN pip install cython --force-reinstall

# build MOAB
RUN cd $HOME/opt \
&& mkdir moab \
&& cd moab \
&& git clone https://bitbucket.org/fathomteam/moab \
&& cd moab \
&& git checkout -b Version5.1.0 origin/Version5.1.0 \
&& cd .. \
&& mkdir build \
&& cd build \
&& ls ../moab/ \
&& cmake ../moab/ \
-DCMAKE_INSTALL_PREFIX=$HOME/opt/moab \
-DENABLE_HDF5=ON \
&& make -j 3 \
&& make install \
&& cmake ../moab/ \
-DCMAKE_INSTALL_PREFIX=$HOME/opt/moab \
-DENABLE_HDF5=ON \
-DBUILD_SHARED_LIBS=OFF \
&& make -j 3 \
&& make install \
&& cd .. \
&& rm -rf build moab

# put MOAB on the path
ENV LD_LIBRARY_PATH $HOME/opt/moab/lib:$LD_LIBRARY_PATH
ENV LIBRARY_PATH $HOME/opt/moab/lib:$LIBRARY_PATH
ENV PYTHONPATH=$HOME/opt/moab/lib/python2.7/site-packages/

# Define default command
CMD ["/bin/bash"]
41 changes: 41 additions & 0 deletions moab/u.18.04_py.3.6_moab.5.1.0.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM ubuntu.18.04_py:3.6

# make starting directory
RUN mkdir -p $HOME/opt
RUN echo "export PATH=$HOME/.local/bin:\$PATH" >> ~/.bashrc \
&& echo "alias build_pyne='python setup.py install --user -j 3 -DMOAB_LIBRARY=\$HOME/opt/moab/lib -DMOAB_INCLUDE_DIR=\$HOME/opt/moab/include'" >> ~/.bashrc \
&& echo "alias python=python" >> ~/.bashrc \
&& echo "alias nosetests=nosetests3" >> ~/.bashrc

# build MOAB
RUN cd $HOME/opt \
&& mkdir moab \
&& cd moab \
&& git clone https://bitbucket.org/fathomteam/moab \
&& cd moab \
&& git checkout -b Version5.1.0 origin/Version5.1.0 \
&& cd .. \
&& mkdir build \
&& cd build \
&& ls ../moab/ \
&& cmake ../moab/ \
-DCMAKE_INSTALL_PREFIX=$HOME/opt/moab \
-DENABLE_HDF5=ON \
&& make -j 3 \
&& make install \
&& cmake ../moab/ \
-DCMAKE_INSTALL_PREFIX=$HOME/opt/moab \
-DENABLE_HDF5=ON \
-DBUILD_SHARED_LIBS=OFF \
&& make -j 3 \
&& make install \
&& cd .. \
&& rm -rf build moab

# put MOAB on the path
ENV LD_LIBRARY_PATH $HOME/opt/moab/lib:$LD_LIBRARY_PATH
ENV LIBRARY_PATH $HOME/opt/moab/lib:$LIBRARY_PATH
ENV PYTHONPATH=$HOME/opt/moab/lib/python3.6/site-packages/

# Define default command
CMD ["/bin/bash"]
15 changes: 15 additions & 0 deletions pyne/u.18.04_py.2.7_moab.5.1.0_dagmc.dev_pyne.dev.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from ubuntu.18.04_python.2.7_moab.5.1.0_dagmc:dev

# Install PyNE
RUN cd $HOME/opt \
&& git clone https://github.com/cnerg/pyne.git \
&& cd pyne \
&& git checkout pymoab_cleanup \
&& python setup.py install --user \
--moab $HOME/opt/moab --dagmc $HOME/opt/dagmc --clean

ENV PATH $HOME/.local/bin:$PATH
RUN cd $HOME && nuc_data_make

# Define default command
CMD ["/bin/bash"]
15 changes: 15 additions & 0 deletions pyne/u.18.04_py.3.6_moab.5.1.0_dagmc.dev_pyne.dev.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from ubuntu.18.04_python.3.6_moab.5.1.0_dagmc:dev

# Install PyNE
RUN cd $HOME/opt \
&& git clone https://github.com/cnerg/pyne.git \
&& cd pyne \
&& git checkout pymoab_cleanup \
&& python3 setup.py install --user \
--moab $HOME/opt/moab --dagmc $HOME/opt/dagmc --clean

ENV PATH $HOME/.local/bin:$PATH
RUN cd $HOME && nuc_data_make

# Define default command
CMD ["/bin/bash"]
23 changes: 23 additions & 0 deletions ubuntu.18.04_python_moab.5.1.0_dagmc.dev_pyne.dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash


py_v="3.6"
if [ ! $# -eq 1 ]; then
echo "Python version not specified!"
echo "Using default version: ${py_v}"
elif [ $1 == "3.6" ] || [ $1 == "2.7" ]; then
py_v=$1
else
echo "2.7 and 3.6 are the only supported Python version !"
echo "Using default version: ${py_v}"
fi

# build Ubuntu 18.04 with required python version
docker build -t ubuntu.18.04_py:${py_v} -f ubuntu/u.18.04.py.${py_v}.dockerfile .
# build moab
docker build -t ubuntu.18.04_python.${py_v}_moab:5.1.0 -f moab/u.18.04_py.${py_v}_moab.5.1.0.dockerfile .
# build dagmc
docker build -t ubuntu.18.04_python.${py_v}_moab.5.1.0_dagmc:dev -f dagmc/u.18.04_py.${py_v}_moab.5.1.0_dagmc.dev.dockerfile .
# build pyne
docker build -t ubuntu.18.04_py.${py_v}_moab.5.1.0_dagmc.dev_pyne:dev -f pyne/u.18.04_py.${py_v}_moab.5.1.0_dagmc.dev_pyne.dev.dockerfile .

26 changes: 26 additions & 0 deletions ubuntu/u.18.04.py.2.7.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:18.04

ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

ENV HOME /root
RUN apt-get update \
&& apt-get install -y --fix-missing \
software-properties-common wget g++ \
build-essential python-numpy python-scipy cython python-setuptools \
python-nose git cmake vim emacs gfortran libblas-dev \
liblapack-dev libhdf5-dev libhdf5-serial-dev gfortran python-tables \
python-matplotlib python-jinja2 python-dev libpython-dev \
autoconf libtool python-setuptools python-pip doxygen \
&& apt-get clean -y \
&& pip install sphinx \
cloud_sptheme \
prettytable \
sphinxcontrib_bibtex \
numpydoc \
nbconvert \
numpy


# Define default command
CMD ["/bin/bash"]
28 changes: 28 additions & 0 deletions ubuntu/u.18.04.py.3.6.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ubuntu:18.04

ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

ENV HOME /root

RUN apt-get update \
&& apt-get install -y --fix-missing \
software-properties-common wget g++ \
build-essential python3-numpy python3-scipy cython python3-setuptools \
python3-nose git cmake vim emacs gfortran libblas-dev \
liblapack-dev libhdf5-dev libhdf5-serial-dev gfortran python3-tables \
python3-matplotlib python3-jinja2 python3-dev libpython3-dev \
autoconf libtool python-setuptools python3-pip doxygen \
&& apt-get clean -y \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
&& pip3 install --force-reinstall \
sphinx \
cloud_sptheme \
prettytable \
sphinxcontrib_bibtex \
numpydoc \
nbconvert \
cython

# Define default command
CMD ["/bin/bash"]