NESCent / popgenInfo

Vignettes for Population Genetics in R
http://popgen.nescent.org
MIT License
21 stars 50 forks source link

make html error on local machine #155

Closed zkamvar closed 8 years ago

zkamvar commented 8 years ago

@hlapp, I'm trying to test the website on my local machine, but I'm getting an error:

docker run --user="501:20" -e "HOME=/tmp" -v /Users/zhian/Documents/forks/popgenInfo:/repo -w /repo/build rocker/popgen Rscript -e "rmarkdown::render('2015-05-18-Dist-SNP.Rmd')"
Fatal error: cannot create 'R_TempDir'
make[1]: *** [2015-05-18-Dist-SNP.html] Error 2
make: *** [html] Error 2

For verbosity:

17:53:44~/Documents/forks/popgenInfo (fix-git2r)> make html
cp -p CONTRIBUTING_WITH_GIT2R.Rmd TEMPLATE.Rmd developer_example.Rmd CONDUCT.md CONTRIBUTING.md DATAFORMATS.md DEVELOPER.md GETSTARTED.md LEARN.md LOAD_PACKAGES.md PACKAGES.md R_MARKDOWN.md SNP.md SSR.md USINGR.md WORKFLOWS.md index.md /Users/zhian/Documents/forks/popgenInfo/build
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C use html
cp -p 2015-05-18-Dist-SNP.Rmd 2015-12-15-microsatellite-differentiation.Rmd 2016-01-26-SNP-selection.Rmd DifferentiationSNP.Rmd PopDiffSequenceData.Rmd StartSNP.Rmd startMicrosatellite.Rmd LinksToResources.md /Users/zhian/Documents/forks/popgenInfo/build
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C install html
cp -p  /Users/zhian/Documents/forks/popgenInfo/build
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
make[1]: [html] Error 64 (ignored)
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C develop html
cp -p DEVELOPER_INTRO.Rmd package_basics.Rmd PACKAGE_TUTORIALS.md /Users/zhian/Documents/forks/popgenInfo/build
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C /Users/zhian/Documents/forks/popgenInfo/build html
docker build -t rocker/popgen - < Dockerfile
Sending build context to Docker daemon  2.56 kB
Step 1 : FROM hlapp/rpopgen:latest
 ---> e2623d2a7712
Step 2 : MAINTAINER Hilmar Lapp hilmar.lapp@duke.edu
 ---> Using cache
 ---> c35f7a903721
Successfully built c35f7a903721
docker run --user="501:20" -e "HOME=/tmp" -v /Users/zhian/Documents/forks/popgenInfo:/repo -w /repo/build rocker/popgen Rscript -e "rmarkdown::render('2015-05-18-Dist-SNP.Rmd')"
Fatal error: cannot create 'R_TempDir'
make[1]: *** [2015-05-18-Dist-SNP.html] Error 2
make: *** [html] Error 2
17:53:52~/Documents/forks/popgenInfo (fix-git2r)> docker --version
Docker version 1.8.1, build d12ea79
zkamvar commented 8 years ago

Would it be helpful to run:

sudo make html
hlapp commented 8 years ago

No. I think the reason that this happens is that on MacOSX, the Docker container doesn't run on the host computer but on a VM (run by Virtualbox) on the host computer.

If it ran before the change (which I suppose it did) then I guess on MacOSX it needs to be run under the default UID:GID, which is root:

$ UID=0 GID=0 make html
zkamvar commented 8 years ago

That command successfully sets GID, but does not pass UID.

hlapp commented 8 years ago

UID happens to be a bash builtin variable. The fix is in #156. With that fix, obviously you need to put the new variable names:

$ USERID=0 GROUPID=0 make html