Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 43 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,46 @@
This repository is for creating docker containers for BOUT-dev master and next branches. (found here: https://github.com/boutproject/BOUT-dev)
BOUT++ docker scripts
=====================

bout.dkr - docker script for building BOUT-dev master
bout-next.dkr - docker script for building BOUt-dev next
buildBOUT.sh - script to build a container from a docker script
start-interactive.sh - script for starting an interactive docker container
start-BOUT.sh - script for starting bout container with some detailed options (see below)


To build these containers you must first install docker and then set it running (instructions here: https://docs.docker.com/install/linux/docker-ce/centos/)
Once docker is running, you can navigate into this repo directory and type:
./buildBOUT.sh

This will ask you the name of the docker script file you'd like to build so either "bout" or "bout-next"

It may take a while to build, you will need an internet connection, and you will need sudo privelages. If your docker commands
function without sudo privelages, then you will need to modify the buildBOUT.sh script by removing all the sudo commands.

When complete, a list of your currently loaded docker images will be displayed. To open an image as a container you can type:
./start-interactive.sh
it will prompt you for the name of the image (which should either be bout-img or bout-next-img depending on which you built)
This repository contains scripts for creating and using docker
containers for BOUT-dev master and next branches. (found here:
https://github.com/boutproject/BOUT-dev)

To build or use Docker containers, you must first install docker and
then set it running (instructions here:
https://docs.docker.com/install/linux/docker-ce/centos/)

Building docker images
----------------------

The `.dkr` files each create a docker image, and each should have
the command needed to run them at the top of the file.

For example, to build BOUT-next on Arch Linux,

$ cd arch
$ sudo docker build -t boutproject/bout-next:4cee87c-arch -f arch-bout-next.dkr .

Note that the tag should be updated to reflect the BOUT++ commit or release
being compiled.

Using docker images
-------------------

To open an image as a container you can type:

./start-interactive.sh

it will prompt you for the name of the image (which should either be
bout-img or bout-next-img depending on which you built)

You will find yourself at the command line logged in to the container as boutuser. You should see the BOUT++ installation and should be able to build
and run examples.
You will find yourself at the command line logged in to the container
as boutuser. You should see the BOUT++ installation and should be
able to build and run examples.

Alternatively, you can use the start-BOUT.sh script which will prompt you to create a common data folder so files can be shared between your machine and the container. This script
will also prompt you regarding the number of processors you desire.
Alternatively, you can use:

./start-BOUT.sh

which will prompt you to create a common data folder so files can be
shared between your machine and the container. This script will also
prompt you regarding the number of processors you desire.
75 changes: 75 additions & 0 deletions arch/arch-bout-master-sundials.dkr
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# ================================================================================
# Dockerfile to setup build environment for BOUT-master build
#
# Build example:
# sudo docker build -t boutproject/bout-master:3b23201-sundials-arch -f arch-bout-master-sundials.dkr .
#
# ================================================================================

FROM archlinux/base
MAINTAINER Ben Dudson "benjamin.dudson@york.ac.uk"

# ----------------------------------------------------------------
# Convenient network/system tools, python, dependencies
# ----------------------------------------------------------------

RUN pacman -Syu --noconfirm \
&& pacman -Sy --noconfirm emacs-nox vim nano git gcc gcc-fortran \
fftw cblas lapack cmake sudo core/which gawk \
wget make file m4 hdf5 netcdf netcdf-cxx \
python-numpy python-scipy python-matplotlib ipython openmpi \
&& pacman -Scc --noconfirm

#####################
# Install SUNDIALS

WORKDIR /
RUN wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz \
&& tar -xvzf sundials-2.7.0.tar.gz \
&& rm sundials-2.7.0.tar.gz \
&& cd sundials-2.7.0 \
&& mkdir build \
&& mkdir -p /usr/examples \
&& cd build/ \
&& cmake \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DEXAMPLES_INSTALL_PATH=/usr/examples \
-DCMAKE_LINKER=/usr/lib \
-DLAPACK_ENABLE=ON \
-DOPENMP_ENABLE=ON \
-DMPI_ENABLE=ON \
../ \
&& make \
&& make install \
&& cd / \
&& rm -r sundials-2.7.0

# ----------------------------------------------------------------
# Build and install BOUT++
# ----------------------------------------------------------------

# configure and build BOUT++ source code
RUN useradd -ms /bin/bash boutuser \
&& echo -e "boutforever\nboutforever" | passwd boutuser \
&& usermod -aG wheel boutuser \
&& echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers

USER boutuser
WORKDIR /home/boutuser

RUN git clone -b master --depth 1 git://github.com/boutproject/BOUT-dev.git BOUT-master \
&& chown boutuser /home/boutuser/BOUT-master

WORKDIR /home/boutuser/BOUT-master

RUN ./configure --with-sundials=/usr/ --with-fftw --with-netcdf --enable-openmp --with-cvode --with-arkode --with-lapack LIBS="-llapack -lblas" --enable-shared \
&& make \
&& make clean-remove-object-files

ENV PYTHONPATH=/home/boutuser/BOUT-master/tools/pylib/:$PYTHONPATH
ENV PYTHONIOENCODING=utf-8

#####################
# Make common folder for moving data to/from host
WORKDIR /home/boutuser
RUN mkdir bout-img-shared
111 changes: 111 additions & 0 deletions arch/arch-bout-master.dkr
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# ================================================================================
# Dockerfile to setup build environment for BOUT-master build
#
# Build example:
# sudo docker build -t boutproject/bout-master:3b23201-arch -f arch-bout-master.dkr .
#
# ================================================================================

FROM archlinux/base
MAINTAINER Ben Dudson "benjamin.dudson@york.ac.uk"

# ----------------------------------------------------------------
# Convenient network/system tools, python, dependencies
# ----------------------------------------------------------------

RUN pacman -Syu --noconfirm \
&& pacman -Sy --noconfirm emacs-nox vim nano git gcc gcc-fortran \
fftw cblas lapack cmake sudo core/which gawk \
wget make file m4 hdf5 netcdf netcdf-cxx \
python-numpy python-scipy python-matplotlib ipython openmpi \
&& pacman -Scc --noconfirm

#####################
# Install SUNDIALS

WORKDIR /
RUN wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz \
&& tar -xvzf sundials-2.7.0.tar.gz \
&& rm sundials-2.7.0.tar.gz \
&& cd sundials-2.7.0 \
&& mkdir build \
&& mkdir -p /usr/examples \
&& cd build/ \
&& cmake \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DEXAMPLES_INSTALL_PATH=/usr/examples \
-DCMAKE_LINKER=/usr/lib \
-DLAPACK_ENABLE=ON \
-DOPENMP_ENABLE=ON \
-DMPI_ENABLE=ON \
../ \
&& make \
&& make install \
&& cd / \
&& rm -r sundials-2.7.0

#####################
# Install PETSC
#
# Notes:
# - Moved URL for hypre 2.14 release
# - Need python2 for PETSc configure, but remove after install

WORKDIR /
RUN pacman -Sy --noconfirm core/diffutils \
&& pacman -Scc --noconfirm \
&& wget https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.14.2.tar.gz \
&& tar -xvzf petsc-lite-3.14.2.tar.gz \
&& cd petsc-3.14.2/ \
&& ./configure --with-mpi=yes --with-shared-libraries --with-precision=double --with-scalar-type=real \
--download-hypre=https://github.com/hypre-space/hypre/archive/v2.14.0.tar.gz \
&& make -f /petsc-3.14.2/makefile all \
&& make -f /petsc-3.14.2/makefile PETSC_DIR=/petsc-3.14.2 PETSC_ARCH=arch-linux-c-debug check \
&& ln -s /petsc-3.14.2/arch-linux-c-debug/include/* /usr/include/ \
&& ln -s /petsc-3.14.2/arch-linux-c-debug/lib/*a /usr/lib/ \
&& mkdir -p /usr/lib/modules/ \
&& ln -s /petsc-3.14.2/arch-linux-c-debug/lib/modules/* /usr/lib/modules/ \
&& cd /petsc-3.14.2/arch-linux-c-debug/ \
&& rm -r externalpackages obj \
&& cd /petsc-3.14.2/ \
&& rm -r src

ENV PETSC_DIR=/petsc-3.14.2/
ENV PETSC_ARCH=arch-linux-c-debug

####################
# Cython

RUN pacman -Sy --noconfirm cython ipython \
&& pacman -Scc --noconfirm

# ----------------------------------------------------------------
# Build and install BOUT++
# ----------------------------------------------------------------

# configure and build BOUT++ source code
RUN useradd -ms /bin/bash boutuser \
&& echo -e "boutforever\nboutforever" | passwd boutuser \
&& usermod -aG wheel boutuser \
&& echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers

USER boutuser
WORKDIR /home/boutuser

RUN git clone -b master --depth 1 git://github.com/boutproject/BOUT-dev.git BOUT-master \
&& chown boutuser /home/boutuser/BOUT-master

WORKDIR /home/boutuser/BOUT-master

RUN ./configure --with-petsc PETSC_DIR=/petsc-3.14.2 PETSC_ARCH=arch-linux-c-debug --with-sundials=/usr/ --with-fftw --with-netcdf --enable-openmp --with-cvode --with-arkode --with-lapack LIBS="-llapack -lblas" --enable-shared --with-hypre \
&& make \
&& make python \
&& make clean-remove-object-files

ENV PYTHONPATH=/home/boutuser/BOUT-master/tools/pylib/:$PYTHONPATH
ENV PYTHONIOENCODING=utf-8

#####################
# Make common folder for moving data to/from host
WORKDIR /home/boutuser
RUN mkdir bout-img-shared
75 changes: 75 additions & 0 deletions arch/arch-bout-next-sundials.dkr
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# ================================================================================
# Dockerfile to setup build environment for BOUT-next build
#
# Build example:
# sudo docker build -t boutproject/bout-next:4cee87c-sundials-arch -f arch-bout-next-sundials.dkr .
#
# ================================================================================

FROM archlinux/base
MAINTAINER Ben Dudson "benjamin.dudson@york.ac.uk"

# ----------------------------------------------------------------
# Convenient network/system tools, python, dependencies
# ----------------------------------------------------------------

RUN pacman -Syu --noconfirm \
&& pacman -Sy --noconfirm emacs-nox vim nano git gcc gcc-fortran \
fftw cblas lapack cmake sudo core/which gawk \
wget make file m4 hdf5 netcdf netcdf-cxx \
python-numpy python-scipy python-matplotlib ipython openmpi \
&& pacman -Scc --noconfirm

#####################
# Install SUNDIALS

WORKDIR /
RUN wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz \
&& tar -xvzf sundials-2.7.0.tar.gz \
&& rm sundials-2.7.0.tar.gz \
&& cd sundials-2.7.0 \
&& mkdir build \
&& mkdir -p /usr/examples \
&& cd build/ \
&& cmake \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DEXAMPLES_INSTALL_PATH=/usr/examples \
-DCMAKE_LINKER=/usr/lib \
-DLAPACK_ENABLE=ON \
-DOPENMP_ENABLE=ON \
-DMPI_ENABLE=ON \
../ \
&& make \
&& make install \
&& cd / \
&& rm -r sundials-2.7.0

# ----------------------------------------------------------------
# Build and install BOUT++
# ----------------------------------------------------------------

# configure and build BOUT++ source code
RUN useradd -ms /bin/bash boutuser \
&& echo -e "boutforever\nboutforever" | passwd boutuser \
&& usermod -aG wheel boutuser \
&& echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers

USER boutuser
WORKDIR /home/boutuser

RUN git clone -b next --depth 1 git://github.com/boutproject/BOUT-dev.git BOUT-next \
&& chown boutuser /home/boutuser/BOUT-next

WORKDIR /home/boutuser/BOUT-next

RUN ./configure --with-sundials=/usr/ --with-fftw --with-netcdf --enable-openmp --with-cvode --with-arkode --with-lapack LIBS="-llapack -lblas" \
&& make \
&& make clean-remove-object-files

ENV PYTHONPATH=/home/boutuser/BOUT-next/tools/pylib/:$PYTHONPATH
ENV PYTHONIOENCODING=utf-8

#####################
# Make common folder for moving data to/from host
WORKDIR /home/boutuser
RUN mkdir bout-img-shared
Loading