diff --git a/bwa-postalt/Makefile b/bwa-postalt/Makefile deleted file mode 100644 index 049e1a2..0000000 --- a/bwa-postalt/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -# Definitions -runtime_fullpath = $(realpath runtime) -name = quay.io/ucsc_cgl/bwa-postalt -tag = 0.7.12 -build_output = runtime/bwa-postalt.js -build_tool = runtime-container.DONE - -# Steps -build: ${build_output} ${build_tool} - -${build_output}: build/Dockerfile - cd build && docker build -t ${name}-build:${tag} . - docker run -v ${runtime_fullpath}:/data ${name}-build:${tag} cp /home/bwa/bwakit/bwa-postalt.js /data/bwa-postalt.js - docker run -v ${runtime_fullpath}:/data ${name}-build:${tag} cp -r /home/k8 /data/k8 - -${build_tool}: ${build_output} runtime/Dockerfile - cd runtime && docker build -t ${name}:${tag} . - touch ${build_tool} - -push: build - # Requires ~/.dockercfg - docker push ${name}:${tag} - docker push ${name}:latest - -test: build - python test.py - -clean: - docker rmi ${name}-build:${tag} - docker rmi ${name}:${tag} - rm -rf ${build_tool} ${build_output} runtime/k8 diff --git a/bwa-postalt/build/Dockerfile b/bwa-postalt/build/Dockerfile deleted file mode 100644 index ac74617..0000000 --- a/bwa-postalt/build/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM quay.io/ucsc_cgl/bwa-build:0.7.12 - -MAINTAINER Frank Austin Nothaft, fnothaft@berkeley.edu - -RUN apt-get install -y subversion python2.7 libpthread-stubs0-dev - -WORKDIR /home - -# clone k8 -WORKDIR /home -RUN git clone https://github.com/attractivechaos/k8.git -WORKDIR /home/k8 - -# clone v8 -RUN git clone https://github.com/v8/v8 -WORKDIR /home/k8/v8 -RUN git checkout 3.16.4 - -# build v8 -RUN make dependencies -RUN make x64.release - -# now build k8 -WORKDIR /home/k8 -RUN g++ -O2 -Wall -o k8 -Iv8/include k8.cc -lpthread -pthread -lz /home/k8/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a /home/k8/v8/out/x64.release/obj.target/tools/gyp/libv8_snapshot.a \ No newline at end of file diff --git a/bwa-postalt/runtime/.gitignore b/bwa-postalt/runtime/.gitignore deleted file mode 100644 index e5a788d..0000000 --- a/bwa-postalt/runtime/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -k8 -bwa-postalt.js \ No newline at end of file diff --git a/bwa-postalt/runtime/Dockerfile b/bwa-postalt/runtime/Dockerfile deleted file mode 100644 index 4b18c50..0000000 --- a/bwa-postalt/runtime/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM ubuntu:12.04 - -MAINTAINER Frank Austin Nothaft, fnothaft@berkeley.edu - -# make artifact directories -RUN mkdir /opt/bwa-postalt - -# add k8 -COPY k8 /opt/k8 - -# add bwa-postalt.js -COPY bwa-postalt.js /opt/bwa-postalt/bwa-postalt.js - -# set the entrypoint to invoke k8 and the bwa-postalt.js script -ENTRYPOINT ["/opt/k8/k8", "/opt/bwa-postalt/bwa-postalt.js"] diff --git a/bwa/Makefile b/bwa/Makefile index df9ff29..d898625 100644 --- a/bwa/Makefile +++ b/bwa/Makefile @@ -2,23 +2,27 @@ build_output = runtime/bwa runtime_fullpath = $(realpath runtime) build_tool = runtime-container.DONE +git_commit ?= $(shell git log --pretty=oneline -n 1 -- ../bwa | cut -f1 -d " ") name = quay.io/ucsc_cgl/bwa -tag = 0.7.12 +tag = 0.7.12--${git_commit} # Steps build: ${build_output} ${build_tool} ${build_output}: build/Dockerfile - cd build && docker build -t ${name}-build:${tag} . - docker run -v ${runtime_fullpath}:/data ${name}-build:${tag} cp bwa /data + cd build && docker build -t bwabuild . + docker run -v ${runtime_fullpath}:/data bwabuild cp bwa /data ${build_tool}: ${build_output} runtime/Dockerfile cd runtime && docker build -t ${name}:${tag} . + docker tag -f ${name}:${tag} ${name}:latest + docker rmi -f bwabuild touch ${build_tool} push: build # Requires ~/.dockercfg docker push ${name}:${tag} + docker push ${name}:latest test: build python test.py @@ -26,5 +30,3 @@ test: build clean: -rm ${build_tool} -rm ${build_output} - docker rmi ${name}-build:${tag} - docker rmi ${name}:${tag} \ No newline at end of file diff --git a/bwa/build/Dockerfile b/bwa/build/Dockerfile index b16316d..805ef9f 100644 --- a/bwa/build/Dockerfile +++ b/bwa/build/Dockerfile @@ -9,7 +9,4 @@ RUN git clone https://github.com/lh3/bwa.git WORKDIR /home/bwa -# specifically check out 0.7.12 release tag -RUN git checkout 0.7.12 - RUN make diff --git a/bwa/runtime/.gitignore b/bwa/runtime/.gitignore deleted file mode 100644 index a605578..0000000 --- a/bwa/runtime/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bwa \ No newline at end of file diff --git a/bwakit/Dockerfile b/bwakit/Dockerfile new file mode 100644 index 0000000..95f0a28 --- /dev/null +++ b/bwakit/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu + +MAINTAINER Frank Austin Nothaft, fnothaft@berkeley.edu + +RUN apt-get update && \ + apt-get install -y \ + curl + +# pull down bwa-kit +RUN curl -L http://sourceforge.net/projects/bio-bwa/files/bwakit/bwakit-0.7.12_x64-linux.tar.bz2 \ + | tar -xjC /opt/ + +# add wrapper script +ADD wrapper.sh /opt/wrapper.sh + +# set entrypoint to bwakit +ENTRYPOINT ["/opt/wrapper.sh"] \ No newline at end of file diff --git a/bwakit/Makefile b/bwakit/Makefile new file mode 100644 index 0000000..1344e2f --- /dev/null +++ b/bwakit/Makefile @@ -0,0 +1,19 @@ +build_tool = runtime-container.DONE +nametag = quay.io/ucsc_cgl/bwakit:0.7.12 + +build: ${build_tool} + +${build_tool}: Dockerfile + docker build -t ${nametag} . + touch ${build_tool} + +push: build + # Requires ~/.dockercfg + docker push ${nametag} + +test: build + python test.py + +clean: + -rm ${build_tool} + docker rmi ${nametag} diff --git a/bwa-postalt/test.py b/bwakit/test.py similarity index 76% rename from bwa-postalt/test.py rename to bwakit/test.py index 8c78091..5e22ffa 100644 --- a/bwa-postalt/test.py +++ b/bwakit/test.py @@ -5,11 +5,11 @@ import unittest -class TestBWAPostalt(unittest.TestCase): +class TestBWAKIT(unittest.TestCase): def test_docker_call(self): - out, err = check_docker_output(tool='quay.io/ucsc_cgl/bwa-postalt:0.7.12') - self.assertTrue('k8 bwa-postalt.js [options] [aln.sam]' in out) + out, err = check_docker_output(tool='quay.io/ucsc_cgl/bwakit:0.7.12') + self.assertTrue('Map paired-end reads to GRCh38+ALT+decoy+HLA and perform HLA typing:' in out) def check_docker_output(tool): command = 'docker run ' + tool diff --git a/bwakit/wrapper.sh b/bwakit/wrapper.sh new file mode 100755 index 0000000..70c8a0c --- /dev/null +++ b/bwakit/wrapper.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +/opt/bwa.kit/run-bwamem $@ | bash \ No newline at end of file