Search code examples
rubunturstudioopencpu

How to deploy a *.tar.gz package on Opencpu


I have the following issue:

I created a R package which is ending in *.tar.gz and I want to just upload this to the ubuntu server and install it into opencpu from the servers file system without using github (as Im not familiar with github that much yet).

I have the following configuration: Ubuntu 14.04 running opencpu /opencpu-cache on it Installed R Installed RStudio

I haven't found any guideline which points into this direction. Does anyone have some guidance on how a R package (tar.gz) can be installed in Opencpu without using Github? Thank you!


Solution

  • There is nothing special about packages that you use with OpenCPU. Install it like any R package:

    R CMD INSTALL yourpackage_1.2.tar.gz
    

    If you are not root and you want to install in the global library you might need sudo:

    sudo R CMD INSTALL yourpackage_1.2.tar.gz --library=/usr/local/lib/R/site-library
    

    Afterward installing you should be able to interact with the package via e.g.

    curl http://localhost/ocpu/user/yourname/library/yourpackage/R 
    curl http://localhost/ocpu/library/yourpackage/R