dockertest
dockertest copied to clipboard
Strange behaviour (possible failure) on ubuntu
@richfitz -- I'm hoping you might be able to test this on another linux machine. If the results below extend to other linux boxes then dockertest may not be working as hoped on linux.
@jscamac and I were trying to use dockerest on linux box to run some analyses for our mortality analysis and encountered some strange behaviours. Initially, we encountered the error that file remake.yml
does not exist in the current wd when clearly it does:
@SCI-6297:~/mortality_bci$ remake fulldata_models_precompiled_docker
[ LOAD ]
[ READ ] | # loading sources
< MAKE > fulldata_models_precompiled_docker
[ BUILD ] fulldata_models_precompiled_docker | fulldata_models_precompil...
[ READ ] | # loading packages
Error: while reading 'remake.yml'
The file 'remake.yml' does not exist
jscamac@SCI-6297:~/mortality_bci$ ls
data downloads ms R remake_sources.yml
docker figures precompile README.md remake.yml
But what is actually happening in building the fulldata_models_precompiled_docker
target is that we are loading a docker container and compiling models inside, with directory mapped back to the current wd. (This works fine on imac but failed on the linux machine.)
Using the dry-run
argument of dockertest reveals the code that call that is made to docker. I then ran a simplified version of that to highlight why the above error is not working.
Basically it seems like the directory mapping is not working as it should. Running the following should map our current wd onto the folder /home/data
in the docker container. That's what happens on the mac:
✗ /usr/local/bin/docker run -v /Users/dfalster/Dropbox/_research/SIEF/mortality_bci:/home/data -it traitecoevo/mortality_bci
root@246b720e3d9e:/home/data# ls
data docker downloads ignore ms ms.pdf Notes.md R README.md remake_sources.yml remake.yml results
But running the equivalent on linux does not produce the desired result (note calling ls returns an empty folder):
jscamac@SCI-6297:~/mortality_bci$ /usr/bin/docker run -v /home/jscamac/mortality_bci:/home/data -it traitecoevo/mortality_bci
root@df98b8b9fa61:/home/data# ls
root@df98b8b9fa61:/home/data#
I got a similar result using the base ubuntu container:
jscamac@SCI-6297:~/mortality_bci$ /usr/bin/docker run -v /home/jscamac:/home/data -it ubuntu
root@6ed0501b533c:/home/data# ls
root@6ed0501b533c:/home/data#
The machine we using is running Ubuntu 14.04.2 (LTS).