Skip to content

Commit 53078bc

Browse files
committed
Add docker images used for school setup
1 parent 91d1216 commit 53078bc

File tree

3 files changed

+308
-0
lines changed

3 files changed

+308
-0
lines changed

.binder/Dockerfile

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
FROM --platform=linux/amd64 ubuntu:24.04
2+
ARG LLVM=19
3+
ARG BUILD_ID=18
4+
5+
RUN apt-get update && \
6+
#apt-get install -y lsb-release wget software-properties-common && \
7+
#wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && chmod +x /tmp/llvm.sh && /tmp/llvm.sh ${LLVM} && \
8+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9+
make \
10+
meson \
11+
cmake \
12+
g++ \
13+
gfortran \
14+
git \
15+
htop \
16+
nano \
17+
vim \
18+
less \
19+
curl \
20+
hdf5-tools \
21+
openssh-client \
22+
clang-${LLVM} \
23+
llvm-${LLVM}-dev \
24+
libclang-${LLVM}-dev \
25+
libc++-${LLVM}-dev \
26+
libc++abi-${LLVM}-dev \
27+
libomp-${LLVM}-dev \
28+
lldb-${LLVM} \
29+
libboost-dev \
30+
libeigen3-dev \
31+
libfftw3-dev \
32+
libgfortran5 \
33+
libgmp-dev \
34+
libmpfr-dev \
35+
libhdf5-dev \
36+
libopenblas-dev \
37+
libopenmpi-dev \
38+
libnfft3-dev \
39+
libzstd-dev \
40+
openmpi-bin \
41+
openmpi-common \
42+
openmpi-doc \
43+
python3-clang-${LLVM} \
44+
python3-dev \
45+
python3-ipython \
46+
python3-mako \
47+
python3-matplotlib \
48+
python3-mpi4py \
49+
python3-numpy \
50+
python3-pandas \
51+
python3-pytest \
52+
python3-scipy \
53+
python3-setuptools \
54+
python3-skimage \
55+
python3-tk \
56+
python3-tomli \
57+
python3-venv \
58+
jupyter-notebook \
59+
&& \
60+
apt-get autoremove --purge -y && \
61+
apt-get autoclean -y && \
62+
rm -rf /var/cache/apt/* /var/lib/apt/lists/*
63+
64+
RUN ln -s /usr/bin/python3 /usr/bin/python
65+
66+
ARG NB_USER=triqs
67+
ARG NB_UID=1010
68+
RUN useradd -u ${NB_UID} -m ${NB_USER} -o
69+
70+
USER ${NB_USER}
71+
RUN python3 -m venv --system-site-packages /home/${NB_USER}/.venv
72+
ENV VIRTUAL_ENV=/home/${NB_USER}/.venv \
73+
PATH=/home/${NB_USER}/.venv/bin:$PATH
74+
RUN pip install jupyterlab==4.3.7 jupyterhub jupyter-archive ipykernel sparse-ir[xprec]
75+
RUN python -m ipykernel install --user --name=python3
76+
77+
ARG BRANCH=unstable
78+
ARG NCORES=10
79+
ARG ARCH=native
80+
ENV SRC=/tmp/src BUILD=/tmp/build INSTALL=/usr \
81+
CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu/openmpi:/usr/include/hdf5/serial:$CPLUS_INCLUDE_PATH \
82+
CC=clang-${LLVM} CXX=clang++-${LLVM} CXXFLAGS="-stdlib=libc++ -march=${ARCH}"
83+
84+
USER root
85+
RUN set -ex ; \
86+
mkdir $BUILD ; cd $BUILD ; \
87+
git clone https://github.com/flatironinstitute/clair --branch doc --depth 1 $SRC ; \
88+
CXXFLAGS="" cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL ; \
89+
make -j$NCORES ; \
90+
make install ; \
91+
rm -rf $SRC $BUILD ;
92+
RUN set -ex ; \
93+
mkdir $BUILD ; cd $BUILD ; \
94+
git clone https://github.com/TRIQS/triqs --branch modest_updates --depth 1 $SRC ; \
95+
cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL ; \
96+
make -j$NCORES ; \
97+
make install ; \
98+
rm -rf $SRC $BUILD ;
99+
ARG BRANCH=unstable
100+
RUN set -ex ; \
101+
for pkg in cthyb ctseg ctint tprf maxent hubbardI hartree_fock dft_tools solid_dmft ; do \
102+
mkdir $BUILD ; cd $BUILD ; \
103+
git clone https://github.com/TRIQS/$pkg --branch $BRANCH --depth 1 $SRC ; \
104+
cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL ; \
105+
make -j$NCORES ; \
106+
make install ; \
107+
rm -rf $SRC $BUILD ; \
108+
done
109+
RUN set -ex ; \
110+
mkdir $BUILD ; cd $BUILD ; \
111+
git clone https://github.com/TRIQS/modest --branch DEV_DOCS --depth 1 $SRC ; \
112+
cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL -DUpdate_Python_Bindings=ON ; \
113+
make -j$NCORES ; \
114+
make install ; \
115+
rm -rf $SRC $BUILD ;
116+
117+
# SLATE
118+
RUN set -ex ; \
119+
mkdir $BUILD ; cd $BUILD ; \
120+
git clone --branch master --depth 1 \
121+
--recurse-submodules --shallow-submodules \
122+
https://github.com/icl-utk-edu/slate.git $SRC ; \
123+
cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL -Dblas=openblas -Dgpu_backend=none -Dbuild_tests=no ; \
124+
make -j$NCORES ; \
125+
make install ; \
126+
rm -rf $SRC $BUILD ;
127+
128+
# CoQui
129+
RUN set -ex ; \
130+
mkdir $BUILD ; cd $BUILD ; \
131+
git clone --branch triqs_school_2025 --depth 1 https://github.com/AbInitioQHub/coqui $SRC ; \
132+
cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL \
133+
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -fPIC" \
134+
-DCMAKE_C_FLAGS="-fPIC" \
135+
-DCMAKE_Fortran_FLAGS="-fPIC" \
136+
-DBUILD_UNIT_TESTS=OFF \
137+
-DCOQUI_PYTHON_SUPPORT=ON ; \
138+
make -j$NCORES ; \
139+
make install ; \
140+
rm -rf $SRC $BUILD ;
141+
142+
RUN echo "localhost slots=2" >> /etc/openmpi/openmpi-default-hostfile
143+
ENV PYTHONPATH=/usr/lib/python3.12/site-packages:$PYTHONPATH \
144+
OMP_NUM_THREADS=2
145+
146+
USER ${NB_USER}
147+
COPY --chown=${NB_USER} setup.sh /
148+
EXPOSE 8888
149+
ENTRYPOINT ["/setup.sh"]

.binder/Dockerfile_Hub

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
FROM --platform=linux/amd64 ubuntu:24.04
2+
ARG LLVM=19
3+
ARG BUILD_ID=2
4+
5+
RUN apt-get update && \
6+
#apt-get install -y lsb-release wget software-properties-common && \
7+
#wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && chmod +x /tmp/llvm.sh && /tmp/llvm.sh ${LLVM} && \
8+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9+
make \
10+
meson \
11+
cmake \
12+
g++ \
13+
gfortran \
14+
git \
15+
htop \
16+
nano \
17+
vim \
18+
less \
19+
curl \
20+
hdf5-tools \
21+
openssh-client \
22+
clang-${LLVM} \
23+
llvm-${LLVM}-dev \
24+
libclang-${LLVM}-dev \
25+
libc++-${LLVM}-dev \
26+
libc++abi-${LLVM}-dev \
27+
libomp-${LLVM}-dev \
28+
lldb-${LLVM} \
29+
libboost-dev \
30+
libeigen3-dev \
31+
libfftw3-dev \
32+
libgfortran5 \
33+
libgmp-dev \
34+
libmpfr-dev \
35+
libhdf5-dev \
36+
libopenblas-dev \
37+
libopenmpi-dev \
38+
libnfft3-dev \
39+
libzstd-dev \
40+
openmpi-bin \
41+
openmpi-common \
42+
openmpi-doc \
43+
python3-clang-${LLVM} \
44+
python3-dev \
45+
python3-ipython \
46+
python3-mako \
47+
python3-matplotlib \
48+
python3-mpi4py \
49+
python3-numpy \
50+
python3-pandas \
51+
python3-pytest \
52+
python3-scipy \
53+
python3-setuptools \
54+
python3-skimage \
55+
python3-tk \
56+
python3-tomli \
57+
python3-venv \
58+
jupyter-notebook \
59+
&& \
60+
apt-get autoremove --purge -y && \
61+
apt-get autoclean -y && \
62+
rm -rf /var/cache/apt/* /var/lib/apt/lists/*
63+
64+
RUN ln -s /usr/bin/python3 /usr/bin/python
65+
66+
ARG NB_USER=triqs
67+
ARG NB_UID=1010
68+
RUN useradd -u ${NB_UID} -m ${NB_USER} -o
69+
70+
USER ${NB_USER}
71+
RUN python3 -m venv --system-site-packages /home/${NB_USER}/.venv
72+
ENV VIRTUAL_ENV=/home/${NB_USER}/.venv \
73+
PATH=/home/${NB_USER}/.venv/bin:$PATH
74+
RUN pip install jupyterlab==4.3.7 jupyterhub jupyter-archive ipykernel sparse-ir[xprec]
75+
RUN python -m ipykernel install --user --name=python3
76+
77+
ARG BRANCH=unstable
78+
ARG NCORES=10
79+
ARG ARCH=native
80+
ENV SRC=/tmp/src BUILD=/tmp/build INSTALL=/usr \
81+
CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu/openmpi:/usr/include/hdf5/serial:$CPLUS_INCLUDE_PATH \
82+
CC=clang-${LLVM} CXX=clang++-${LLVM} CXXFLAGS="-stdlib=libc++ -march=${ARCH}"
83+
84+
USER root
85+
RUN set -ex ; \
86+
mkdir $BUILD ; cd $BUILD ; \
87+
git clone https://github.com/flatironinstitute/clair --branch doc --depth 1 $SRC ; \
88+
CXXFLAGS="" cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL ; \
89+
make -j$NCORES ; \
90+
make install ; \
91+
rm -rf $SRC $BUILD ;
92+
RUN set -ex ; \
93+
mkdir $BUILD ; cd $BUILD ; \
94+
git clone https://github.com/TRIQS/triqs --branch modest_updates --depth 1 $SRC ; \
95+
cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL ; \
96+
make -j$NCORES ; \
97+
make install ; \
98+
rm -rf $SRC $BUILD ;
99+
ARG BRANCH=unstable
100+
RUN set -ex ; \
101+
for pkg in cthyb ctseg ctint tprf maxent hubbardI hartree_fock dft_tools solid_dmft ; do \
102+
mkdir $BUILD ; cd $BUILD ; \
103+
git clone https://github.com/TRIQS/$pkg --branch $BRANCH --depth 1 $SRC ; \
104+
cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL ; \
105+
make -j$NCORES ; \
106+
make install ; \
107+
rm -rf $SRC $BUILD ; \
108+
done
109+
RUN set -ex ; \
110+
mkdir $BUILD ; cd $BUILD ; \
111+
git clone https://github.com/TRIQS/modest --branch DEV_DOCS --depth 1 $SRC ; \
112+
cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL -DUpdate_Python_Bindings=ON ; \
113+
make -j$NCORES ; \
114+
make install ; \
115+
rm -rf $SRC $BUILD ;
116+
117+
# SLATE
118+
RUN set -ex ; \
119+
mkdir $BUILD ; cd $BUILD ; \
120+
git clone --branch master --depth 1 \
121+
--recurse-submodules --shallow-submodules \
122+
https://github.com/icl-utk-edu/slate.git $SRC ; \
123+
cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL -Dblas=openblas -Dgpu_backend=none -Dbuild_tests=no ; \
124+
make -j$NCORES ; \
125+
make install ; \
126+
rm -rf $SRC $BUILD ;
127+
128+
# CoQui
129+
RUN set -ex ; \
130+
mkdir $BUILD ; cd $BUILD ; \
131+
git clone --branch triqs_school_2025 --depth 1 https://github.com/AbInitioQHub/coqui $SRC ; \
132+
cmake $SRC -DCMAKE_INSTALL_PREFIX=$INSTALL \
133+
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -fPIC" \
134+
-DCMAKE_C_FLAGS="-fPIC" \
135+
-DCMAKE_Fortran_FLAGS="-fPIC" \
136+
-DBUILD_UNIT_TESTS=OFF \
137+
-DCOQUI_PYTHON_SUPPORT=ON ; \
138+
make -j$NCORES ; \
139+
make install ; \
140+
rm -rf $SRC $BUILD ;
141+
142+
ENV PYTHONPATH=/usr/lib/python3.12/site-packages:$PYTHONPATH
143+
144+
USER ${NB_USER}
145+
RUN git clone https://github.com/triqs/tutorials --branch unstable --depth 1 /home/${NB_USER}/tutorials
146+
WORKDIR /home/${NB_USER}/tutorials/
147+
148+
EXPOSE 8888
149+
CMD ["jupyter","lab","--ip","0.0.0.0", "--no-browser"]

.binder/setup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
if [[ ! -d ~/home/tutorials ]]
4+
then
5+
git clone https://github.com/triqs/tutorials --branch unstable --depth 1 ~/home/tutorials & sleep 5
6+
fi
7+
cd ~/home/tutorials
8+
export SHELL=/bin/bash
9+
10+
exec "$@"

0 commit comments

Comments
 (0)