Building mzR package under docker fails
0
0
Entering edit mode
mjmg • 0
@mjmg-8837
Last seen 9.1 years ago
Philippines

Hello, I'm building docker image containing the mzR package with both centos:latest and r-base:latest (which is also used by Bioconductor docker images) as base images.

Both installation of package ‘mzR’ had non-zero exit status and doesn't finish compiling at all. I'm not using the Bioconductor docker images to keep image sizes to a minimum.

Below is the debian build Dockerfile

## start with the Docker 'base R' Debian-based image
FROM r-base:latest 

## Remain current
RUN apt-get update -qq \ 
&& apt-get dist-upgrade -y 
RUN apt-get update -qq \ 
&& apt-get install -y \ 
curl \ 
libnetcdf-dev \ 
libxml2-dev 

# Setup default cran repo 
RUN echo "r <- getOption('repos'); r['CRAN'] <- 'http://cran.us.r-project.org'; options(repos = r);" > ~/.Rprofile 

# This installs other R packages under Bioconductor 
RUN Rscript -e "source('https://bioconductor.org/biocLite.R'); biocLite('mzR')"

Here is the buildlog: http://pastebin.com/gWvBjN1N

 

Below is the centos build Dockerfile

FROM centos:centos7 
# Update System Image and install EPEL 
RUN \ yum update -y && \ 
yum upgrade -y && \ 
yum install -y epel-release 

# Install R 
RUN \ 
yum install -y R 

#install additional tools and library prerequisites 
RUN \ 
yum install -y netcdf-devel libxml2-devel 

# Setup default cran repo 
RUN echo "r <- getOption('repos'); r['CRAN'] <- 'http://cran.us.r-project.org'; options(repos = r);" > ~/.Rprofile 

# This installs other R packages under Bioconductor 
RUN Rscript -e "source('https://bioconductor.org/biocLite.R'); biocLite('mzR')" 

CMD "/bin/bash"

 

This build ends with an internal compiler error.

 

 

mzR docker debian centos rocker • 3.0k views
ADD COMMENT
1
Entering edit mode

Sounds like an issue I have discussed with the mzR developers. At least for the debian-based image, the compiler is too new. This is at least partially fixed in https://github.com/sneumann/mzR/tree/boost_159.

So if you do the following:

source("http://bioconductor.org/biocLite.R")
biocLite("devtools")
library(devtools)
install_github("sneumann/mzR", branch="boost_159", repos=biocinstallRepos())

That should install mzR. However, I found that the installation that takes place as part of R CMD check was still failing. I asked the mzR people about that but have not heard back. I would hope that when that issue is resolved, the boost_159 branch will be merged into master. Maybe someone from the mzr team can chime in here.

I don't know if the same instructions will help you on centos or not, but you could try them and let us know.

ADD REPLY
0
Entering edit mode

Sorry, I haven't had a chance to make any progress on that front. KK is the person who is most au fait.

To answer your question: yes, the plan is to merge into master, once recent boost and pwiz have been successfully tested.

ADD REPLY
0
Entering edit mode

It might be good to call KK's attention to this thread so he can update us.

ADD REPLY
0
Entering edit mode

Have done it before posting my previous reply.

ADD REPLY
0
Entering edit mode

If it helps, the centos build fails on Unimod.c from pwiz:

g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report, with preprocessed source if appropriate.   See <http://bugzilla.redhat.com/bugzilla> for instructions.   
make: *** [pwiz/data/common/Unimod.o] Error 4   
ERROR: compilation failed for package 'mzR'  removing '/usr/lib64/R/library/mzR' 
ADD REPLY
0
Entering edit mode

I'm  also failing on Unimod.c from pwiz.. Any resolution to this yet?

 

g++ -I/usr/share/R/include -DNDEBUG -D_LARGEFILE_SOURCE -I./boost_aux/ -I. -DHAVE_PWIZ_MZML_LIB -D_NODEBUG -DWITHOUT_MZ5 -I./boost `nc-config --cflags || /bin/true`  -I"/home/lerman/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include" -I"/home/lerman/R/x86_64-pc-linux-gnu-library/3.2/zlibbioc/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c pwiz/data/common/Unimod.cpp -o pwiz/data/common/Unimod.o
virtual memory exhausted: Cannot allocate memory
make: *** [pwiz/data/common/Unimod.o] Error 1
ERROR: compilation failed for package ‘mzR’
* removing ‘/home/lerman/R/x86_64-pc-linux-gnu-library/3.2/mzR’
Error: Command failed (1)

I think I only have 2 GB RAM on this machine. Is that a problem?

ADD REPLY
0
Entering edit mode

Thank you. Will try your suggestion. If this workaround proves hard to maintain in the future, I might just base my images on latest ubuntu lts or centos 

Surprisingly, when I tried installing mzR on an actual installation of centos and locally building the docker image, mzR compiles to completion and installs without errors in contrast to the docker image being built in the dockerhub repository. There must be something amiss when mzR is built on Dockerhub repository.

Here i the centos dockerfile build log from dockerhub for completeness.

A few comments:

1) Development libraries for xml2 should be explicitly added to mzR dependencies. Took me some time to figure that out from the log file for both centos and debian docker builds.

2) For the debian build, since the official Bioconductor docker images are also based on rocker/r-base which is the official R docker images and which you also have adopted, resolving errors when using those as base images should have some priority. Perhaps all Bioconductor packages should be built and tested against that image. Pushing it further, if possible perhaps it should be the reference architecture for building Bioconductor packages for *nix since its docker image can be easily deployed with a few commands on any computer system.

Just my two cents. 

 

 

ADD REPLY
0
Entering edit mode

Can you clarify what you mean by "Surprisingly, when I tried installing mzR on an actual installation of centos and locally building the docker image, mzR compiles to completion and installs without errors in contrast to the docker image being built in the dockerhub repository. There must be something amiss when mzR is built on Dockerhub repository."

?

Are you saying that running 'docker build'  on a  centos machine works but building the exact same dockerfile in docker hub does not? It could be that the dockerhub build machine does not have enough memory. 

Or do you mean you installed mzR directly on a centos machine without docker? 

I am not sure that mzR has a dependency on libxml2-devel. I think perhaps some package in its dependency tree may depend on it. But I could be wrong.

ADD REPLY
0
Entering edit mode

I did both. Installed mzR on a local centos install and build the docker image locally (this was under windows). I'll try to replicate to verify it's not a quirk. Please feel free to do the same using the dockerfiles above. 

ADD REPLY
0
Entering edit mode

My bad with the libml2-dev dependency of mzR, indeed it is not the case, perhaps with another package where mzR is a dependency. For the record I also added netconfig-bin to the build.

I can also confirm the compiler error on building mzR on dockerhub is probably due to insufficient memory (2 GB, single core)

https://github.com/docker/hub-feedback/issues/319

About to try the workround posted by using the boost branch for the debian build. Is it too late to incorporate this into the latest Bioconductor release?

 

 

ADD REPLY

Login before adding your answer.

Traffic: 779 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6