ImperialCollegeLondon / covid19model

Code for modelling estimated deaths and cases for COVID19.
MIT License
944 stars 271 forks source link

Instructions are incorrect for new Dockerfile #48

Closed bazzargh closed 4 years ago

bazzargh commented 4 years ago

Describe the bug 15 hours or so ago the Dockerfile was replaced with one that doesn't use run_model_script.sh. As a result, the command line in the README tries to pass a uid/gid to Rscript and fails.

To Reproduce Steps to reproduce the behavior:

$ docker run --rm -it -v $(pwd):/var/model harrisonzhu5080/covid19model:latest $(id -u) $(id -g)
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"1459431370\": executable file not found in $PATH": unknown.

If you leave off the uid/gid, you get a different error (running with a locally built image):

$ docker run --rm -it -v $(pwd):/var/model covid19model:latest
[snip...]
[1] "Portugal has 50 days of data"
[1] "First non-zero cases is on day 60, and 30 days before 10 deaths is day 46"
[1] "Netherlands has 57 days of data"
Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! In file included from /usr/lib/R/site-library/RcppEigen/include/Eigen/Core:392,
                 from /usr/lib/R/site-library/RcppEigen/include/Eigen/Dense:1,
                 from /usr/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13,
                 from <command-line>:
/usr/lib/R/site-library/RcppEigen/include/Eigen/src/Core/arch/SSE/PacketMath.h:60:39: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
   60 | template<> struct is_arithmetic<__m128>  { enum { value = true }; };
      |                                       ^
/usr/lib/R/site-library/RcppEigen/include/Eigen/src/Core/arch/SSE/PacketMath.h:61:40: warning: ignoring attributes on template argument ‘__m128i’ {aka ‘__vector(2) long long int’} [-Wignored-attributes]
   61 | template<> struct is_arithmetic<__m128i> { enum { value = true }; };
      |              
Calls: stan_model ... cxxfunctionplus -> <Anonymous> -> cxxfunction -> compileCode
In addition: Warning message:
In system(cmd, intern = !verbose) :
  running command '/usr/lib/R/bin/R CMD SHLIB file76f43ff93.cpp 2> file76f43ff93.cpp.err.txt' had status 1
Error in sink(type = "output") : invalid connection
Calls: stan_model -> cxxfunctionplus -> sink
Execution halted

This one appears to be a permission error.

Expected behavior The program runs without errors

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

You can pass the uid and gid to docker containers without a wrapper script, and this is how I got the program to run:

docker run --user $(id -u):$(id -g) --rm -it -v $(pwd):/var/model covid19model:latest 
s-mishra commented 4 years ago

Thanka for pointing this out. @fvalka see if you missed this due to something

fvalka commented 4 years ago

Thank you, yes missed updating the README.md for the docker file.

@bazzargh Thanks for pointing it out! There were a couple of issues in the old docker file, with the biggest one being that the source code of the model wasn't actually included in the Dockerfile and you still needed the git repo in the right folder to run it and such. I'll update it right away :-)

fvalka commented 4 years ago

@bazzargh My pull request was just merged. Would be really great if you could take a look at the new documentation and see if it works for you now. Thanks!