Skip to content

Commit

Permalink
Merge pull request #4 from biosimulators/main
Browse files Browse the repository at this point in the history
updating process constructor configurations
  • Loading branch information
AlexPatrie authored Feb 26, 2024
2 parents 7d6e59c + fb6c32f commit b3e8189
Show file tree
Hide file tree
Showing 34 changed files with 9,815 additions and 361 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ submit-biosimulators-container.sh
.vagrant
._vagrant
.THIS-IS-FOR-CONTAINER-DEV-ONLY
buildDockerImage.yml
98 changes: 51 additions & 47 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,64 @@
# TODO: Use a more specific tag instead of latest for reproducibility
FROM ubuntu:latest

ENV DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND=noninteractive \
XVFB_RES="1920x1080x24" \
XVFB_ARGS="" \
PATH="/app/.venv/bin:$PATH" \
CONFIG_ENV_FILE="/app/config/config.env" \
SECRET_ENV_FILE="/app/secret/secret.env" \
STORAGE_GCS_CREDENTIALS_FILE="/app/secret/gcs_credentials.json" \
STORAGE_LOCAL_CACHE_DIR="/app/scratch"

WORKDIR /app

COPY . /app
# copy and make dirs
COPY ./biosimulator_processes/processes /app/biosimulator_processes
COPY ./notebooks /app/notebooks

# copy files
COPY ./pyproject.toml ./poetry.lock ./data ./scripts/trust-notebooks.sh /app/
COPY ./scripts/xvfb-startup.sh /xvfb-startup.sh

RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
build-essential \
libncurses5 \
cmake \
make \
libx11-dev \
libc6-dev \
libx11-6 \
libc6 \
gcc \
python3.10 \
python3-pip \
build-essential \
libncurses5 \
cmake \
make \
libx11-dev \
libc6-dev \
libx11-6 \
libc6 \
gcc \
swig \
pkg-config \
curl \
tar \
libgl1-mesa-glx \
libice6 \
libpython3.10 \
wget \
&& rm -rf /var/lib/apt/lists/*

# RUN apt-get update && apt-get install -y python3-pip

RUN apt-get -y update \
\
&& apt-get install --no-install-recommends -y \
xvfb \
&& mkdir /tmp/.X11-unix \
&& chmod 1777 /tmp/.X11-unix \
\
&& rm -rf /var/lib/apt/lists/*

COPY scripts/xvfb-startup.sh /xvfb-startup.sh

ENV XVFB_RES="1920x1080x24" \
XVFB_ARGS=""

RUN pip install --upgrade pip \
&& pip install poetry
pkg-config \
curl \
tar \
libgl1-mesa-glx \
libice6 \
libpython3.10 \
wget \
xvfb \
&& mkdir /tmp/.X11-unix \
&& chmod 1777 /tmp/.X11-unix \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --upgrade pip && pip install poetry \
&& poetry config virtualenvs.in-project true \
&& poetry install \
&& chmod +x ./trust-notebooks.sh \
&& ./trust-notebooks.sh \
&& rm ./trust-notebooks.sh

# Add Poetry to PATH
ENV PATH="/root/.local/bin:${PATH}"
VOLUME /app/data

# RUN poetry config virtualenvs.create false
CMD ["poetry", "run", "jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]

RUN poetry run pip install --upgrade pip \
&& poetry run pip install python-libnuml --use-pep517 \
&& poetry install

ENTRYPOINT ["poetry", "run", "jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
# PLEASE NOTE: We do not need to add a USER in the Dockerfile as Singularity will handle
# such logic in conversion on the HPC.

# type imports
# dist
# param scan demo/location
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,9 @@ A simplified view of the above script:
>> workflow.run(10)
>> results = workflow.gather_results()
>> print(f'RESULTS: {pf(results)}')


### A NOTE FOR DEVELOPERS:
This tooling implements version control for dynamically-created composite containers through
`poetry`. The version control for content on the Python Package Index is performed by
`setup.py`.
6 changes: 6 additions & 0 deletions biosimulator_processes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@
print(f"{class_name} registered successfully.")
except ImportError as e:
print(f"{class_name} not available. Error: {e}")


from biosimulator_processes.copasi_process import CopasiProcess
from biosimulator_processes.smoldyn_process import SmoldynProcess
from biosimulator_processes.cobra_process import CobraProcess
from biosimulator_processes.tellurium_process import TelluriumProcess
72 changes: 72 additions & 0 deletions biosimulator_processes/container-assets/Dockerfile-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
FROM ubuntu:latest

ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /app

COPY ./biosimulator_processes /app

# COPY ./scripts /app

# RUN rm -r /app/composer-api

RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
build-essential \
libncurses5 \
cmake \
make \
libx11-dev \
libc6-dev \
libx11-6 \
libc6 \
gcc \
swig \
pkg-config \
curl \
tar \
libgl1-mesa-glx \
libice6 \
libpython3.10 \
wget \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get -y update \
&& apt-get install --no-install-recommends -y \
xvfb \
&& mkdir /tmp/.X11-unix \
&& chmod 1777 /tmp/.X11-unix \
&& rm -rf /var/lib/apt/lists/*

COPY ./scripts/xvfb-startup.sh /xvfb-startup.sh

# RUN rm -r ./scripts

ENV XVFB_RES="1920x1080x24" \
XVFB_ARGS=""

# RUN pip install --upgrade pip \
# && pip install poetry

# RUN poetry config virtualenvs.in-project true

# Add Poetry to PATH
# ENV PATH="/root/.local/bin:${PATH}"

# RUN poetry run pip install --upgrade pip \
# && poetry run pip install python-libnuml --use-pep517 \
# && poetry install

# activate poetry virtualenv
# ENV PATH="/app/.venv/bin:$PATH"
# ENV CONFIG_ENV_FILE="/app/config/config.env"
# ENV SECRET_ENV_FILE="/app/secret/secret.env"
# ENV STORAGE_GCS_CREDENTIALS_FILE="/app/secret/gcs_credentials.json"
# ENV STORAGE_LOCAL_CACHE_DIR="/app/scratch"
#
# # activate the poetry virtualenv each new non-interative shell
# RUN echo "source /app/.venv/bin/activate" >> /etc/bash.bashrc

RUN pip install --upgrade pip && pip install jupyterlab
# ENTRYPOINT ["poetry", "run", "jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
Loading

0 comments on commit b3e8189

Please sign in to comment.