1
- # VERSION: 0.1
1
+ # VERSION: 1.0
2
2
# DESCRIPTION: Dockerized PyNucleus build
3
3
# AUTHOR: Christian Glusa
4
4
5
5
# Base docker image
6
6
FROM debian:testing
7
7
LABEL maintainer Christian Glusa
8
8
9
- ENV LANG en_US.UTF-8
10
-
11
9
# install packages needed for build
12
10
RUN sed -i 's/Components: main/Components: main contrib non-free/' /etc/apt/sources.list.d/debian.sources \
13
11
&& apt-get update && \
14
12
DEBIAN_FRONTEND=noninteractive apt-get install -y \
15
- locales \
16
- autoconf automake gcc g++ make gfortran wget zlib1g-dev libffi-dev \
17
- tk-dev \
18
- libssl-dev ca-certificates cmake \
19
- git less \
20
- libboost-dev \
13
+ gcc g++ make gfortran \
14
+ libssl-dev ca-certificates \
15
+ git less nano \
16
+ libmetis-dev libparmetis-dev \
21
17
hdf5-tools \
22
18
libsuitesparse-dev \
23
19
libarpack2-dev \
24
20
mpi-default-bin mpi-default-dev \
25
- python3 python3-dev python-is-python3 python3-pip python3-mpi4py cython3 python3-numpy python3-scipy python3-matplotlib python3-tk python3-venv \
26
- libmetis-dev libparmetis-dev \
27
- texlive texlive-extra-utils texlive-latex-extra ttf-staypuft dvipng cm-super \
28
- jupyter-notebook \
29
- emacs-nox vim \
21
+ python3 python3-dev python-is-python3 python3-pip \
22
+ python3-numpy python3-scipy python3-matplotlib python3-mpi4py cython3 python3-yaml python3-h5py python3-tk jupyter-notebook \
30
23
--no-install-recommends \
31
- && rm -rf /var/lib/apt/lists/* \
32
- && sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen \
33
- && dpkg-reconfigure --frontend=noninteractive locales \
34
- && update-locale LANG=$LANG
24
+ && rm -rf /var/lib/apt/lists/*
35
25
36
26
# allow running MPI as root in the container
37
27
# bind MPI ranks to hwthreads
38
- ENV LANG=en_US.UTF-8 \
39
- LANGUAGE=en_US:en \
40
- LC_ALL=en_US.UTF-8 \
41
- VIRTUAL_ENV=/pynucleus/venv \
42
- PATH="/pynucleus/venv/bin:$PATH" \
43
- OMPI_MCA_hwloc_base_binding_policy=hwthread \
28
+ ENV OMPI_MCA_hwloc_base_binding_policy=hwthread \
44
29
MPIEXEC_FLAGS=--allow-run-as-root \
45
30
OMPI_ALLOW_RUN_AS_ROOT=1 \
46
31
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
@@ -49,14 +34,32 @@ COPY . /pynucleus
49
34
50
35
WORKDIR /pynucleus
51
36
52
- RUN python3 -m venv $VIRTUAL_ENV && \
53
- make prereq PIP_FLAGS=--no-cache-dir && \
54
- make prereq-extra PIP_FLAGS=--no-cache-dir && \
55
- make install && \
37
+ ARG PYNUCLEUS_BUILD_PARALLELISM=1
38
+
39
+ # Build PyNucleus
40
+ RUN make prereq PIP_FLAGS="--no-cache-dir --break-system-packages" && \
41
+ make prereq-extra PIP_FLAGS="--no-cache-dir --break-system-packages" && \
42
+ make install PIP_INSTALL_FLAGS="--no-cache-dir --break-system-packages" && \
56
43
make docs && \
57
- python -m pip install --no-cache-dir ipykernel && \
58
- rm -rf build packageTools/build base/build metisCy/build fem/build multilevelSolver/build nl/build && \
44
+ find . -type f -name '*.c' -exec rm {} + && \
45
+ find . -type f -name '*.cpp' -exec rm {} + && \
46
+ rm -rf build packageTools/build base/build metisCy/build fem/build multilevelSolver/build nl/build
47
+
48
+ # Set up Jupyter notebooks, greeting, some bash things
49
+ RUN python -m pip install --no-cache-dir --break-system-packages ipykernel && \
59
50
python -m ipykernel install --name=PyNucleus && \
60
- echo '[ ! -z "$TERM" -a -r /pynucleus/README.container.rst ] && printf "\e [32m" && cat /pynucleus/README.container.rst && printf "\e [0m"' >> /etc/bash.bashrc
51
+ echo '[ ! -z "$TERM" -a -r /pynucleus/README.container.rst ] && printf "\e [32m" && cat /pynucleus/README.container.rst && printf "\e [0m"' >> /etc/bash.bashrc && \
52
+ echo "alias ls='ls --color=auto -FN'" >> /etc/bash.bashrc && \
53
+ echo "set completion-ignore-case On" >> /etc/inputrc
61
54
62
55
WORKDIR /root
56
+
57
+ # Copy examples and drivers to user home, launch Jupyter notebook server
58
+ ENTRYPOINT mkdir -p /root/examples && \
59
+ mkdir -p /root/drivers && \
60
+ cp -r --no-clobber /pynucleus/examples/* /root/examples && \
61
+ cp -r --no-clobber /pynucleus/drivers/* /root/drivers && \
62
+ jupyter notebook --port=8889 --no-browser --ip=0.0.0.0 --allow-root --NotebookApp.token='' --NotebookApp.password='' --notebook-dir=/root/ --KernelSpecManager.ensure_native_kernel=False --KernelSpecManager.allowed_kernelspecs=pynucleus > /dev/null 2>&1 & \
63
+ /bin/bash
64
+
65
+ EXPOSE 8889
0 commit comments