-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.ubuntu
100 lines (81 loc) · 3.88 KB
/
Dockerfile.ubuntu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# First stage
# ===================================
FROM --platform=linux/amd64 ubuntu:22.04 as intermediate
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential gfortran git m4 wget cmake ninja-build \
libopenblas-dev libfftw3-dev libhdf5-dev libhdf5-serial-dev libnetcdf-dev libnetcdff-dev libgl1-mesa-dev \
python3-dev python3-pip python3-venv
# Install mpich manually
WORKDIR /src
ARG mpich=4.0.3
ARG mpich_prefix=mpich-$mpich
RUN \
wget https://www.mpich.org/static/downloads/$mpich/$mpich_prefix.tar.gz && \
tar xvzf $mpich_prefix.tar.gz && \
cd $mpich_prefix && \
FFLAGS=-fallow-argument-mismatch FCFLAGS=-fallow-argument-mismatch ./configure && \
make -j 4 && \
make install && \
make clean && \
cd .. && \
rm -rf $mpich_prefix
RUN /sbin/ldconfig
RUN \
git clone --depth 1 https://github.com/Reference-ScaLAPACK/scalapack.git scalapack && \
mkdir scalapack/build && \
cd scalapack/build && \
CC=mpicc F77=mpif77 FC=mpif90 CXX=mpicxx cmake -DBUILD_SHARED_LIBS=ON -GNinja .. && \
cmake --build . 2>&1 | tee scalapack_build.log && \
cmake --install . 2>&1 | tee scalapack_install.log
RUN /sbin/ldconfig
RUN python3 -m pip install wheel
RUN python3 -m venv /venv/
RUN /venv/bin/pip install -U pip
RUN /venv/bin/python -m pip install numpy scipy jax jaxlib f90nml mpi4py jupyter notebook jupyterlab ipython qsc sympy scikit-build ninja "pybind11[global]" cmake
RUN /venv/bin/pip install git+https://github.com/zhucaoxiang/f90wrap
ENV PATH="/venv/bin:${PATH}"
RUN git clone --depth 1 https://github.com/PrincetonUniversity/SPEC.git /src/SPEC && \
cd /src/SPEC && \
/venv/bin/pip install -v . 2>&1 | tee spec_build.log
RUN git clone --depth 1 https://github.com/hiddenSymmetries/VMEC2000.git /src/VMEC && \
cd /src/VMEC && \
cp cmake/machines/ubuntu.json cmake_config_file.json && \
/venv/bin/pip install -v . 2>&1 | tee vmec_build.log
RUN /venv/bin/pip install h5py pyoculus py_spec
RUN /venv/bin/pip install vtk==9.2.6 pyqt5 matplotlib pyevtk plotly
RUN /venv/bin/pip install mayavi
RUN /venv/bin/pip install git+https://github.com/hiddenSymmetries/booz_xform
RUN /venv/bin/pip install git+https://github.com/hiddenSymmetries/virtual-casing
RUN /venv/bin/pip install git+https://github.com/rogeriojorge/pyQIC
RUN /venv/bin/pip install git+https://github.com/landreman/pyQSC
# ENV CI=True
# RUN git clone --recurse-submodules https://github.com/hiddenSymmetries/simsopt.git /src/simsopt && \
# cd /src/simsopt && \
# git fetch --tags --all && \
# /venv/bin/pip install -v .
# Get the failure logs by uncommenting the two lines following # === and running
# DOCKER_BUILDKIT=1 docker build -t test -f Dockerfile.ubuntu . --target=fail-logs --output type=local,dest=./output/
# For Mac, don't forget sudo before docker command
# ========================================
#FROM scratch AS fail-logs
#COPY --from=intermediate /src /output
# Second stage
# ===================================
FROM --platform=linux/amd64 ubuntu:22.04
LABEL maintainer.name="Bharat Medasani" \
maintainer.email="mbkumar.at.gmail" \
developers="Hidden Symmetries Team" \
version="0.07" \
description="Docker file for simsopt container based on ubuntu image"
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y m4 vim emacs nano git wget \
libfftw3-dev libopenblas-dev libhdf5-serial-dev libnetcdf-dev libnetcdff-dev libgl1-mesa-dev \
python3-dev python3-venv
COPY --from=intermediate /venv /venv
COPY --from=intermediate /usr/local /usr/local
RUN /sbin/ldconfig
COPY entrypoint.sh /venv/bin
#env PATH=$PATH:/venv/bin
# ENV OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
ENTRYPOINT ["bash", "/venv/bin/entrypoint.sh"]
CMD ["bash"]