none
How to install R packages on DeployR server running on Linux (hosted on Amazon EC2)? RRS feed

  • Question

  • I successfully installed DeployR on Redhat Linux that is being hosted on Amazon EC2 instance.  I can successfully go to the DeployR landing page and checked diagnostics tab, and it says DeployR is running, and appears fine.

    I've tested a simple R script and runs fine on DeployR, but now I need to install RJDBC package: install.packages("RJDBC",dep=TRUE)

    The documentation is not clear for package management: https://deployr.revolutionanalytics.com/documents/admin/r-package-mgmt/

    It says: "Manually run this R script on a DeployR grid node."  But not sure how to run a script on a grid node.  How do I access a grid node? 

    In general, need guidance on how to install packages for DeployR.


    Friday, April 29, 2016 3:17 PM

All replies

  • Do you have DeployR Enterprise or Open?


    Friday, April 29, 2016 5:04 PM
    Moderator
  • Open
    Friday, April 29, 2016 5:46 PM
  • There is only one grid node for DeployR Open.  Run the script on the DeployR Server machine, which hosts the Default Grid Node. 
    Friday, April 29, 2016 6:04 PM
    Moderator
  • What script?  That is not very clear.  

    Also, how do I run it on the "DeployR Server" machine?   I know how to get onto the linux instance and run commands on the linux shell.  What command(s) do I run on the linux shell to interact with DeployR?

    • Edited by sihuda Friday, April 29, 2016 6:55 PM
    Friday, April 29, 2016 6:28 PM
  • One option is to create a master R script that you'll use to install the package dependencies locally and on the server. At the top of that script, declare each package dependency individually using deployrPackage(). For the full function help, use library(help="deployrUtils") in your IDE. Then run that script on the server.

    Another option, assuming you are the admin user, is to  declare each package dependency individually using deployrPackage() directly in your R script as you would typically with install.packages. The admin user is granted permissions to install R packages via deployrUtils::deployrPackage().  Then, run that script on the server.

    The documentation covers how to upload scripts to DeployR through the API directly, or using the Repository Manager tool. https://deployr.revolutionanalytics.com/documents/help/repo-man/#c-file-create-upload.htm%3FTocPath%3DWorking%2520with%2520Files%7C_____1

    Friday, April 29, 2016 7:07 PM
    Moderator
  • I'm assuming you mean upload an R script with the command deployrUtils::deployrPackage().

    I've done that by creating a test script, uploading to DeployR:


    deployrUtils::deployrPackage("RJDBC",dep=TRUE)
    library(RJDBC)

    I get the following message:

    unable to create temporary directory ‘/tmp/RtmpYRaET4/downloaded_packages’


    • Edited by sihuda Friday, April 29, 2016 7:19 PM
    Friday, April 29, 2016 7:18 PM
  • Any update on this?  It seems DeployR can't access tmp directories on Linux (AWS EC2).

    I keep getting: unable to create temporary directory.

    Any way to allow access to tmp dir on EC2 hosted Linux?

    Monday, May 2, 2016 8:24 PM
  • The documentation is not clear for package management: https://deployr.revolutionanalytics.com/documents/admin/r-package-mgmt/

    I totally agree on that.

    I am struggling to get a custom package installed. I used RGui (MRO for RRE 8.0 64-bit) to install the package. As installing packages seems to boil down to putting some file in a library, I thought that using RGui as a back-door might work. I use R Open, so, grid deployment is not an issue.

    Then, I used the Repository Manager (/deployr/repository-manager/) to do some testing:

    1. Create an empty local file test.R
    2. Use Action - Upload File...
    3. Upload the file
    4. Click the file name to open the page with file properties
    5. Click ☆ Test
    6. In the upper-left panel, Source, enter R-statements. Sample:
    Sys.getenv("R_HOME")
    .libPaths()
    installed.packages()
    deployrPackage("assertive")
    are_identical(1, 1)
    are_identical(1, 2)

    Note that double-quotes are required with deployrPackage(), while they are optional with library(). If all works well, the last part of the Debug Console Output will read:

    > are_identical(1, 1)
    [1] TRUE
    > are_identical(1, 2)
    [1] FALSE
    Cause of failure: 1 and 2 are not identical. 

    Otherwise, the tab API Response in the Artifacts pane may give some more information. For instance, a custom package that I attempted to load, using deployrPackage(), gave an error 900, "Package not found" and warning "'<package name>' is not available (as a binary package for R version 3.2.2)".

    In RGui, you can use deployrPackage after running library(deployrUtils).


    • Edited by rs23771 Friday, May 27, 2016 8:56 AM
    Friday, May 27, 2016 8:54 AM
  • I had a similar problem with another packages ("stringr" and "smbinnings"), using the recommended function "deployrPackage”. After hours of troubleshooting I discovered the packages installation needed components not installed on RHEL. The missing components were "gcc", "tcl" and "tk". To install it, I ran the commands "sudo yum install gcc-c++", "sudo yum install tcl" and "sudo yum install tk" respectively.

    The message "package not found" emitted by function is not clear, since it doesn't give a clue about errors occurred during the install process.

    Tuesday, June 14, 2016 8:31 PM