dnanexus-rnd / GLnexus

Scalable gVCF merging and joint variant calling for population sequencing projects
Apache License 2.0
145 stars 37 forks source link

docker image #177

Closed brentp closed 4 years ago

brentp commented 5 years ago

hi, thanks for providing the software and the Dockerfile. Would it be possible to have an image on dockerhub? this makes it simpler to create a singularity image to run on a cluster (I'm not able to get the static binary to work on our cluster regardless of the GCC futzing).

mlin commented 5 years ago

The existing Dockerfile is meant for compiling from scratch, so it'll produce a giant image. For runtime use, I think we just can drop the glnexus_cli static binary into an ubuntu:18.04 image (even better, with libjemalloc1 and setting ENV LD_PRELOAD=...). Will try to hook up the CI to do this at some point

mlin commented 5 years ago

PS if the cluster just has a super old kernel then there may be not much I can do, otherwise I'd like to make the static binary as widely compatible as possible. We do some gymnastics (e.g. below) to avoid depending on too new of a GLIBC version, but it's a bit of finger in the dike of course..

https://github.com/dnanexus-rnd/GLnexus/blob/f4ce0ffe2c2744f879f3a4f75a70a1aebd88705a/src/genotyper.cc#L11-L13

JakeHagen commented 5 years ago

@brentp Have you tried patchelf? (https://nixos.org/patchelf.html). I was able to get the binary to work on centos 6 by building gcc 9 and glibc-2.18 and then linking to them with the command patchelf --set-interpreter ~/opt/glibc-2.18/lib/ld-linux-x86-64.so.2 --set-rpath ~/opt/gcc9/lib64 /glnexus_cli

brentp commented 5 years ago

@JakeHagen sweet! I will try that!

@mlin maybe it's possible to get a truly static binary using alpine linux with musl-gcc?

mlin commented 4 years ago

I've got the CI automatically pushing a little image to https://quay.io/repository/mlin/glnexus?tab=tags now. Example usage:

docker run --rm -i -v /tmp/dv_platinum6_chr21_gvcf/:/in quay.io/mlin/glnexus:v1.2.0-pre.0-2-gd7235e6 bash -c 'glnexus_cli --config DeepVariant in/*.gvcf.gz' | bcftools view > test.vcf

The jemalloc configuration is already set up inside the image which is a nice touch. I'll update the docs with this when it seems stable!

brentp commented 4 years ago

thank you. this is working for me.

mlin commented 4 years ago

The Getting Started tutorial has been updated to discuss the docker image.