Skip to content

Commit

Permalink
updated to removed clair3
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcolq committed Aug 22, 2024
1 parent 19d1e4e commit 6d5524d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 16 deletions.
66 changes: 51 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,67 @@
FROM mambaorg/micromamba:1.5.8
# start with an image with conda installed
FROM condaforge/mambaforge AS compile-image

WORKDIR /data

COPY . ./fieldbioinformatics/

USER root
# check for updates
RUN apt-get update -y && \
apt-get upgrade -y && \
apt install build-essential -y --no-install-recommends && \
apt-get clean && apt-get autoclean

# copy in artic
RUN cd /data/fieldbioinformatics && \
mamba install conda -n base -c conda-forge -c defaults -c bioconda && \
mamba env create -f /data/fieldbioinformatics/environment.yml

# Make RUN commands use the new environment:
SHELL ["conda", "run", "-n", "artic", "/bin/bash", "-c"]
RUN mamba install -c conda-forge -n artic python=3.9 conda-pack && \
cd /data/fieldbioinformatics && \
pip install .

RUN apt-get update && apt-get install -y --no-install-recommends build-essential wget procps
# Use conda-pack to create a standalone enviornment
# in /venv:
RUN conda list && \
conda-pack -n artic -o /tmp/env.tar && \
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \
rm /tmp/env.tar && /venv/bin/conda-unpack

USER $MAMBA_USER
SHELL ["/bin/bash", "-c"]

COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/env.yml
RUN conda clean --all &&\
conda remove --name artic --all

RUN sed -i 's/name: artic/name: base/' /tmp/env.yml
# build artic
WORKDIR /data/fieldbioinformatics
RUN source /venv/bin/activate && pip install --user --no-cache-dir . \
&& pip uninstall -y tensorflow keras pyabpoa \
&& conda install -y -c conda-forge tensorflow~=2.11 keras~=2.11

RUN micromamba install --yes --file /tmp/env.yml && \
micromamba clean --all --yes
# build image
FROM debian:bullseye-slim AS runtime-image

ARG MAMBA_DOCKERFILE_ACTIVATE=1
COPY --from=compile-image /root/.local /root/.local
ENV PATH=/root/.local/bin:$PATH

USER root
# Copy /venv from the previous stage:
COPY --from=compile-image /venv /venv

RUN python3 -m pip install ./fieldbioinformatics
# check for updates
RUN apt-get update -y && \
apt-get upgrade -y && \
apt install build-essential -y --no-install-recommends && \
apt install -y procps && \
apt-get clean && apt-get autoclean

RUN pip uninstall -y tensorflow keras pyabpoa \
&& micromamba install -y -c conda-forge -c bioconda tensorflow=2.11 keras=2.11
WORKDIR /data

USER $MAMBA_USER
SHELL ["/bin/bash", "-c"]

ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"]
# to allow streamed log output
ENV PYTHONUNBUFFERED=1
ENV PATH=/venv/bin:$PATH

CMD ["/bin/bash"]
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- bcftools
- biopython
- bwa
- clair3
- clint
- htslib
- minimap2
Expand Down

0 comments on commit 6d5524d

Please sign in to comment.