clipper icon indicating copy to clipboard operation
clipper copied to clipboard

RClipper Docker Container run error - "Failed to install library: Rclipper"

Open csmithnm opened this issue 6 years ago • 2 comments

I am having issues getting from the "Build a model" step to the "Deploy and link model". I can finally get the "Build a model" step working, but when I try to "Query the model" I get the "No connected models found for query" error message from the REST API.

{"query_id":0,"output":-1.0,"default":true,"default_explanation":"No connected models found for query"}

I believe the issue is that the r_container_entrypoint.sh that is executed during the setup of the initial Docker container ("Deploy and link model" step) is failing because when I checked for the Docker container for my model after about 10 minutes (docker ps) the containers was no longer available. Since I can't see what is happening in the Docker container, I then decided to run the container via the command line to see what was happening:

docker run -it -e "CLIPPER_MODEL_NAME=r-csus-tc" -e "CLIPPER_MODEL_VERSION=6" -e "CLIPPER_IP=127.0.0.1" -e "CLIPPER_PORT:7000" r-csus-tc:6 /bin/bash

The last few lines of the output from the above docker run command look like this:

installing source package ‘caret’ ... ** package ‘caret’ successfully unpacked and MD5 sums checked ** libs gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c caret.c -o caret.o g++ -shared -L/usr/lib/R/lib -Wl,-z,relro -o caret.so caret.o -L/usr/lib/R/lib -lR installing to /usr/local/lib/R/site-library/caret/libs ** R ** data ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded DONE (caret)

The downloaded source packages are in ‘/tmp/RtmpWCAafb/downloaded_packages’ Loading required package: lattice Loading required package: ggplot2 [1] "Failed to install library: caret" [1] "Proceeding with deserialization. Model inference may fail if this library is required!" Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) [1] "Failed to install library: Rclipper" [1] "Proceeding with deserialization. Model inference may fail if this library is required!" Error in parse(text = new_obj_string) : :1:1: unexpected '/' 1: / ^ Calls: deserialize_model -> eval -> parse In addition: Warning message: package ‘Rclipper’ is not available (for R version 3.4.4) Execution halted

As you can see "caret" is installed, but for some reason your deserialization_model.R code can't seem to see "caret" or your own "Rclipper" package and then fails. I believe at this point the "Rclipper" package is attempted to be installed from CRAN (which does not exist on CRAN) and therefore fails. Which then causes the following error:

Error in parse(text = new_obj_string) : :1:1: unexpected '/' 1: / ^ Calls: deserialize_model -> eval -> parse In addition: Warning message: package ‘Rclipper’ is not available (for R version 3.4.4)

SUGGESTION: Take the packages from the initial Rclipper::build_model() and directly copy them to the Docker image. Having the r_container_entrypoint.sh rebuild something that was working on the host seems like a potential for numerous issues like the one I am having - different package versions are installed in the Docker container causing issues that the person trying to deploy the R model can't easily see.

csmithnm avatar Jul 06 '18 00:07 csmithnm

Thanks for the suggestion @csmithnm! We are slightly behind on R support and these feedback are great!

I will work on fixing these soon.

simon-mo avatar Jul 06 '18 20:07 simon-mo

I reinstalled clipper-develop on an entirely new AWS instance and I still can't get my R model to deploy. The docker container crashed again after a 15 minutes build.

The R package CodeDepends is definitely causing some issues. I had to do quite few manual apt-get and R package installs to get all of your required Clipper R packages to work on the Rscript model build side. I am using R 3..4.4 to match the build of the Docker container. I figure getting the Docker container to work will be impossible without manual intervention from within the Docker container.

Do you have any suggestions for getting RClipper to work on R 3.4.4?

csmithnm avatar Jul 06 '18 22:07 csmithnm