Skip to content
Open
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: 25 additions & 42 deletions tacc-mvapich2.3-ib-python3.12/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Builds a Docker image for running FEniCS on TACC machines
# The image is at:
#
# https://hub.docker.com/r/uvilla/fenics-2019.1-tacc-mvapich2.3-ib
#
# This is a modified version of
# https://bitbucket.org/fenics-project/docker/src/master/dockerfiles/dev-env/Dockerfile
# This is a modified version of
# https://bitbucket.org/fenics-project/docker/src/master/dockerfiles/dev-env/Dockerfile
#
# See License for further information
#
Expand All @@ -16,16 +13,12 @@

FROM tacc/tacc-ubuntu18-mvapich2.3-ib


RUN useradd -m -s /bin/bash -G sudo fenics && \
echo "fenics:docker" | chpasswd



USER root
WORKDIR /tmp

# Environment variables
ENV FENICS_HOME=/home/fenics
ENV PETSC_VERSION=3.20.2 \
SLEPC_VERSION=3.20.1 \
Expand All @@ -38,10 +31,8 @@ ENV PETSC_VERSION=3.20.2 \
OPENBLAS_VERBOSE=0 \
FENICS_PREFIX=$FENICS_HOME/local

# Non-Python utilities and libraries
RUN apt-get -qq update && \
apt-get -y --with-new-pkgs \
-o Dpkg::Options::="--force-confold" upgrade && \
apt-get -y --with-new-pkgs -o Dpkg::Options::="--force-confold" upgrade && \
apt-get -y install curl && \
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get -y install \
Expand Down Expand Up @@ -78,7 +69,7 @@ RUN apt-get -qq update && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Build python 3.12 from source
# Build Python 3.12 from source
RUN apt-get -qq update && \
apt-get -y install build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm \
Expand All @@ -96,8 +87,7 @@ RUN update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python

# Install Python3 based environment
RUN apt-get -qq update && \
apt-get -y --with-new-pkgs \
-o Dpkg::Options::="--force-confold" upgrade && \
apt-get -y --with-new-pkgs -o Dpkg::Options::="--force-confold" upgrade && \
apt-get -y install \
python3-dev \
python3-flufl.lock \
Expand All @@ -110,16 +100,14 @@ RUN apt-get -qq update && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install setuptools
# Install pip / setuptools for Python 3.12
RUN wget https://bootstrap.pypa.io/pip/get-pip.py && \
python3 get-pip.py && \
pip3 install --no-cache-dir setuptools && \
rm -rf /tmp/*

# Install PETSc from source
RUN apt-get -qq update && \
# apt-get -y install \
# python-minimal && \
wget -nc --quiet https://gitlab.com/petsc/petsc/-/archive/v${PETSC_VERSION}/petsc-v${PETSC_VERSION}.tar.gz -O petsc-${PETSC_VERSION}.tar.gz && \
mkdir -p petsc-src && tar -xf petsc-${PETSC_VERSION}.tar.gz -C petsc-src --strip-components 1 && \
cd petsc-src && \
Expand All @@ -138,7 +126,7 @@ RUN apt-get -qq update && \
--download-spai \
--download-suitesparse \
--download-superlu \
--download-hdf5\
--download-hdf5 \
--download-strumpack \
--download-ml \
--prefix=/usr/local/petsc-32 && \
Expand All @@ -150,11 +138,7 @@ ENV HDF5_ROOT=/usr/local/petsc-32
ENV SCOTCH_DIR=/usr/local/petsc-32

# Install SLEPc from source
# NOTE: Had issues building SLEPc from source tarball generated by bitbucket.
# Website tarballs work fine, however.
RUN apt-get -qq update && \
# apt-get -y install \
# python-minimal && \
wget -nc --quiet https://gitlab.com/slepc/slepc/-/archive/v${SLEPC_VERSION}/slepc-v${SLEPC_VERSION}.tar.gz -O slepc-${SLEPC_VERSION}.tar.gz && \
mkdir -p slepc-src && tar -xf slepc-${SLEPC_VERSION}.tar.gz -C slepc-src --strip-components 1 && \
export PETSC_DIR=/usr/local/petsc-32 && \
Expand All @@ -164,27 +148,26 @@ RUN apt-get -qq update && \
make install && \
rm -rf /tmp/*

# By default use the 32-bit build of SLEPc and PETSc.
# By default use the 32-bit build of SLEPc and PETSc
ENV SLEPC_DIR=/usr/local/slepc-32 \
PETSC_DIR=/usr/local/petsc-32

# Install jupyterlab, sympy, mpi4py, petsc4py, slepc4py and pybind11 from source.
RUN pip3 install --no-cache-dir jupyter jupyterlab matplotlib scipy sympy tqdm pkgconfig && \
pip3 install --no-cache-dir mpi4py==${MPI4PY_VERSION} && \
pip3 install --no-cache-dir petsc4py==${PETSC4PY_VERSION} && \
pip3 install --no-cache-dir slepc4py==${SLEPC4PY_VERSION} && \
pip3 install --no-cache-dir pybind11==${PYBIND11_VERSION} && \
wget -nc --quiet https://github.com/pybind/pybind11/archive/v${PYBIND11_VERSION}.tar.gz && \
tar -xf v${PYBIND11_VERSION}.tar.gz && \
cd pybind11-${PYBIND11_VERSION} && \
mkdir build && \
cd build && \
cmake -DPYBIND11_TEST=False ../ && \
make && \
make install && \
rm -rf /tmp/*
# Pin Cython to 3.0.x for petsc4py/slepc4py 3.20.x
# Pin SymPy to <1.14 to avoid FIAT/FFC crash during DOLFIN doc/demo generation
RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel \
&& pip3 install --no-cache-dir "Cython>=3.0,<3.1" \
&& pip3 install --no-cache-dir jupyter jupyterlab matplotlib scipy "sympy>=1.12.1,<1.14" tqdm pkgconfig \
&& pip3 install --no-cache-dir mpi4py==${MPI4PY_VERSION} \
&& PETSC_DIR=/usr/local/petsc-32 pip3 install --no-cache-dir --no-build-isolation petsc4py==${PETSC4PY_VERSION} \
&& SLEPC_DIR=/usr/local/slepc-32 pip3 install --no-cache-dir --no-build-isolation slepc4py==${SLEPC4PY_VERSION} \
&& wget -nc --quiet https://github.com/pybind/pybind11/archive/v${PYBIND11_VERSION}.tar.gz \
&& tar -xf v${PYBIND11_VERSION}.tar.gz \
&& cd pybind11-${PYBIND11_VERSION} \
&& mkdir build && cd build \
&& cmake -DPYBIND11_TEST=False ../ \
&& make && make install \
&& rm -rf /tmp/*

# Our helper scripts
WORKDIR $FENICS_HOME
COPY fenics.env.conf $FENICS_HOME/fenics.env.conf
COPY bin $FENICS_HOME/bin
Expand All @@ -211,6 +194,6 @@ RUN /home/fenics/bin/fenics-pull && \
/home/fenics/bin/fenics-build

# symbol link ufl to ufl_legacy
RUN ln -s /usr/local/lib/python3.12/site-packages/ufl_legacy /usr/local/lib/python3.12/site-packages/ufl
RUN ln -s /usr/local/lib/python3.12/site-packages/ufl_legacy /usr/local/lib/python3.12/site-packages/ufl || true

RUN ldconfig
RUN ldconfig