Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mbk/docker #318

Merged
merged 3 commits into from
Jun 2, 2023
Merged
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
40 changes: 22 additions & 18 deletions ci/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
# First stage
# ===================================
FROM ubuntu:20.04 as intermediate
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 \
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=3.3
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 && \
./configure && \
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 /src/scalapack && \
cd /src/scalapack && \
CC=mpicc F77=mpif77 FC=mpif90 CXX=mpicxx cmake -DBUILD_SHARED_LIBS=ON -S . -B build && \
cd build && \
make -j 4 && \
cmake --install . && \
cd ../.. && \
rm -rf scalapack
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

Expand All @@ -47,16 +46,15 @@ ENV PATH="/venv/bin:${PATH}"

RUN git clone --depth 1 https://github.com/PrincetonUniversity/SPEC.git /src/SPEC && \
cd /src/SPEC && \
/venv/bin/python setup.py bdist_wheel && \
/venv/bin/pip install -v dist/*.whl

/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 .
/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.0.1 pyqt5 matplotlib pyevtk plotly
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
Expand All @@ -67,10 +65,16 @@ RUN git clone --recurse-submodules https://github.com/hiddenSymmetries/simsopt.g
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 ubuntu:20.04
FROM --platform=linux/amd64 ubuntu:22.04

LABEL maintainer.name="Bharat Medasani" \
maintainer.email="mbkumar.at.gmail" \
Expand Down