Skip to content

Commit

Permalink
testing env mangagement change
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Oct 30, 2024
1 parent 33b7074 commit f631bb7
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 110 deletions.
77 changes: 13 additions & 64 deletions compose_worker/Dockerfile-compose_worker
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,16 @@ RUN apt-get update && apt-get install -y libatlas-base-dev \
liblapack-dev \
gcc \
gfortran \
libgfortran5


# PySCeS

# SUNDIALS --> installation path is default cmake (/usr/local) with LD_LIBRARY_PATH as runtime location
# ignore certificate checking because certificate was expired as of 2021-11-10
# ARG SUNDIALS_VERSION=2.6.2
# RUN apt-get install -y --no-install-recommends \
# wget \
# cmake \
# make \
# g++ \
# \
# && cd /tmp \
# && wget --no-check-certificate https://computing.llnl.gov/sites/default/files/inline-files/sundials-${SUNDIALS_VERSION}.tar.gz \
# && tar xvvf sundials-${SUNDIALS_VERSION}.tar.gz \
# && cd sundials-${SUNDIALS_VERSION} \
# && mkdir build \
# && cd build \
# && CFLAGS="-fPIC" cmake .. \
# && make \
# && make install \
# \
# && cd /tmp \
# && rm sundials-${SUNDIALS_VERSION}.tar.gz \
# && rm -r sundials-${SUNDIALS_VERSION}
# ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH


############################################
# App content
libgfortran5 \
python3.10-venv


COPY . /app/worker


ENV PATH="/root/.local/bin:$PATH"
ENV TEST_SBML_FP="test_fixtures/Elowitz-Nature-2000-Repressilator/BIOMD0000000012_url.xml"
ENV TEST_OMEX_FP="test_fixtures/Elowitz-Nature-2000-Repressilator.omex"


# copy pysces config
Expand All @@ -62,50 +35,26 @@ RUN mkdir -p /Pysces \
&& mkdir -p /root/Pysces \
&& mkdir -p /root/Pysces/psc \
&& chmod ugo+rw -R /Pysces

COPY ./.pys_usercfg.ini /Pysces/.pys_usercfg.ini
COPY ./.pys_usercfg.ini /root/Pysces/.pys_usercfg.ini


# Install only worker deps TODO: include toml in base deps
RUN poetry install --only=worker,pysces --no-cache


# Install Assimulo from source for Pysces
# RUN apt-get update \
# && apt-get install -y libblas-dev \
# liblapack-dev \
# libatlas-base-dev \
# python3-distutils \
# python3-dev \
# && git clone https://github.com/modelon-community/Assimulo.git \
# && cd Assimulo \
# && poetry run pip install --upgrade setuptools pip wheel Cython numpy \
# && poetry run python3 setup.py install --sundials-home=/usr/local --blas-home=/usr/lib/x86_64-linux-gnu


# install masspy TODO: implement this
# RUN apt-get install -y --no-install-recommends \
# git \
# gcc \
# build-essential \
# libfreetype6-dev \
# libfreetype6 \
# pkg-config \
# \
# && mkdir -p /.cache/cobrapy
# RUN git clone https://github.com/biosimulators/Biosimulators_MASSpy.git \
# && cd Biosimulators_MASSpy \
# && rm pyproject.toml
RUN python3 -m venv env \
&& env/bin/pip install -r /app/worker/requirements.worker.txt


# install amici
# RUN env/bin/pip install biosimulators-amici


WORKDIR /app/worker


RUN python3 -c "import os;files=os.listdir();import shutil;[shutil.rmtree(f) if '__pycache__' in f else None for f in files]"
# RUN python3 -c "import os;files=os.listdir();import shutil;[shutil.rmtree(f) if '__pycache__' in f else None for f in files]"


ENTRYPOINT ["poetry", "run", "python3", "main.py"]
# ENTRYPOINT ["env/bin/python3", "main.py"]


#############################
Expand Down
151 changes: 151 additions & 0 deletions compose_worker/_Dockerfile-compose_worker
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Worker microservice ORIGINAL CONTENT

FROM ghcr.io/biosimulators/bio-check-base:latest


# os deps
RUN apt-get update && apt-get install -y libatlas-base-dev \
libhdf5-serial-dev \
swig \
libboost-all-dev \
git \
meson \
build-essential \
g++ \
gfortran \
libblas-dev \
liblapack-dev \
gcc \
gfortran \
libgfortran5


# PySCeS

# SUNDIALS --> installation path is default cmake (/usr/local) with LD_LIBRARY_PATH as runtime location
# ignore certificate checking because certificate was expired as of 2021-11-10
ARG SUNDIALS_VERSION=2.6.2
RUN apt-get install -y --no-install-recommends \
wget \
cmake \
make \
g++ \
\
&& cd /tmp \
&& wget --no-check-certificate https://computing.llnl.gov/sites/default/files/inline-files/sundials-${SUNDIALS_VERSION}.tar.gz \
&& tar xvvf sundials-${SUNDIALS_VERSION}.tar.gz \
&& cd sundials-${SUNDIALS_VERSION} \
&& mkdir build \
&& cd build \
&& CFLAGS="-fPIC" cmake .. \
&& make \
&& make install \
\
&& cd /tmp \
&& rm sundials-${SUNDIALS_VERSION}.tar.gz \
&& rm -r sundials-${SUNDIALS_VERSION}
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH


############################################
# App content

COPY . /app/worker


ENV PATH="/root/.local/bin:$PATH"
ENV TEST_SBML_FP="test_fixtures/Elowitz-Nature-2000-Repressilator/BIOMD0000000012_url.xml"
ENV TEST_OMEX_FP="test_fixtures/Elowitz-Nature-2000-Repressilator.omex"


# copy pysces config
RUN mkdir -p /Pysces \
&& mkdir -p /Pysces/psc \
&& mkdir -p /root/Pysces \
&& mkdir -p /root/Pysces/psc \
&& chmod ugo+rw -R /Pysces

COPY ./.pys_usercfg.ini /Pysces/.pys_usercfg.ini
COPY ./.pys_usercfg.ini /root/Pysces/.pys_usercfg.ini


# Install only worker deps TODO: include toml in base deps
RUN poetry install --only=worker,pysces --no-cache


# Install Assimulo from source for Pysces
# RUN apt-get update \
# && apt-get install -y libblas-dev \
# liblapack-dev \
# libatlas-base-dev \
# python3-distutils \
# python3-dev \
# && git clone https://github.com/modelon-community/Assimulo.git \
# && cd Assimulo \
# && poetry run pip install --upgrade setuptools pip wheel Cython numpy \
# && poetry run python3 setup.py install --sundials-home=/usr/local --blas-home=/usr/lib/x86_64-linux-gnu


# install masspy TODO: implement this
# RUN apt-get install -y --no-install-recommends \
# git \
# gcc \
# build-essential \
# libfreetype6-dev \
# libfreetype6 \
# pkg-config \
# \
# && mkdir -p /.cache/cobrapy
# RUN git clone https://github.com/biosimulators/Biosimulators_MASSpy.git \
# && cd Biosimulators_MASSpy \
# && rm pyproject.toml


WORKDIR /app/worker


RUN python3 -c "import os;files=os.listdir();import shutil;[shutil.rmtree(f) if '__pycache__' in f else None for f in files]"


ENTRYPOINT ["poetry", "run", "python3", "main.py"]


#############################
# Fenics

# TODO: start the fenics implementation
# RUN apt-get update && apt-get install -y petsc-dev \
# libopenmpi-dev \
# libspdlog-dev \
# libpugixml-dev \
# cmake \
# gcc \
# g++ \
# gfortran \
# && rm -rf /var/lib/apt/lists/* \
# && add-apt-repository ppa:fenics-packages/fenics -y \
# && apt update \
# && apt install -y fenicsx \
# && poetry run pip install meson-python meson ninja

# RUN poetry run pip install \
# biosimulators-utils[logging] \
# biosimulators-amici \
# biosimulators-copasi \
# biosimulators-pysces \
# biosimulators-tellurium

# add deps with extras
# RUN yes | poetry cache clear PyPI --all \
# && poetry add biosimulators-utils --extras=logging \
# && poetry add pysces --extras=sbml \
# && poetry add biosimulators-copasi --python="^3.10"

# install requirements in poetry via pip prox
# RUN poetry run pip install -r /app/worker/requirements.worker.txt

# install masspy TODO: do this
# RUN poetry run pip install biosimulators-masspy

# install with poetry TODO: remove this eventually
# RUN /app/assets/install_deps.sh /app/worker/requirements.worker.txt
Loading

0 comments on commit f631bb7

Please sign in to comment.