From 54ba7a1f8d78dc2864f5ebadbaaf3b6c8afa58be Mon Sep 17 00:00:00 2001 From: Adam Dinan Date: Wed, 12 Jun 2024 20:03:37 +0100 Subject: [PATCH 1/2] Push to Dockerhub before running test pipeline --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07462c7..c96f112 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,10 +40,6 @@ jobs: chmod +x nextflow sudo mv nextflow /usr/local/bin/ - - name: Run pipeline with test data - run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results - - name: Login to Docker Hub uses: docker/login-action@v1 with: @@ -53,4 +49,8 @@ jobs: - name: Build and publish to docker run: | docker build --platform linux/amd64 -t adamd3/bactseq:latest . - docker push adamd3/bactseq:latest \ No newline at end of file + docker push adamd3/bactseq:latest + + - name: Run pipeline with test data + run: | + nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results \ No newline at end of file From 833e58ada91f55a90d9a3d10a70208ce0238cd76 Mon Sep 17 00:00:00 2001 From: Adam Dinan Date: Wed, 12 Jun 2024 20:06:44 +0100 Subject: [PATCH 2/2] Install env in Dockerfile --- Dockerfile | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index b931000..8deeac0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,17 @@ -FROM ubuntu:22.04 +FROM continuumio/miniconda3 LABEL maintainer="Adam Dinan " -ARG DEBIAN_FRONTEND=noninteractive +WORKDIR /app -ENV PYTHON_VERSION=3.8.5 +COPY environment.yml . -ADD https://raw.githubusercontent.com/adamd3/BactSeq/main/requirements.txt . +RUN conda env create -f environment.yml -COPY requirements.txt /tmp -WORKDIR /tmp +RUN echo "source activate $(grep -m 1 -E 'name: *' environment.yml | cut -d' ' -f2)" \ + > ~/.bashrc -RUN apt-get update && \ - apt-get install -y --no-install-recommends ca-certificates \ - build-essential \ - curl libssl-dev libcurl4-openssl-dev libxml2-dev libfontconfig1-dev \ - python3-numpy python3-pip gawk pigz r-base-dev fastqc \ - trim-galore samtools bwa kallisto && \ - apt-get clean autoclean +SHELL ["conda", "run", "-n", \ + "$(grep -m 1 -E 'name: *' environment.yml | cut -d' ' -f2)", "/bin/bash", "-c"] -RUN pip install --no-cache-dir -r requirements.txt - -RUN echo "r <- getOption('repos'); r['CRAN'] <- 'http://cran.rstudio.com'; \ - options(repos = r);" > ~/.Rprofile - -RUN R -e 'install.packages(c( \ - "optparse", "fastmap", "RColorBrewer", "reshape2", \ - "tidyverse", "ape", "scales", "pheatmap", "matrixstats", \ - "plyr", "rsqlite", "umap", "xtable", "BiocManager"))' - -RUN R -e 'BiocManager::install(c("edgeR", "DESeq2", "GO.db", \ - "Rsubread", "topGO"))' - -RUN R -e 'if(!require("remotes")) install.packages("remotes"); \ - remotes::install_github("kevinblighe/EnhancedVolcano")' \ No newline at end of file +# Open a shell by default when the container is run interactively +ENTRYPOINT ["bash"]