Skip to content

Commit

Permalink
Merge pull request #30 from cfe-lab/introduce-docker
Browse files Browse the repository at this point in the history
Introduce docker
  • Loading branch information
Donaim authored Dec 10, 2024
2 parents 9044145 + d20a444 commit 83c4747
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 29 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,14 @@ jobs:
- name: Test with pytest
run: |
pipenv run python -m pytest
docker-build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build docker image
run: docker build -t proviral .
- name: Run the image
run: docker run --rm proviral --help
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

FROM ubuntu:22.04

ENV LANG=en_US.UTF-8

COPY setup.py /opt/primer_finder/setup.py
COPY gene_splicer /opt/primer_finder/gene_splicer/
COPY scripts /opt/primer_finder/scripts/

RUN sh -- /opt/primer_finder/scripts/install.sh

ENTRYPOINT ["gene_splicer_sample", "--hivseqinr", "/opt/hivseqinr"]
31 changes: 2 additions & 29 deletions Singularity
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,10 @@ From: ubuntu:22.04
%files
setup.py /opt/primer_finder/
gene_splicer /opt/primer_finder/
scripts /opt/primer_finder/

%post
echo ===== Installing Prerequisites ===== >/dev/null
apt-get update
apt-get install -y build-essential unzip git wget \
fontconfig libbz2-dev liblzma-dev libssl-dev \
libffi-dev libsqlite3-dev

echo ===== Installing Python ===== >/dev/null
apt-get install -y python3 python3-pip

echo ===== Installing blast ===== >/dev/null
apt-get install -y ncbi-blast+

echo ===== Installing Python packages ===== >/dev/null
cd /opt/primer_finder
pip3 install .

echo ===== Installing minimap2 ===== >/dev/null
apt-get install -y minimap2

echo ===== Installing hivseqinr ===== >/dev/null
apt-get install -y libz-dev libcurl4-openssl-dev libxml2-dev
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y r-base
Rscript /opt/primer_finder/gene_splicer/configure_r.sh
python3 -m gene_splicer.hivseqinr /opt/hivseqinr

# Clean up
apt-get remove -y wget git build-essential
apt-get clean
rm -rf /var/lib/apt/lists/*
sh -- /opt/primer_finder/scripts/install.sh

%environment
export LANG=en_US.UTF-8
Expand Down
12 changes: 12 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /bin/sh

set -e

CURRENT_DIR="${0%/*}"

set -x

for SCRIPT in "$CURRENT_DIR/installation/"*
do
sh -- "$SCRIPT"
done
12 changes: 12 additions & 0 deletions scripts/installation/10-prerequisites.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /bin/sh

set -e

echo ===== Installing Prerequisites ===== >/dev/null

set -x

apt-get update -qq
apt-get install -y build-essential unzip git wget \
fontconfig libbz2-dev liblzma-dev libssl-dev \
libffi-dev libsqlite3-dev
9 changes: 9 additions & 0 deletions scripts/installation/15-python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/sh

set -e

echo ===== Installing Python ===== >/dev/null

set -x

apt-get install -y python3 python3-pip
9 changes: 9 additions & 0 deletions scripts/installation/20-blast.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/sh

set -e

echo ===== Installing blast ===== >/dev/null

set -x

apt-get install -y ncbi-blast+
9 changes: 9 additions & 0 deletions scripts/installation/25-python-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/sh

set -e

echo ===== Installing Python packages ===== >/dev/null

set -x

pip3 install /opt/primer_finder
9 changes: 9 additions & 0 deletions scripts/installation/30-minimap2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/sh

set -e

echo ===== Installing minimap2 ===== >/dev/null

set -x

apt-get install -y minimap2
14 changes: 14 additions & 0 deletions scripts/installation/35-hivseqinr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /bin/sh

set -e

echo ===== Installing hivseqinr ===== >/dev/null

set -x

export DEBIAN_FRONTEND=noninteractive

apt-get install -y libz-dev libcurl4-openssl-dev libxml2-dev
apt-get install --no-install-recommends -y r-base
Rscript /opt/primer_finder/gene_splicer/configure_r.sh
python3 -m gene_splicer.hivseqinr /opt/hivseqinr
11 changes: 11 additions & 0 deletions scripts/installation/90-cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/sh

set -e

echo ===== Clean up ===== >/dev/null

set -x

apt-get remove -y wget git build-essential
apt-get clean
rm -rf /var/lib/apt/lists/*

0 comments on commit 83c4747

Please sign in to comment.