Skip to content

Commit

Permalink
updates to all builds
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Nov 5, 2024
1 parent aac9976 commit b39a4cd
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 39 deletions.
23 changes: 14 additions & 9 deletions Dockerfile-base
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ LABEL org.opencontainers.image.title="bio-check-base" \
org.opencontainers.image.authors="Alexander Patrie <[email protected]>, BioSimulators Team <[email protected]>" \
org.opencontainers.image.vendor="BioSimulators Team"

# SHELL ["/bin/bash", "-c"]
SHELL ["/usr/bin/env", "bash", "-c"]

# shared env
ENV DEBIAN_FRONTEND=noninteractive \
MONGO_URI="mongodb://mongodb/?retryWrites=true&w=majority&appName=bio-check" \
Expand All @@ -16,24 +19,26 @@ ENV DEBIAN_FRONTEND=noninteractive \

# copy docker
COPY assets/docker/config/.biosimulations.json /.google/.bio-check.json
COPY assets/docker/config/base-config/.pys_usercfg.ini /Pysces/.pys_usercfg.ini
COPY assets/docker/config/base-config/.pys_usercfg.ini /root/Pysces/.pys_usercfg.ini
COPY assets/docker/config/.pys_usercfg.ini /Pysces/.pys_usercfg.ini
COPY assets/docker/config/.pys_usercfg.ini /root/Pysces/.pys_usercfg.ini
COPY pyproject.toml assets/docker/shared.py assets/test_fixtures /app/
COPY assets/docker/config/base-config/ assets/docker/config/worker-config/ /app/config/
COPY assets/docker/config/environment.api.yml assets/docker/config/environment.worker.yml /app/config/

# cd /app
WORKDIR /app

RUN mkdir -p /Pysces \
&& mkdir -p /Pysces/psc \
&& mkdir -p /root/Pysces \
&& mkdir -p /root/Pysces/psc
# pip install . --root-user-action=ignore
&& mkdir -p /root/Pysces/psc \
&& echo "conda activate server" >> ~/.bashrc


# # create conda env from yml and ensure env activation
RUN conda env create -f config/environment.base.yml -y \
&& rm -f config/environment.base.yml \
&& conda env export --no-builds > config/environment.lock.yml \
&& poetry lock
# RUN conda env create -f config/environment.base.yml -y \
# && rm -f config/environment.base.yml \
# && conda env export --no-builds > config/environment.lock.yml \
# && poetry lock

# create lockfile conda analogy: conda env export --no-builds > environment.lock.yml
# && conda create -n conda-env python=3.10 -y \
Expand Down
10 changes: 7 additions & 3 deletions api/Dockerfile-api
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ COPY ./ ./

EXPOSE 3001

RUN source ~/.bashrc \
&& poetry install --without=composition,dev,worker --no-cache
RUN conda env create -n server -f config/environment.api.yml -y \
&& rm -rf config \
&& conda clean --all --json -y

ENTRYPOINT ["bash", "-c", "source ~/.bashrc && poetry run uvicorn main:app --host 0.0.0.0 --port 3001 --reload"]
# RUN source ~/.bashrc \
# && poetry install --without=composition,dev,worker --no-cache

ENTRYPOINT ["bash", "-c", "source ~/.bashrc && uvicorn main:app --host 0.0.0.0 --port 3001 --reload"]

2 changes: 1 addition & 1 deletion assets/docker/.BASE_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.2-test
0.0.2
File renamed without changes.
4 changes: 0 additions & 4 deletions assets/docker/config/base-config/requirements.base.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 0 additions & 14 deletions assets/docker/config/worker-config/requirements.worker.txt

This file was deleted.

12 changes: 4 additions & 8 deletions worker/Dockerfile-worker
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ SHELL ["/usr/bin/env", "bash", "-c"]

COPY ./ ./

# WORKDIR /app/worker

ENV TEST_SBML_FP="test_fixtures/Elowitz-Nature-2000-Repressilator/BIOMD0000000012_url.xml" \
TEST_PSC_FP="/Pysces/psc/BIOMD0000000012_url.xml.psc" \
TEST_OMEX_FP="test_fixtures/Elowitz-Nature-2000-Repressilator.omex"
Expand All @@ -32,8 +30,7 @@ ENV TEST_SBML_FP="test_fixtures/Elowitz-Nature-2000-Repressilator/BIOMD000000001
# && apt-get clean

# TODO: perhaps run --no-install-recommends?
RUN source ~/.bashrc \
&& apt-get update \
RUN apt-get update \
&& apt-get install -y \
meson \
g++ \
Expand Down Expand Up @@ -61,15 +58,14 @@ RUN source ~/.bashrc \
libboost-chrono-dev \
libboost-math-dev \
libboost-serialization-dev \
&& conda install -c conda-forge -c pysces pysces -y \
&& conda env update -n conda-env -f config/environment.worker.yml \
&& poetry install --without=api,composition,dev --no-cache \
&& conda env create -n server -f config/environment.worker.yml -y \
&& rm -rf config \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get autoremove -y \
&& apt-get clean \
&& conda clean --all --json -y

ENTRYPOINT ["bash", "-c", "source ~/.bashrc && poetry run python3 main.py"]
ENTRYPOINT ["bash", "-c", "source ~/.bashrc && python3 main.py"]

# --root-user-action=ignore
#############################
Expand Down

0 comments on commit b39a4cd

Please sign in to comment.