Skip to content

Commit

Permalink
Merge pull request #6 from LANL-Bioinformatics/dockerReduction
Browse files Browse the repository at this point in the history
Multistage docker builds + charliecloud for modules currently in main.
  • Loading branch information
mflynn-lanl authored Sep 16, 2024
2 parents 007c34b + d990ebb commit 20f99cc
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 31 deletions.
30 changes: 22 additions & 8 deletions runFaQCs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1
FROM continuumio/miniconda3:23.5.2-0
FROM continuumio/miniconda3:23.5.2-0 AS build

ENV container docker
ENV container=docker

# dependencies for faqcs
RUN apt-get update -y \
Expand All @@ -12,14 +12,28 @@ RUN apt-get update -y \
RUN conda config --add channels conda-forge \
&& conda config --add channels bioconda

RUN conda init bash \
&& . ~/.bashrc \
&& conda create --name runFaQCs \
&& conda activate runFaQCs

# install faqcs
RUN conda install -c bioconda faqcs=2.10
RUN conda install -n runFaQCs -c bioconda faqcs=2.10
#RUN conda install -n runFaQCs -c conda-forge jellyfish
#RUN conda install -n runFaQCs -c conda-forge zlib
RUN conda install -c conda-forge conda-pack

RUN conda-pack -n runFaQCs -o /tmp/env.tar && \
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \
rm /tmp/env.tar

# add files
# ADD runQC_subroutines/* /opt/conda/bin/runQC_subroutines/
ADD *.wdl /opt/conda/bin/
RUN /venv/bin/conda-unpack

# ENV PATH="${PATH}:/opt/conda/bin/runQC_subroutines"
FROM debian:latest AS runtime

CMD ["/bin/bash"]
COPY --from=build /venv /venv
ENV PATH=/venv/bin:$PATH

SHELL ["/bin/bash", "-c"]
CMD /bin/bash

4 changes: 2 additions & 2 deletions runFaQCs/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process.container = 'kaijli/runqc:1.0'
docker.enabled = true
process.container = 'apwat/run_faqcs:1.2'
singularity.enabled = true
workflow.onComplete = {
"rm -rf nf_assets".execute().text
}
Expand Down
56 changes: 38 additions & 18 deletions runReadsToContig/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
# syntax=docker/dockerfile:1
FROM continuumio/miniconda3:23.5.2-0
FROM continuumio/miniconda3:23.5.2-0 AS build

ENV container=docker

# add conda channels
RUN conda config --add channels conda-forge \
&& conda config --add channels bioconda

# install dependencies
RUN conda install -c conda-forge r-base
RUN conda install -c conda-forge python=3.11
RUN conda install -c bioconda perl-json
RUN conda install -c bioconda samclip=0.4.0
RUN conda install -c bioconda bwa
RUN conda install -c bioconda bowtie2
RUN conda install -c bioconda samtools=1.6

ADD bin/bam_to_fastq.pl /opt/conda/bin
ADD bin/contig_stats.pl /opt/conda/bin
ADD bin/ContigCoverageFold_plots_from_samPileup.pl /opt/conda/bin
ADD bin/fastq_utility.pm /opt/conda/bin
ADD bin/runReadsToContig.pl /opt/conda/bin
ADD bin/tab2Json_for_dataTable.pl /opt/conda/bin

CMD ["/bin/bash"]
RUN conda init bash \
&& . ~/.bashrc \
&& conda create --name readsToContig \
&& conda activate readsToContig

RUN conda install -n readsToContig -c conda-forge r-base
RUN conda install -n readsToContig -c conda-forge python=3.11
RUN conda install -n readsToContig -c bioconda perl-json
RUN conda install -n readsToContig -c bioconda samclip=0.4.0
RUN conda install -n readsToContig -c bioconda bwa
RUN conda install -n readsToContig -c bioconda bowtie2
RUN conda install -n readsToContig -c bioconda samtools=1.6
RUN conda install -c conda-forge conda-pack


ADD bin/bam_to_fastq.pl /opt/conda/envs/readsToContig/bin
ADD bin/contig_stats.pl /opt/conda/envs/readsToContig/bin
ADD bin/ContigCoverageFold_plots_from_samPileup.pl /opt/conda/envs/readsToContig/bin
ADD bin/fastq_utility.pm /opt/conda/envs/readsToContig/bin
ADD bin/runReadsToContig.pl /opt/conda/envs/readsToContig/bin
ADD bin/tab2Json_for_dataTable.pl /opt/conda/envs/readsToContig/bin

RUN conda-pack -n readsToContig -o /tmp/env.tar && \
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \
rm /tmp/env.tar

RUN /venv/bin/conda-unpack

FROM debian:buster AS runtime
#RUN apk add --no-cache bash

COPY --from=build /venv /venv
ENV PERL5LIB=/venv/lib/perl5/core_perl
ENV PATH=/venv/bin:$PATH

SHELL ["/bin/bash", "-c"]
CMD /bin/bash
5 changes: 3 additions & 2 deletions runReadsToContig/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
process.container = 'apwat/run_r2c:1.3'
singularity.enabled=true

params {
pairFile = "nf_assets/NO_FILE"
unpairFile = "nf_assets/NO_FILE2"
Expand All @@ -18,5 +21,3 @@ workflow.onComplete = {
"rm -rf nf_assets".execute().text
}

docker.enabled=true
process.container = 'apwat/run_r2c:1.1'
1 change: 1 addition & 0 deletions runReadsToContig/runReadsToContig.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env nextflow

process r2c {
debug true
publishDir(
path: "$params.outDir/AssemblyBasedAnalysis/readsMappingToContig",
mode: 'copy'
Expand Down
2 changes: 1 addition & 1 deletion sra2fastq/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ params {
}

process.container = 'kaijli/sra2fastq:1.6.3'
docker.enabled = true
singularity.enabled = true
executor {
submitRateLimit = '1/5sec'
}

0 comments on commit 20f99cc

Please sign in to comment.