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

Migrated docker image from miniconda to manylinux2014 #3874

Closed
wants to merge 13 commits into from
53 changes: 13 additions & 40 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM continuumio/miniconda3:latest
FROM python:3.11-slim-bullseye

WORKDIR /

Expand All @@ -23,47 +23,20 @@ ENV CMAKE_MAKE_PROGRAM=/usr/bin/make
ENV SUNDIALS_INST=/home/pybamm/.local
ENV LD_LIBRARY_PATH=/home/pybamm/.local/lib

RUN conda create -n pybamm python=3.11
RUN conda init --all
SHELL ["conda", "run", "-n", "pybamm", "/bin/bash", "-c"]
RUN conda install -y pip
# Migrating to venv and create a virtual environment for python 3.11
ENV VIRTUAL_ENV=/home/pybamm/venv
RUN python3.11 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

ARG IDAKLU
ARG ODES
ARG JAX
ARG ALL
RUN pip install --upgrade setuptools wheel wget && \
pip install cmake
RUN #!/bin/bash && \
source /home/pybamm/venv/bin/activate;

RUN pip install --upgrade --user pip setuptools wheel wget
RUN pip install cmake
RUN python scripts/install_KLU_Sundials.py && \
rm -rf pybind11 && \
git clone https://github.com/pybind/pybind11.git && \
pip install -e ".[all,dev,docs,jax,odes]";

RUN if [ "$IDAKLU" = "true" ]; then \
python scripts/install_KLU_Sundials.py && \
rm -rf pybind11 && \
git clone https://github.com/pybind/pybind11.git && \
pip install --user -e ".[all,dev,docs]"; \
fi

RUN if [ "$ODES" = "true" ]; then \
python scripts/install_KLU_Sundials.py && \
pip install --user -e ".[all,dev,docs,odes]"; \
fi

RUN if [ "$JAX" = "true" ]; then \
pip install --user -e ".[all,dev,docs,jax]"; \
fi

RUN if [ "$ALL" = "true" ]; then \
python scripts/install_KLU_Sundials.py && \
rm -rf pybind11 && \
git clone https://github.com/pybind/pybind11.git && \
pip install --user -e ".[all,dev,docs,jax,odes]"; \
fi

RUN if [ -z "$IDAKLU" ] \
&& [ -z "$ODES" ] \
&& [ -z "$JAX" ] \
&& [ -z "$ALL" ]; then \
pip install --user -e ".[all,dev,docs]"; \
fi

ENTRYPOINT ["/bin/bash"]
Loading